Skip to content

Commit

Permalink
1.0.6 & ga improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
alimsky committed Apr 12, 2011
1 parent 8cde7e1 commit f65c7fa
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ Some embeded Google Analytics Actions modified, this would help me to look into

1.05>
Urgent bug fixed

1.06>
More Google Analytics
Definition become stronger again
Clear inputs options
8 changes: 6 additions & 2 deletions bin/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
chrome.extension.onRequest.addListener(
function(request, sender, sendResponse) {
if(request!=null && request.hasOwnProperty('gag_event')){
_gaq.push(['_trackEvent', request['gag_category'], request['gag_event']]);
chrome.tabs.getSelected(null, function(tab){
_gaq.push(['_trackEvent', request['gag_category'], request['gag_event'], tab.url]);
});
}else{
sendResponse({result: localStorage});
}
});
chrome.browserAction.onClicked.addListener(function(){
_gaq.push(['_trackEvent', 'fillFunction', 'browserAction']);
chrome.tabs.getSelected(null, function(tab){
_gaq.push(['_trackEvent', 'fillFunction', 'browserAction', tab.url]);
});
chrome.tabs.executeScript(null, {code:'window.vG.scanTheDomAndMakeSomeMagic();'});
});
var _gaq = _gaq || [];
Expand Down
14 changes: 12 additions & 2 deletions bin/magicfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function magicInputsOptions(){

this.setOption('EMAIL',['mail'], storage);
this.setOption('CONFIRM',['confirm'], storage);
this.setOption('NUMBER',['numb', 'integer', 'price', 'size', 'code'], storage);
this.setOption('NUMBER',['numb', 'integer', 'price', 'size', 'qty', 'code'], storage);

this.setOption('CARD_TYPE','random', storage);
this.setOption('ISCREDITCARDNUMBER',['cc_number', 'cc-number', 'cardnumber', 'credit_card'], storage);
Expand Down Expand Up @@ -71,6 +71,8 @@ function magicInputsOptions(){
this.setOption('CONSONANTS',['b','c','d','f','g','h','j','k','l','m','n','p','r','s','t','v','w','x','z','ch','sh','fr','th','q','k', 'l','m','n','p','s','t','b','c','d','f','g'], storage);
this.setOption('VOWELS',['a','e','i','o','u','y','a','e','i','o','u','y','oo', 'ou', 'ae', 'ea'], storage);
this.setOption('TARGET_BLANK_FORMS', false, storage);

this.setOption('CLEAR_INPUTS_EVENTS', true, storage);
}
//Put presetted to defaults
this.setHardcodedOptions(this.defaultOptions);
Expand Down Expand Up @@ -187,10 +189,18 @@ function valueGenerator(){
return ar[Math.floor(Math.random()*ar.length)];
}

//removes event
this.removeEvent=function(el, actualEventName){
if (element.removeEventListener)
element.removeEventListener(actualEventName, responder, false);
else
element.detachEvent('on' + actualEventName, responder);
}

//Is any entries of the string ST equal to any lements of Array AR
this.isAnyEqual=function(st, ar){
for (elm in ar){
if(st.indexOf(ar[elm])>0){
if(st.indexOf(ar[elm])>=0){
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion bin/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Magic Inputs Filler",
"version": "1.0.5",
"version": "1.0.6",
"description": "Extension allows you to fill all the inputs, textareas and selects on the page with random values depending on it's type.",
"icons": { "16": "images/icon16.png",
"48": "images/icon48.png",
Expand Down
9 changes: 9 additions & 0 deletions bin/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ <h3>Common options</h3>
<input type="checkbox" id="targetblank" name="TARGET_BLANK_FORMS" value="targetblank" />
<label class="long" for="targetblank">Add <em>TARGET="_blank"</em> attribute to forms</label>
</block>
<!-- <block class="radiobox">
<input type="checkbox" id="clear_inputs_events" name="CLEAR_INPUTS_EVENTS" value="clear_inputs_events" checked="checked" />
<label class="long" for="clear_inputs_events">Remove predefined inputs events</label>
</block> -->
</content>
</segment>
<buttons>
Expand All @@ -141,6 +145,11 @@ <h1>About Magic Inputs</h1>
<p>Feel free to <a href="mailto:Serj Alimsky <alimsky@gmail.com>">ask</a> me any questions: </p>
<changelog>
<h3>Changelog</h2>
<h4>1.0.6</h3>
<ul>
<li>Small issues fixed</li>
<li>Definition improved</li>
</ul>
<h4>1.0.5</h3>
<ul>
<li>Cross-domain security iFrame bug fixed</li>
Expand Down
6 changes: 6 additions & 0 deletions bin/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ $(document).ready(function(){

$('#targetblank').attr('checked',sts['TARGET_BLANK_FORMS']?'checked':'');
$('#captchas_fields').attr('checked',sts['DONT_FILL_CAPTCHAS']?'checked':'');
//$('#clear_inputs_events').attr('checked',sts['CLEAR_INPUTS_EVENTS']?'checked':'');

}

Expand All @@ -122,26 +123,30 @@ $(document).ready(function(){
$(el).click(function(){ //maybe somebode clicked radioboxes, we should save it
highlightChange(this);
storeOption(this.name, this.value);
_gaq.push(['_trackEvent', 'options', this.name]);
})
});
$('input[type=checkbox]').each(function(i,el){
if($(el).hasClass('__dont_save')) return;
$(el).click(function(){ //maybe somebody clicked checkboxes, we should save it
highlightChange(this);
storeOption(this.name, this.checked);
_gaq.push(['_trackEvent', 'options', this.name]);
})
});
$('#use_hotkeys').click(function(){
if(!$('#use_hotkeys')[0].checked)
$('#hotkey__content block.hotkey *').each(function(i,el){$(el).fadeTo(500,0.5)});
else
$('#hotkey__content block.hotkey *').each(function(i,el){$(el).fadeTo(300,1)});
_gaq.push(['_trackEvent', 'options', 'hotkeys clicked']);
})
$('textarea, input[type=text]').each(function(i,el){
if($(el).hasClass('__dont_save')) return;
$(el).change(function(){ //maybe somebode changed inputs, we should save it
highlightChange(this);
storeOption(this.name, $(this).val());
_gaq.push(['_trackEvent', 'options', this.name]);
})
});
$('textarea.save_as_array, input.save_as_array[type=text]').each(function(i,el){
Expand All @@ -150,6 +155,7 @@ $(document).ready(function(){
$(el).change(function(){ //maybe somebode changed inputs, we should save it
highlightChange(this);
storeOption(this.name, $(this).val().split(' ').join('').split(','));
_gaq.push(['_trackEvent', 'options', this.name]);
})
});
$('#hotkey_typical, #hotkey_typical_input').mouseup(function(){ //assign typical hotkey
Expand Down

0 comments on commit f65c7fa

Please sign in to comment.