diff options
author | Benjamin Jones <bjones@galois.com> | 2013-01-26 14:52:16 -0800 |
---|---|---|
committer | Benjamin Jones <bjones@galois.com> | 2013-01-26 14:52:16 -0800 |
commit | 711179148abdef4cd9370d980b53025beb7c3872 (patch) | |
tree | 98c3e4e7a40f990b1e9694becc9454e72b4922a1 /contexts/data/fiveui | |
parent | da901ff2787b5444227a46667f9f0310cd2992e8 (diff) |
fixed bug: reports tiggered on UI dialog
Diffstat (limited to 'contexts/data/fiveui')
-rw-r--r-- | contexts/data/fiveui/injected/fiveui-injected-ui.js | 1 | ||||
-rw-r--r-- | contexts/data/fiveui/injected/prelude.js | 33 |
2 files changed, 32 insertions, 2 deletions
diff --git a/contexts/data/fiveui/injected/fiveui-injected-ui.js b/contexts/data/fiveui/injected/fiveui-injected-ui.js index b93e442..5db6c46 100644 --- a/contexts/data/fiveui/injected/fiveui-injected-ui.js +++ b/contexts/data/fiveui/injected/fiveui-injected-ui.js @@ -204,6 +204,7 @@ // Add a button that causes a debuger break. // // handy for playing with Jquery on the dom. + // Note: This only works in Google Chrome. $('#controls').append($('<div id="breakButton"></div>') .button({ label: 'break' })); $('#breakButton').click(function() { diff --git a/contexts/data/fiveui/injected/prelude.js b/contexts/data/fiveui/injected/prelude.js index abe249e..06ac9bf 100644 --- a/contexts/data/fiveui/injected/prelude.js +++ b/contexts/data/fiveui/injected/prelude.js @@ -81,9 +81,13 @@ fiveui.query = function (sel, context) { } ); + $filteredResults = $results.not('#uic-top *') + .not('#uic-top') + .filter(':visible'); + // update global stats - $filteredResults = $results.not('#uic-top').filter(':visible'); fiveui.stats.numElts += $filteredResults.length; + return $filteredResults; }; @@ -241,7 +245,7 @@ fiveui.color.colorCheck = function (selector, colorSet) { allowable = {}; for (i = 0; i < colorSet.length; i += 1) { allowable[colorSet[i]] = true; } forEachFuncStr = 'function (j, elt) {\n' - + ' var allowable = ' + goog.json.serialize(allowable) + ';\n' + + ' var allowable = ' + JSON.stringify(allowable) + ';\n' + ' var color = fiveui.color.colorToHex($(elt).css("color"));\n' + ' if (!(color in allowable)) {\n' + ' report("Disallowed color " + color + " in element matching " + ' + goog.json.serialize(selector) + ', $(elt));\n' @@ -392,3 +396,28 @@ fiveui.font.validate = function (allow, font) { * @param {?Node} node The node in the DOM that caused the problem. * @name report */ + +/** + * JSON.stringify is included here for extension and ruleset debugging + * purposes. It is used by the jQuery pluggin jQuery.fn.log. + */ +var JSON = JSON || {}; +JSON.stringify = JSON.stringify || function (obj) { + var t = typeof (obj); + if (t != "object" || obj === null) { + // simple data type + if (t == "string") obj = '"'+obj+'"'; + return String(obj); + } + else { + // recurse array or object + var n, v, json = [], arr = (obj && obj.constructor == Array); + for (n in obj) { + v = obj[n]; t = typeof(v); + if (t == "string") v = '"'+v+'"'; + else if (t == "object" && v !== null) v = JSON.stringify(v); + json.push((arr ? "" : '"' + n + '":') + String(v)); + } + return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}"); + } +}; |