diff options
author | Benjamin Jones <bjones@galois.com> | 2012-10-30 11:46:31 -0700 |
---|---|---|
committer | Benjamin Jones <bjones@galois.com> | 2012-10-30 11:46:31 -0700 |
commit | 37b44115d6ae992dd643fe328e92079bf3e26750 (patch) | |
tree | 82197b443843ed82f437d981ee57f313e53509ca /contexts/data | |
parent | e340601fb8422e8b94b09e003b71668e68cb6b54 (diff) |
removed broken and demo plugins, added to the jsdocs
Diffstat (limited to 'contexts/data')
-rw-r--r-- | contexts/data/fiveui/injected/jquery-plugins.js | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/contexts/data/fiveui/injected/jquery-plugins.js b/contexts/data/fiveui/injected/jquery-plugins.js index 23403f7..5df0494 100644 --- a/contexts/data/fiveui/injected/jquery-plugins.js +++ b/contexts/data/fiveui/injected/jquery-plugins.js @@ -33,15 +33,6 @@ fiveui.jqueryPlugins = fiveui.jqueryPlugins || {}; /** - * Simple proof of concept plugin - * - * @returns {!Object} A modified jQuery object - */ -fiveui.jqueryPlugins.myPlugin = function () { - return this.css("border-style", "solid").css("border-color", "red"); -} - -/** * Wrapper for the :contains('text') selector * * @param {!String} text Text to select for @@ -99,20 +90,18 @@ fiveui.jqueryPlugins.cssIsNot = function (prop, set, fn) { }); } -/** - * Send a report to FiveUI reporting a problem with each element in the - * jQuery object. - * - * @param {!String} msg Message to report - */ -fiveui.jqueryPlugins.report = function (msg) { - this.each(function (i, elt) { - report(msg, elt); // NOTE: this doesn't work. report() is not in scope here! - }); -} /** - * Visually highlight elements in the jQuery object (mostly for debugging purposes). + * Visually highlight elements in the jQuery object. + * + * @description This plugin is useful mostly in the process of writing + * guidelines, for example the guideline developer can load a page, + * click the "Break" button on the FiveUI window, enter the browser's + * Javascript console, and run: + * + * @example > $5("p").hasText("foo").highlight(); + * + * to visually inspect which elements in the page match the query. * * @param {String} [hint] Highlighted border color, defaults to "red" * @returns {!Object} A modified jQuery object @@ -126,8 +115,16 @@ fiveui.jqueryPlugins.highlight = function (hint) { /** * Returns a list of css properties that element in the jQuery - * object have. This is useful for analysis of a given page when - * writing guielines. + * object have. + * + * @description This plugin is useful for analysis of a given page when + * writing guielines. For example if the guideline developer wants to + * know what font sizes are used on a loaded page, they can run from the + * Javascript console: + * + * @example > $5("*").propDist("font-size", true); + * + * and a frequency table of font-sizes is logged to the console. * * @param {String} prop CSS property to be inspected * @param {boolean} [log] Boolean which enables console logging of the result; default is `false`. |