PageSourceSearch

https://posadas.gob.ar/assets/js/jquery.blockUI.js

js posadas.gob.ar collected 2026-10-02 16:54:57 UTC 26,521 bytes, 676 lines download raw bytes

vendor: 25,081 bytes, lines 1-629
1/*!
2 * jQuery blockUI plugin
3 * Version 2.70.0-2014.11.23
4 * Requires jQuery v1.7 or later
5 *
6 * Examples at: http://malsup.com/jquery/block/
7 * Copyright (c) 2007-2013 M. Alsup
8 * Dual licensed under the MIT and GPL licenses:
9 * http://www.opensource.org/licenses/mit-license.php
10 * http://www.gnu.org/licenses/gpl.html
11 *
12 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
13 */
14
15;(function () {
16    /*jshint eqeqeq:false curly:false latedef:false */
17    "use strict";
18
19    function setup($) {
20        $.fn._fadeIn = $.fn.fadeIn;
21
22        var noOp = $.noop || function () {
23        };
24
25        // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
26        // confusing userAgent strings on Vista)
27        var msie = /MSIE/.test(navigator.userAgent);
28        var ie6 = /MSIE 6.0/.test(navigator.userAgent) && !/MSIE 8.0/.test(navigator.userAgent);
29        var mode = document.documentMode || 0;
30        var setExpr = $.isFunction(document.createElement('div').style.setExpression);
31
32        // global $ methods for blocking/unblocking the entire page
33        $.blockUI = function (opts) {
34            install(window, opts);
35        };
36        $.unblockUI = function (opts) {
37            remove(window, opts);
38        };
39
40        // convenience method for quick growl-like notifications  (http://www.google.com/search?q=growl)
41        $.growlUI = function (title, message, timeout, onClose) {
42            var $m = $('<div class="growlUI"></div>');
43            if (title) $m.append('<h1>' + title + '</h1>');
44            if (message) $m.append('<h2>' + message + '</h2>');
45            if (timeout === undefined) timeout = 3000;
46
47            // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
48            var callBlock = function (opts) {
49                opts = opts || {};
50
51                $.blockUI({
52                    message: $m,
53                    fadeIn: typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
54                    fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
55                    timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
56                    centerY: false,
57                    showOverlay: false,
58                    onUnblock: onClose,
59                    css: $.blockUI.defaults.growlCSS
60                });
61            };
62
63            callBlock();
64            var nonmousedOpacity = $m.css('opacity');
65            $m.mouseover(function () {
66                callBlock({
67                    fadeIn: 0,
68                    timeout: 30000
69                });
70
71                var displayBlock = $('.blockMsg');
72                displayBlock.stop(); // cancel fadeout if it has started
73                displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
74            }).mouseout(function () {
75                $('.blockMsg').fadeOut(1000);
76            });
77            // End konapun additions
78        };
79
80        // plugin method for blocking element content
81        $.fn.block = function (opts) {
82            if (this[0] === window) {
83                $.blockUI(opts);
84                return this;
85            }
86            var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
87            this.each(function () {
88                var $el = $(this);
89                if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
90                    return;
91                $el.unblock({fadeOut: 0});
92            });
93
94            return this.each(function () {
95                if ($.css(this, 'position') == 'static') {
96                    this.style.position = 'relative';
97                    $(this).data('blockUI.static', true);
98                }
99                this.style.zoom = 1; // force 'hasLayout' in ie
100                install(this, opts);
101            });
102        };
103
104        // plugin method for unblocking element content
105        $.fn.unblock = function (opts) {
106            if (this[0] === window) {
107                $.unblockUI(opts);
108                return this;
109            }
110            return this.each(function () {
111                remove(this, opts);
112            });
113        };
114
115        $.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!
116
117        // override these in your code to change the default behavior and style
118        // var urlimg = '{{ asset("assets/js/") }}' + 'procesando.png';
119        // var urlimg = '{{ asset("images/general/") }}' + '000_point.png';
120
121
122        $.blockUI.defaults = {
123
124
125            // message displayed when blocking (use null for no message)
126            message: '',
127            // message:  '<h1>Please wait...</h1>',
128
129            title:
130                null,		// title string; only used when theme == true
131            draggable:
132                true,	// only used when theme == true (requires jquery-ui.js to be loaded)
133
134            theme:
135                false, // set to true to use with jQuery UI themes
136
137            // styles for the message when blocking; if you wish to disable
138            // these and use an external stylesheet then do this in your code:
139            // $.blockUI.defaults.css = {};
140            css:
141                {
142                    padding: 0,
143                    margin: 0,
144                    width: '30%',
145                    top: '40%',
146                    left: '35%',
147                    textAlign: 'center',
148                    color: '#000',
149                    border: 'none',
150                    backgroundColor: 'transparent',
151                    cursor: 'wait'
152                }
153            ,
154
155            // minimal style set used when themes are used
156            themedCSS: {
157                width: '30%',
158                top:
159                    '40%',
160                left:
161                    '35%'
162            }
163            ,
164
165            // styles for the overlay
166            overlayCSS: {
167                backgroundColor: '#000',
168                opacity: 0.6,
169                cursor: 'wait'
170            },
171
172            // style to replace wait cursor before unblocking to correct issue
173            // of lingering wait cursor
174            cursorReset: 'default',
175
176            // styles applied when using $.growlUI
177            growlCSS:
178                {
179                    width: '350px',
180                    top:
181                        '10px',
182                    left:
183                        '',
184                    right:
185                        '10px',
186                    border:
187                        'none',
188                    padding:
189                        '5px',
190                    opacity:
191                        0.6,
192                    cursor:
193                        'default',
194                    color:
195                        '#fff',
196                    backgroundColor:
197                        '#000',
198                    '-webkit-border-radius':
199                        '10px',
200                    '-moz-border-radius':
201                        '10px',
202                    'border-radius':
203                        '10px'
204                }
205            ,
206
207            // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
208            // (hat tip to Jorge H. N. de Vasconcelos)
209            /*jshint scripturl:true */
210            iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
211
212            // force usage of iframe in non-IE browsers (handy for blocking applets)
213            forceIframe:
214                false,
215
216            // z-index for the blocking overlay
217            baseZ:
218                1000,
219
220            // set these to true to have the message automatically centered
221            centerX:
222                true, // <-- only effects element blocking (page block controlled via css above)
223            centerY:
224                true,
225
226            // allow body element to be stetched in ie6; this makes blocking look better
227            // on "short" pages.  disable if you wish to prevent changes to the body height
228            allowBodyStretch:
229                true,
230
231            // enable if you want key and mouse events to be disabled for content that is blocked
232            bindEvents:
233                true,
234
235            // be default blockUI will supress tab navigation from leaving blocking content
236            // (if bindEvents is true)
237            constrainTabKey:
238                true,
239
240            // fadeIn time in millis; set to 0 to disable fadeIn on block
241            fadeIn:
242                200,
243
244            // fadeOut time in millis; set to 0 to disable fadeOut on unblock
245            fadeOut:
246                400,
247
248            // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
249            timeout:
250                0,
251
252            // disable if you don't want to show the overlay
253            showOverlay:
254                true,
255
256            // if true, focus will be placed in the first available input field when
257            // page blocking
258            focusInput:
259                true,
260
261            // elements that can receive focus
262            focusableElements:
263                ':input:enabled:visible',
264
265            // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
266            // no longer needed in 2012
267            // applyPlatformOpacityRules: true,
268
269            // callback method invoked when fadeIn has completed and blocking message is visible
270            onBlock:
271                null,
272
273            // callback method invoked when unblocking has completed; the callback is
274            // passed the element that has been unblocked (which is the window object for page
275            // blocks) and the options that were passed to the unblock call:
276            //	onUnblock(element, options)
277            onUnblock:
278                null,
279
280            // callback method invoked when the overlay area is clicked.
281            // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
282            onOverlayClick:
283                null,
284
285            // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
286            quirksmodeOffsetHack:
287                4,
288
289            // class name of the message block
290            blockMsgClass:
291                'blockMsg',
292
293            // if it is already blocked, then ignore it (don't unblock and reblock)
294            ignoreIfBlocked:
295                false
296        }
297        ;
298
299        // private data and functions follow...
300
301        var pageBlock = null;
302        var pageBlockEls = [];
303
304        function install(el, opts) {
305            var css, themedCSS;
306            var full = (el == window);
307            var msg = (opts && opts.message !== undefined ? opts.message : undefined);
308            opts = $.extend({}, $.blockUI.defaults, opts || {});
309
310            if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
311                return;
312
313            opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
314            css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
315            if (opts.onOverlayClick)
316                opts.overlayCSS.cursor = 'pointer';
317
318            themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
319            msg = msg === undefined ? opts.message : msg;
320
321            // remove the current block (if there is one)
322            if (full && pageBlock)
323                remove(window, {fadeOut: 0});
324
325            // if an existing element is being used as the blocking content then we capture
326            // its current place in the DOM (and current display style) so we can restore
327            // it when we unblock
328            if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
329                var node = msg.jquery ? msg[0] : msg;
330                var data = {};
331                $(el).data('blockUI.history', data);
332                data.el = node;
333                data.parent = node.parentNode;
334                data.display = node.style.display;
335                data.position = node.style.position;
336                if (data.parent)
337                    data.parent.removeChild(node);
338            }
339
340            $(el).data('blockUI.onUnblock', opts.onUnblock);
341            var z = opts.baseZ;
342
343            // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
344            // layer1 is the iframe layer which is used to supress bleed through of underlying content
345            // layer2 is the overlay layer which has opacity and a wait cursor (by default)
346            // layer3 is the message content that is displayed while blocking
347            var lyr1, lyr2, lyr3, s;
348            if (msie || opts.forceIframe)
349                lyr1 = $('<iframe class="blockUI" style="z-index:' + (z++) + ';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="' + opts.iframeSrc + '"></iframe>');
350            else
351                lyr1 = $('<div class="blockUI" style="display:none"></div>');
352
353            if (opts.theme)
354                lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:' + (z++) + ';display:none"></div>');
355            else
356                lyr2 = $('<div class="blockUI blockOverlay" style="z-index:' + (z++) + ';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
357
358            if (opts.theme && full) {
359                s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:' + (z + 10) + ';display:none;position:fixed">';
360                if (opts.title) {
361                    s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (opts.title || '&nbsp;') + '</div>';
362                }
363                s += '<div class="ui-widget-content ui-dialog-content"></div>';
364                s += '</div>';
365            }
366            else if (opts.theme) {
367                s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:' + (z + 10) + ';display:none;position:absolute">';
368                if (opts.title) {
369                    s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (opts.title || '&nbsp;') + '</div>';
370                }
371                s += '<div class="ui-widget-content ui-dialog-content"></div>';
372                s += '</div>';
373            }
374            else if (full) {
375                s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:' + (z + 10) + ';display:none;position:fixed"></div>';
376            }
377            else {
378                s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:' + (z + 10) + ';display:none;position:absolute"></div>';
379            }
380            lyr3 = $(s);
381
382            // if we have a message, style it
383            if (msg) {
384                if (opts.theme) {
385                    lyr3.css(themedCSS);
386                    lyr3.addClass('ui-widget-content');
387                }
388                else
389                    lyr3.css(css);
390            }
391
392            // style the overlay
393            if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
394                lyr2.css(opts.overlayCSS);
395            lyr2.css('position', full ? 'fixed' : 'absolute');
396
397            // make iframe layer transparent in IE
398            if (msie || opts.forceIframe)
399                lyr1.css('opacity', 0.0);
400
401            //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
402            var layers = [lyr1, lyr2, lyr3], $par = full ? $('body') : $(el);
403            $.each(layers, function () {
404                this.appendTo($par);
405            });
406
407            if (opts.theme && opts.draggable && $.fn.draggable) {
408                lyr3.draggable({
409                    handle: '.ui-dialog-titlebar',
410                    cancel: 'li'
411                });
412            }
413
414            // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
415            var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
416            if (ie6 || expr) {
417                // give body 100% height
418                if (full && opts.allowBodyStretch && $.support.boxModel)
419                    $('html,body').css('height', '100%');
420
421                // fix ie6 issue when blocked element has a border width
422                if ((ie6 || !$.support.boxModel) && !full) {
423                    var t = sz(el, 'borderTopWidth'), l = sz(el, 'borderLeftWidth');
424                    var fixT = t ? '(0 - ' + t + ')' : 0;
425                    var fixL = l ? '(0 - ' + l + ')' : 0;
426                }
427
428                // simulate fixed position
429                $.each(layers, function (i, o) {
430                    var s = o[0].style;
431                    s.position = 'absolute';
432                    if (i < 2) {
433                        if (full)
434                            s.setExpression('height', 'Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:' + opts.quirksmodeOffsetHack + ') + "px"');
435                        else
436                            s.setExpression('height', 'this.parentNode.offsetHeight + "px"');
437                        if (full)
438                            s.setExpression('width', 'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
439                        else
440                            s.setExpression('width', 'this.parentNode.offsetWidth + "px"');
441                        if (fixL) s.setExpression('left', fixL);
442                        if (fixT) s.setExpression('top', fixT);
443                    }
444                    else if (opts.centerY) {
445                        if (full) s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
446                        s.marginTop = 0;
447                    }
448                    else if (!opts.centerY && full) {
449                        var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
450                        var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + ' + top + ') + "px"';
451                        s.setExpression('top', expression);
452                    }
453                });
454            }
455
456            // show the message
457            if (msg) {
458                if (opts.theme)
459                    lyr3.find('.ui-widget-content').append(msg);
460                else
461                    lyr3.append(msg);
462                if (msg.jquery || msg.nodeType)
463                    $(msg).show();
464            }
465
466            if ((msie || opts.forceIframe) && opts.showOverlay)
467                lyr1.show(); // opacity is zero
468            if (opts.fadeIn) {
469                var cb = opts.onBlock ? opts.onBlock : noOp;
470                var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
471                var cb2 = msg ? cb : noOp;
472                if (opts.showOverlay)
473                    lyr2._fadeIn(opts.fadeIn, cb1);
474                if (msg)
475                    lyr3._fadeIn(opts.fadeIn, cb2);
476            }
477            else {
478                if (opts.showOverlay)
479                    lyr2.show();
480                if (msg)
481                    lyr3.show();
482                if (opts.onBlock)
483                    opts.onBlock.bind(lyr3)();
484            }
485
486            // bind key and mouse events
487            bind(1, el, opts);
488
489            if (full) {
490                pageBlock = lyr3[0];
491                pageBlockEls = $(opts.focusableElements, pageBlock);
492                if (opts.focusInput)
493                    setTimeout(focus, 20);
494            }
495            else
496                center(lyr3[0], opts.centerX, opts.centerY);
497
498            if (opts.timeout) {
499                // auto-unblock
500                var to = setTimeout(function () {
501                    if (full)
502                        $.unblockUI(opts);
503                    else
504                        $(el).unblock(opts);
505                }, opts.timeout);
506                $(el).data('blockUI.timeout', to);
507            }
508        }
509
510        // remove the block
511        function remove(el, opts) {
512            var count;
513            var full = (el == window);
514            var $el = $(el);
515            var data = $el.data('blockUI.history');
516            var to = $el.data('blockUI.timeout');
517            if (to) {
518                clearTimeout(to);
519                $el.removeData('blockUI.timeout');
520            }
521            opts = $.extend({}, $.blockUI.defaults, opts || {});
522            bind(0, el, opts); // unbind events
523
524            if (opts.onUnblock === null) {
525                opts.onUnblock = $el.data('blockUI.onUnblock');
526                $el.removeData('blockUI.onUnblock');
527            }
528
529            var els;
530            if (full) // crazy selector to handle odd field errors in ie6/7
531                els = $('body').children().filter('.blockUI').add('body > .blockUI');
532            else
533                els = $el.find('>.blockUI');
534
535            // fix cursor issue
536            if (opts.cursorReset) {
537                if (els.length > 1)
538                    els[1].style.cursor = opts.cursorReset;
539                if (els.length > 2)
540                    els[2].style.cursor = opts.cursorReset;
541            }
542
543            if (full)
544                pageBlock = pageBlockEls = null;
545
546            if (opts.fadeOut) {
547                count = els.length;
548                els.stop().fadeOut(opts.fadeOut, function () {
549                    if (--count === 0)
550                        reset(els, data, opts, el);
551                });
552            }
553            else
554                reset(els, data, opts, el);
555        }
556
557        // move blocking element back into the DOM where it started
558        function reset(els, data, opts, el) {
559            var $el = $(el);
560            if ($el.data('blockUI.isBlocked'))
561                return;
562
563            els.each(function (i, o) {
564                // remove via DOM calls so we don't lose event handlers
565                if (this.parentNode)
566                    this.parentNode.removeChild(this);
567            });
568
569            if (data && data.el) {
570                data.el.style.display = data.display;
571                data.el.style.position = data.position;
572                data.el.style.cursor = 'default'; // #59
573                if (data.parent)
574                    data.parent.appendChild(data.el);
575                $el.removeData('blockUI.history');
576            }
577
578            if ($el.data('blockUI.static')) {
579                $el.css('position', 'static'); // #22
580            }
581
582            if (typeof opts.onUnblock == 'function')
583                opts.onUnblock(el, opts);
584
585            // fix issue in Safari 6 where block artifacts remain until reflow
586            var body = $(document.body), w = body.width(), cssW = body[0].style.width;
587            body.width(w - 1).width(w);
588            body[0].style.width = cssW;
589        }
590
591        // bind/unbind the handler
592        function bind(b, el, opts) {
593            var full = el == window, $el = $(el);
594
595            // don't bother unbinding if there is nothing to unbind
596            if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
597                return;
598
599            $el.data('blockUI.isBlocked', b);
600
601            // don't bind events when overlay is not in use or if bindEvents is false
602            if (!full || !opts.bindEvents || (b && !opts.showOverlay))
603                return;
604
605            // bind anchors and inputs for mouse and key events
606            var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
607            if (b)
608                $(document).bind(events, opts, handler);
609            else
610                $(document).unbind(events, handler);
611
612            // former impl...
613            //		var $e = $('a,:input');
614            //		b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
615        }
616
617        // event handler to suppress keyboard/mouse events when blocking
618        function handler(e) {
619            // allow tab navigation (conditionally)
620            if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
621                if (pageBlock && e.data.constrainTabKey) {
622                    var els = pageBlockEls;
623                    var fwd = !e.shiftKey && e.target === els[els.length - 1];
624                    var back = e.shiftKey && e.target === els[0];
625                    if (fwd || back) {
626                        setTimeout(function () {
627                            focus(back);
628                        }, 10);
629                        return false;
vendor: 1,440 bytes, lines 630-676
630                    }
631                }
632            }
633            var opts = e.data;
634            var target = $(e.target);
635            if (target.hasClass('blockOverlay') && opts.onOverlayClick)
636                opts.onOverlayClick(e);
637
638            // allow events within the message content
639            if (target.parents('div.' + opts.blockMsgClass).length > 0)
640                return true;
641
642            // allow events for content that is not being blocked
643            return target.parents().children().filter('div.blockUI').length === 0;
644        }
645
646        function focus(back) {
647            if (!pageBlockEls)
648                return;
649            var e = pageBlockEls[back === true ? pageBlockEls.length - 1 : 0];
650            if (e)
651                e.focus();
652        }
653
654        function center(el, x, y) {
655            var p = el.parentNode, s = el.style;
656            var l = ((p.offsetWidth - el.offsetWidth) / 2) - sz(p, 'borderLeftWidth');
657            var t = ((p.offsetHeight - el.offsetHeight) / 2) - sz(p, 'borderTopWidth');
658            if (x) s.left = l > 0 ? (l + 'px') : '0';
659            if (y) s.top = t > 0 ? (t + 'px') : '0';
660        }
661
662        function sz(el, p) {
663            return parseInt($.css(el, p), 10) || 0;
664        }
665
666    }
667
668
669    /*global define:true */
670    if (typeof define === 'function' && define.amd && define.amd.jQuery) {
671        define(['jquery'], setup);
672    } else {
673        setup(jQuery);
674    }
675
676})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.