Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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