Index: lams_central/web/css/jquery.countdown.css =================================================================== diff -u -rb652cf47563185ee684068696c5af1bb96f8b0fa -r49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd --- lams_central/web/css/jquery.countdown.css (.../jquery.countdown.css) (revision b652cf47563185ee684068696c5af1bb96f8b0fa) +++ lams_central/web/css/jquery.countdown.css (.../jquery.countdown.css) (revision 49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd) @@ -1,47 +1,54 @@ -/* jQuery Countdown styles */ -.hasCountdown { +/* jQuery Countdown styles 2.0.0. */ +.is-countdown { border: 1px solid #ccc; background-color: #eee; } -.countdown_rtl { +.countdown-rtl { direction: rtl; } -.countdown_holding div { - background-color: #ccc; +.countdown-holding span { + color: #888; } -.countdown_row { +.countdown-row { clear: both; width: 100%; + padding: 0px 2px; text-align: center; } -.countdown_show1 div { - width: 100%; +.countdown-show1 .countdown-section { + width: 98%; } -.countdown_show2 div { - width: 50%; +.countdown-show2 .countdown-section { + width: 48%; } -.countdown_show3 div { - width: 33%; +.countdown-show3 .countdown-section { + width: 32.5%; } -.countdown_show4 div { - width: 25%; +.countdown-show4 .countdown-section { + width: 24.5%; } -.countdown_show5 div { - width: 20%; +.countdown-show5 .countdown-section { + width: 19.5%; } -.countdown_show6 div { - width: 16%; +.countdown-show6 .countdown-section { + width: 16.25%; } -.countdown_show7 div { +.countdown-show7 .countdown-section { width: 14%; } -.countdown_section { +.countdown-section { + display: block; float: left; - font-size: 75% + font-size: 75%; + text-align: center; } -.countdown_amount { - font-size: 200%; +.countdown-amount { + font-size: 200%; } -.countdown_descr { +.countdown-period { + display: block; +} +.countdown-descr { + display: block; width: 100%; } Index: lams_central/web/css/jquery.jgrowl.css =================================================================== diff -u --- lams_central/web/css/jquery.jgrowl.css (revision 0) +++ lams_central/web/css/jquery.jgrowl.css (revision 49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd) @@ -0,0 +1,100 @@ +.jGrowl { + z-index: 9999; + color: #ffffff; + font-size: 12px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + position: fixed; +} +.jGrowl.top-left { + left: 0px; + top: 0px; +} +.jGrowl.top-right { + right: 0px; + top: 0px; +} +.jGrowl.bottom-left { + left: 0px; + bottom: 0px; +} +.jGrowl.bottom-right { + right: 0px; + bottom: 0px; +} +.jGrowl.center { + top: 0px; + width: 50%; + left: 25%; +} +.jGrowl.center .jGrowl-notification, +.jGrowl.center .jGrowl-closer { + margin-left: auto; + margin-right: auto; +} +.jGrowl-notification { + background-color: #000000; + opacity: 0.9; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(90); + filter: progid:DXImageTransform.Microsoft.Alpha(90); + zoom: 1; + width: 250px; + padding: 10px; + margin: 10px; + text-align: left; + display: none; + border-radius: 5px; + min-height: 40px; +} +.jGrowl-notification .ui-state-highlight, +.jGrowl-notification .ui-widget-content .ui-state-highlight, +.jGrowl-notification .ui-widget-header .ui-state-highlight { + border: 1px solid #000; + background: #000; + color: #fff; +} +.jGrowl-notification .jGrowl-header { + font-weight: bold; + font-size: .85em; +} +.jGrowl-notification .jGrowl-close { + background-color: transparent; + color: inherit; + border: none; + z-index: 99; + float: right; + font-weight: bold; + font-size: 1em; + cursor: pointer; +} +.jGrowl-closer { + background-color: #000000; + opacity: 0.9; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(90); + filter: progid:DXImageTransform.Microsoft.Alpha(90); + zoom: 1; + width: 250px; + padding: 10px; + margin: 10px; + text-align: left; + display: none; + border-radius: 5px; + padding-top: 4px; + padding-bottom: 4px; + cursor: pointer; + font-size: .9em; + font-weight: bold; + text-align: center; +} +.jGrowl-closer .ui-state-highlight, +.jGrowl-closer .ui-widget-content .ui-state-highlight, +.jGrowl-closer .ui-widget-header .ui-state-highlight { + border: 1px solid #000; + background: #000; + color: #fff; +} +/** Hide jGrowl when printing **/ +@media print { + .jGrowl { + display: none; + } +} Index: lams_central/web/includes/javascript/jquery.blockUI.js =================================================================== diff -u -rc8e76e0e04c3ed0df8c88b4b46ad4ac07897aaf0 -r49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd --- lams_central/web/includes/javascript/jquery.blockUI.js (.../jquery.blockUI.js) (revision c8e76e0e04c3ed0df8c88b4b46ad4ac07897aaf0) +++ lams_central/web/includes/javascript/jquery.blockUI.js (.../jquery.blockUI.js) (revision 49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd) @@ -1,10 +1,10 @@ /*! * jQuery blockUI plugin - * Version 2.54 (17-DEC-2012) - * @requires jQuery v1.3 or later + * Version 2.70.0-2014.11.23 + * Requires jQuery v1.7 or later * * Examples at: http://malsup.com/jquery/block/ - * Copyright (c) 2007-2012 M. Alsup + * Copyright (c) 2007-2013 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html @@ -13,25 +13,19 @@ */ ;(function() { +/*jshint eqeqeq:false curly:false latedef:false */ "use strict"; function setup($) { - if (/^1\.(0|1|2)/.test($.fn.jquery)) { - /*global alert:true */ - alert('blockUI requires jQuery v1.3 or later! You are using v' + $.fn.jquery); - return; - } - $.fn._fadeIn = $.fn.fadeIn; var noOp = $.noop || function() {}; // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle - // retarded userAgent strings on Vista) + // confusing userAgent strings on Vista) var msie = /MSIE/.test(navigator.userAgent); - var ie6 = /MSIE 6.0/.test(navigator.userAgent); + var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent); var mode = document.documentMode || 0; - // var setExpr = msie && (($.browser.version < 8 && !mode) || mode < 8); var setExpr = $.isFunction( document.createElement('div').style.setExpression ); // global $ methods for blocking/unblocking the entire page @@ -44,16 +38,46 @@ if (title) $m.append('

'+title+'

'); if (message) $m.append('

'+message+'

'); if (timeout === undefined) timeout = 3000; - $.blockUI({ - message: $m, fadeIn: 700, fadeOut: 1000, centerY: false, - timeout: timeout, showOverlay: false, - onUnblock: onClose, - css: $.blockUI.defaults.growlCSS + + // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications + var callBlock = function(opts) { + opts = opts || {}; + + $.blockUI({ + message: $m, + fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700, + fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000, + timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout, + centerY: false, + showOverlay: false, + onUnblock: onClose, + css: $.blockUI.defaults.growlCSS + }); + }; + + callBlock(); + var nonmousedOpacity = $m.css('opacity'); + $m.mouseover(function() { + callBlock({ + fadeIn: 0, + timeout: 30000 + }); + + var displayBlock = $('.blockMsg'); + displayBlock.stop(); // cancel fadeout if it has started + displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency + }).mouseout(function() { + $('.blockMsg').fadeOut(1000); }); + // End konapun additions }; // plugin method for blocking element content $.fn.block = function(opts) { + if ( this[0] === window ) { + $.blockUI( opts ); + return this; + } var fullOpts = $.extend({}, $.blockUI.defaults, opts || {}); this.each(function() { var $el = $(this); @@ -63,21 +87,27 @@ }); return this.each(function() { - if ($.css(this,'position') == 'static') + if ($.css(this,'position') == 'static') { this.style.position = 'relative'; + $(this).data('blockUI.static', true); + } this.style.zoom = 1; // force 'hasLayout' in ie install(this, opts); }); }; // plugin method for unblocking element content $.fn.unblock = function(opts) { + if ( this[0] === window ) { + $.unblockUI( opts ); + return this; + } return this.each(function() { remove(this, opts); }); }; - $.blockUI.version = 2.54; // 2nd generation blocking at no extra cost! + $.blockUI.version = 2.70; // 2nd generation blocking at no extra cost! // override these in your code to change the default behavior and style $.blockUI.defaults = { @@ -182,6 +212,9 @@ // page blocking focusInput: true, + // elements that can receive focus + focusableElements: ':input:enabled:visible', + // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) // no longer needed in 2012 // applyPlatformOpacityRules: true, @@ -280,7 +313,7 @@ s = ''; } @@ -393,15 +426,15 @@ if (msg) lyr3.show(); if (opts.onBlock) - opts.onBlock(); + opts.onBlock.bind(lyr3)(); } // bind key and mouse events bind(1, el, opts); if (full) { pageBlock = lyr3[0]; - pageBlockEls = $(':input:enabled:visible',pageBlock); + pageBlockEls = $(opts.focusableElements,pageBlock); if (opts.focusInput) setTimeout(focus, 20); } @@ -422,6 +455,7 @@ // remove the block function remove(el, opts) { + var count; var full = (el == window); var $el = $(el); var data = $el.data('blockUI.history'); @@ -456,15 +490,22 @@ pageBlock = pageBlockEls = null; if (opts.fadeOut) { - els.fadeOut(opts.fadeOut); - setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut); + count = els.length; + els.stop().fadeOut(opts.fadeOut, function() { + if ( --count === 0) + reset(els,data,opts,el); + }); } else reset(els, data, opts, el); } // move blocking element back into the DOM where it started function reset(els,data,opts,el) { + var $el = $(el); + if ( $el.data('blockUI.isBlocked') ) + return; + els.each(function(i,o) { // remove via DOM calls so we don't lose event handlers if (this.parentNode) @@ -474,11 +515,16 @@ if (data && data.el) { data.el.style.display = data.display; data.el.style.position = data.position; + data.el.style.cursor = 'default'; // #59 if (data.parent) data.parent.appendChild(data.el); - $(el).removeData('blockUI.history'); + $el.removeData('blockUI.history'); } + if ($el.data('blockUI.static')) { + $el.css('position', 'static'); // #22 + } + if (typeof opts.onUnblock == 'function') opts.onUnblock(el,opts); @@ -499,7 +545,7 @@ $el.data('blockUI.isBlocked', b); // don't bind events when overlay is not in use or if bindEvents is false - if (!opts.bindEvents || (b && !opts.showOverlay)) + if (!full || !opts.bindEvents || (b && !opts.showOverlay)) return; // bind anchors and inputs for mouse and key events @@ -517,7 +563,7 @@ // event handler to suppress keyboard/mouse events when blocking function handler(e) { // allow tab navigation (conditionally) - if (e.keyCode && e.keyCode == 9) { + if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) { if (pageBlock && e.data.constrainTabKey) { var els = pageBlockEls; var fwd = !e.shiftKey && e.target === els[els.length-1]; @@ -531,7 +577,7 @@ var opts = e.data; var target = $(e.target); if (target.hasClass('blockOverlay') && opts.onOverlayClick) - opts.onOverlayClick(); + opts.onOverlayClick(e); // allow events within the message content if (target.parents('div.' + opts.blockMsgClass).length > 0) @@ -571,4 +617,4 @@ setup(jQuery); } -})(); \ No newline at end of file +})(); Index: lams_central/web/includes/javascript/jquery.countdown.js =================================================================== diff -u -rb652cf47563185ee684068696c5af1bb96f8b0fa -r49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd --- lams_central/web/includes/javascript/jquery.countdown.js (.../jquery.countdown.js) (revision b652cf47563185ee684068696c5af1bb96f8b0fa) +++ lams_central/web/includes/javascript/jquery.countdown.js (.../jquery.countdown.js) (revision 49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd) @@ -1,505 +1,6 @@ /* http://keith-wood.name/countdown.html - Countdown for jQuery v1.4.3. - Written by Keith Wood (kbwood@virginbroadband.com.au) January 2008. - Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and - MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. + Countdown for jQuery v2.0.1. + Written by Keith Wood (kbwood{at}iinet.com.au) January 2008. + Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license. Please attribute the author if you use it. */ - -/* Display a countdown timer. - Attach it with options like: - $('div selector').countdown( - {until: new Date(2009, 1 - 1, 1, 0, 0, 0), onExpiry: happyNewYear}); */ - -(function($) { // Hide scope, no $ conflict - -/* Countdown manager. */ -function Countdown() { - this.regional = []; // Available regional settings, indexed by language code - this.regional[''] = { // Default regional settings - // The display texts for the counters - labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'], - // The display texts for the counters if only one - labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'], - compactLabels: ['y', 'm', 'w', 'd'], // The compact texts for the counters - timeSeparator: ':', // Separator for time periods - isRTL: false // True for right-to-left languages, false for left-to-right - }; - this._defaults = { - format: 'dHMS', // Format for display - upper case for always, lower case only if non-zero, - // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds - layout: '', // Build your own layout for the countdown - compact: false, // True to display in a compact format, false for an expanded one - description: '', // The description displayed for the countdown - expiryUrl: null, // A URL to load upon expiry, replacing the current page - alwaysExpire: false, // True to trigger onExpiry even if never counted down - onExpiry: null, // Callback when the countdown expires - - // receives no parameters and 'this' is the containing division - onTick: null, // Callback when the countdown is updated - - // receives int[7] being the breakdown by period (based on format) - // and 'this' is the containing division - serverTime: null // The current time on the server, to calculate an offset for other time zones - }; - $.extend(this._defaults, this.regional['']); -} - -var PROP_NAME = 'countdown'; - -var Y = 0; // Years -var O = 1; // Months -var W = 2; // Weeks -var D = 3; // Days -var H = 4; // Hours -var M = 5; // Minutes -var S = 6; // Seconds - -$.extend(Countdown.prototype, { - /* Class name added to elements to indicate already configured with countdown. */ - markerClassName: 'hasCountdown', - - /* Override the default settings for all instances of the countdown widget. - @param options (object) the new settings to use as defaults */ - setDefaults: function(options) { - this._resetExtraLabels(this._defaults, options); - extendRemove(this._defaults, options || {}); - }, - - /* Attach the countdown widget to a div. - @param target (element) the containing division - @param options (object) the initial settings for the countdown */ - _attachCountdown: function(target, options) { - target = $(target); - if (target.hasClass(this.markerClassName)) { - return; - } - target.addClass(this.markerClassName); - var inst = {}; - inst.options = $.extend({}, options); - inst._periods = [0, 0, 0, 0, 0, 0, 0]; - this._adjustSettings(inst); - $.data(target[0], PROP_NAME, inst); - this._updateCountdown(target, inst); - }, - - /* Redisplay the countdown with an updated display. - @param target (jQuery) the containing division - @param inst (object) the current settings for this instance */ - _updateCountdown: function(target, inst) { - var target = $(target); - inst = inst || $.data(target[0], PROP_NAME); - if (!inst) { - return; - } - target.html(this._generateHTML(inst)); - target[(this._get(inst, 'isRTL') ? 'add' : 'remove') + 'Class']('countdown_rtl'); - var onTick = this._get(inst, 'onTick'); - if (onTick) { - onTick.apply(target[0], [inst._hold != 'lap' ? inst._periods : - this._calculatePeriods(inst, inst._show, new Date())]); - } - var expired = inst._hold != 'pause' && - (inst._since ? inst._now.getTime() <= inst._since.getTime() : - inst._now.getTime() >= inst._until.getTime()); - if (expired) { - if (inst._timer || this._get(inst, 'alwaysExpire')) { - var onExpiry = this._get(inst, 'onExpiry'); - if (onExpiry) { - onExpiry.apply(target[0], []); - } - var expiryUrl = this._get(inst, 'expiryUrl'); - if (expiryUrl) { - window.location = expiryUrl; - } - } - inst._timer = null; - } - else if (inst._hold == 'pause') { - inst._timer = null; - } - else { - var format = this._get(inst, 'format'); - inst._timer = setTimeout(function() { $.countdown._updateCountdown(target); }, - (format.match('s|S') ? 1 : (format.match('m|M') ? 30 : 600)) * 980); // just under the full time - } - $.data(target[0], PROP_NAME, inst); - }, - - /* Reconfigure the settings for a countdown div. - @param target (element) the containing division - @param options (object) the new settings for the countdown */ - _changeCountdown: function(target, options) { - var inst = $.data(target, PROP_NAME); - if (inst) { - this._resetExtraLabels(inst.options, options); - extendRemove(inst.options, options || {}); - this._adjustSettings(inst); - $.data(target, PROP_NAME, inst); - this._updateCountdown(target, inst); - } - }, - - /* Reset any extra labelsn and compactLabelsn entries if changing labels. - @param base (object) the options to be updated - @param options (object) the new option values */ - _resetExtraLabels: function(base, options) { - var changingLabels = false; - for (var n in options) { - if (n.match(/[Ll]abels/)) { - changingLabels = true; - break; - } - } - if (changingLabels) { - for (var n in base) { // Remove custom numbered labels - if (n.match(/[Ll]abels[0-9]/)) { - base[n] = null; - } - } - } - }, - - /* Remove the countdown widget from a div. - @param target (element) the containing division */ - _destroyCountdown: function(target) { - target = $(target); - if (!target.hasClass(this.markerClassName)) { - return; - } - target.removeClass(this.markerClassName).empty(); - var inst = $.data(target[0], PROP_NAME); - if (inst._timer) { - clearTimeout(inst._timer); - } - $.removeData(target[0], PROP_NAME); - }, - - /* Pause a countdown widget at the current time. - Stop it running but remember and display the current time. - @param target (element) the containing division */ - _pauseCountdown: function(target) { - this._hold(target, 'pause'); - }, - - /* Pause a countdown widget at the current time. - Stop the display but keep the countdown running. - @param target (element) the containing division */ - _lapCountdown: function(target) { - this._hold(target, 'lap'); - }, - - /* Resume a paused countdown widget. - @param target (element) the containing division */ - _resumeCountdown: function(target) { - this._hold(target, null); - }, - - /* Pause or resume a countdown widget. - @param target (element) the containing division - @param hold (string) the new hold setting */ - _hold: function(target, hold) { - var inst = $.data(target, PROP_NAME); - if (inst) { - if (inst._hold == 'pause' && !hold) { - inst._periods = inst._savePeriods; - var sign = (inst._since ? '-' : '+'); - inst[inst._since ? '_since' : '_until'] = - this._determineTime(sign + inst._periods[0] + 'Y' + - sign + inst._periods[1] + 'O' + sign + inst._periods[2] + 'W' + - sign + inst._periods[3] + 'D' + sign + inst._periods[4] + 'H' + - sign + inst._periods[5] + 'M' + sign + inst._periods[6] + 'S'); - } - inst._hold = hold; - inst._savePeriods = (hold == 'pause' ? inst._periods : null); - $.data(target, PROP_NAME, inst); - this._updateCountdown(target, inst); - } - }, - - /* Return the current time periods. - @param target (element) the containing division - @return (number[7]) the current periods for the countdown */ - _getTimesCountdown: function(target) { - var inst = $.data(target, PROP_NAME); - return (!inst ? null : (!inst._hold ? inst._periods : - this._calculatePeriods(inst, inst._show, new Date()))); - }, - - /* Get a setting value, defaulting if necessary. - @param inst (object) the current settings for this instance - @param name (string) the name of the required setting - @return (any) the setting's value or a default if not overridden */ - _get: function(inst, name) { - return (inst.options[name] != null ? - inst.options[name] : $.countdown._defaults[name]); - }, - - /* Calculate interal settings for an instance. - @param inst (object) the current settings for this instance */ - _adjustSettings: function(inst) { - var now = new Date(); - var serverTime = this._get(inst, 'serverTime'); - inst._offset = (serverTime ? serverTime.getTime() - now.getTime() : 0); - inst._since = this._get(inst, 'since'); - if (inst._since) { - inst._since = this._determineTime(inst._since, null); - } - inst._until = this._determineTime(this._get(inst, 'until'), now); - inst._show = this._determineShow(inst); - }, - - /* A time may be specified as an exact value or a relative one. - @param setting (string or number or Date) - the date/time value - as a relative or absolute value - @param defaultTime (Date) the date/time to use if no other is supplied - @return (Date) the corresponding date/time */ - _determineTime: function(setting, defaultTime) { - var offsetNumeric = function(offset) { // e.g. +300, -2 - var time = new Date(); - time.setTime(time.getTime() + offset * 1000); - return time; - }; - var getDaysInMonth = function(year, month) { - return 32 - new Date(year, month, 32).getDate(); - }; - var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m' - var time = new Date(); - var year = time.getFullYear(); - var month = time.getMonth(); - var day = time.getDate(); - var hour = time.getHours(); - var minute = time.getMinutes(); - var second = time.getSeconds(); - var pattern = /([+-]?[0-9]+)\s*(s|S|m|M|h|H|d|D|w|W|o|O|y|Y)?/g; - var matches = pattern.exec(offset); - while (matches) { - switch (matches[2] || 's') { - case 's' : case 'S' : - second += parseInt(matches[1], 10); break; - case 'm' : case 'M' : - minute += parseInt(matches[1], 10); break; - case 'h' : case 'H' : - hour += parseInt(matches[1], 10); break; - case 'd' : case 'D' : - day += parseInt(matches[1], 10); break; - case 'w' : case 'W' : - day += parseInt(matches[1], 10) * 7; break; - case 'o' : case 'O' : - month += parseInt(matches[1], 10); - day = Math.min(day, getDaysInMonth(year, month)); - break; - case 'y': case 'Y' : - year += parseInt(matches[1], 10); - day = Math.min(day, getDaysInMonth(year, month)); - break; - } - matches = pattern.exec(offset); - } - time = new Date(year, month, day, hour, minute, second, 0); - return time; - }; - var time = (setting == null ? defaultTime : - (typeof setting == 'string' ? offsetString(setting) : - (typeof setting == 'number' ? offsetNumeric(setting) : setting))); - if (time) time.setMilliseconds(0); - return time; - }, - - /* Generate the HTML to display the countdown widget. - @param inst (object) the current settings for this instance - @return (string) the new HTML for the countdown display */ - _generateHTML: function(inst) { - // Determine what to show - inst._periods = periods = (inst._hold ? inst._periods : - this._calculatePeriods(inst, inst._show, new Date())); - // Show all 'asNeeded' after first non-zero value - var shownNonZero = false; - var showCount = 0; - for (var period = 0; period < inst._show.length; period++) { - shownNonZero |= (inst._show[period] == '?' && periods[period] > 0); - inst._show[period] = (inst._show[period] == '?' && !shownNonZero ? null : inst._show[period]); - showCount += (inst._show[period] ? 1 : 0); - } - var compact = this._get(inst, 'compact'); - var layout = this._get(inst, 'layout'); - var labels = (compact ? this._get(inst, 'compactLabels') : this._get(inst, 'labels')); - var timeSeparator = this._get(inst, 'timeSeparator'); - var description = this._get(inst, 'description') || ''; - var twoDigits = function(value) { - return (value < 10 ? '0' : '') + value; - }; - var showCompact = function(period) { - var labelsNum = $.countdown._get(inst, 'compactLabels' + periods[period]); - return (inst._show[period] ? periods[period] + - (labelsNum ? labelsNum[period] : labels[period]) + ' ' : ''); - }; - var showFull = function(period) { - var labelsNum = $.countdown._get(inst, 'labels' + periods[period]); - return (inst._show[period] ? - '
' + - periods[period] + '
' + - (labelsNum ? labelsNum[period] : labels[period]) + '
' : ''); - }; - return (layout ? this._buildLayout(inst, layout, compact) : - ((compact ? // Compact version - '
' + - showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) + - (inst._show[H] ? twoDigits(periods[H]) : '') + - (inst._show[M] ? (inst._show[H] ? timeSeparator : '') + twoDigits(periods[M]) : '') + - (inst._show[S] ? (inst._show[H] || inst._show[M] ? timeSeparator : '') + - twoDigits(periods[S]) : '') : - // Full version - '
' + - showFull(Y) + showFull(O) + showFull(W) + showFull(D) + - showFull(H) + showFull(M) + showFull(S)) + '
' + - (description ? '
' + description + '
' : ''))); - }, - - /* Construct a custom layout. - @param inst (object) the current settings for this instance - @param layout (string) the customised layout - @param compact (boolean) true if using compact labels - @return (string) the custom HTML */ - _buildLayout: function(inst, layout, compact) { - var labels = (compact ? this._get(inst, 'compactLabels') : this._get(inst, 'labels')); - var html = layout; - var processPeriod = function(period, index) { - var pattern1 = new RegExp('%' + period + '.*%' + period); - var pattern2 = new RegExp('%' + period + '.*'); - while (true) { - var matches = pattern1.exec(html); - if (!matches) { - break; - } - matches[0] = matches[0].substr(0, 2) + - matches[0].substr(2).replace(pattern2, '%' + period); - html = html.replace(matches[0], inst._show[index] ? - customisePeriod(matches[0], period, index) : ''); - } - }; - var customisePeriod = function(text, period, index) { - var labelsNum = $.countdown._get(inst, - (compact ? 'compactLabels' : 'labels') + inst._periods[index]); - return text.substr(2, text.length - 4). - replace(/%nn/g, (inst._periods[index] < 10 ? '0' : '') + - inst._periods[index]). - replace(/%n/g, inst._periods[index]). - replace(/%l/g, (labelsNum ? labelsNum[index] : labels[index])); - }; - processPeriod('Y', Y); - processPeriod('O', O); - processPeriod('W', W); - processPeriod('D', D); - processPeriod('H', H); - processPeriod('M', M); - processPeriod('S', S); - return html; - }, - - /* Translate the format into flags for each period. - @param inst (object) the current settings for this instance - @return (string[7]) flags indicating which periods are requested (?) or - required (!) by year, month, week, day, hour, minute, second */ - _determineShow: function(inst) { - var format = this._get(inst, 'format'); - var show = []; - show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null)); - show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null)); - show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null)); - show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null)); - show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null)); - show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null)); - show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null)); - return show; - }, - - /* Calculate the requested periods between now and the target time. - @param inst (object) the current settings for this instance - @param show (string[7]) flags indicating which periods are requested/required - @param now (Date) the current date and time - @return (number[7]) the current time periods (always positive) - by year, month, week, day, hour, minute, second */ - _calculatePeriods: function(inst, show, now) { - // Find endpoints - inst._now = now; - inst._now.setMilliseconds(0); - var until = new Date(inst._now.getTime()); - if (inst._since && now.getTime() < inst._since.getTime()) { - inst._now = now = until; - } - else if (inst._since) { - now = inst._since; - } - else { - until.setTime(inst._until.getTime()); - if (now.getTime() > inst._until.getTime()) { - inst._now = now = until; - } - } - until.setTime(until.getTime() - inst._offset); // Adjust for time zone - // Calculate differences by period - var periods = [0, 0, 0, 0, 0, 0, 0]; - if (show[Y] || show[O]) { - var months = Math.max(0, (until.getFullYear() - now.getFullYear()) * 12 + - until.getMonth() - now.getMonth() + (until.getDate() < now.getDate() ? -1 : 0)); - periods[Y] = (show[Y] ? Math.floor(months / 12) : 0); - periods[O] = (show[O] ? months - periods[Y] * 12 : 0); - if (inst._since) { - until.setFullYear(until.getFullYear() - periods[Y]); - until.setMonth(until.getMonth() - periods[O]); - } - else { - now = new Date(now.getTime()); - now.setFullYear(now.getFullYear() + periods[Y]); - now.setMonth(now.getMonth() + periods[O]); - } - } - var diff = Math.floor((until.getTime() - now.getTime()) / 1000); - var extractPeriod = function(period, numSecs) { - periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0); - diff -= periods[period] * numSecs; - }; - extractPeriod(W, 604800); - extractPeriod(D, 86400); - extractPeriod(H, 3600); - extractPeriod(M, 60); - extractPeriod(S, 1); - return periods; - } -}); - -/* jQuery extend now ignores nulls! */ -function extendRemove(target, props) { - $.extend(target, props); - for (var name in props) { - if (props[name] == null) { - target[name] = null; - } - } - return target; -} - -/* Attach the countdown functionality to a jQuery selection. - @param command (string) the command to run (optional, default 'attach') - @param options (object) the new settings to use for these countdown instances - @return (jQuery) for chaining further calls */ -$.fn.countdown = function(options) { - var otherArgs = Array.prototype.slice.call(arguments, 1); - if (options == 'getTimes') { - return $.countdown['_' + options + 'Countdown']. - apply($.countdown, [this[0]].concat(otherArgs)); - } - return this.each(function() { - if (typeof options == 'string') { - $.countdown['_' + options + 'Countdown'].apply($.countdown, [this].concat(otherArgs)); - } - else { - $.countdown._attachCountdown(this, options); - } - }); -}; - -/* Initialise the countdown functionality. */ -$.countdown = new Countdown(); // singleton instance - -})(jQuery); +(function($){var w='countdown';var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;$.JQPlugin.createPlugin({name:w,defaultOptions:{until:null,since:null,timezone:null,serverSync:null,format:'dHMS',layout:'',compact:false,padZeroes:false,significant:0,description:'',expiryUrl:'',expiryText:'',alwaysExpire:false,onExpiry:null,onTick:null,tickInterval:1},regionalOptions:{'':{labels:['Years','Months','Weeks','Days','Hours','Minutes','Seconds'],labels1:['Year','Month','Week','Day','Hour','Minute','Second'],compactLabels:['y','m','w','d'],whichLabels:null,digits:['0','1','2','3','4','5','6','7','8','9'],timeSeparator:':',isRTL:false}},_getters:['getTimes'],_rtlClass:w+'-rtl',_sectionClass:w+'-section',_amountClass:w+'-amount',_periodClass:w+'-period',_rowClass:w+'-row',_holdingClass:w+'-holding',_showClass:w+'-show',_descrClass:w+'-descr',_timerElems:[],_init:function(){var c=this;this._super();this._serverSyncs=[];var d=(typeof Date.now=='function'?Date.now:function(){return new Date().getTime()});var e=(window.performance&&typeof window.performance.now=='function');function timerCallBack(a){var b=(a<1e12?(e?(performance.now()+performance.timing.navigationStart):d()):a||d());if(b-g>=1000){c._updateElems();g=b}f(timerCallBack)}var f=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null;var g=0;if(!f||$.noRequestAnimationFrame){$.noRequestAnimationFrame=null;setInterval(function(){c._updateElems()},980)}else{g=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||d();f(timerCallBack)}},UTCDate:function(a,b,c,e,f,g,h,i){if(typeof b=='object'&&b.constructor==Date){i=b.getMilliseconds();h=b.getSeconds();g=b.getMinutes();f=b.getHours();e=b.getDate();c=b.getMonth();b=b.getFullYear()}var d=new Date();d.setUTCFullYear(b);d.setUTCDate(1);d.setUTCMonth(c||0);d.setUTCDate(e||1);d.setUTCHours(f||0);d.setUTCMinutes((g||0)-(Math.abs(a)<30?a*60:a));d.setUTCSeconds(h||0);d.setUTCMilliseconds(i||0);return d},periodsToSeconds:function(a){return a[0]*31557600+a[1]*2629800+a[2]*604800+a[3]*86400+a[4]*3600+a[5]*60+a[6]},_instSettings:function(a,b){return{_periods:[0,0,0,0,0,0,0]}},_addElem:function(a){if(!this._hasElem(a)){this._timerElems.push(a)}},_hasElem:function(a){return($.inArray(a,this._timerElems)>-1)},_removeElem:function(b){this._timerElems=$.map(this._timerElems,function(a){return(a==b?null:a)})},_updateElems:function(){for(var i=this._timerElems.length-1;i>=0;i--){this._updateCountdown(this._timerElems[i])}},_optionsChanged:function(a,b,c){if(c.layout){c.layout=c.layout.replace(/</g,'<').replace(/>/g,'>')}this._resetExtraLabels(b.options,c);var d=(b.options.timezone!=c.timezone);$.extend(b.options,c);this._adjustSettings(a,b,c.until!=null||c.since!=null||d);var e=new Date();if((b._since&&b._sincee)){this._addElem(a[0])}this._updateCountdown(a,b)},_updateCountdown:function(a,b){a=a.jquery?a:$(a);b=b||this._getInst(a);if(!b){return}a.html(this._generateHTML(b)).toggleClass(this._rtlClass,b.options.isRTL);if($.isFunction(b.options.onTick)){var c=b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,b.options.significant,new Date());if(b.options.tickInterval==1||this.periodsToSeconds(c)%b.options.tickInterval==0){b.options.onTick.apply(a[0],[c])}}var d=b._hold!='pause'&&(b._since?b._now.getTime()=b._until.getTime());if(d&&!b._expiring){b._expiring=true;if(this._hasElem(a[0])||b.options.alwaysExpire){this._removeElem(a[0]);if($.isFunction(b.options.onExpiry)){b.options.onExpiry.apply(a[0],[])}if(b.options.expiryText){var e=b.options.layout;b.options.layout=b.options.expiryText;this._updateCountdown(a[0],b);b.options.layout=e}if(b.options.expiryUrl){window.location=b.options.expiryUrl}}b._expiring=false}else if(b._hold=='pause'){this._removeElem(a[0])}},_resetExtraLabels:function(a,b){for(var n in b){if(n.match(/[Ll]abels[02-9]|compactLabels1/)){a[n]=b[n]}}for(var n in a){if(n.match(/[Ll]abels[02-9]|compactLabels1/)&&typeof b[n]==='undefined'){a[n]=null}}},_adjustSettings:function(a,b,c){var d;var e=0;var f=null;for(var i=0;i0);h[i]=(c._show[i]=='?'&&!e?null:c._show[i]);f+=(h[i]?1:0);g-=(c._periods[i]>0?1:0)}var j=[false,false,false,false,false,false,false];for(var i=S;i>=Y;i--){if(c._show[i]){if(c._periods[i]){j[i]=true}else{j[i]=g>0;g--}}}var k=(c.options.compact?c.options.compactLabels:c.options.labels);var l=c.options.whichLabels||this._normalLabels;var m=function(a){var b=c.options['compactLabels'+l(c._periods[a])];return(h[a]?d._translateDigits(c,c._periods[a])+(b?b[a]:k[a])+' ':'')};var n=(c.options.padZeroes?2:1);var o=function(a){var b=c.options['labels'+l(c._periods[a])];return((!c.options.significant&&h[a])||(c.options.significant&&j[a])?''+''+d._minDigits(c,c._periods[a],n)+''+''+(b?b[a]:k[a])+'':'')};return(c.options.layout?this._buildLayout(c,h,c.options.layout,c.options.compact,c.options.significant,j):((c.options.compact?''+m(Y)+m(O)+m(W)+m(D)+(h[H]?this._minDigits(c,c._periods[H],2):'')+(h[M]?(h[H]?c.options.timeSeparator:'')+this._minDigits(c,c._periods[M],2):'')+(h[S]?(h[H]||h[M]?c.options.timeSeparator:'')+this._minDigits(c,c._periods[S],2):''):''+o(Y)+o(O)+o(W)+o(D)+o(H)+o(M)+o(S))+''+(c.options.description?''+c.options.description+'':'')))},_buildLayout:function(c,d,e,f,g,h){var j=c.options[f?'compactLabels':'labels'];var k=c.options.whichLabels||this._normalLabels;var l=function(a){return(c.options[(f?'compactLabels':'labels')+k(c._periods[a])]||j)[a]};var m=function(a,b){return c.options.digits[Math.floor(a/b)%10]};var o={desc:c.options.description,sep:c.options.timeSeparator,yl:l(Y),yn:this._minDigits(c,c._periods[Y],1),ynn:this._minDigits(c,c._periods[Y],2),ynnn:this._minDigits(c,c._periods[Y],3),y1:m(c._periods[Y],1),y10:m(c._periods[Y],10),y100:m(c._periods[Y],100),y1000:m(c._periods[Y],1000),ol:l(O),on:this._minDigits(c,c._periods[O],1),onn:this._minDigits(c,c._periods[O],2),onnn:this._minDigits(c,c._periods[O],3),o1:m(c._periods[O],1),o10:m(c._periods[O],10),o100:m(c._periods[O],100),o1000:m(c._periods[O],1000),wl:l(W),wn:this._minDigits(c,c._periods[W],1),wnn:this._minDigits(c,c._periods[W],2),wnnn:this._minDigits(c,c._periods[W],3),w1:m(c._periods[W],1),w10:m(c._periods[W],10),w100:m(c._periods[W],100),w1000:m(c._periods[W],1000),dl:l(D),dn:this._minDigits(c,c._periods[D],1),dnn:this._minDigits(c,c._periods[D],2),dnnn:this._minDigits(c,c._periods[D],3),d1:m(c._periods[D],1),d10:m(c._periods[D],10),d100:m(c._periods[D],100),d1000:m(c._periods[D],1000),hl:l(H),hn:this._minDigits(c,c._periods[H],1),hnn:this._minDigits(c,c._periods[H],2),hnnn:this._minDigits(c,c._periods[H],3),h1:m(c._periods[H],1),h10:m(c._periods[H],10),h100:m(c._periods[H],100),h1000:m(c._periods[H],1000),ml:l(M),mn:this._minDigits(c,c._periods[M],1),mnn:this._minDigits(c,c._periods[M],2),mnnn:this._minDigits(c,c._periods[M],3),m1:m(c._periods[M],1),m10:m(c._periods[M],10),m100:m(c._periods[M],100),m1000:m(c._periods[M],1000),sl:l(S),sn:this._minDigits(c,c._periods[S],1),snn:this._minDigits(c,c._periods[S],2),snnn:this._minDigits(c,c._periods[S],3),s1:m(c._periods[S],1),s10:m(c._periods[S],10),s100:m(c._periods[S],100),s1000:m(c._periods[S],1000)};var p=e;for(var i=Y;i<=S;i++){var q='yowdhms'.charAt(i);var r=new RegExp('\\{'+q+'<\\}([\\s\\S]*)\\{'+q+'>\\}','g');p=p.replace(r,((!g&&d[i])||(g&&h[i])?'$1':''))}$.each(o,function(n,v){var a=new RegExp('\\{'+n+'\\}','g');p=p.replace(a,v)});return p},_minDigits:function(a,b,c){b=''+b;if(b.length>=c){return this._translateDigits(a,b)}b='0000000000'+b;return this._translateDigits(a,b.substr(b.length-c))},_translateDigits:function(b,c){return(''+c).replace(/[0-9]/g,function(a){return b.options.digits[a]})},_determineShow:function(a){var b=a.options.format;var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(c,d,e,f){c._now=f;c._now.setMilliseconds(0);var g=new Date(c._now.getTime());if(c._since){if(f.getTime()c._until.getTime()){c._now=f=g}}var h=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var i=this._getDaysInMonth(f.getFullYear(),f.getMonth());var j=this._getDaysInMonth(g.getFullYear(),g.getMonth());var k=(g.getDate()==f.getDate()||(g.getDate()>=Math.min(i,j)&&f.getDate()>=Math.min(i,j)));var l=function(a){return(a.getHours()*60+a.getMinutes())*60+a.getSeconds()};var m=Math.max(0,(g.getFullYear()-f.getFullYear())*12+g.getMonth()-f.getMonth()+((g.getDate()o){f.setDate(o)}f.setFullYear(f.getFullYear()+h[Y]);f.setMonth(f.getMonth()+h[O]);if(n){f.setDate(o)}}var p=Math.floor((g.getTime()-f.getTime())/1000);var q=function(a,b){h[a]=(d[a]?Math.floor(p/b):0);p-=h[a]*b};q(W,604800);q(D,86400);q(H,3600);q(M,60);q(S,1);if(p>0&&!c._since){var r=[1,12,4.3482,7,24,60,60];var s=S;var t=1;for(var u=S;u>=Y;u--){if(d[u]){if(h[s]>=t){h[s]=0;p=1}if(p>0){h[u]++;p=0;s=u;t=1}}t*=r[u]}}if(e){for(var u=Y;u<=S;u++){if(e&&h[u]){e--}else if(!e){h[u]=0}}}return h}})})(jQuery); \ No newline at end of file Index: lams_central/web/includes/javascript/jquery.form.js =================================================================== diff -u -r9eff75a1a0891eedc1ecb5dd1a0ba9898d248df5 -r49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd --- lams_central/web/includes/javascript/jquery.form.js (.../jquery.form.js) (revision 9eff75a1a0891eedc1ecb5dd1a0ba9898d248df5) +++ lams_central/web/includes/javascript/jquery.form.js (.../jquery.form.js) (revision 49e311f4db1c7f0a7ff4aaa0c18bf3b72b372efd) @@ -1,7 +1,11 @@ -/* -* jQuery Form Plugin; v3.45.0-2013.10.17 -* http://jquery.malsup.com/form/ -* Copyright (c) 2013 M. Alsup; Dual licensed: MIT/GPL -* https://github.com/malsup/form#copyright-and-license -*/ -;(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;a.length>i;i++)n.append(a[i].name,a[i].value);if(t.extraData){var o=r(t.extraData);for(i=0;o.length>i;i++)o[i]&&n.append(o[i][0],o[i][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:u||"POST"});t.uploadProgress&&(s.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(100*(a/n))),t.uploadProgress(e,a,n,r)},!1),r}),s.data=null;var l=s.beforeSend;return s.beforeSend=function(e,r){r.data=t.formData?t.formData:n,l&&l.call(this,e,r)},e.ajax(s)}function s(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(r){a("cannot get iframe.contentWindow document: "+r)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function o(){function t(){try{var e=n(g).readyState;a("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(r){a("Server abort: ",r," (",r.name,")"),s(k),j&&clearTimeout(j),j=void 0}}var r=f.attr2("target"),i=f.attr2("action");w.setAttribute("target",d),(!u||/post/i.test(u))&&w.setAttribute("method","POST"),i!=m.url&&w.setAttribute("action",m.url),m.skipEncodingOverride||u&&!/post/i.test(u)||f.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),m.timeout&&(j=setTimeout(function(){T=!0,s(D)},m.timeout));var o=[];try{if(m.extraData)for(var l in m.extraData)m.extraData.hasOwnProperty(l)&&(e.isPlainObject(m.extraData[l])&&m.extraData[l].hasOwnProperty("name")&&m.extraData[l].hasOwnProperty("value")?o.push(e('').val(m.extraData[l].value).appendTo(w)[0]):o.push(e('').val(m.extraData[l]).appendTo(w)[0]));m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(c){var p=document.createElement("form").submit;p.apply(w)}}finally{w.setAttribute("action",i),r?w.setAttribute("target",r):f.removeAttr("target"),e(o).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),S.reject(x,"timeout"),void 0;if(t==k&&x)return x.abort("server abort"),S.reject(x,"error","server abort"),void 0;if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),setTimeout(s,250),void 0;var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var l=(m.dataType||"").toLowerCase(),c=/(json|script|text)/.test(l);if(c||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(c){var d=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];d?x.responseText=d.textContent?d.textContent:d.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==l&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,l,m)}catch(b){i="parsererror",x.error=r=b||i}}catch(b){a("error caught: ",b),i="error",x.error=r=b||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&300>x.status||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),p&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),p&&e.event.trigger("ajaxError",[x,m,r])),p&&e.event.trigger("ajaxComplete",[x,m]),p&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var l,c,m,p,d,v,g,x,b,y,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(c=0;h.length>c;c++)l=e(h[c]),i?l.prop("disabled",!1):l.removeAttr("disabled");if(m=e.extend(!0,{},e.ajaxSettings,t),m.context=m.context||m,d="jqFormIO"+(new Date).getTime(),m.iframeTarget?(v=e(m.iframeTarget),y=v.attr2("name"),y?d=y:v.attr2("name",d)):(v=e('