1,273
edits
Dandonkulous (talk | contribs) |
Dandonkulous (talk | contribs) |
||
Line 30: | Line 30: | ||
var myMods = new pageMod({ | var myMods = new pageMod({ | ||
'matches': ['*.google.com', 'jetpack.mozillalabs.com'], | 'matches': ['*.google.com', 'jetpack.mozillalabs.com'], | ||
'ignores': ['https://mail.google.com/*'], | |||
'includes': { | 'includes': { | ||
'script': ['http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools.js'], | 'script': ['http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools.js'], | ||
Line 56: | Line 57: | ||
#<b>type</b> - (<i>string</i>) The type of modifier being added. Can be 'matches', 'includes', 'styles', or 'script'. If the only argument passed in is an object, Page Mods assumes multiple modifiers will be passed in. | #<b>type</b> - (<i>string</i>) The type of modifier being added. Can be 'matches', 'includes', 'styles', or 'script'. If the only argument passed in is an object, Page Mods assumes multiple modifiers will be passed in. | ||
#<b>data</b> - | #<b>data</b> - | ||
#* matches: (<i>array</i>) an array of | #* matches: (<i>array</i>) an array of URL strings to apply mods to | ||
#* ignores: (<i>array</i>) an array of URL strings to skip when modding | |||
#* includes: (<i>object</i>) 'script' or 'style' keyed nodes whose values are arrays of asset resource strings | #* includes: (<i>object</i>) 'script' or 'style' keyed nodes whose values are arrays of asset resource strings | ||
#* styles: (<i>object</i>) an object whose keys are CSS selectors and whose values are objects composed of CSS property keys and values | #* styles: (<i>object</i>) an object whose keys are CSS selectors and whose values are objects composed of CSS property keys and values | ||
Line 73: | Line 75: | ||
<pre class="brush:js;"> | <pre class="brush:js;"> | ||
myMods.add('matches', ['*.digg.com']); | myMods.add('matches', ['*.digg.com']); | ||
myMods.add('ignores', ['http://labs.digg.com/*']); | |||
myMods.add('includes', { | myMods.add('includes', { | ||
Line 107: | Line 111: | ||
#<b>type</b> - (<i>string</i>) The type of modifier being added. Can be 'matches', 'includes', 'styles', or 'script'. NOTE: If the only argument is an object, Page Mods assumes multiple modifiers will be passed in. | #<b>type</b> - (<i>string</i>) The type of modifier being added. Can be 'matches', 'includes', 'styles', or 'script'. NOTE: If the only argument is an object, Page Mods assumes multiple modifiers will be passed in. | ||
#<b>data</b> - | #<b>data</b> - | ||
#* matches: (<i>array</i>) an array of | #* matches: (<i>array</i>) an array of URL strings (removal reloads modded docs) | ||
#* ignores: (<i>array</i>) an array of URL strings (removal applies mods to docs if any are open) | |||
#* includes: (<i>object</i>) 'script' or 'style' keyed nodes whose values are arrays of asset resource strings. Passing string of 'all' for the value of either 'include' key of 'styles' or 'script' will remove all includes of that type. | #* includes: (<i>object</i>) 'script' or 'style' keyed nodes whose values are arrays of asset resource strings. Passing string of 'all' for the value of either 'include' key of 'styles' or 'script' will remove all includes of that type. | ||
#* styles: (<i>object</i>) expects object nodes keyed with CSS selector strings, whose values are arrays of the CSS property strings you would like to remove | #* styles: (<i>object</i>) expects object nodes keyed with CSS selector strings, whose values are arrays of the CSS property strings you would like to remove | ||
Line 125: | Line 130: | ||
myMods.remove('matches', ['*.google.com']); | myMods.remove('matches', ['*.google.com']); | ||
myMods.remove('ignores', ['http://labs.digg.com/*']); | |||
myMods.remove('includes', { | myMods.remove('includes', { |
edits