[jQuery] blockUI Plugin Lint Check Fixes

[jQuery] blockUI Plugin Lint Check Fixes


I just had to make some fixes to version 2.0.8 of the blockUI jQuery
plugin as it was throwing up warnings with the JavaScript Lint Checker
and as a result wasn't minifying correctly with YUI Compressor. Here's
a diff of the changes I've maded against the original. If Mike Alsup
(blockUI developer) sees this it would be great if he could update the
blockUI plugin to help other users.
--- /Users/simonplend/Sites/htdocs/projects/pingmymap/working-copy/
trunk/website/html/javascript/lib/jquery/jquery.blockUI.fixed.js
2008-08-10 16:19:31.000000000 +0100
+++ /Users/simonplend/Sites/htdocs/projects/pingmymap/working-copy/
trunk/website/html/javascript/lib/jquery/jquery.blockUI.js    2008-08-10
16:32:59.000000000 +0100
@@ -14,7 +14,7 @@
;(function($) {
-if ((/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery)) || (/
^1.1/.test($.fn.jquery))) {
+if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /
^1.1/.test($.fn.jquery)) {
alert('blockUI requires jQuery v1.2.3 or later! You are using v'
+ $.fn.jquery);
return;
}
@@ -103,7 +103,7 @@
// private data and functions follow...
-var ie6 = $.browser.msie && (/MSIE 6.0/.test(navigator.userAgent));
+var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
var pageBlock = null;
var pageBlockEls = [];
@@ -140,9 +140,9 @@
// layer2 is the overlay layer which has opacity and a wait
cursor
// layer3 is the message content that is displayed while blocking
- var lyr1 = ($.browser.msie) ? $('<iframe class="blockUI" style="z-
index:'+ (z++) +';border:none;margin:0;padding:
0;position:absolute;width:100%;height:100%;top:0;left:0"
src="javascript:false;"></iframe>')
+ var lyr1 = ($.browser.msie) ? $('<iframe class="blockUI" style="z-
index:'+ z++ +';border:none;margin:0;padding:0;position:absolute;width:
100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>')
: $('<div class="blockUI"
style="display:none"></div>');
- var lyr2 = $('<div class="blockUI" style="z-index:'+ (z++)
+';cursor:wait;border:none;margin:0;padding:0;width:100%;height:
100%;top:0;left:0"></div>');
+ var lyr2 = $('<div class="blockUI" style="z-index:'+ z++
+';cursor:wait;border:none;margin:0;padding:0;width:100%;height:
100%;top:0;left:0"></div>');
var lyr3 = full ? $('<div class="blockUI blockMsg blockPage"
style="z-index:'+z+';position:fixed"></div>')
: $('<div class="blockUI blockMsg blockElement"
style="z-index:'+z+';display:none;position:absolute"></div>');
@@ -151,7 +151,7 @@
lyr3.css(css);
// style the overlay
- if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && (/
Linux/.test(navigator.platform))))
+ if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /
Linux/.test(navigator.platform)))
lyr2.css(opts.overlayCSS);
lyr2.css('position', full ? 'fixed' : 'absolute');
@@ -276,7 +276,7 @@
var fwd = !e.shiftKey && e.target == els[els.length-1];
var back = e.shiftKey && e.target == els[0];
if (fwd || back) {
- setTimeout(function(){focus(back);},10);
+ setTimeout(function(){focus(back)},10);
return false;
}
}
@@ -306,7 +306,7 @@
};
function sz(el, p) {
- return parseInt($.css(el,p), 10)||0;
+ return parseInt($.css(el,p))||0;
};
})(jQuery);












































































    • Topic Participants

    • simon