aboutsummaryrefslogtreecommitdiff
path: root/contexts/data/fiveui
diff options
context:
space:
mode:
Diffstat (limited to 'contexts/data/fiveui')
-rw-r--r--contexts/data/fiveui/injected/fiveui-injected-ui.js1
-rw-r--r--contexts/data/fiveui/injected/prelude.js33
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 ? "]" : "}");
+ }
+};