Przeniesienie się na jQuery 1.4.
authorzuber <marek@stepniowski.com>
Tue, 26 Jan 2010 20:31:17 +0000 (21:31 +0100)
committerzuber <marek@stepniowski.com>
Tue, 26 Jan 2010 20:31:17 +0000 (21:31 +0100)
platforma/static/js/jquery.blockui.js
platforma/templates/base.html

index d023054..d2da4bc 100644 (file)
@@ -1,6 +1,6 @@
 /*!\r
  * jQuery blockUI plugin\r
- * Version 2.28 (02-DEC-2009)\r
+ * Version 2.31 (06-JAN-2010)\r
  * @requires jQuery v1.2.3 or later\r
  *\r
  * Examples at: http://malsup.com/jquery/block/\r
@@ -21,6 +21,8 @@ if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
 \r
 $.fn._fadeIn = $.fn.fadeIn;\r
 \r
+var noOp = function() {};\r
+\r
 // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle\r
 // retarded userAgent strings on Vista)\r
 var mode = document.documentMode || 0;\r
@@ -63,7 +65,7 @@ $.fn.unblock = function(opts) {
        });\r
 };\r
 \r
-$.blockUI.version = 2.28; // 2nd generation blocking at no extra cost!\r
+$.blockUI.version = 2.31; // 2nd generation blocking at no extra cost!\r
 \r
 // override these in your code to change the default behavior and style\r
 $.blockUI.defaults = {\r
@@ -164,6 +166,9 @@ $.blockUI.defaults = {
 \r
        // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)\r
        applyPlatformOpacityRules: true,\r
+       \r
+       // callback method invoked when fadeIn has completed and blocking message is visible\r
+       onBlock: null,\r
 \r
        // callback method invoked when unblocking has completed; the callback is\r
        // passed the element that has been unblocked (which is the window object for page\r
@@ -252,7 +257,11 @@ function install(el, opts) {
        if ($.browser.msie || opts.forceIframe)\r
                lyr1.css('opacity',0.0);\r
 \r
-       $([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);\r
+       //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);\r
+       var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);\r
+       $.each(layers, function() {\r
+               this.appendTo($par);\r
+       });\r
        \r
        if (opts.theme && opts.draggable && $.fn.draggable) {\r
                lyr3.draggable({\r
@@ -312,16 +321,21 @@ function install(el, opts) {
        if (($.browser.msie || opts.forceIframe) && opts.showOverlay)\r
                lyr1.show(); // opacity is zero\r
        if (opts.fadeIn) {\r
+               var cb = opts.onBlock ? opts.onBlock : noOp;\r
+               var cb1 = (opts.showOverlay && !msg) ? cb : noOp;\r
+               var cb2 = msg ? cb : noOp;\r
                if (opts.showOverlay)\r
-                       lyr2._fadeIn(opts.fadeIn);\r
+                       lyr2._fadeIn(opts.fadeIn, cb1);\r
                if (msg)\r
-                       lyr3.fadeIn(opts.fadeIn);\r
+                       lyr3._fadeIn(opts.fadeIn, cb2);\r
        }\r
        else {\r
                if (opts.showOverlay)\r
                        lyr2.show();\r
                if (msg)\r
                        lyr3.show();\r
+               if (opts.onBlock)\r
+                       opts.onBlock();\r
        }\r
 \r
        // bind key and mouse events\r
@@ -460,4 +474,4 @@ function sz(el, p) {
        return parseInt($.css(el,p))||0;\r
 };\r
 \r
-})(jQuery);\r
+})(jQuery);
\ No newline at end of file
index 750cf7b..c3e2e80 100755 (executable)
@@ -4,8 +4,7 @@
     <head>
         <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
         <title>{% block title %}Platforma Redakcyjna{% block subtitle %}{% endblock subtitle %}{% endblock title%}</title>
-        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
-        {# <script src="{{ STATIC_URL }}js/lib/jquery.js" type="text/javascript" charset="utf-8"></script> #}
+        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
         {% block extrahead %}
         {% endblock %}
     </head>