PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 2.0.3
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v2.0.3
3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / assets / js / jquery-blockui / jquery.blockUI.js
everest-forms / assets / js / jquery-blockui Last commit date
jquery.blockUI.js 5 years ago jquery.blockUI.min.js 6 years ago
jquery.blockUI.js
618 lines
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 ;(function() {
15 /*jshint eqeqeq:false curly:false latedef:false */
16 "use strict";
17
18 function setup($) {
19 $.fn._fadeIn = $.fn.fadeIn;
20
21 var noOp = $.noop || function() {};
22
23 // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
24 // confusing userAgent strings on Vista)
25 var msie = /MSIE/.test(navigator.userAgent);
26 var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
27
28 // global $ methods for blocking/unblocking the entire page
29 $.blockUI = function(opts) { install(window, opts); };
30 $.unblockUI = function(opts) { remove(window, opts); };
31
32 // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
33 $.growlUI = function(title, message, timeout, onClose) {
34 var $m = $('<div class="growlUI"></div>');
35 if (title) $m.append('<h1>'+title+'</h1>');
36 if (message) $m.append('<h2>'+message+'</h2>');
37 if (timeout === undefined) timeout = 3000;
38
39 // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
40 var callBlock = function(opts) {
41 opts = opts || {};
42
43 $.blockUI({
44 message: $m,
45 fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
46 fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
47 timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
48 centerY: false,
49 showOverlay: false,
50 onUnblock: onClose,
51 css: $.blockUI.defaults.growlCSS
52 });
53 };
54
55 callBlock();
56 var nonmousedOpacity = $m.css('opacity');
57 $m.mouseover(function() {
58 callBlock({
59 fadeIn: 0,
60 timeout: 30000
61 });
62
63 var displayBlock = $('.blockMsg');
64 displayBlock.stop(); // cancel fadeout if it has started
65 displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
66 }).mouseout(function() {
67 $('.blockMsg').fadeOut(1000);
68 });
69 // End konapun additions
70 };
71
72 // plugin method for blocking element content
73 $.fn.block = function(opts) {
74 if ( this[0] === window ) {
75 $.blockUI( opts );
76 return this;
77 }
78 var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
79 this.each(function() {
80 var $el = $(this);
81 if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
82 return;
83 $el.unblock({ fadeOut: 0 });
84 });
85
86 return this.each(function() {
87 if ($.css(this,'position') == 'static') {
88 this.style.position = 'relative';
89 $(this).data('blockUI.static', true);
90 }
91 this.style.zoom = 1; // force 'hasLayout' in ie
92 install(this, opts);
93 });
94 };
95
96 // plugin method for unblocking element content
97 $.fn.unblock = function(opts) {
98 if ( this[0] === window ) {
99 $.unblockUI( opts );
100 return this;
101 }
102 return this.each(function() {
103 remove(this, opts);
104 });
105 };
106
107 $.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!
108
109 // override these in your code to change the default behavior and style
110 $.blockUI.defaults = {
111 // message displayed when blocking (use null for no message)
112 message: '<h1>Please wait...</h1>',
113
114 title: null, // title string; only used when theme == true
115 draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
116
117 theme: false, // set to true to use with jQuery UI themes
118
119 // styles for the message when blocking; if you wish to disable
120 // these and use an external stylesheet then do this in your code:
121 // $.blockUI.defaults.css = {};
122 css: {
123 padding: 0,
124 margin: 0,
125 width: '30%',
126 top: '40%',
127 left: '35%',
128 textAlign: 'center',
129 color: '#000',
130 border: '3px solid #aaa',
131 backgroundColor:'#fff',
132 cursor: 'wait'
133 },
134
135 // minimal style set used when themes are used
136 themedCSS: {
137 width: '30%',
138 top: '40%',
139 left: '35%'
140 },
141
142 // styles for the overlay
143 overlayCSS: {
144 backgroundColor: '#000',
145 opacity: 0.6,
146 cursor: 'wait'
147 },
148
149 // style to replace wait cursor before unblocking to correct issue
150 // of lingering wait cursor
151 cursorReset: 'default',
152
153 // styles applied when using $.growlUI
154 growlCSS: {
155 width: '350px',
156 top: '10px',
157 left: '',
158 right: '10px',
159 border: 'none',
160 padding: '5px',
161 opacity: 0.6,
162 cursor: 'default',
163 color: '#fff',
164 backgroundColor: '#000',
165 '-webkit-border-radius':'10px',
166 '-moz-border-radius': '10px',
167 'border-radius': '10px'
168 },
169
170 // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
171 // (hat tip to Jorge H. N. de Vasconcelos)
172 /*jshint scripturl:true */
173 iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
174
175 // force usage of iframe in non-IE browsers (handy for blocking applets)
176 forceIframe: false,
177
178 // z-index for the blocking overlay
179 baseZ: 1000,
180
181 // set these to true to have the message automatically centered
182 centerX: true, // <-- only effects element blocking (page block controlled via css above)
183 centerY: true,
184
185 // allow body element to be stetched in ie6; this makes blocking look better
186 // on "short" pages. disable if you wish to prevent changes to the body height
187 allowBodyStretch: true,
188
189 // enable if you want key and mouse events to be disabled for content that is blocked
190 bindEvents: true,
191
192 // be default blockUI will supress tab navigation from leaving blocking content
193 // (if bindEvents is true)
194 constrainTabKey: true,
195
196 // fadeIn time in millis; set to 0 to disable fadeIn on block
197 fadeIn: 200,
198
199 // fadeOut time in millis; set to 0 to disable fadeOut on unblock
200 fadeOut: 400,
201
202 // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
203 timeout: 0,
204
205 // disable if you don't want to show the overlay
206 showOverlay: true,
207
208 // if true, focus will be placed in the first available input field when
209 // page blocking
210 focusInput: true,
211
212 // elements that can receive focus
213 focusableElements: ':input:enabled:visible',
214
215 // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
216 // no longer needed in 2012
217 // applyPlatformOpacityRules: true,
218
219 // callback method invoked when fadeIn has completed and blocking message is visible
220 onBlock: null,
221
222 // callback method invoked when unblocking has completed; the callback is
223 // passed the element that has been unblocked (which is the window object for page
224 // blocks) and the options that were passed to the unblock call:
225 // onUnblock(element, options)
226 onUnblock: null,
227
228 // callback method invoked when the overlay area is clicked.
229 // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
230 onOverlayClick: null,
231
232 // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
233 quirksmodeOffsetHack: 4,
234
235 // class name of the message block
236 blockMsgClass: 'blockMsg',
237
238 // if it is already blocked, then ignore it (don't unblock and reblock)
239 ignoreIfBlocked: false
240 };
241
242 // private data and functions follow...
243
244 var pageBlock = null;
245 var pageBlockEls = [];
246
247 function install(el, opts) {
248 var css, themedCSS;
249 var full = (el == window);
250 var msg = (opts && opts.message !== undefined ? opts.message : undefined);
251 opts = $.extend({}, $.blockUI.defaults, opts || {});
252
253 if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
254 return;
255
256 opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
257 css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
258 if (opts.onOverlayClick)
259 opts.overlayCSS.cursor = 'pointer';
260
261 themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
262 msg = msg === undefined ? opts.message : msg;
263
264 // remove the current block (if there is one)
265 if (full && pageBlock)
266 remove(window, {fadeOut:0});
267
268 // if an existing element is being used as the blocking content then we capture
269 // its current place in the DOM (and current display style) so we can restore
270 // it when we unblock
271 if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
272 var node = msg.jquery ? msg[0] : msg;
273 var data = {};
274 $(el).data('blockUI.history', data);
275 data.el = node;
276 data.parent = node.parentNode;
277 data.display = node.style.display;
278 data.position = node.style.position;
279 if (data.parent)
280 data.parent.removeChild(node);
281 }
282
283 $(el).data('blockUI.onUnblock', opts.onUnblock);
284 var z = opts.baseZ;
285
286 // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
287 // layer1 is the iframe layer which is used to supress bleed through of underlying content
288 // layer2 is the overlay layer which has opacity and a wait cursor (by default)
289 // layer3 is the message content that is displayed while blocking
290 var lyr1, lyr2, lyr3, s;
291 if (msie || opts.forceIframe)
292 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>');
293 else
294 lyr1 = $('<div class="blockUI" style="display:none"></div>');
295
296 if (opts.theme)
297 lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
298 else
299 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>');
300
301 if (opts.theme && full) {
302 s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
303 if ( opts.title ) {
304 s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
305 }
306 s += '<div class="ui-widget-content ui-dialog-content"></div>';
307 s += '</div>';
308 }
309 else if (opts.theme) {
310 s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
311 if ( opts.title ) {
312 s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
313 }
314 s += '<div class="ui-widget-content ui-dialog-content"></div>';
315 s += '</div>';
316 }
317 else if (full) {
318 s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
319 }
320 else {
321 s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
322 }
323 lyr3 = $(s);
324
325 // if we have a message, style it
326 if (msg) {
327 if (opts.theme) {
328 lyr3.css(themedCSS);
329 lyr3.addClass('ui-widget-content');
330 }
331 else
332 lyr3.css(css);
333 }
334
335 // style the overlay
336 if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
337 lyr2.css(opts.overlayCSS);
338 lyr2.css('position', full ? 'fixed' : 'absolute');
339
340 // make iframe layer transparent in IE
341 if (msie || opts.forceIframe)
342 lyr1.css('opacity',0.0);
343
344 //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
345 var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
346 $.each(layers, function() {
347 this.appendTo($par);
348 });
349
350 if (opts.theme && opts.draggable && $.fn.draggable) {
351 lyr3.draggable({
352 handle: '.ui-dialog-titlebar',
353 cancel: 'li'
354 });
355 }
356
357 // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
358 var expr = typeof document.createElement('div').style.setExpression === "function" && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
359 if (ie6 || expr) {
360 // give body 100% height
361 if (full && opts.allowBodyStretch && $.support.boxModel)
362 $('html,body').css('height','100%');
363
364 // fix ie6 issue when blocked element has a border width
365 if ((ie6 || !$.support.boxModel) && !full) {
366 var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
367 var fixT = t ? '(0 - '+t+')' : 0;
368 var fixL = l ? '(0 - '+l+')' : 0;
369 }
370
371 // simulate fixed position
372 $.each(layers, function(i,o) {
373 var s = o[0].style;
374 s.position = 'absolute';
375 if (i < 2) {
376 if (full)
377 s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
378 else
379 s.setExpression('height','this.parentNode.offsetHeight + "px"');
380 if (full)
381 s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
382 else
383 s.setExpression('width','this.parentNode.offsetWidth + "px"');
384 if (fixL) s.setExpression('left', fixL);
385 if (fixT) s.setExpression('top', fixT);
386 }
387 else if (opts.centerY) {
388 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"');
389 s.marginTop = 0;
390 }
391 else if (!opts.centerY && full) {
392 var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
393 var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
394 s.setExpression('top',expression);
395 }
396 });
397 }
398
399 // show the message
400 if (msg) {
401 if (opts.theme)
402 lyr3.find('.ui-widget-content').append(msg);
403 else
404 lyr3.append(msg);
405 if (msg.jquery || msg.nodeType)
406 $(msg).show();
407 }
408
409 if ((msie || opts.forceIframe) && opts.showOverlay)
410 lyr1.show(); // opacity is zero
411 if (opts.fadeIn) {
412 var cb = opts.onBlock ? opts.onBlock : noOp;
413 var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
414 var cb2 = msg ? cb : noOp;
415 if (opts.showOverlay)
416 lyr2._fadeIn(opts.fadeIn, cb1);
417 if (msg)
418 lyr3._fadeIn(opts.fadeIn, cb2);
419 }
420 else {
421 if (opts.showOverlay)
422 lyr2.show();
423 if (msg)
424 lyr3.show();
425 if (opts.onBlock)
426 opts.onBlock.bind(lyr3)();
427 }
428
429 // bind key and mouse events
430 bind(1, el, opts);
431
432 if (full) {
433 pageBlock = lyr3[0];
434 pageBlockEls = $(opts.focusableElements,pageBlock);
435 if (opts.focusInput)
436 setTimeout(focus, 20);
437 }
438 else
439 center(lyr3[0], opts.centerX, opts.centerY);
440
441 if (opts.timeout) {
442 // auto-unblock
443 var to = setTimeout(function() {
444 if (full)
445 $.unblockUI(opts);
446 else
447 $(el).unblock(opts);
448 }, opts.timeout);
449 $(el).data('blockUI.timeout', to);
450 }
451 }
452
453 // remove the block
454 function remove(el, opts) {
455 var count;
456 var full = (el == window);
457 var $el = $(el);
458 var data = $el.data('blockUI.history');
459 var to = $el.data('blockUI.timeout');
460 if (to) {
461 clearTimeout(to);
462 $el.removeData('blockUI.timeout');
463 }
464 opts = $.extend({}, $.blockUI.defaults, opts || {});
465 bind(0, el, opts); // unbind events
466
467 if (opts.onUnblock === null) {
468 opts.onUnblock = $el.data('blockUI.onUnblock');
469 $el.removeData('blockUI.onUnblock');
470 }
471
472 var els;
473 if (full) // crazy selector to handle odd field errors in ie6/7
474 els = $(document.body).children().filter('.blockUI').add('body > .blockUI');
475 else
476 els = $el.find('>.blockUI');
477
478 // fix cursor issue
479 if ( opts.cursorReset ) {
480 if ( els.length > 1 )
481 els[1].style.cursor = opts.cursorReset;
482 if ( els.length > 2 )
483 els[2].style.cursor = opts.cursorReset;
484 }
485
486 if (full)
487 pageBlock = pageBlockEls = null;
488
489 if (opts.fadeOut) {
490 count = els.length;
491 els.stop().fadeOut(opts.fadeOut, function() {
492 if ( --count === 0)
493 reset(els,data,opts,el);
494 });
495 }
496 else
497 reset(els, data, opts, el);
498 }
499
500 // move blocking element back into the DOM where it started
501 function reset(els,data,opts,el) {
502 var $el = $(el);
503 if ( $el.data('blockUI.isBlocked') )
504 return;
505
506 els.each(function(i,o) {
507 // remove via DOM calls so we don't lose event handlers
508 if (this.parentNode)
509 this.parentNode.removeChild(this);
510 });
511
512 if (data && data.el) {
513 data.el.style.display = data.display;
514 data.el.style.position = data.position;
515 data.el.style.cursor = 'default'; // #59
516 if (data.parent)
517 data.parent.appendChild(data.el);
518 $el.removeData('blockUI.history');
519 }
520
521 if ($el.data('blockUI.static')) {
522 $el.css('position', 'static'); // #22
523 }
524
525 if (typeof opts.onUnblock == 'function')
526 opts.onUnblock(el,opts);
527
528 // fix issue in Safari 6 where block artifacts remain until reflow
529 var body = $(document.body), w = body.width(), cssW = body[0].style.width;
530 body.width(w-1).width(w);
531 body[0].style.width = cssW;
532 }
533
534 // bind/unbind the handler
535 function bind(b, el, opts) {
536 var full = el == window, $el = $(el);
537
538 // don't bother unbinding if there is nothing to unbind
539 if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
540 return;
541
542 $el.data('blockUI.isBlocked', b);
543
544 // don't bind events when overlay is not in use or if bindEvents is false
545 if (!full || !opts.bindEvents || (b && !opts.showOverlay))
546 return;
547
548 // bind anchors and inputs for mouse and key events
549 var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
550 if (b)
551 $(document).bind(events, opts, handler);
552 else
553 $(document).unbind(events, handler);
554
555 // former impl...
556 // var $e = $('a,:input');
557 // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
558 }
559
560 // event handler to suppress keyboard/mouse events when blocking
561 function handler(e) {
562 // allow tab navigation (conditionally)
563 if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
564 if (pageBlock && e.data.constrainTabKey) {
565 var els = pageBlockEls;
566 var fwd = !e.shiftKey && e.target === els[els.length-1];
567 var back = e.shiftKey && e.target === els[0];
568 if (fwd || back) {
569 setTimeout(function(){focus(back);},10);
570 return false;
571 }
572 }
573 }
574 var opts = e.data;
575 var target = $(e.target);
576 if (target.hasClass('blockOverlay') && opts.onOverlayClick)
577 opts.onOverlayClick(e);
578
579 // allow events within the message content
580 if (target.parents('div.' + opts.blockMsgClass).length > 0)
581 return true;
582
583 // allow events for content that is not being blocked
584 return target.parents().children().filter('div.blockUI').length === 0;
585 }
586
587 function focus(back) {
588 if (!pageBlockEls)
589 return;
590 var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
591 if (e)
592 e.focus();
593 }
594
595 function center(el, x, y) {
596 var p = el.parentNode, s = el.style;
597 var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
598 var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
599 if (x) s.left = l > 0 ? (l+'px') : '0';
600 if (y) s.top = t > 0 ? (t+'px') : '0';
601 }
602
603 function sz(el, p) {
604 return parseInt($.css(el,p),10)||0;
605 }
606
607 }
608
609
610 /*global define:true */
611 if (typeof define === 'function' && define.amd && define.amd.jQuery) {
612 define(['jquery'], setup);
613 } else {
614 setup(jQuery);
615 }
616
617 })();
618