Labs/Jetpack/Reboot/JEP/107: Difference between revisions

Line 35: Line 35:
       'stylesheet': ['http://yui.yahooapis.com/3.0.0/build/cssbase/base-min.css']
       'stylesheet': ['http://yui.yahooapis.com/3.0.0/build/cssbase/base-min.css']
   },
   },
   'styles': ['body { background: #ffffff; font-family: Trebuchet MS; }'],
   'styles': [
    'body { background: #ffffff; font-family: Trebuchet MS; }',
    'span.details { font-size: 7px; }'
  ],
   'scripts': [function(){
   'scripts': [function(){
       $('container').addEvents({
       $('container').addEvents({
Line 56: Line 59:
#* excludes: (<i>array</i>) an array of URL strings to skip when modding
#* excludes: (<i>array</i>) an array of URL strings to skip when modding
#* files: (<i>object</i>) 'javascript' or 'stylesheet' keyed nodes whose values are arrays of asset resource strings
#* files: (<i>object</i>) 'javascript' or 'stylesheet' 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>array</i>) an array of styles, wherein each array item is a selector and contained within are properties and values.
#* scripts: (<i>function</i>) a function that will be injected into the page and called. By default, the function is bound with the target document's window object
#* scripts: (<i>function</i>) a function that will be injected into the page and called. By default, the function is bound with the target document's window object


Line 79: Line 82:
});
});


myMods.add('styles', ['body: { background: #ffffff; font-family: Trebuchet MS; } span.details { font-size: 7px; }']);
myMods.add('styles', ['body: { background: #ffffff; font-family: Trebuchet MS; }', 'span.details { font-size: 7px; }']);


// Creating a function reference
// Creating a function reference
Line 102: Line 105:
#* excludes: (<i>array</i>) an array of URL strings (removal applies mods to docs if any are open)
#* excludes: (<i>array</i>) an array of URL strings (removal applies mods to docs if any are open)
#* files: (<i>object</i>) 'javascript' or 'stylesheet' 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.
#* files: (<i>object</i>) 'javascript' or 'stylesheet' 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>array</i>) an array of styles, wherein each array item can be a selector name only (to remove all styles related to the selector) or additionally, can include specific property names (removing only styles of that property while leaving unmentioned selector styles intact).
#* scripts: (<i>function</i>) removes the script associated with a function reference
#* scripts: (<i>function</i>) removes the script associated with a function reference


1,273

edits