Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "function" != typeof Object.create && (Object.create = function() {
- function F() {}
- return function(o) {
- if (1 !== arguments.length) throw new Error("This Object.create implementation only accepts one parameter.");
- return F.prototype = o, new F
- }
- }());
- var apex = {};
- apex.jQuery = jQuery,
- function($, undefined) {
- "use strict";
- apex.gPageContext$ = $(document), apex.gParentPageContext$ = apex.gPageContext$, $(document).on("pagebeforecreate pageshow", function(pEvent) {
- var lNewPageContext$ = $(pEvent.target);
- "dialog" === lNewPageContext$.data("role") ? 1 === lNewPageContext$.has("[role='listbox']").length ? apex.gPageContext$ = apex.gParentPageContext$ : apex.gPageContext$ = $(pEvent.target) : (apex.gPageContext$ = $(pEvent.target), apex.gParentPageContext$ = apex.gPageContext$)
- }), $(document).on("pageshow", function(pEvent) {
- var lData = $(pEvent.target).data();
- lData.apexPageTransition && ($.mobile.defaultPageTransition = lData.apexPageTransition), lData.apexPopupTransition && ($.mobile.defaultDialogTransition = lData.apexPopupTransition)
- });
- var resizeTimerId, lastStoredHeight = 0,
- lastStoredWidth = 0;
- $(window).resize(function() {
- ($(window).height() != lastStoredHeight || $(window).width() != lastStoredWidth) && (lastStoredHeight = $(window).height(), lastStoredWidth = $(window).width(), resizeTimerId && clearTimeout(resizeTimerId), resizeTimerId = setTimeout(function() {
- $(window).trigger("apexwindowresized"), resizeTimerId = null
- }, 200))
- });
- var ie_upto10 = /MSIE \d/.test(navigator.userAgent),
- ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),
- ie = ie_upto10 || ie_11up,
- ie_version = ie && (ie_upto10 ? document.documentMode || 7 : ie_11up[1]);
- 7 === ie_version ? $("html").addClass("ie7 lt-ie8 lt-ie9 lte-ie9 lte-ie10") : 8 === ie_version ? $("html").addClass("ie8 lt-ie9 lte-ie9 lte-ie10") : 9 === ie_version ? $("html").addClass("ie9 lte-ie9 lte-ie10") : 10 === ie_version && $("html").addClass("ie10 lte-ie10"), $(document).ready(function() {
- var lTestColour;
- $("body").append("<p id='hcmtest' style='position:absolute;top:0;left:-99999px;background-color:#878787;'></p>"), lTestColour = $("#hcmtest").css("background-color").toLowerCase(), $("#hcmtest").remove(), "#878787" !== lTestColour && "rgb(135, 135, 135)" !== lTestColour && $("body").addClass("u-HCM")
- })
- }(apex.jQuery);
- apex.debug = {}, apex.debug = function() {
- "use strict";
- apex.debug.log.apply(this, arguments)
- },
- function(debug, $, undefined) {
- "use strict";
- function noop() {}
- function ie7log(a, b, c) {
- c !== undefined ? console.log(a, b, c) : b !== undefined ? console.log(a, b) : console.log(a)
- }
- var gDebugLogLevel = -1,
- log = noop,
- error = noop,
- warn = noop,
- info = noop;
- window.console && console.log && ("undefined" == typeof console.log.apply ? (log = ie7log, error = ie7log, warn = ie7log, info = ie7log) : (log = console.log, error = console.error ? console.error : console.log, warn = console.warn ? console.warn : console.log, info = console.info ? console.info : console.log)), debug.LOG_LEVEL = {
- OFF: 0,
- ERROR: 1,
- WARN: 2,
- INFO: 4,
- APP_TRACE: 6,
- ENGINE_TRACE: 9
- }, debug.getLevel = function() {
- var lDebugValue;
- return 0 > gDebugLogLevel && (lDebugValue = $("#pdebug", apex.gPageContext$).val(), gDebugLogLevel = "YES" === lDebugValue ? debug.LOG_LEVEL.INFO : /^LEVEL[0-9]$/.test(lDebugValue) ? parseInt(lDebugValue.substr(5), 10) : debug.LOG_LEVEL.OFF), gDebugLogLevel
- }, debug.setLevel = function(pLevel) {
- var lLevel, lPdebug$, lOldLevel = gDebugLogLevel;
- gDebugLogLevel = "number" == typeof pLevel ? pLevel : debug.LOG_LEVEL.OFF, (0 > gDebugLogLevel || gDebugLogLevel > 9) && (gDebugLogLevel = debug.LOG_LEVEL.OFF), gDebugLogLevel !== lOldLevel && (lLevel = "LEVEL" + gDebugLogLevel, lPdebug$ = $("#pdebug", apex.gPageContext$), 0 === lPdebug$.length && (lPdebug$ = $("<input id='pdebug' type='hidden' name='p_debug'>").prependTo($("#wwvFlowForm", apex.gPageContext$))), lPdebug$.val(lLevel))
- }, debug.message = function(pLevel) {
- var fn = log;
- debug.getLevel() >= pLevel && pLevel > 0 && (pLevel === debug.LOG_LEVEL.ERROR ? fn = error : pLevel <= debug.LOG_LEVEL.WARN ? fn = warn : pLevel <= debug.LOG_LEVEL.INFO && (fn = info), fn.apply(console, Array.prototype.slice.call(arguments, 1)))
- }, debug.error = function() {
- error.apply(console, arguments), console.trace && console.trace()
- }, debug.warn = function() {
- debug.getLevel() >= debug.LOG_LEVEL.WARN && warn.apply(console, arguments)
- }, debug.info = function() {
- debug.getLevel() >= debug.LOG_LEVEL.INFO && info.apply(console, arguments)
- }, debug.trace = function() {
- debug.getLevel() >= debug.LOG_LEVEL.APP_TRACE && log.apply(console, arguments)
- }, debug.log = function() {
- debug.getLevel() > debug.LOG_LEVEL.OFF && log.apply(console, arguments)
- }, debug.deprecated = function(message) {
- debug.warn("DEPRECATED: " + message)
- }
- }(apex.debug, apex.jQuery);
- apex.util = {},
- function(util, $, undefined) {
- "use strict";
- util.toArray = function(pValue, pSeparator) {
- var lSeparator, lReturn = [];
- return "string" == typeof pValue ? (lSeparator = pSeparator === undefined ? ":" : pSeparator, lReturn = pValue.split(lSeparator)) : lReturn = $.makeArray(pValue), lReturn
- }, util.escapeHTML = function(pValue) {
- return pValue.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/")
- }, util.escapeRegExp = function(pValue) {
- var lReturn = "";
- return pValue ? pValue.replace(/([\.\$\*\+\-\?\(\)\{\}\|\^\[\]\\])/g, "\\$1") : lReturn
- };
- var CSS_META_CHARS_REGEXP = new RegExp("([" + util.escapeRegExp(" !#$%&'()*+,./:;<=>?@[\\]^`{|}~\"") + "])", "g");
- util.escapeCSS = function(pValue) {
- var lReturn = "";
- return pValue ? pValue.replace(CSS_META_CHARS_REGEXP, "\\$1") : lReturn
- }, util.escapeHTMLContent = util.escapeHTMLAttr = function(s) {
- return s = "" + s, util.escapeHTML(s)
- };
- var htmlBuilderPrototype = {
- markup: function(t) {
- return this.html += t, this
- },
- attr: function(name, value) {
- return 1 === arguments.length && (value = name, name = null), name && (this.html += " ", this.html += name, this.html += "='"), this.html += util.escapeHTMLAttr(value), name && (this.html += "'"), this
- },
- optionalAttr: function(name, value) {
- return value && "object" != typeof value && (this.html += " ", this.html += name, this.html += "='", this.html += util.escapeHTMLAttr(value), this.html += "'"), this
- },
- optionalBoolAttr: function(name, value) {
- return value === !0 && (this.html += " ", this.html += name), this
- },
- content: function(t) {
- return this.html += util.escapeHTMLContent(t), this
- },
- clear: function() {
- this.html = ""
- },
- toString: function() {
- return this.html
- }
- };
- util.htmlBuilder = function() {
- var that = Object.create(htmlBuilderPrototype);
- return that.clear(), that
- }, util.makeApplicationUrl = function(pArgs) {
- var i, lUrl = "f?p=";
- if (lUrl += pArgs.appId || $v("pFlowId"), lUrl += ":", lUrl += pArgs.pageId || $v("pFlowStepId"), lUrl += ":", lUrl += pArgs.session || $v("pInstance"), lUrl += ":", lUrl += pArgs.request || $v("pRequest"), lUrl += ":", lUrl += pArgs.debug || $v("pdebug") || "", lUrl += ":", lUrl += pArgs.clearCache || "", lUrl += ":", pArgs.itemNames && (lUrl += pArgs.itemNames.join(",")), lUrl += ":", pArgs.itemValues)
- for (i = 0; i < pArgs.itemValues.length; i++) i > 0 && (lUrl += ","), lUrl += encodeURIComponent(pArgs.itemValues[i]);
- return lUrl += ":", lUrl += pArgs.printerFriendly || ""
- }, util.showSpinner = function(pContainer, pOptions) {
- var lSpinner$, lTop, lBottom, lYPosition, lYOffset, out = util.htmlBuilder(),
- lContainer$ = $(pContainer ? pContainer : "body"),
- lWindow$ = $(window),
- lContainer = lContainer$.offset(),
- lOptions = $.extend({
- alert: apex.lang.getMessage("APEX.PROCESSING")
- }, pOptions),
- lViewport = {
- top: lWindow$.scrollTop(),
- left: lWindow$.scrollLeft()
- };
- return lViewport.bottom = lViewport.top + lWindow$.height(), lViewport.right = lViewport.left + lWindow$.width(), lContainer.bottom = lContainer.top + lContainer$.outerHeight(), lContainer.right = lContainer.left + lContainer$.outerWidth(), lTop = lContainer.top > lViewport.top ? lContainer.top : lViewport.top, lBottom = lContainer.bottom < lViewport.bottom ? lContainer.bottom : lViewport.bottom, lYPosition = (lBottom - lTop) / 2, lYOffset = lViewport.top - lContainer.top, lYOffset > 0 && (lYPosition += lYOffset), out.markup("<span").attr("class", "u-Processing").attr("role", "alert").markup(">").markup("<span").attr("class", "u-Processing-spinner").markup(">").markup("</span>").markup("<span").attr("class", "u-VisuallyHidden").markup(">").content(lOptions.alert).markup("</span>").markup("</span>"), lSpinner$ = $(out.toString()), lSpinner$.appendTo(lContainer$), lSpinner$.position({
- my: "center",
- at: "left+50% top+" + lYPosition + "px",
- of: lContainer$,
- collision: "fit"
- }), lSpinner$
- }, util.delayLinger = function() {
- function getScope(scopeName) {
- var s = scopes[scopeName];
- return s || (s = {
- count: 0,
- timer: null
- }, scopes[scopeName] = s), s
- }
- function removeScope(scopeName) {
- delete scopes[scopeName]
- }
- var scopes = {},
- busyDelay = 200,
- busyLinger = 1e3;
- return {
- start: function(pScopeName, pAction) {
- var s = getScope(pScopeName);
- s.count += 1, 1 === s.count && null === s.timer && (s.start = (new Date).getTime(), s.timer = setTimeout(function() {
- s.timer = null, pAction()
- }, busyDelay))
- },
- finish: function(pScopeName, pAction) {
- var elapsed, s = getScope(pScopeName);
- if (0 === s.count) throw "delayLinger.finish called before start for scope " + pScopeName;
- elapsed = (new Date).getTime() - s.start, s.count -= 1, 0 === s.count && (null === s.timer ? busyLinger > elapsed ? setTimeout(function() {
- pAction(), removeScope(pScopeName)
- }, busyLinger - elapsed) : (pAction(), removeScope(pScopeName)) : (clearTimeout(s.timer), s.timer = null, removeScope(pScopeName)))
- }
- }
- }(), util.setOuterHeight = function($e, h) {
- $.each(["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom", "marginTop", "marginBottom"], function(i, p) {
- var v = parseInt($e.css(p), 10);
- isNaN(v) || (h -= v)
- }), $e.height(h)
- }, util.setOuterWidth = function($e, w) {
- $.each(["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight", "marginLeft", "marginRight"], function(i, p) {
- var v = parseInt($e.css(p), 10);
- isNaN(v) || (w -= v)
- }), $e.width(w)
- }, util.getDateFromISO8601String = function(pDateStr) {
- var date, year, month, day, hr = 0,
- min = 0,
- sec = 0,
- ms = 0,
- m = /^(\d\d\d\d)-(\d\d)-(\d\d)(T(\d\d):(\d\d)(:(\d\d)(.(\d\d\d))?)?Z?)?$/.exec(pDateStr);
- if (!m) throw "Invalid date format";
- return year = parseInt(m[1], 10), month = parseInt(m[2], 10) - 1, day = parseInt(m[3], 10), m[5] && (hr = parseInt(m[5], 10), min = parseInt(m[6], 10), m[8] && (sec = parseInt(m[8], 10), m[10] && (ms = parseInt(m[10], 10)))), date = new Date(Date.UTC(year, month, day, hr, min, sec, ms))
- };
- var gTopApex = null;
- util.getTopApex = function() {
- function get(w) {
- var a;
- try {
- a = w.apex || null
- } catch (ex) {
- a = null
- }
- return a
- }
- var curWindow, lastApex;
- if (null !== gTopApex) return gTopApex;
- if (gTopApex = get(top), null !== gTopApex) return gTopApex;
- for (curWindow = window; lastApex = get(curWindow), null !== lastApex && curWindow.parent && curWindow.parent !== curWindow;) gTopApex = lastApex, curWindow = curWindow.parent;
- return gTopApex
- }
- }(apex.util, apex.jQuery);
- apex.locale = {},
- function(locale) {
- "use strict";
- var gOptions = {
- separators: {
- group: ",",
- decimal: "."
- }
- };
- locale.init = function(pOptions) {
- gOptions = pOptions
- }, locale.getGroupSeparator = function() {
- return gOptions.separators.group
- }, locale.getDecimalSeparator = function() {
- return gOptions.separators.decimal
- }
- }(apex.locale);
- apex.lang = {},
- function(lang, util, debug, $, undefined) {
- "use strict";
- function formatMessage(pUnsafe, pPattern) {
- var args, re = /%([0-9,%])/g;
- args = $.isArray(arguments[2]) ? arguments[2] : Array.prototype.slice.call(arguments, 2);
- var count = 0,
- result = pPattern.replace(re, function(m, p1) {
- var n;
- if ("%" === p1) return "%";
- if (n = parseInt(p1, 10), count++, n >= args.length) throw "format(" + pPattern + "): too few arguments";
- return pUnsafe ? util.escapeHTML(args[n] + "") : args[n]
- });
- return count < args.length && debug.error("Format(" + pPattern + "): too many arguments. Expecting " + count + ", got " + args.length), result
- }
- var gMessages = {};
- lang.addMessages = function(pMessages) {
- $.extend(gMessages, pMessages)
- }, lang.clearMessages = function() {
- gMessages = {}
- }, lang.getMessage = function(pKey) {
- var msg;
- return msg = gMessages[pKey], null === msg || msg === undefined ? pKey : msg
- }, lang.formatMessage = function(pKey) {
- var pattern = lang.getMessage(pKey),
- args = [pattern].concat(Array.prototype.slice.call(arguments, 1));
- return lang.format.apply(this, args)
- }, lang.format = function(pPattern) {
- var args = Array.prototype.slice.call(arguments, 1);
- return formatMessage(!0, pPattern, args)
- }, lang.formatMessageNoEscape = function(pKey) {
- var pattern = lang.getMessage(pKey),
- args = [pattern].concat(Array.prototype.slice.call(arguments, 1));
- return lang.formatNoEscape.apply(this, args)
- }, lang.formatNoEscape = function(pPattern) {
- var args = Array.prototype.slice.call(arguments, 1);
- return formatMessage(!1, pPattern, args)
- }
- }(apex.lang, apex.util, apex.debug, apex.jQuery);
- apex.storage = {},
- function(storage, $, undefined) {
- "use strict";
- function makeDomStorage(check, store, options) {
- var that;
- return check() ? (that = Object.create(storagePrototype), that.prefix = makeKeyPrefix(options), that._store = store, that._re = new RegExp("^" + that.prefix), that.length = countKeys(that._store, that._re)) : (that = Object.create(noopStoragePrototype), that.prefix = makeKeyPrefix(options)), that
- }
- function makeKeyPrefix(options) {
- var prefix = (options.prefix || "") + ".";
- return (options.useAppId === undefined || null === options.AppId) && (options.useAppId = !0), options.useAppId && (prefix += $("#pFlowId").val() + "."), options.usePageId && (prefix += $("#pFlowStepId").val() + "."), options.regionId && (prefix += options.regionId + "."), prefix
- }
- function countKeys(store, re) {
- var i, count = 0;
- for (i = 0; i < store.length; i++) re.test(store.key(i)) && (count += 1);
- return count
- }
- storage.getCookieVal = function(pOffset) {
- var lEndPos = document.cookie.indexOf(";", pOffset);
- return -1 === lEndPos && (lEndPos = document.cookie.length), unescape(document.cookie.substring(pOffset, lEndPos))
- }, storage.getCookie = function(pName) {
- for (var lArg = pName + "=", lArgLength = lArg.length, lCookieLength = document.cookie.length, i = 0; lCookieLength > i;) {
- var j = i + lArgLength;
- if (document.cookie.substring(i, j) === lArg) return storage.getCookieVal(j);
- if (i = document.cookie.indexOf(" ", i) + 1, 0 === i) break
- }
- return null
- }, storage.setCookie = function(pName, pValue) {
- var argv = arguments,
- argc = arguments.length,
- expires = argc > 2 ? argv[2] : null,
- path = argc > 3 ? argv[3] : null,
- domain = argc > 4 ? argv[4] : null,
- secure = argc > 5 ? !0 : !1;
- document.cookie = pName + "=" + escape(pValue) + (null === expires ? "" : "; expires=" + expires.toGMTString()) + (null === path ? "" : "; path=" + path) + (null === domain ? "" : "; domain=" + domain) + (secure === !0 || "https:" === window.location.protocol ? "; secure" : "")
- }, storage.hasLocalStorageSupport = function() {
- var localStorageSupport = null,
- test = "$test$";
- return function() {
- if (null !== localStorageSupport) return localStorageSupport;
- if (window.Modernizr && window.Modernizr.hasOwnProperty("localstorage")) localStorageSupport = Modernizr.localstorage;
- else try {
- localStorage.setItem(test, test), localStorage.removeItem(test), localStorageSupport = !0
- } catch (e) {
- localStorageSupport = !1
- }
- return localStorageSupport
- }
- }(), storage.hasSessionStorageSupport = function() {
- var sessionStorageSupport = null,
- test = "$test$";
- return function() {
- if (null !== sessionStorageSupport) return sessionStorageSupport;
- if (window.Modernizr && window.Modernizr.hasOwnProperty("sessionstorage")) sessionStorageSupport = Modernizr.localstorage;
- else try {
- sessionStorage.setItem(test, test), sessionStorage.removeItem(test), sessionStorageSupport = !0
- } catch (e) {
- sessionStorageSupport = !1
- }
- return sessionStorageSupport
- }
- }();
- var storagePrototype = {
- prefix: "",
- length: 0,
- key: function(index) {
- var i, k, scopeIndex = 0;
- if (index < this._store.length)
- for (i = 0; i < this._store.length; i++)
- if (k = this._store.key(i), this._re.test(k)) {
- if (index === scopeIndex) return k;
- scopeIndex += 1
- }
- return null
- },
- getItem: function(key) {
- return this._store.getItem(this.prefix + key)
- },
- setItem: function(key, data) {
- var old = this.getItem(key);
- this._store.setItem(this.prefix + key, data), null === old && (this.length += 1)
- },
- removeItem: function(key) {
- var old = this.getItem(key);
- this._store.removeItem(this.prefix + key), null !== old && (this.length -= 1)
- },
- clear: function() {
- var i, k;
- for (i = 0; i < this._store.length; i++) k = this._store.key(i), this._re.test(k) && this._store.removeItem(k);
- this.length = 0
- },
- sync: function() {
- this.length = countKeys(this._store, this._re)
- }
- },
- noopStoragePrototype = {
- prefix: "",
- length: 0,
- key: function(index) {
- return null
- },
- getItem: function(key) {
- return null
- },
- setItem: function(key, data) {},
- removeItem: function(key) {},
- clear: function() {}
- };
- storage.getScopedSessionStorage = function(options) {
- return makeDomStorage(storage.hasSessionStorageSupport, window.sessionStorage, options)
- }, storage.getScopedLocalStorage = function(options) {
- return makeDomStorage(storage.hasLocalStorageSupport, window.localStorage, options)
- }
- }(apex.storage, apex.jQuery);
- apex.navigation = {},
- function(navigation, util, $, undefined) {
- "use strict";
- var DIALOG_DIV_ID = "apex_dialog_",
- INTERNAL_CLOSE_EVENT = "apexclosedialoginternal";
- navigation.redirect = function(pWhere) {
- $.mobile && pWhere.substring(0, pWhere.indexOf(":")) === "f?p=" + $v("pFlowId") ? $(":mobile-pagecontainer").pagecontainer("change", pWhere, {
- reload: !0
- }) : location.href = pWhere
- }, navigation.popup = function(pOptions) {
- var lOptions = $.extend({
- url: "about:blank",
- name: "_blank",
- width: 600,
- height: 600,
- scroll: "yes",
- resizable: "yes",
- toolbar: "no",
- location: "no",
- statusbar: "no",
- menubar: "no"
- }, pOptions),
- lWindow = window.open(lOptions.url, "_blank" === (lOptions.name + "").toLowerCase() ? lOptions.name : lOptions.name + "_" + $v("pInstance"), "toolbar=" + lOptions.toolbar + ",scrollbars=" + lOptions.scroll + ",location=" + lOptions.location + ",status=" + lOptions.statusbar + ",menubar=" + lOptions.menubar + ",resizable=" + lOptions.resizable + ",width=" + lOptions.width + ",height=" + lOptions.height);
- return lWindow && (null === lWindow.opener && (lWindow.opener = window.self), lWindow.focus()), lWindow
- }, navigation.openInNewWindow = function(pURL, pWindowName, pOptions) {
- var other, features, altSuffix = pOptions ? pOptions.altSuffix || null : null;
- return pWindowName === undefined && (pWindowName = "_blank"), "_blank" !== pWindowName.toLowerCase() && (null === altSuffix && (altSuffix = $v("pInstance")), altSuffix && (pWindowName += "_" + altSuffix)), pOptions && pOptions.favorTabbedBrowsing === !0 || (features = /(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase()) ? "personalbar,menubar,titlebar,toolbar,location,resizable,scrollbars" : "personalbar,menubar,titlebar,toolbar,location,status,resizable,scrollbars"), other = features ? window.open(pURL, pWindowName, features) : window.open(pURL, pWindowName), other && other.focus(), other
- }, navigation.popup.url = function(pURL) {
- navigation.popup({
- url: pURL,
- name: "winLov",
- width: 800,
- height: 600
- })
- }, navigation.popup.close = function(pItem, pValue) {
- window.opener.$x_Value(pItem, pValue), window.close()
- }, util.getTopApex().navigation._gNextDialogId || (util.getTopApex().navigation._gNextDialogId = 1), navigation.dialog = function(pUrl, pOptions, pCssClasses, pTriggeringElement) {
- var lTriggeringElement$, lDialog$, lDialogId, lPopupWindow, lWindowName, lUserClose, lDefaults = {
- width: 500,
- maxWidth: 1500,
- height: 500,
- closeText: apex.lang.getMessage("APEX.DIALOG.CLOSE"),
- modal: !0,
- resizable: !1,
- scroll: "auto",
- closeOnEscape: !0,
- dialog: null,
- dialogClass: "ui-dialog--apex"
- },
- lOptions = $.extend(lDefaults, pOptions);
- pOptions.dialogClass && (lOptions.dialogClass = "ui-dialog--apex " + pOptions.dialogClass), lUserClose = lOptions.close, lOptions.close = function(event, ui) {
- lUserClose && lUserClose(event, ui), util.getTopApex().jQuery(this).dialog("destroy").remove()
- }, pCssClasses && (lOptions.dialogClass += " " + pCssClasses), $.mobile ? null === lOptions.dialog ? (lTriggeringElement$ = $(pTriggeringElement, apex.gPageContext$), $.mobile && pUrl.substring(0, pUrl.indexOf(":")) === "f?p=" + $v("pFlowId") && (navigation.redirect(pUrl), navigation.dialog.registerCloseHandler({
- handler$: lTriggeringElement$,
- dialog: $(".ui-dialog"),
- triggeringElement$: lTriggeringElement$,
- closeFunction: function() {
- navigation.redirect(pTriggeringElement.context.URL)
- }
- }))) : $(window.parent.location).attr("href", pUrl) : (lTriggeringElement$ = $(pTriggeringElement, apex.gPageContext$), lOptions.modal ? null === lOptions.dialog ? (lDialogId = DIALOG_DIV_ID + util.getTopApex().navigation._gNextDialogId, util.getTopApex().navigation._gNextDialogId += 1, lDialog$ = util.getTopApex().jQuery('<div id="' + lDialogId + '"><iframe src="' + util.escapeHTMLAttr(pUrl) + '"title="' + util.escapeHTMLAttr(lOptions.title) + '" width="100%" height="100%" style="min-width: 95%;height:100%;" scrolling="' + util.escapeHTMLAttr(lOptions.scroll) + '"></iframe></div>'), lDialog$.on("dialogcreate", function() {
- $(this).closest(".ui-dialog").css("position", "fixed")
- }).on("dialogopen", function() {
- lOptions.modal && util.getTopApex().navigation.beginFreezeScroll(), lDialog$.children("iframe").on("load", function() {
- $(this.contentDocument.body).on("keydown", function(event) {
- if (event.which === $.ui.keyCode.ESCAPE) lDialog$.dialog("close");
- else if (event.which === $.ui.keyCode.TAB) {
- var pageLast = $(this).find(":tabbable").last(),
- first = lDialog$.closest(".ui-dialog").find(":tabbable").first();
- event.target !== pageLast[0] || event.shiftKey || (first.focus(1), event.preventDefault())
- }
- })
- })
- }).on("dialogclose", function() {
- lOptions.modal && util.getTopApex().navigation.endFreezeScroll()
- }).on("dialogresize", function() {
- var h = lDialog$.height(),
- w = lDialog$.width();
- lDialog$.closest(".ui-dialog").css("position", "fixed"), lDialog$.children("iframe").width(w).height(h)
- }), lDialog$.dialog(lOptions), lDialog$.closest(".ui-dialog").on("keydown", function(event) {
- if (event.keyCode === $.ui.keyCode.TAB) {
- var pageTabbables = $(lDialog$.children("iframe")[0].contentDocument.body).find(":tabbable"),
- pageFirst = pageTabbables.filter(":first"),
- pageLast = pageTabbables.filter(":last"),
- tabbables = $(this).find(":tabbable"),
- first = tabbables.filter(":first"),
- last = tabbables.filter(":last");
- event.target !== last[0] && event.target !== lDialog$[0] || event.shiftKey ? event.target !== first[0] && event.target !== lDialog$[0] || !event.shiftKey || (pageLast.focus(1), event.preventDefault()) : (pageFirst.focus(1), event.preventDefault())
- }
- }), navigation.dialog.registerCloseHandler({
- handler$: lDialog$,
- dialog: lDialog$,
- triggeringElement$: lTriggeringElement$,
- closeFunction: function() {
- lDialog$.dialog("close")
- }
- })) : lOptions.dialog.dialog("option", "title", lOptions.title).children("iframe").attr("src", pUrl) : null === lOptions.dialog ? (lWindowName = lTriggeringElement$.id !== undefined && lTriggeringElement$[0].id !== undefined && "" !== lTriggeringElement$[0].id && lTriggeringElement$ ? lTriggeringElement$[0].id : "winDialog", lPopupWindow = navigation.popup({
- url: pUrl,
- name: lWindowName,
- width: lOptions.width,
- height: lOptions.height
- }), navigation.dialog.registerCloseHandler({
- handler$: lTriggeringElement$,
- dialog: lPopupWindow,
- triggeringElement$: lTriggeringElement$,
- closeFunction: function() {
- lPopupWindow.close()
- }
- })) : (lOptions.dialog.location.href = pUrl, lOptions.dialog.resizeTo(lOptions.width, lOptions.height)))
- }, navigation.dialog.close = function(pIsModal, pAction) {
- function apexCheck() {
- try {
- if (window.opener.apex && window.opener.apex.jQuery) return !0
- } catch (ex) {
- return !1
- }
- return !1
- }
- function getValuesForItems(pItemNames) {
- var i, val, name, lItems = {};
- for (i = 0; i < pItemNames.length; i++) name = pItemNames[i], val = $v(name), lItems[name] = val;
- return lItems
- }
- var lTriggeringId;
- $.isArray(pAction) && (pAction = getValuesForItems(pAction)), $.mobile ? $.isFunction(pAction) ? pAction.call(this, window) : navigation.redirect(apex.jQuery.ajaxSettings.url) : pIsModal ? navigation.dialog.fireCloseHandler(util.getTopApex().jQuery(".ui-dialog--apex").last().children(".ui-dialog-content"), pAction) : window.opener && !window.opener.closed && apexCheck() ? (lTriggeringId = window.name, lTriggeringId.lastIndexOf("_") > 0 && (lTriggeringId = lTriggeringId.substring(0, lTriggeringId.lastIndexOf("_"))), lTriggeringId === undefined ? window.close() : "winDialog" === lTriggeringId ? $.isFunction(pAction) ? pAction.call(this, window) : window.close() : navigation.dialog.fireCloseHandler(window.opener.apex.jQuery("#" + lTriggeringId), pAction)) : $.isFunction(pAction) ? pAction.call(this, window) : window.close()
- }, navigation.dialog.cancel = function(pIsModal) {
- navigation.dialog.close(pIsModal, !1)
- }, navigation.dialog.registerCloseHandler = function(pOptions) {
- pOptions.handler$.off(INTERNAL_CLOSE_EVENT).on(INTERNAL_CLOSE_EVENT, function(pEvent, pAction) {
- $.isFunction(pAction) ? pAction.call(this, pOptions.dialog) : "string" === $.type(pAction) ? (navigation.redirect(pAction), pOptions.closeFunction.call()) : pAction === !1 ? pOptions.closeFunction.call() : (pOptions.closeFunction.call(), pOptions.triggeringElement$.trigger("apexafterclosedialog", [pAction]))
- })
- }, navigation.dialog.fireCloseHandler = function(pHandler$, pAction) {
- pHandler$.trigger(INTERNAL_CLOSE_EVENT, pAction)
- };
- var gDefaultBodyWidth, gFreezeDepth = 0,
- allowNormalWidth = function() {
- $(document.body).css("width", gDefaultBodyWidth), $(window).off("apexwindowresized", allowNormalWidth)
- };
- navigation.beginFreezeScroll = function() {
- 0 === gFreezeDepth && ($(window).on("apexwindowresized", allowNormalWidth), gDefaultBodyWidth = document.body.style.width, $(document.body).width($(document.body).width()).addClass("apex-no-scroll")), gFreezeDepth += 1
- }, navigation.endFreezeScroll = function() {
- gFreezeDepth -= 1, 0 >= gFreezeDepth && (allowNormalWidth(), $(document.body).removeClass("apex-no-scroll"), gFreezeDepth = 0)
- }
- }(apex.navigation, apex.util, apex.jQuery);
- apex.event = {},
- function(event, $) {
- "use strict";
- event.gCancelFlag = !1, event.trigger = function(pSelector, pEvent, pData) {
- return event.gCancelFlag = !1, $(pSelector, apex.gPageContext$).trigger(pEvent, pData), event.gCancelFlag
- }
- }(apex.event, apex.jQuery);
- apex.server = {}, apex.jQuery.ajaxSettings.traditional = !0, apex.jQuery.ajaxPrefilter("script", function(options) {
- options.cache = !0
- }),
- function(server, $, util, undefined) {
- "use strict";
- function addToQueue(pQueueName, pAction, pRequest, pData, pOptions) {
- function getQueue(name) {
- var queue = queues[name];
- return queue || (queue = queues[name] = []), queue
- }
- function sendNext(name) {
- var item, jqXHR, queue = getQueue(name);
- queue.length >= 1 && (item = queue[0], jqXHR = item.jqXHR = _call(item.request, item.data, item.options), jqXHR.then(function(data, status) {
- queue.shift(), sendNext(name)
- }, function(jqXHR, status) {
- var i, item;
- for (i = 1; i < queue.length; i++) item = queue[i], item.error && item.error({
- status: 0
- }, "abort", null), item.complete && item.complete({
- status: 0
- }, "abort");
- queue.length = 0
- }))
- }
- function findInQueue(pQueue, pName) {
- var i;
- for (i = 0; i < pQueue.length; i++)
- if (pQueue[i].name === pName) return pQueue[i];
- return null
- }
- var queue, delta, config, currentItem;
- if ("lazyWrite" === pAction) {
- if (config = findInQueue(lazyWriteQueue, pQueueName)) return config.request = pRequest, config.data = pData, void(config.options = pOptions);
- if (lazyWriteQueue.push({
- name: pQueueName,
- request: pRequest,
- data: pData,
- options: pOptions
- }), lastWriteTimerId) return;
- null === lastWriteTime ? delta = 10 : (delta = lastWriteTime + MIN_LAZY_WRITE_FREQ - (new Date).getTime(), delta = 0 > delta ? 10 : delta), lastWriteTimerId = setTimeout(function() {
- var item;
- for (lastWriteTimerId = null, lastWriteTime = (new Date).getTime(); lazyWriteQueue.length > 0;) item = lazyWriteQueue.shift(), _call(item.request, item.data, item.options)
- }, delta)
- } else queue = getQueue(pQueueName), "replace" === pAction && queue.length >= 1 && (currentItem = queue.shift(), queue.length = 0, currentItem.jqXHR && currentItem.jqXHR.abort()), queue.push({
- request: pRequest,
- data: pData,
- options: pOptions
- }), 1 === queue.length && sendNext(pQueueName)
- }
- function callOrQueue(pRequest, pData, pOptions) {
- var lQName, lAction;
- return pOptions && pOptions.queue ? (lQName = pOptions.queue.name, lAction = pOptions.queue.action, delete pOptions.queue, addToQueue(lQName, lAction, pRequest, pData, pOptions), null) : _call(pRequest, pData, pOptions)
- }
- function _call(pRequest, pData, pOptions) {
- var i, lItem, lIdx, lParameterName, lValue, lLoadingIndicator$, C_MAX_SAFE_LEN = 8e3,
- lProgressScopeName = null,
- lOptions = $.extend({
- dataType: "json",
- type: "post",
- async: !0,
- url: "wwv_flow.show",
- traditional: !0,
- loadingIndicatorPosition: "after"
- }, pOptions),
- lSuccessCallback = lOptions.success,
- lErrorCallback = lOptions.error,
- lData = $.extend({
- p_request: pRequest,
- p_flow_id: $v("pFlowId"),
- p_flow_step_id: $v("pFlowStepId"),
- p_instance: $v("pInstance"),
- p_debug: $v("pdebug"),
- p_arg_names: [],
- p_arg_values: []
- }, pData),
- lLoadingIndicatorTmpl$ = $('<span class="u-Processing u-Processing--inline"><span class="u-Processing-spinner"></span></span>'),
- lLoadingIndicators$ = $(),
- lLoadingIndicatorPosition = lOptions.loadingIndicatorPosition;
- if ($.isArray(lData.pageItems))
- for (i = 0; i < lData.pageItems.length; i++) lItem = $x(lData.pageItems[i]), lItem && (lIdx = lData.p_arg_names.length, lData.p_arg_names[lIdx] = lItem.id, lData.p_arg_values[lIdx] = $v(lItem));
- else $(lData.pageItems, apex.gPageContext$).each(function() {
- var lIdx = lData.p_arg_names.length;
- lData.p_arg_names[lIdx] = this.id, lData.p_arg_values[lIdx] = $v(this)
- });
- for (delete lData.pageItems, i = 1; 20 >= i; i++)
- if (lParameterName = "f" + (10 > i ? "0" + i : i), lData.hasOwnProperty(lParameterName) && !$.isArray(lData[lParameterName]) && (lValue = lData[lParameterName] + "", lValue.length > C_MAX_SAFE_LEN)) {
- for (lData[lParameterName] = []; lValue.length > C_MAX_SAFE_LEN;) lData[lParameterName].push(lValue.substr(0, C_MAX_SAFE_LEN)), lValue = lValue.substr(C_MAX_SAFE_LEN);
- lData[lParameterName].push(lValue)
- }
- return apex.event.trigger(lOptions.refreshObject, "apexbeforerefresh", lOptions.refreshObjectData) ? !1 : ($.isFunction(lOptions.clear) && lOptions.clear(), delete lOptions.loadingIndicatorPosition, (lOptions.loadingIndicator || "page" === lLoadingIndicatorPosition) && (progressScopeNameIndex += 1, lProgressScopeName = "_call" + progressScopeNameIndex, util.delayLinger.start(lProgressScopeName, function() {
- "page" === lLoadingIndicatorPosition ? (lLoadingIndicator$ = util.showSpinner(), lLoadingIndicators$ = lLoadingIndicators$.add(lLoadingIndicator$)) : $.isFunction(lOptions.loadingIndicator) ? lLoadingIndicators$ = lOptions.loadingIndicator(lLoadingIndicatorTmpl$) : $(lOptions.loadingIndicator).each(function() {
- lLoadingIndicator$ = lLoadingIndicatorTmpl$.clone(), apex.item(this).callbacks.loadingIndicator !== undefined ? lLoadingIndicator$ = apex.item(this).loadingIndicator(lLoadingIndicator$) : "before" === lLoadingIndicatorPosition ? lLoadingIndicator$ = lLoadingIndicator$.insertBefore($(this, apex.gPageContext$).filter(":not(:hidden)")) : "after" === lLoadingIndicatorPosition ? lLoadingIndicator$ = lLoadingIndicator$.insertAfter($(this, apex.gPageContext$).filter(":not(:hidden)")) : "prepend" === lLoadingIndicatorPosition ? lLoadingIndicator$ = lLoadingIndicator$.prependTo($(this, apex.gPageContext$)) : "append" === lLoadingIndicatorPosition ? lLoadingIndicator$ = lLoadingIndicator$.appendTo($(this, apex.gPageContext$)) : "centered" === lLoadingIndicatorPosition && (lLoadingIndicator$ = util.showSpinner($(this, apex.gPageContext$))), lLoadingIndicators$ = lLoadingIndicators$.add(lLoadingIndicator$)
- })
- })), lOptions.data = lData, lOptions.error = function(pjqXHR, pTextStatus, pErrorThrown) {
- _error(pjqXHR, pTextStatus, pErrorThrown, {
- callback: lErrorCallback,
- loadingIndicator: lLoadingIndicators$,
- progressScopeName: lProgressScopeName
- })
- }, lOptions.success = function(pData, pTextStatus, pjqXHR) {
- _success(pData, pTextStatus, pjqXHR, {
- callback: lSuccessCallback,
- errorCallback: lOptions.error,
- loadingIndicator: lLoadingIndicators$,
- progressScopeName: lProgressScopeName,
- refreshObject: lOptions.refreshObject
- })
- }, $.ajax(lOptions))
- }
- function _removeLoadingIndicator(pLoadingIndicator, pProgressScopeName) {
- function cleanup() {
- $.isFunction(pLoadingIndicator) ? pLoadingIndicator() : $(pLoadingIndicator, apex.gPageContext$).remove()
- }
- pProgressScopeName ? util.delayLinger.finish(pProgressScopeName, function() {
- cleanup()
- }) : cleanup()
- }
- function _success(pData, pTextStatus, pjqXHR, pOptions) {
- var lResult = !0,
- lErrorHeader = pjqXHR.getResponseHeader("X-APEX-ERROR");
- if (pData) {
- if (pData.error) return pOptions.errorCallback(pjqXHR, "APEX", pData.error);
- if (lErrorHeader) return pOptions.errorCallback(pjqXHR, "APEX", lErrorHeader)
- }
- return _removeLoadingIndicator(pOptions.loadingIndicator, pOptions.progressScopeName), $.isFunction(pOptions.callback) && (lResult = pOptions.callback(pData, pTextStatus, pjqXHR)), (lResult || lResult == undefined) && apex.event.trigger(pOptions.refreshObject, "apexafterrefresh", pOptions.refreshObjectData) ? !1 : lResult
- }
- function _error(pjqXHR, pTextStatus, pErrorThrown, pOptions) {
- var lMsg, lResult = !1;
- return _removeLoadingIndicator(pOptions.loadingIndicator, pOptions.progressScopeName), $.isFunction(pOptions.callback) ? lResult = pOptions.callback(pjqXHR, pTextStatus, pErrorThrown) : 0 !== pjqXHR.status && (lMsg = "APEX" === pTextStatus ? pErrorThrown : "Error: " + pTextStatus + " - " + pErrorThrown, $.isFunction(window.onerror) ? window.onerror(lMsg, null, null) : window.alert(lMsg)), lResult
- }
- server.plugin = function(pAjaxIdentifier, pData, pOptions) {
- return callOrQueue("PLUGIN=" + pAjaxIdentifier, pData, pOptions)
- }, server.pluginUrl = function(pAjaxIdentifier, pData) {
- return server.url($.extend({}, pData, {
- p_request: "PLUGIN=" + pAjaxIdentifier
- }))
- }, server.url = function(pData, pPage) {
- var i, lKey, lUrl, lPage = pPage;
- (null === lPage || lPage === undefined) && (lPage = $v("pFlowStepId")), lUrl = "wwv_flow.show?p_flow_id=" + $v("pFlowId") + "&p_flow_step_id=" + lPage + "&p_instance=" + $v("pInstance") + "&p_debug=" + $v("pdebug");
- for (lKey in pData)
- if (pData.hasOwnProperty(lKey))
- if ("pageItems" === lKey)
- if ($.isArray(pData.pageItems))
- for (i = 0, lItem; i < pData.pageItems.length; i++) lItem = $x(pData.pageItems[i]), lItem && (lUrl = lUrl + "&p_arg_names=" + encodeURIComponent(lItem.id) + "&p_arg_values=" + encodeURIComponent($v(lItem)));
- else $(pData.pageItems, apex.gPageContext$).each(function() {
- lUrl = lUrl + "&p_arg_names=" + encodeURIComponent(this.id) + "&p_arg_values=" + encodeURIComponent($v(this))
- });
- else lUrl = lUrl + "&" + lKey + "=" + encodeURIComponent(pData[lKey]);
- return lUrl
- }, server.process = function(pName, pData, pOptions) {
- return _call("APPLICATION_PROCESS=" + pName, pData, pOptions)
- }, server.widget = function(pName, pData, pOptions) {
- var lData = pData || {};
- return lData.p_widget_name = pName, _call("APXWGT", lData, pOptions)
- };
- var MIN_LAZY_WRITE_FREQ = 5e3,
- lastWriteTimerId = null,
- lastWriteTime = null,
- lazyWriteQueue = [],
- queues = {},
- progressScopeNameIndex = 0
- }(apex.server, apex.jQuery, apex.util);
- apex.page = {},
- function(page, $, event, undefined) {
- function _getSubmitOptions(pOptions, pMode) {
- var lRequestDefault, lDefaults, lOptions = {};
- switch ("SUBMIT" === pMode ? lRequestDefault = null : "CONFIRM" === pMode && (lRequestDefault = "Delete"), lDefaults = {
- request: lRequestDefault,
- set: null,
- showWait: !1,
- waitMsg: null,
- form: "wwv_flow"
- }, typeof pOptions) {
- case "string":
- lOptions = $.extend(lDefaults, {
- request: pOptions
- });
- break;
- case "object":
- lOptions = $.extend(lDefaults, pOptions);
- break;
- default:
- lOptions = lDefaults
- }
- return lOptions
- }
- page.itemCallbacks = {}, page.submit = function(pOptions) {
- var lKeyCode, lWaitPopup, lNumTimeouts, lForm$, lRunSubmitProcessing, lOptions = _getSubmitOptions(pOptions, "SUBMIT"),
- lCancelSubmit = !1;
- if (lOptions.submitIfEnter !== undefined && (lKeyCode = window.event ? window.event.keyCode : lOptions.submitIfEnter.which, 13 !== lKeyCode)) return !0;
- if (lCancelSubmit = event.trigger(apex.gPageContext$, "apexbeforepagesubmit", lOptions.request)) event.gCancelFlag = !1;
- else {
- lOptions.showWait && (lWaitPopup = apex.widget.waitPopup()), lOptions.set && $.each(lOptions.set, function(pId, pValue) {
- pId && pValue !== undefined && $s(pId, pValue)
- }), flowSelectAll(), $("#pRequest", apex.gPageContext$).val(lOptions.request);
- try {
- window.external && "unknown" == typeof window.external.AutoCompleteSaveForm && window.external.AutoCompleteSaveForm($("form[name=" + lOptions.form + "]", apex.gPageContext$).get(0))
- } catch (e) {}
- lNumTimeouts = 0, lForm$ = $("form[name=" + lOptions.form + "]", apex.gPageContext$), lRunSubmitProcessing = function() {
- "wwv_flow.accept" === lForm$.attr("action") && 0 === $("#pPageChecksum", apex.gPageContext$).length ? (lNumTimeouts++, lNumTimeouts > 5 ? (lWaitPopup && lWaitPopup.remove(), window.alert(apex.lang.getMessage("APEX.WAIT_UNTIL_PAGE_LOADED"))) : (lWaitPopup === undefined && 1 === lNumTimeouts && (lWaitPopup = apex.widget.waitPopup()), window.setTimeout(lRunSubmitProcessing, 300))) : (event.trigger(apex.gPageContext$, "apexpagesubmit", lOptions.request), lForm$.trigger("submit"))
- }, lRunSubmitProcessing()
- }
- return lOptions.submitIfEnter !== undefined ? !1 : void 0
- }, page.confirm = function(pMessage, pOptions) {
- var lMessage, lOptions = _getSubmitOptions(pOptions, "CONFIRM");
- lMessage = pMessage ? pMessage : "Would you like to perform this delete action?", confirm(lMessage) && page.submit(lOptions)
- }, apex.submit = page.submit, apex.confirm = page.confirm
- }(apex.page, apex.jQuery, apex.event);
- apex.item = function(pNd, pCallbacks) {
- function init(pNd, pCallbacks) {
- try {
- switch (typeof pNd) {
- case "string":
- _self.node = apex.jQuery("#" + apex.util.escapeCSS(pNd), apex.gPageContext$)[0];
- break;
- case "object":
- _self.node = pNd;
- break;
- default:
- _self.node = !1
- }
- _self.node && 1 === _self.node.nodeType || (_self.node = !1)
- } catch (e) {
- _self.node = !1
- }
- if (_self.node) {
- _self.id = _self.node.id, pCallbacks ? apex.page.itemCallbacks[_self.id] = _self.callbacks : apex.page.itemCallbacks[_self.id] && (_self.callbacks = apex.page.itemCallbacks[_self.id]);
- var lNodeType = _self.node.nodeName.toUpperCase(),
- lClass = _self.node.className.toUpperCase();
- if ("FIELDSET" === lNodeType) switch (_self.item_type = lClass, lClass) {
- case "CHECKBOX_GROUP":
- case "RADIO_GROUP":
- case "SHUTTLE":
- break;
- default:
- _self.item_type = !1
- } else if ("INPUT" === lNodeType) switch (_self.item_type = _self.node.type.toUpperCase(), _self.item_type) {
- case "CHECKBOX":
- case "RADIO":
- break;
- case "TEXT":
- var TEXT_TYPE = _self.node.parentNode.className.toUpperCase();
- switch (TEXT_TYPE) {
- case "DATEPICKER":
- _self.item_type = TEXT_TYPE;
- break;
- case "LOV":
- apex.jQuery("#" + _self.id + "_HIDDENVALUE", apex.gPageContext$).length > 0 ? _self.item_type = "POPUP_KEY_LOV" : _self.item_type = "POPUP_LOV"
- }
- break;
- case "HIDDEN":
- _self.display_span = $x(_self.id + "_DISPLAY"), _self.display_span && (_self.item_type = "DISPLAY_SAVES_STATE");
- break;
- default:
- _self.item_type = "TEXT"
- } else switch (_self.item_type = lNodeType, _self.item_type) {
- case "TEXTAREA":
- if ("html_editor" === _self.node.parentNode.className && "FIELDSET" === _self.node.parentNode.tagName) _self.item_type = "FCKEDITOR";
- else try {
- window.CKEDITOR && window.CKEDITOR.instances[_self.id] && (_self.item_type = "CKEDITOR3")
- } catch (e) {}
- break;
- case "SELECT":
- break;
- case "SPAN":
- "display_only" === _self.node.className && (_self.item_type = "DISPLAY_ONLY");
- break;
- default:
- _self.item_type = !1
- }
- }
- }
- function getValue() {
- if (!_self.node) return "";
- if (apex.jQuery.isFunction(_self.callbacks.getValue)) return _self.callbacks.getValue.call(_self);
- var oEditor, lRadio$, lArray = !0,
- lReturn = [];
- switch (_self.item_type) {
- case "RADIO_GROUP":
- lRadio$ = apex.jQuery(":checked", _self.node), lReturn = 0 === lRadio$.length ? "" : lRadio$.val();
- break;
- case "CHECKBOX_GROUP":
- apex.jQuery(":checked", _self.node).each(function() {
- lReturn[lReturn.length] = this.value
- });
- break;
- case "SELECT":
- lReturn = apex.jQuery(_self.node).val(), (null === lReturn || void 0 === lReturn) && (lReturn = apex.jQuery(_self.node).attr("multiple") ? [] : "");
- break;
- default:
- lArray = !1
- }
- if (!lArray) switch (_self.item_type) {
- case "CHECKBOX":
- lReturn = _self.node.checked ? _self.node.value : "";
- break;
- case "RADIO":
- lReturn = _self.node.checked ? _self.node.value : "";
- break;
- case "TEXT":
- lReturn = _self.node.value;
- break;
- case "POPUP_LOV":
- lReturn = _self.node.value;
- break;
- case "POPUP_KEY_LOV":
- lReturn = apex.jQuery("#" + _self.node.id + "_HIDDENVALUE", apex.gPageContext$).val();
- break;
- case "DATEPICKER":
- lReturn = _self.node.value;
- break;
- case "HIDDEN":
- lReturn = _self.node.value;
- break;
- case "DISPLAY_SAVES_STATE":
- lReturn = _self.node.value;
- break;
- case "DISPLAY_ONLY":
- lReturn = _self.node.innerHTML;
- break;
- case "TEXTAREA":
- lReturn = _self.node.value;
- break;
- case "FCKEDITOR":
- oEditor = FCKeditorAPI.GetInstance(_self.node.id), lReturn = oEditor.GetHTML();
- break;
- default:
- lReturn = ""
- }
- return lReturn
- }
- function setValue(pValue, pDisplayValue, pSuppressChangeEvent) {
- if (apex.jQuery.isFunction(_self.callbacks.setValue)) _self.callbacks.setValue.call(_self, pValue, pDisplayValue, pSuppressChangeEvent);
- else {
- var lCheck, lOpts = !1,
- lSelf$ = apex.jQuery(_self.node, apex.gPageContext$);
- if (!_self.node) return;
- switch (_self.item_type) {
- case "RADIO_GROUP":
- lOpts = $x_FormItems(_self.node, "RADIO");
- break;
- case "CHECKBOX_GROUP":
- lOpts = $x_FormItems(_self.node, "CHECKBOX");
- break;
- case "POPUP_KEY_LOV":
- apex.jQuery("#" + _self.node.id + "_HIDDENVALUE", apex.gPageContext$).val(pValue), lSelf$.val(pDisplayValue);
- break;
- case "SELECT":
- lOpts = _self.node.options;
- break;
- default:
- lOpts = !1
- }
- if (lOpts)
- for (var i = 0, len = lOpts.length; len > i; i++) lCheck = lOpts[i].value == pValue, "RADIO_GROUP" === _self.item_type || "CHECKBOX_GROUP" === _self.item_type ? lOpts[i].checked = lCheck : lOpts[i].selected = lCheck;
- else switch (_self.item_type) {
- case "CHECKBOX":
- case "RADIO":
- _self.node.value == pValue && (_self.node.checked = !0);
- break;
- case "TEXT":
- case "POPUP_LOV":
- case "DATEPICKER":
- case "PASSWORD":
- case "HIDDEN":
- case "TEXTAREA":
- lSelf$.val(pValue);
- break;
- case "DISPLAY_SAVES_STATE":
- lSelf$.val(pValue), apex.jQuery(_self.display_span, apex.gPageContext$).html(pValue);
- break;
- case "DISPLAY_ONLY":
- lSelf$.html(pValue);
- break;
- case "FCKEDITOR":
- var oEditor = FCKeditorAPI.GetInstance(_self.node.id);
- oEditor.SetHTML(pValue);
- break;
- default:
- _self.node.innerHTML = pValue
- }
- }
- _self.afterModify(), pSuppressChangeEvent || apex.jQuery(_self.node).trigger("change")
- }
- function enable() {
- apex.jQuery.isFunction(_self.callbacks.enable) ? _self.callbacks.enable.call(_self) : (apex.jQuery(_self.node).removeClass("apex_disabled").prop("disabled", !1), !$.mobile || "TEXTAREA" !== _self.item_type && -1 == apex.jQuery.inArray(_self.node.type, ["text", "email", "url", "tel", "search", "number", "password", "time", "date", "month", "week", "datetime", "datetime-local", "color"]) || apex.jQuery(_self.node).textinput("enable")), _self.afterModify()
- }
- function disable() {
- apex.jQuery.isFunction(_self.callbacks.disable) ? _self.callbacks.disable.call(_self) : (apex.jQuery(_self.node).addClass("apex_disabled").prop("disabled", !0), !$.mobile || "TEXTAREA" !== _self.item_type && -1 == apex.jQuery.inArray(_self.node.type, ["text", "email", "url", "tel", "search", "number", "password", "time", "date", "month", "week", "datetime", "datetime-local", "color"]) || apex.jQuery(_self.node).textinput("disable")), _self.afterModify()
- }
- function show(pShowRow) {
- var lNodeId = apex.util.escapeCSS(_self.node.id),
- lNodeDisplay$ = apex.jQuery("#" + lNodeId + "_CONTAINER", apex.gPageContext$);
- lNodeDisplay$.length > 0 ? lNodeDisplay$.show() : pShowRow ? $x_ItemRow(_self.node, "SHOW") : (apex.jQuery.isFunction(_self.callbacks.show) ? _self.callbacks.show.call(_self) : (lNodeDisplay$ = apex.jQuery("#" + lNodeId + "_DISPLAY", apex.gPageContext$), lNodeDisplay$.length > 0 ? lNodeDisplay$.show() : apex.jQuery(_self.node).show().trigger("apexaftershow")), lNodeId && apex.jQuery("label[for=" + lNodeId + "]", apex.gPageContext$).show())
- }
- function hide(pHideRow) {
- var lNodeId = apex.util.escapeCSS(_self.node.id),
- lNodeDisplay$ = apex.jQuery("#" + lNodeId + "_CONTAINER", apex.gPageContext$);
- lNodeDisplay$.length > 0 ? lNodeDisplay$.hide() : pHideRow ? $x_ItemRow(_self.node, "HIDE") : (apex.jQuery.isFunction(_self.callbacks.hide) ? _self.callbacks.hide.call(_self) : (lNodeDisplay$ = apex.jQuery("#" + lNodeId + "_DISPLAY", apex.gPageContext$), lNodeDisplay$.length > 0 ? lNodeDisplay$.hide() : apex.jQuery(_self.node).hide().trigger("apexafterhide")), lNodeId && apex.jQuery("label[for=" + lNodeId + "]", apex.gPageContext$).hide())
- }
- function isEmpty() {
- var lItemValue, re, lThis, lOpts, lReturn, lNullValue = "";
- return lItemValue = _self.getValue(), lItemValue = apex.jQuery.isArray(lItemValue) ? lItemValue.join(":") : "" + lItemValue, re = /^\s{1,}$/g, lThis = $x(_self.node), lOpts = !1, "nullValue" in _self.callbacks ? apex.jQuery.isFunction(_self.callbacks.nullValue) ? _self.callbacks.nullValue.call(_self) : 0 === lItemValue.length || null === lItemValue || lItemValue === _self.callbacks.nullValue || lItemValue.search(re) > -1 ? !0 : !1 : ("SELECT" === _self.item_type ? (apex.widget && apex.widget.report && apex.widget.report.tabular && apex.widget.report.tabular.gNullValueList && apex.jQuery.each(apex.widget.report.tabular.gNullValueList, function(pId, pValue) {
- return this.name === lThis.name ? (lNullValue = pValue.value, !1) : void 0
- }), lReturn = lThis.multiple ? 0 === lItemValue.length || lItemValue === lNullValue : lNullValue || "" === lNullValue ? lItemValue === lNullValue : !1) : lReturn = 0 === lItemValue.length || null === lItemValue || lItemValue.search(re) > -1 ? !0 : !1, lReturn)
- }
- function addValue(pValue) {
- apex.jQuery.isFunction(_self.callbacks.addValue) ? _self.callbacks.addValue.call(_self, pValue) : alert("No default handling defined for addValue"), _self.afterModify()
- }
- function removeValue() {
- apex.jQuery.isFunction(_self.callbacks.removeValue) ? _self.callbacks.removeValue.call(_self) : alert("No default handling defined for removeValue"), _self.afterModify()
- }
- function setFocus() {
- var lSetFocusTo$;
- lSetFocusTo$ = "setFocusTo" in _self.callbacks ? apex.jQuery.isFunction(_self.callbacks.setFocusTo) ? _self.callbacks.setFocusTo.call(_self) : apex.jQuery(_self.callbacks.setFocusTo) : apex.jQuery("#" + apex.util.escapeCSS(_self.id), apex.gPageContext$), lSetFocusTo$.focus()
- }
- function setStyle(pPropertyName, pPropertyValue) {
- var lSetStyleTo$;
- lSetStyleTo$ = "setStyleTo" in _self.callbacks ? apex.jQuery.isFunction(_self.callbacks.setStyleTo) ? _self.callbacks.setStyleTo.call(_self) : apex.jQuery(_self.callbacks.setStyleTo) : apex.jQuery("#" + apex.util.escapeCSS(_self.id), apex.gPageContext$), lSetStyleTo$.css(pPropertyName, pPropertyValue), _self.afterModify()
- }
- function afterModify() {
- apex.jQuery.isFunction(_self.callbacks.afterModify) && _self.callbacks.afterModify.call(_self)
- }
- function loadingIndicator(pLoadingIndicator$) {
- var lLoadingIndicator$;
- return "loadingIndicator" in _self.callbacks && apex.jQuery.isFunction(_self.callbacks.loadingIndicator) && (lLoadingIndicator$ = _self.callbacks.loadingIndicator.call(_self, pLoadingIndicator$)), lLoadingIndicator$
- }
- if (!(this instanceof arguments.callee)) return new apex.item(pNd, pCallbacks);
- var _self = this;
- this.node = !1, this.item_type = !1, this.id = !1, this.getValue = getValue, this.init = init, this.setValue = setValue, this.isEmpty = isEmpty, this.enable = enable, this.disable = disable, this.show = show, this.hide = hide, this.addValue = addValue, this.removeValue = removeValue, this.setFocus = setFocus, this.setStyle = setStyle, this.afterModify = afterModify, this.loadingIndicator = loadingIndicator, pCallbacks ? this.callbacks = pCallbacks : this.callbacks = {}, this.init(pNd, pCallbacks)
- };
- function $d_LOV_from_JSON() {
- function create(pThis, pJSON, pType, pId, pCheckedValue, pForceNewLine) {
- var myObject = apex.jQuery.parseJSON(pJSON);
- if ("SHUTTLE" == that.l_Type) {
- var lvar = '<table cellspacing="0" cellpadding="0" border="0" class="ajax_shuttle" summary=""><tbody><tr><td class="shuttleSelect1" id="shuttle1"></td><td align="center" class="shuttleControl"><img title="Reset" alt="Reset" onclick="g_Shuttlep_v01.reset();" src="/i/htmldb/icons/shuttle_reload.png"/><img title="Move All" alt="Move All" onclick="g_Shuttlep_v01.move_all();" src="/i/htmldb/icons/shuttle_last.png"/><img title="Move" alt="Move" onclick="g_Shuttlep_v01.move();" src="/i/htmldb/icons/shuttle_right.png"/><img title="Remove" alt="Remove" onclick="g_Shuttlep_v01.remove();" src="/i/htmldb/icons/shuttle_left.png"/><img title="Remove All" alt="Remove All" onclick="g_Shuttlep_v01.remove_all();" src="/i/htmldb/icons/shuttle_first.png"/></td><td class="shuttleSelect2" id="shuttle2"></td><td class="shuttleSort2"><img title="Top" alt="Top" onclick="g_Shuttlep_v01.sort2(\'T\');" src="/i/htmldb/icons/shuttle_top.png"/><img title="Up" alt="Up" onclick="g_Shuttlep_v01.sort2(\'U\');" src="/i/htmldb/icons/shuttle_up.png"/><img title="Down" alt="Down" onclick="g_Shuttlep_v01.sort2(\'D\');" src="/i/htmldb/icons/shuttle_down.png"/><img title="Bottom" alt="Bottom" onclick="g_Shuttlep_v01.sort2(\'B\');" src="/i/htmldb/icons/shuttle_bottom.png"/></td></tr></tbody></table>';
- $x(pThis).innerHTML = lvar;
- var lSelect = $dom_AddTag("shuttle1", "select"),
- lSelect2 = $dom_AddTag("shuttle2", "select");
- lSelect.multiple = !0, lSelect2.multiple = !0;
- for (var i = 0, len = myObject.row.length; len > i; i++)
- if (myObject.row[i]) {
- var lTest = myObject.row[i].C ? parseInt(myObject.row[i].C) : !1;
- if (lTest) var lOption = $dom_AddTag(lSelect2, "option");
- else var lOption = $dom_AddTag(lSelect, "option");
- lOption.text = myObject.row[i].D, lOption.value = myObject.row[i].R
- }
- if (window.g_Shuttlep_v01 = null, !flowSelectArray) var flowSelectArray = [];
- return flowSelectArray[2] = lSelect, flowSelectArray[1] = lSelect2, window.g_Shuttlep_v01 = new dhtml_ShuttleObject(lSelect, lSelect2), window.g_Shuttlep_v01
- }
- if ("SELECT" == that.l_Type || "MULTISELECT" == that.l_Type) {
- for (var lSelect = $dom_AddTag(pThis, "select"), i = 0, len = myObject.row.length; len > i; i++)
- if (myObject.row[i]) {
- var lOption = $dom_AddTag(lSelect, "option");
- lOption.text = myObject.row[i].D, lOption.value = myObject.row[i].R;
- var lTest = parseInt(myObject.row[i].C);
- lOption.selected = lTest
- }
- return that.l_Dom = lSelect, that
- }
- if ("RADIO" == that.l_Type) {
- for (var ltable = $dom_AddTag(pThis, "table"), i = 0, len = myObject.row.length; len > i; i++)
- if (myObject.row[i]) {
- (i % 10 == 0 || pForceNewLine) && (lrow = $dom_AddTag(ltable, "tr"));
- var lTd = $dom_AddTag(lrow, "td"),
- lTest = !1;
- pCheckedValue && pCheckedValue == myObject.row[i].R && (lTest = !0);
- var lCheck = $dom_AddInput(lTd, "radio", myObject.row[i].R);
- lCheck.checked = lTest, $dom_AddTag(lTd, "span", myObject.row[i].D)
- }
- return that.l_Dom = lSelect, that
- }
- if ("CHECKBOX" == that.l_Type) {
- for (var ltable = $dom_AddTag(pThis, "table"), i = 0, len = myObject.row.length; len > i; i++)
- if (myObject.row[i]) {
- (i % 10 == 0 || pForceNewLine) && (lrow = $dom_AddTag(ltable, "tr"));
- var lTd = $dom_AddTag(lrow, "td"),
- lTest = parseInt(myObject.row[i].C),
- lCheck = $dom_AddInput(lTd, "checkbox", myObject.row[i].R);
- lCheck.checked = lTest, $dom_AddTag(lTd, "span", myObject.row[i].D)
- }
- return that.l_Dom = lSelect, that
- }
- for (var lHolder = $dom_AddTag(pThis, "div"), i = 0, len = myObject.row.length; len > i; i++)
- if (myObject.row[i] && myObject.row[i].R) {
- var l_D = myObject.row[i].D ? myObject.row[i].D : myObject.row[i].R,
- lThis = $dom_AddTag(lHolder, that.l_Type.toUpperCase(), l_D);
- that.l_NewEls[that.l_NewEls.length] = lThis, lThis.id = myObject.row[i].R;
- var lTest = parseInt(myObject.row[i].C);
- lTest && (lThis.className = "checked")
- }
- return that.l_Dom = lHolder, that
- }
- var that = this;
- this.l_Type = !1, this.l_Json = !1, this.l_This = !1, this.l_JSON = !1, this.l_Id = "json_temp", this.l_NewEls = [], this.create = create, this.l_Dom = !1
- }
- function item_menu(pThis, pColumn) {
- $x_Style("item_menu", "position", "absolute");
- for (var lA = $x("item_menu").getElementsByTagName("a"), i = 0, len = lA.length; len > i; i++) {
- var lHref = lA[i].href;
- lHref = lHref.split(":"), lHref[lHref.length - 1] = pColumn, lA[i].href = $u_ArrayToString(lHref, ":")
- }
- dhtml_ButtonDropDown(pThis, "item_menu"), $x_Show("item_menu")
- }
- function doMultiple(pNd, pMode) {
- pNd = $u_Carray(pNd);
- for (var i = 0; i < pNd.length; i++) {
- var node = $x(pNd[i]);
- apex.item(node)[pMode]()
- }
- return $u_Narray(pNd)
- }
- function base_disableItem(pNd, pTest) {
- pTest = !!pTest, $x(pNd) && (pNd = [pNd]);
- for (var i = 0, len = pNd.length; len > i; i++) {
- var node = $x_object(pNd[i]);
- if (node) {
- var l_Dom_Node = node.node;
- "RADIO_GROUP" == node.item_type || "CHECKBOX_GROUP" == node.item_type ? (l_Dom_Node = $x_FormItems(l_Dom_Node, "RADIO_GROUP" == node.item_type ? "RADIO" : "CHECKBOX"), base_disableItem(l_Dom_Node, pTest)) : "radio" == l_Dom_Node.type || "checkbox" == l_Dom_Node.type ? (apex.jQuery(l_Dom_Node).toggleClass("apex_disabled_multi", pTest), l_Dom_Node.disabled = pTest) : (apex.jQuery(l_Dom_Node).toggleClass("apex_disabled", pTest), l_Dom_Node.disabled = pTest)
- }
- }
- return 1 == pNd.length && (pNd = pNd[0]), pNd
- }
- function htmldb_Get(obj, flow, req, page, instance, proc, queryString) {
- function setNode(id) {
- this.node = $x(id)
- }
- function replaceNode(newNode) {
- var i = 0;
- for (i = this.node.childNodes.length - 1; i >= 0; i--) this.node.removeChild(this.node.childNodes[i]);
- this.node.appendChild(newNode)
- }
- this.obj = $x(obj), this.proc = proc ? proc : "wwv_flow.show", this.flow = flow ? flow : $v("pFlowId"), this.request = req ? req : "", this.page = page ? page : "0", this.queryString = queryString ? queryString : null, this.params = "", this.response = "", this.base = null, this.syncMode = !1, this.addParam = htmldb_Get_addParam, this.add = htmldb_Get_addItem, this.getPartial = htmldb_Get_trimPartialPage, this.getFull = function(obj) {
- var result, node;
- return obj && (this.obj = $x(obj)), this.obj && ("INPUT" == this.obj.nodeName ? this.obj.value = this.response : document.all ? (result = this.response, node = this.obj, setTimeout(function() {
- htmldb_get_WriteResult(node, result)
- }, 100)) : $s(this.obj, this.response)), this.response
- }, this.get = function(mode, startTag, endTag) {
- var p;
- try {
- p = new XMLHttpRequest
- } catch (e) {
- p = new ActiveXObject("Msxml2.XMLHTTP")
- }
- try {
- new Date;
- return p.open("POST", this.base, this.syncMode), p.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), p.send(null == this.queryString ? this.params : this.queryString), this.response = p.responseText, this.node && this.replaceNode(p.responseXML), null == mode || "PPR" == mode ? this.getPartial(startTag, endTag) : "XML" == mode ? p.responseXML : this.getFull()
- } catch (e) {
- return
- }
- }, this.url = htmldb_Get_getUrl, this.escape = htmldb_Get_escape, this.clear = htmldb_Get_clear, this.sync = htmldb_Get_sync, this.setNode = setNode, this.replaceNode = replaceNode;
- var u = window.location.href.indexOf("?") > 0 ? window.location.href.substring(0, window.location.href.indexOf("?")) : window.location.href;
- this.base = u.substring(0, u.lastIndexOf("/")), this.proc || (this.proc = u.substring(u.lastIndexOf("/") + 1)), this.base = this.base + "/" + this.proc, null == instance || "" == instance ? this.instance = $v("pInstance") : this.instance = instance, queryString || (this.addParam("p_request", this.request), this.addParam("p_instance", this.instance), this.addParam("p_flow_id", this.flow), this.addParam("p_flow_step_id", this.page))
- }
- function htmldb_Get_sync(s) {
- this.syncMode = s
- }
- function htmldb_Get_clear(val) {
- this.addParam("p_clear_cache", val)
- }
- function htmldb_Get_getUrl() {
- return null == this.queryString ? this.base + "?" + this.params : this.queryString
- }
- function htmldb_Get_escape(val) {
- return val += "", val = val.replace(/\%/g, "%25"), val = val.replace(/\+/g, "%2B"), val = val.replace(/\ /g, "%20"), val = val.replace(/\./g, "%2E"), val = val.replace(/\*/g, "%2A"), val = val.replace(/\?/g, "%3F"), val = val.replace(/\\/g, "%5C"), val = val.replace(/\//g, "%2F"), val = val.replace(/\>/g, "%3E"), val = val.replace(/\</g, "%3C"), val = val.replace(/\{/g, "%7B"), val = val.replace(/\}/g, "%7D"), val = val.replace(/\~/g, "%7E"), val = val.replace(/\[/g, "%5B"), val = val.replace(/\]/g, "%5D"), val = val.replace(/\`/g, "%60"), val = val.replace(/\;/g, "%3B"), val = val.replace(/\?/g, "%3F"), val = val.replace(/\@/g, "%40"), val = val.replace(/\&/g, "%26"), val = val.replace(/\#/g, "%23"), val = val.replace(/\|/g, "%7C"), val = val.replace(/\^/g, "%5E"), val = val.replace(/\:/g, "%3A"), val = val.replace(/\=/g, "%3D"), val = val.replace(/\$/g, "%24")
- }
- function htmldb_Get_addParam(name, val) {
- "" == this.params ? this.params = name + "=" + (null != val ? this.escape(val) : "") : this.params = this.params + "&" + name + "=" + (null != val ? this.escape(val) : "")
- }
- function htmldb_Get_addItem(name, value) {
- this.addParam("p_arg_names", name), this.addParam("p_arg_values", value)
- }
- function htmldb_Get_trimPartialPage(startTag, endTag, obj) {
- obj && (this.obj = $x(obj)), startTag || (startTag = "<!--START-->"), endTag || (endTag = "<!--END-->");
- var result, node, start = this.response.indexOf(startTag);
- if (start > 0) {
- this.response = this.response.substring(start + startTag.length);
- var end = this.response.indexOf(endTag);
- this.response = this.response.substring(0, end)
- }
- return this.obj && (document.all ? (result = this.response, node = this.obj, setTimeout(function() {
- htmldb_get_WriteResult(node, result)
- }, 100)) : $s(this.obj, this.response)), this.response
- }
- function htmldb_get_WriteResult(node, result) {
- $s(node, result)
- }
- function htmldb_ExternalPost(pThis, pRegion, pPostUrl) {
- var pURL = "f?p=" + $x("pFlowId").value + ":" + $x("pFlowStepId").value + ":" + $x("pInstance").value + ":FLOW_FOP_OUTPUT_R" + pRegion;
- document.body.innerHTML = document.body.innerHTML + '<div style="display:none;" id="dbaseSecondForm"><form id="xmlFormPost" action="' + pPostUrl + '?ie=.pdf" method="post" target="pdf"><textarea name="vXML" id="vXML" style="width:500px;height:500px;"></textarea></form></div>';
- var l_El = $x("vXML"),
- get = new htmldb_Get(l_El, null, null, null, null, "f", pURL.substring(2));
- get.get(), get = null, setTimeout(function() {
- $x("xmlFormPost").submit()
- }, 10)
- }
- function $xml_Control(pThis) {
- function _CloneAndPlace(pThis, pThat, pText) {
- var lThat = $x(pThat);
- if (document.all) {
- this.xsl_processor.addParameter("xpath", pThis), this.xsl_processor.input = this.xml, this.xsl_processor.transform;
- var newFragment = this.xsl_processor.output
- } else {
- this.xsl_processor.setParameter(null, "xpath", pThis);
- var newFragment = this.xsl_processor.transformToFragment(this.xml, this.ownerDocument)
- }
- return lThat ? (ie ? $s(lThat, newFragment) : ($s(lThat, ""), lThat.appendChild(newFragment)), newFragment) : void 0
- }
- this.xsl_string = '<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html"/><xsl:param name="xpath" /><xsl:template match="/"><xsl:copy-of select="//*[@id=$xpath]"/></xsl:template></xsl:stylesheet>', document.all ? (this.xsl_object = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0"), this.xsl_object.async = !1, this.xsl_object.loadXML(this.xsl_string), tmp = new ActiveXObject("Msxml2.XSLTemplate.3.0"), tmp.stylesheet = this.xsl_object, this.xsl_processor = tmp.createProcessor()) : (this.xsl_object = (new DOMParser).parseFromString(this.xsl_string, "text/xml"), this.xsl_processor = new XSLTProcessor, this.xsl_processor.importStylesheet(this.xsl_object), this.ownerDocument = document.implementation.createDocument("", "test", null)), this.xml = pThis, this.CloneAndPlace = _CloneAndPlace
- }
- function $a_PostClob(pThis, pRequest, pPage, pReturnFunction) {
- var get = new htmldb_Get(null, $v("pFlowId"), pRequest, pPage, null, "wwv_flow.accept");
- get.AddArrayClob($x(pThis).value, 1), get.GetAsync(pReturnFunction), get = null
- }
- function $a_GetClob(pRequest, pPage, pReturnFunction) {
- var get = new htmldb_Get(null, $v("pFlowId"), pRequest, pPage, null, "wwv_flow.accept");
- get.GetAsync(pReturnFunction), get = null, x = null
- }
- function $s_Split(pString, pLength) {
- var lArray = [];
- if (pString.length <= pLength) lArray[lArray.length] = pString;
- else {
- for (; pString.length > 4e3;) lArray[lArray.length] = pString.substr(0, 4e3), pString = pString.substr(4e3, pString.length - 4e3);
- lArray[lArray.length] = pString.substr(0, 4e3)
- }
- return lArray
- }
- function json_SetItems(gReturn) {
- gReturn = apex.jQuery.parseJSON(gReturn);
- for (var j = 0, len = gReturn.item.length; len > j; j++) apex.item(gReturn.item[j].id).setValue(gReturn.item[j].value)
- }
- function $x(pNd) {
- return apex.item(pNd).node
- }
- function $x_object(pNd) {
- return apex.item(pNd)
- }
- function $v(pNd) {
- var lValue = apex.item(pNd).getValue();
- return apex.jQuery.isArray(lValue) ? lValue.join(":") : lValue
- }
- function $v2(pNd) {
- return apex.item(pNd).getValue()
- }
- function $s(pNd, pValue, pDisplayValue, pSuppressChangeEvent) {
- return apex.item(pNd).setValue(pValue, pDisplayValue, pSuppressChangeEvent)
- }
- function $u_Carray(pNd) {
- return $x(pNd) ? [pNd] : pNd
- }
- function $u_Narray(pNd) {
- return 1 == pNd.length ? pNd[0] : pNd
- }
- function $nvl(pTest, pDefault) {
- return null != pTest ? pTest : pDefault ? pDefault : ""
- }
- function $x_Check_For_Compound(pNd) {
- var lNode = $x(pNd);
- return lNode && $x(lNode.id + "_fieldset") ? $x(lNode.id + "_fieldset") : lNode
- }
- function $x_Style(pNd, pStyle, pString) {
- pNd = $u_Carray(pNd);
- for (var i = 0; i < pNd.length; i++) {
- var node = $x(pNd[i]);
- node ? node.style[pStyle] = pString : null
- }
- return $u_Narray(pNd)
- }
- function $x_Hide(pNd) {
- return doMultiple(pNd, "hide")
- }
- function $x_Show(pNd) {
- return doMultiple(pNd, "show")
- }
- function $x_Show_Hide(pShow, pHide) {
- $x_Hide(pHide), $x_Show(pShow)
- }
- function $x_Toggle(pNd) {
- var id, node, testNode;
- pNd = $u_Carray(pNd);
- for (var i = 0; i < pNd.length; i++) node = $x(pNd[i]), "string" == typeof pNd[i] ? id = pNd[i] : pNd[i].id && (id = pNd[i].id), id && (testNode = apex.jQuery("#" + id + "_CONTAINER").get(0), testNode || (testNode = apex.jQuery("#" + id + "_DISPLAY").get(0))), testNode || (testNode = node), node && (0 === apex.jQuery(testNode).filter(":visible").length ? $x_Show(node) : $x_Hide(node));
- return $u_Narray(pNd)
- }
- function $x_Remove(pNd) {
- pNd = $u_Carray(pNd);
- for (var i = 0, len = pNd.length; len > i; i++) {
- var node = $x(pNd[i]),
- lParent = node.parentNode;
- node && lParent && (lParent.removeChild(node), lParent.normalize())
- }
- return $u_Narray(pNd)
- }
- function $x_Value(pNd, pValue) {
- pNd = $u_Carray(pNd);
- for (var j = 0, len = pNd.length; len > j; j++) {
- var lTemp = $item(pNd[j]);
- lTemp.setValue(pValue)
- }
- }
- function $x_UpTill(pNd, pToTag, pToClass) {
- var node = $x(pNd);
- if (node) {
- var tPar = node.parentNode;
- if (pToClass)
- for (; tPar && (tPar.nodeName != pToTag || !apex.jQuery(tPar).hasClass(pToClass));) tPar = tPar.parentNode;
- else
- for (; tPar && tPar.nodeName != pToTag;) tPar = tPar.parentNode;
- return tPar || !1
- }
- return !1
- }
- function $x_ItemRow(pNd, pFunc) {
- var node, lTr;
- pNd = $u_Carray(pNd);
- for (var i = 0; i < pNd.length; i++)
- if (node = $x_Check_For_Compound(pNd[i]), lTr = $x_UpTill(node, "TR")) switch (pFunc) {
- case "TOGGLE":
- $x_Toggle(lTr);
- break;
- case "SHOW":
- $x_Show(lTr);
- break;
- case "HIDE":
- $x_Hide(lTr)
- }
- }
- function $x_HideItemRow(pNd) {
- $x_ItemRow(pNd, "HIDE")
- }
- function $x_ShowItemRow(pNd) {
- $x_ItemRow(pNd, "SHOW")
- }
- function $x_ToggleItemRow(pNd) {
- $x_ItemRow(pNd, "TOGGLE")
- }
- function $x_HideAllExcept(pNd, pNdArray) {
- var l_Node = $x(pNd);
- return l_Node && ($x_Hide(pNdArray), $x_Show(l_Node)), l_Node
- }
- function $x_HideSiblings(pNd) {
- var lNode = apex.jQuery($x(pNd));
- return lNode.show().siblings().hide().get()
- }
- function $x_ShowSiblings(pNd) {
- var lNode = apex.jQuery($x(pNd));
- return lNode.show().siblings().show().get()
- }
- function $x_Class(pNd, pClass) {
- $x(pNd) && (pNd = [pNd]);
- for (var l = pNd.length, i = 0; l > i; i++) $x(pNd[i]) && ($x(pNd[i]).className = pClass);
- return $u_Narray(pNd)
- }
- function $x_SetSiblingsClass(pNd, pClass, pNdClass) {
- var l_Node = apex.jQuery($x(pNd));
- return l_Node.siblings().removeClass("").addClass(pClass), pNdClass && l_Node.removeClass("").addClass(pNdClass), l_Node.get()
- }
- function $x_ByClass(pClass, pNd, pTag) {
- var lClass = pTag ? pTag + "." + pClass : "." + pClass;
- return apex.jQuery(lClass, $x(pNd)).get()
- }
- function $x_ShowAllByClass(pNd, pClass, pTag) {
- lClass = pTag ? pTag + "." + pClass : "." + pClass, apex.jQuery(lClass, $x(pNd)).show()
- }
- function $x_ShowChildren(pNd) {
- apex.jQuery($x(pNd)).children().show()
- }
- function $x_HideChildren(pNd) {
- apex.jQuery($x(pNd)).children().hide()
- }
- function $x_disableItem(pNd, pTest) {
- var lMode = pTest ? "disable" : "enable";
- return doMultiple(pNd, lMode)
- }
- function $f_get_emptys(pNd, pClassFail, pClass) {
- var l_temp = [],
- l_temp2 = [];
- $x(pNd) && (pNd = [pNd]);
- for (var i = 0, len = pNd.length; len > i; i++) {
- var node = $x(pNd[i]);
- node && (apex.item(node).isEmpty() ? l_temp[l_temp.length] = node : l_temp2[l_temp2.length] = node)
- }
- return pClassFail && $x_Class(l_temp, pClassFail), pClass && $x_Class(l_temp2, pClass), 0 === l_temp.length ? l_temp = !1 : l_temp[0].focus(), l_temp
- }
- function $v_Array(pNd) {
- return apex.jQuery.makeArray(apex.item(pNd).getValue())
- }
- function $f_ReturnChecked(pNd) {
- return $x(pNd) ? $v_Array(pNd) : !1
- }
- function $d_ClearAndHide(pNd) {
- $x(pNd) && (pNd = [pNd]);
- for (var i = 0, len = pNd.length; len > i; i++) {
- var lNode = $x(pNd[i]);
- lNode && ($x_Hide(lNode).innerHTML = "")
- }
- }
- function $f_SelectedOptions(pNd) {
- var lSelect = $x(pNd),
- lValue = [];
- if ("SELECT" == lSelect.nodeName) {
- for (var lOpts = lSelect.options, i = 0, len = lOpts.length; len > i; i++) lOpts[i].selected && (lValue[lValue.length] = lOpts[i]);
- return $u_Narray(lValue)
- }
- return !1
- }
- function $f_SelectValue(pNd) {
- var lValue = $v_Array(pNd);
- return $u_Narray(lValue)
- }
- function $u_ArrayToString(pArray, pDelim) {
- var lReturn = "";
- pDelim && (pDelim = ":"), pArray = $u_Carray(pArray);
- for (var i = 0, len = pArray.length; len > i; i++) lReturn += pArray[i] ? pArray[i] + pDelim : "" + pDelim;
- return lReturn.substr(0, lReturn.length - 1)
- }
- function $v_CheckValueAgainst(pThis, pValue) {
- var lTest = !1,
- lArray = [],
- lValue = !1;
- pValue.constructor == Array ? lArray = pValue : lArray[0] = pValue, lValue = $v(pThis);
- for (var i = 0, len = lArray.length; len > i && !(lTest = lValue == lArray[i]); i++);
- return lTest
- }
- function $f_Hide_On_Value_Item(pThis, pThat, pValue) {
- var lTest = $v_CheckValueAgainst(pThis, pValue);
- return lTest ? $x_Hide(pThat) : $x_Show(pThat), lTest
- }
- function $f_Show_On_Value_Item(pThis, pThat, pValue) {
- var lTest = $v_CheckValueAgainst(pThis, pValue);
- return lTest ? $x_Show(pThat) : $x_Hide(pThat), lTest
- }
- function $f_Hide_On_Value_Item_Row(pThis, pThat, pValue) {
- var lTest = $v_CheckValueAgainst(pThis, pValue);
- return lTest ? $x_HideItemRow(pThat) : $x_ShowItemRow(pThat), lTest
- }
- function $f_Show_On_Value_Item_Row(pThis, pThat, pValue) {
- var lTest = $v_CheckValueAgainst(pThis, pValue);
- return lTest ? $x_ShowItemRow(pThat) : $x_HideItemRow(pThat), lTest
- }
- function $f_DisableOnValue(pThis, pValue, pThat) {
- var lTest = $v_CheckValueAgainst(pThis, pValue),
- lNd = [];
- if (pThat) {
- if (pThat instanceof Array) lNd = pThat;
- else
- for (var i = 2; i < arguments.length; i++) arguments[i] && (lNd[lNd.length] = arguments[i]);
- $x_disableItem(lNd, lTest)
- }
- return lTest
- }
- function $x_ClassByClass(pNd, pClass, pTag, pClass2) {
- var l_Els = $x_ByClass(pClass, pNd, pTag);
- return $x_Class(l_Els, pClass2), l_Els
- }
- function $f_ValuesToArray(pThis, pClass, pTag) {
- for (var lTemp = $x_ByClass(pClass, pThis, pTag), lArray = [], i = 0, len = lTemp.length; len > i; i++) lArray[i] = lTemp[i].value;
- return lArray
- }
- function $dom_JoinNodeLists(pThis, pThat) {
- var i, len, lArray = [];
- for (i = 0, len = pThis.length; len > i; i++) lArray[i] = pThis[i];
- for (i = 0, len = pThat.length; len > i; i++) lArray[lArray.length] = pThat[i];
- return lArray
- }
- function $x_FormItems(pNd, pType) {
- var lType = pType ? pType.toUpperCase() : "ALL",
- l_Inputs = [],
- l_Array = [],
- l_This = $x(pNd);
- if (l_This) {
- if ("SELECT" == l_This.nodeName || "INPUT" == l_This.nodeName || "TEXTAREA" == l_This.nodeName) return [l_This];
- if (l_Selects = l_This.getElementsByTagName("SELECT"), l_Inputs = l_This.getElementsByTagName("INPUT"), l_Textarea = l_This.getElementsByTagName("TEXTAREA"), l_Fieldset = l_This.getElementsByTagName("FIELDSET"), "SELECT" == lType ? l_Inputs = l_Selects : "TEXTAREA" == lType ? l_Inputs = l_Textarea : "ALL" == lType && (l_Inputs = $dom_JoinNodeLists(l_Inputs, l_Fieldset), l_Inputs = $dom_JoinNodeLists(l_Inputs, l_Selects), l_Inputs = $dom_JoinNodeLists(l_Inputs, l_Textarea)), "SELECT" == lType || "TEXTAREA" == lType || "ALL" == lType) l_Array = l_Inputs;
- else
- for (var i = 0; i < l_Inputs.length; i++) l_Inputs[i].type.toUpperCase() == pType.toUpperCase() && (l_Array[l_Array.length] = l_Inputs[i]);
- return l_Array
- }
- }
- function $f_CheckAll(pThis, pCheck, pArray) {
- var l_Inputs;
- l_Inputs = pArray ? pArray : $x_FormItems(pThis, "CHECKBOX");
- for (var i = 0, l = l_Inputs.length; l > i; i++) l_Inputs[i].checked = pCheck
- }
- function $f_CheckFirstColumn(pNd) {
- for (var lTable = $x_UpTill(pNd, "TABLE"), lArray = [], i = 0, len = lTable.rows.length; len > i; i++) {
- var l_Temp = $x_FormItems(lTable.rows[i], "CHECKBOX")[0];
- l_Temp && (lArray[lArray.length] = l_Temp)
- }
- return $f_CheckAll(!1, pNd.checked, lArray), lArray
- }
- function $x_ToggleWithImage(pThis, pNd) {
- pThis = $x(pThis), $x_CheckImageSrc(pThis, "plus") ? ($x_Class(pThis, gToggleWithImageI), pThis.src = html_StringReplace(pThis.src, "plus", "minus")) : ($x_Class(pThis, gToggleWithImageA), pThis.src = html_StringReplace(pThis.src, "minus", "plus"));
- var node = $x_Toggle(pNd);
- return node
- }
- function $x_SwitchImageSrc(pNd, pSearch, pReplace) {
- var lEl = $x(pNd);
- return lEl && "IMG" == lEl.nodeName && -1 != lEl.src.indexOf(pSearch) && (lEl.src = pReplace), lEl
- }
- function $x_CheckImageSrc(pNd, pSearch) {
- var lEL = $x(pNd),
- lReturn = !1;
- return lEL && "IMG" == lEL.nodeName && (lReturn = $u_SubString(lEL.src, pSearch)), lReturn
- }
- function $u_SubString(pText, pMatch) {
- return -1 != pText.toString().indexOf(pMatch.toString())
- }
- function html_RemoveAllChildren(pNd) {
- var lEl = $x(pNd);
- if (lEl && lEl.hasChildNodes && lEl.removeChild)
- for (; lEl.hasChildNodes();) lEl.removeChild(lEl.firstChild)
- }
- function ajax_Loading(pState) {
- 1 == pState ? $x_Show("loader", "wait") : $x_Hide("loader")
- }
- function html_SetSelectValue(pId, pValue) {
- var lSelect = $x(pId);
- if ("SELECT" == lSelect.nodeName) {
- lSelect.selectedIndex = 0;
- for (var i = 0, l = lSelect.options.length; l > i; i++) lSelect.options[i].value == pValue && (lSelect.options[i].selected = !0)
- }
- }
- function addLoadEvent(pFunction) {
- apex.jQuery(document).ready(pFunction)
- }
- function $f_Swap(pThis, pThat) {
- var lThis = $x(pThis);
- lThat = $x(pThat), pThis && pThat && ($x_Value(pThis, lThat.value), $x_Value(pThat, lThis.value))
- }
- function $f_Enter(e) {
- var keycode;
- if (window.event) keycode = window.event.keyCode;
- else {
- if (!e) return !1;
- keycode = e.which
- }
- return 13 == keycode ? !0 : !1
- }
- function $f_SetValueSequence(pArray, pMultiple) {
- for (var lLength = pArray.length, i = 0; lLength > i; i++) $x_Value(pArray[i], (i + 1) * pMultiple)
- }
- function $dom_AddTag(pThis, pTag, pText) {
- var lThis = document.createElement(pTag),
- lThat = $x(pThis);
- return lThat && lThat.appendChild(lThis), null != pText && (lThis.innerHTML = pText), lThis
- }
- function $tr_AddTD(pThis, pText) {
- return $dom_AddTag($x(pThis), "TD", pText)
- }
- function $tr_AddTH(pThis, pText) {
- return $dom_AddTag($x(pThis), "TH", pText)
- }
- function $dom_Replace(pThis, pThat) {
- var lThis = $x(pThis),
- lParent = lThis.parentNode;
- return lThat = $dom_AddTag(lParent, pThat), lParent.replaceChild(lThat, lThis)
- }
- function $dom_AddInput(pThis, pType, pId, pName, pValue) {
- var lThis = $dom_AddTag(!1, "INPUT");
- return lThis.type = pType ? pType : "text", lThis.id = pId ? pId : "", lThis.name = pName ? pName : "", lThis.value = pValue ? pValue : "", pThis && $x(pThis).appendChild(lThis), lThis
- }
- function $dom_MakeParent(pThis, p_Parent) {
- var l_Node = $x(pThis),
- l_Parent = $x(p_Parent);
- return l_Node && l_Parent && l_Node.parentNode != l_Parent && l_Parent.appendChild(l_Node), l_Node
- }
- function $x_RowHighlight(pThis, pColor) {
- var lThis = $x(pThis);
- lThis && $x_Style(lThis.getElementsByTagName("TD"), "backgroundColor", pColor), gCurrentRow = lThis
- }
- function $x_RowHighlightOff(pThis) {
- var lThis = $x(pThis);
- lThis && $x_Style(lThis.getElementsByTagName("TD"), "backgroundColor", "")
- }
- function $v_Upper(pId) {
- var obj = $x(pId);
- obj && (obj.value = obj.value.toUpperCase())
- }
- function $d_Find(pThis, pString, pTags, pClass) {
- if (pTags || (pTags = "DIV"), pThis = $x(pThis)) {
- var d = pThis.getElementsByTagName(pTags);
- pThis.style.display = "none", gRegex || (gRegex = new RegExp("test")), gRegex.compile(pString, "i");
- for (var i = 0, len = d.length; len > i; i++) gRegex.test(d[i].innerHTML) ? d[i].style.display = "block" : d[i].style.display = "none";
- pThis.style.display = "block"
- }
- }
- function $f_First_field(pNd) {
- var lThis = $x(pNd);
- try {
- return lThis && ("hidden" == lThis.type || lThis.disabled || lThis.focus()), !0
- } catch (e) {}
- }
- function html_StringReplace(string, text, by) {
- by || (by = "");
- var strLength = string.length,
- txtLength = text.length;
- if (0 === strLength || 0 === txtLength) return string;
- var i = string.indexOf(text);
- if (!i && text != string.substring(0, txtLength)) return string;
- if (-1 == i) return string;
- var newstr = string.substring(0, i) + by;
- return strLength > i + txtLength && (newstr += html_StringReplace(string.substring(i + txtLength, strLength), text, by)), newstr
- }
- function getScrollXY() {
- var scrOfX = 0,
- scrOfY = 0;
- return "number" == typeof window.pageYOffset ? (scrOfY = window.pageYOffset, scrOfX = window.pageXOffset) : document.body && (document.body.scrollLeft || document.body.scrollTop) ? (scrOfY = document.body.scrollTop, scrOfX = document.body.scrollLeft) : document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop) && (scrOfY = document.documentElement.scrollTop, scrOfX = document.documentElement.scrollLeft), [scrOfX, scrOfY]
- }
- function html_GetTarget(e) {
- var targ;
- return e || (e = window.event), e.target ? targ = e.target : e.srcElement && (targ = e.srcElement), 3 == targ.nodeType && (targ = targ.parentNode), targ
- }
- function findPosX(obj) {
- var lEl = $x(obj),
- curleft = 0;
- if (lEl.x) return lEl.x;
- if (lEl.offsetParent)
- for (; lEl.offsetParent;) {
- if (lEl.style.left) return curleft += parseInt(lEl.style.left.substring(0, lEl.style.left.length - 2), 10);
- curleft += lEl.offsetLeft, lEl = lEl.offsetParent
- }
- return curleft
- }
- function findPosY(obj) {
- var lEl = $x(obj),
- curtop = 0;
- if (lEl.y) return lEl.y;
- if (lEl.offsetParent)
- for (; lEl.offsetParent;) {
- if (lEl.style.top) return curtop += parseInt(lEl.style.top.substring(0, lEl.style.top.length - 2), 10);
- curtop += lEl.offsetTop, lEl = lEl.offsetParent
- }
- return curtop
- }
- function setSelectionRange(input, selectionStart, selectionEnd) {
- var lInputLength;
- if (input.setSelectionRange) lInputLength = input.value.length, selectionStart > lInputLength && (selectionStart = lInputLength), selectionEnd > lInputLength && (selectionEnd = lInputLength), input.focus(), input.setSelectionRange(selectionStart, selectionEnd);
- else if (input.createTextRange) {
- var range = input.createTextRange();
- range.collapse(!0), range.moveEnd("character", selectionEnd), range.moveStart("character", selectionStart), range.select()
- }
- }
- function setCaretToPos(input, pos) {
- setSelectionRange(input, pos, pos)
- }
- function html_ReturnToTextSelection(pText, pThis, pNoSpace) {
- var cmd = $x(pThis),
- lSpace = apex.item(cmd).isEmpty() || pNoSpace ? "" : " ";
- if (document.selection) {
- cmd.focus();
- var sel = document.selection,
- rng = sel.createRange();
- rng.text = rng.text + lSpace + pText
- } else start = cmd.selectionStart, end = cmd.selectionEnd, cmd.value = cmd.value.slice(0, start) + lSpace + pText + cmd.value.slice(end, cmd.value.length), cmd.focus(), setCaretToPos(cmd, end + (pText.length + 2))
- }
- function setCaretToEnd(input) {
- setSelectionRange(input, input.value.length, input.value.length)
- }
- function setCaretToBegin(input) {
- setSelectionRange(input, 0, 0)
- }
- function selectString(input, string) {
- var match = new RegExp(string, "i").exec(input.value);
- match && setSelectionRange(input, match.index, match.index + match[0].length)
- }
- function ob_PPR_TAB(l_URL) {
- top.gLastTab = l_URL;
- var lBody = document.body,
- http = new htmldb_Get(lBody, null, null, null, null, "f", l_URL.substring(2));
- http.get(null, '<body style="padding:10px;">', "</body>")
- }
- function flowSelectAll() {
- var theList, lListLength, i;
- if ("undefined" == typeof flowSelectArray) return !0;
- for (var a = 0, len = flowSelectArray.length; len > a; a++) {
- for (theList = $x(flowSelectArray[a]), lListLength = theList.length, i = 0; lListLength - 1 >= i; i++) theList.options[i].selected = !1;
- for (i = 0; lListLength - 1 >= i; i++) theList.options[i].selected = !0
- }
- return !0
- }
- function htmldb_item_change(e) {
- htmldb_ch = !0
- }
- function htmldb_doUpdate(r) {
- htmldb_ch ? (lc_SetChange(), apex.submit(r)) : apex.submit(r)
- }
- function htmldb_goSubmit(r) {
- htmldb_ch ? (htmldb_ch_message && null !== htmldb_ch_message || (htmldb_ch_message = "Are you sure you want to leave this page without saving? /n Please use translatable string."), window.confirm(htmldb_ch_message) && apex.submit(r)) : apex.submit(r)
- }
- function $p_DatePicker(p_element_index, p_form_index, p_date_format, p_bgcolor, p_dd, p_hh, p_mi, p_pm, p_yyyy, p_lang, p_application_format, p_application_id, p_security_group_id, p_mm, p_height) {
- var w = open("wwv_flow_utilities.show_as_popup_calendar?p_element_index=" + escape(p_element_index) + "&p_form_index=" + escape(p_form_index) + "&p_date_format=" + escape(p_date_format) + "&p_bgcolor=" + escape(p_bgcolor) + "&p_dd=" + escape(p_dd) + "&p_hh=" + escape(p_hh) + "&p_mi=" + escape(p_mi) + "&p_pm=" + escape(p_pm) + "&p_yyyy=" + escape(p_yyyy) + "&p_lang=" + escape(p_lang) + "&p_application_format=" + escape(p_application_format) + "&p_application_id=" + escape(p_application_id) + "&p_security_group_id=" + escape(p_security_group_id) + "&p_mm=" + escape(p_mm), "winLov", "Scrollbars=no,resizable=yes,width=258,height=" + p_height);
- return null == w.opener && (w.opener = self), w.focus(), w
- }
- function confirmDelete2(p_Msg, p_Req) {
- var l_req = p_Req ? p_Req : "DELETE",
- l_msg = p_Msg ? p_Msg : "Would you like to perform this delete action?";
- confirm(l_msg) && (apex.submit(l_req), window.close())
- }
- function lc_SetChange() {
- gChangeCheck && (gChangeCheck.value = 1, gChangeCheck.type = "text")
- }
- function setValue2(id, val, errorMsg) {
- var obj = $x(id);
- obj && ($x_Value(obj, val), $v(obj) != val && alert(errorMsg))
- }
- function dhtml_CloseAllSubMenus(pStart) {
- var l_Start = null;
- l_Start = pStart ? pStart : 0;
- for (var i = l_Start; i <= gSubMenuArray.length; i++)
- if (gSubMenuArray[i]) {
- var l_Sm = $x_Hide(gSubMenuArray[i]);
- l_Sm && $x_Hide(l_Sm)
- }
- pStart || (gSubMenuArray.length = 0), htmldb_IE_Select_Item_Fix(!1), $gCurrentAnchorList = apex.jQuery("#" + gCurrentAppMenu).children().children().filter("a[class!=eLink]")
- }
- function dhtml_CloseAllSubMenusL(pThis) {
- var l_Start = parseInt($x_UpTill(pThis, "UL").getAttribute("htmldb:listlevel"), 10) + 1;
- dhtml_CloseAllSubMenus(l_Start)
- }
- function app_AppMenuMultiClose() {
- if (gCurrentAppMenu) {
- var lMenu = $x(gCurrentAppMenu);
- gCurrentAppMenuImage.className = g_dhtmlMenu, $x_Hide(lMenu), gCurrentAppMenu = !1, gCurrentAppMenuImage = !1, $gCurrentAnchorList = !1
- }
- }
- function dhtml_DocMenuCheck(e) {
- for (var tPar = html_GetTarget(e), l_Test = !0;
- "BODY" != tPar.nodeName;) tPar = tPar.parentNode, $u_SubString(tPar.className, "dhtmlMenuLG") && (l_Test = !l_Test);
- l_Test && (app_AppMenuMultiClose(), dhtml_CloseAllSubMenus(), document.onclick = null)
- }
- function dhtml_ButtonDropDown(pThis, pThat, pDir, pX, pY) {
- dhtml_SingeMenuOpen(pThis, pThat, "Bottom", pX, pY)
- }
- function dhtml_KeyAction(pEvent, pEventNamespace) {
- var $lCurrentAnchor, lIndex;
- switch ($lCurrentAnchor = apex.jQuery(pEvent.target), lIndex = $gCurrentAnchorList.index($lCurrentAnchor), pEvent.which) {
- case 40:
- $gCurrentAnchorList.eq(lIndex + 1).focus();
- break;
- case 38:
- $gCurrentAnchorList.eq(lIndex - 1).focus();
- break;
- case 37:
- var $lParent = apex.jQuery("#" + gCurrentAppMenu + " a").filter(function() {
- return 1 == apex.jQuery(this).data("setParent")
- });
- $lParent.length > 0 && (dhtml_CloseAllSubMenusL($lParent[0]), $lParent.focus().data("setParent", !1));
- break;
- case 39:
- ($lCurrentAnchor.parent().hasClass("dhtmlSubMenuN") || $lCurrentAnchor.parent().hasClass("dhtmlSubMenuS")) && ($lCurrentAnchor.trigger("mouseover"), $gCurrentAnchorList[0].focus(), $lCurrentAnchor.data("setParent", !0));
- break;
- case 13:
- return
- }
- pEvent.preventDefault()
- }
- function dhtml_MenuOpen(pThis, pThat, pSub, pDir, pRoot) {
- var lNamespace;
- if ($x(pThat)) {
- if (lNamespace = "menu_keys_" + pThat, document.onclick = dhtml_DocMenuCheck, apex.jQuery(document).unbind("keydown." + lNamespace + "_esc").bind("keydown." + lNamespace + "_esc", function(event) {
- 27 === event.which && (app_AppMenuMultiClose(), dhtml_CloseAllSubMenus(), document.onclick = null, pRoot && apex.jQuery(pRoot).focus())
- }), pSub) {
- var l_Level = parseInt($x(pThat).getAttribute("htmldb:listlevel"), 10),
- l_Temp = gSubMenuArray[l_Level];
- l_Temp && $x_Hide(l_Temp), gSubMenuArray[l_Level] = $x(pThat)
- } else dhtml_CloseAllSubMenus(), gCurrentAppMenu = pThat;
- $gCurrentAnchorList = apex.jQuery("#" + pThat).children().children().filter("a[class!=eLink]"), apex.jQuery(document).unbind("keydown." + lNamespace).bind("keydown." + lNamespace, function(event) {
- var lKeyCodes = [40, 38, 37, 39, 13];
- apex.jQuery("#" + pThat + ":visible").filter("ul")[0] && -1 !== apex.jQuery.inArray(event.which, lKeyCodes) && dhtml_KeyAction(event, lNamespace)
- });
- var lMenu = $x(pThat);
- document.body.appendChild(lMenu), pDir && "Right" != pDir ? "Bottom" == pDir ? (lMenu.style.position = "absolute", lMenu.style.top = parseInt(findPosY(pThis), 10) + parseInt(pThis.offsetHeight, 10) + "px", lMenu.style.left = parseInt(findPosX(pThis), 10) + "px") : "BottomRight" == pDir ? (lMenu.style.position = "absolute", lMenu.style.top = parseInt(findPosY(pThis), 10) + parseInt(pThis.offsetHeight, 10) + "px", lMenu.style.left = parseInt(findPosX(pThis), 10) - parseInt(pThis.offsetWidth, 10) + "px") : (lMenu.style.position = "absolute", lMenu.style.top = parseInt(findPosY(pThis), 10) + "px", lMenu.style.left = parseInt(findPosX(pThis), 10) + parseInt(pThis.offsetWidth, 10) + "px") : (lMenu.style.position = "absolute", lMenu.style.top = parseInt(findPosY(pThis), 10) + "px", lMenu.style.left = parseInt(findPosX(pThis), 10) + "px"), $x_Show(lMenu), dhtml_FixLeft(pThis, lMenu, pDir), htmldb_IE_Select_Item_Fix(lMenu)
- }
- }
- function dhtml_DocMenuSingleCheck(e, force) {
- if (g_Single_Menu_Count > 0) {
- var l_Test = !0;
- if (e)
- for (var tPar = html_GetTarget(e);
- "BODY" != tPar.nodeName && !force;) tPar = tPar.parentNode, tPar == g_Single_Menu && (l_Test = !l_Test);
- (l_Test || force) && ($x_Hide(g_Single_Menu), document.onclick = null)
- } else g_Single_Menu_Count = 1
- }
- function dhtml_SingeMenuOpen(pThis, pThat, pDir, pX, pY) {
- var lMenu = $x(pThat),
- lThis = $x(pThis);
- lMenu.style.zIndex = 2001,
- document.body.appendChild(lMenu), pDir && "Right" != pDir ? "Bottom" == pDir ? (lMenu.style.position = "absolute", lMenu.style.top = parseInt(findPosY(lThis), 10) + parseInt(lThis.offsetHeight, 10) + "px", lMenu.style.left = parseInt(findPosX(lThis), 10) + "px") : "BottomRight" == pDir ? (lMenu.style.position = "absolute", lMenu.style.top = parseInt(findPosY(lThis), 10) + parseInt(lThis.offsetHeight, 10) + "px", lMenu.style.left = parseInt(findPosX(lThis), 10) - parseInt(lThis.offsetWidth, 10) + "px") : "Set" == pDir ? (lMenu.style.position = "absolute", lMenu.style.top = parseInt(pY, 10) + "px", lMenu.style.left = parseInt(pX, 10) + "px") : (lMenu.style.position = "absolute", lMenu.style.top = parseInt(findPosY(lThis), 10) + "px", lMenu.style.left = parseInt(findPosX(lThis), 10) + parseInt(lThis.offsetWidth, 10) + "px") : (lMenu.style.position = "absolute", lMenu.style.top = parseInt(findPosY(lThis), 10) + "px", lMenu.style.left = parseInt(findPosX(lThis), 10) + "px"), $x_Show(lMenu), dhtml_FixLeft(lThis, lMenu, pDir), htmldb_IE_Select_Item_Fix(!0), g_Single_Menu_Count = 0, g_Single_Menu = lMenu, document.onclick = dhtml_DocMenuSingleCheck
- }
- function dhtml_FixLeft(pThis, pMenu, pDir) {
- var l_Width;
- l_Width = document.all ? document.body.clientWidth : window.innerWidth, "Bottom" == pDir ? parseInt(l_Width, 10) < parseInt(findPosX(pThis), 10) + parseInt(pThis.offsetWidth, 10) + parseInt(pMenu.offsetWidth, 10) && (pMenu.style.position = "absolute", pMenu.style.left = parseInt(findPosX(pThis), 10) - parseInt(pMenu.offsetWidth, 10) + parseInt(pThis.offsetWidth, 10) + "px") : parseInt(l_Width, 10) < parseInt(findPosX(pThis), 10) + parseInt(pMenu.offsetWidth, 10) && (pMenu.style.position = "absolute", pMenu.style.left = parseInt(findPosX(pThis), 10) - parseInt(pMenu.offsetWidth, 10) + "px")
- }
- function htmldb_IE_Select_Item_Fix(pTest) {
- var lSel = document.getElementsByTagName("SELECT").length >= 1;
- document.all && pTest && lSel && pTest.firstChild && "IFRAME" != pTest.firstChild.nodeName && (pTest.innerHTML = '<iframe src="' + htmldb_Img_Dir + 'blank.html" width="' + pTest.offsetWidth + '" height="' + pTest.offsetHeight + '" style="z-index:-10;position: absolute;left: 0;top: 0;filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);" scrolling="no" frameborder="0"></iframe>' + pTest.innerHTML)
- }
- function app_AppMenuMultiOpenBottom(pThis, pThat, pSub) {
- $x(pThat);
- if (pThis != gCurrentAppMenuImage) {
- app_AppMenuMultiClose();
- var l_That = pThis.previousSibling.firstChild;
- pThis.className = g_dhtmlMenuOn, dhtml_MenuOpen(l_That, pThat, !1, "Bottom", pThis), gCurrentAppMenuImage = pThis
- } else dhtml_CloseAllSubMenus(), app_AppMenuMultiClose()
- }
- function app_AppMenuMultiOpenBottom2(pThis, pThat, pSub) {
- $x(pThat);
- if (pThis != gCurrentAppMenuImage) {
- app_AppMenuMultiClose();
- var l_That = pThis.parentNode;
- pThis.className = g_dhtmlMenuOn, dhtml_MenuOpen(l_That, pThat, !1, "Bottom", pThis), gCurrentAppMenuImage = pThis
- } else dhtml_CloseAllSubMenus(), app_AppMenuMultiClose()
- }
- function app_AppMenuMultiOpenBottom3(pThis, pThat, pMenu, pSub) {
- $x(pThat);
- if (pThis != gCurrentAppMenuImage) {
- app_AppMenuMultiClose();
- var l_That = $x(pMenu);
- pThis.className = g_dhtmlMenuOn, dhtml_MenuOpen(l_That, pThat, !1, "Bottom", pThis), gCurrentAppMenuImage = pThis
- } else dhtml_CloseAllSubMenus(), app_AppMenuMultiClose()
- }
- function $u_js_temp_drop() {
- var lTemp = apex.jQuery("#apex_js_temp_drop");
- return lTemp.length > 0 ? lTemp.empty() : lTemp = apex.jQuery('<div id="apex_js_temp_drop"></div>').prependTo(document.body).hide(), lTemp[0]
- }
- function $u_js_temp_clear() {
- var lThis = $x("apex_js_temp_drop");
- return lThis && (lThis.innerHTML = ""), lThis
- }
- function ie_RowFixStart(pThis) {
- if (document.all) {
- var l_Items = $x_FormItems(pThis, "checkbox");
- g_CheckedArray_IE = [];
- for (var i = 0, len = l_Items.length; len > i; i++) "checkbox" == l_Items[i].type && (g_CheckedArray_IE[i] = l_Items[i].checked)
- }
- }
- function ie_RowFixFinish(pThis) {
- if (document.all)
- for (var l_Items = $x_FormItems(pThis, "checkbox"), i = 0, len = l_Items.length; len > i; i++) "checkbox" == l_Items[i].type && (l_Items[i].checked = g_CheckedArray_IE[i])
- }
- function $tr_RowMoveFollow(pThis, pColorLastRow) {
- gLastRowHighlight && (pColorLastRow && gLastRowMoved && $x_RowHighlightOff(gLastRowMoved), $x_RowHighlight(pThis, gLastRowMovedColor)), gLastRowMoved = pThis
- }
- function html_RowUp(pThis, pColorLastRow) {
- var l_Row = $x_UpTill(pThis, "TR");
- ie_RowFixStart(l_Row), $tr_RowMoveFollow(l_Row, pColorLastRow);
- for (var l_Table = l_Row.parentNode, l_RowPrev = l_Row.previousSibling; l_RowPrev && 1 != l_RowPrev.nodeType;) l_RowPrev = l_RowPrev.previousSibling;
- return l_RowPrev && l_RowPrev.firstChild && "TH" != l_RowPrev.firstChild.nodeName && "TR" == l_RowPrev.nodeName ? oElement = l_Table.insertBefore(l_Row, l_RowPrev) : oElement = l_Table.appendChild(l_Row), ie_RowFixFinish(oElement), oElement
- }
- function html_RowDown(pThis, pColorLastRow) {
- var l_Row = $x_UpTill(pThis, "TR");
- ie_RowFixStart(l_Row), $tr_RowMoveFollow(l_Row, pColorLastRow);
- for (var l_Table = l_Row.parentNode, l_RowNext = l_Row.nextSibling; l_RowNext && 1 != l_RowNext.nodeType;) l_RowNext = l_RowNext.nextSibling;
- return l_RowNext && "TR" == l_RowNext.nodeName ? oElement = l_Table.insertBefore(l_Row, l_RowNext.nextSibling) : oElement = l_Table.insertBefore(l_Row, l_Table.getElementsByTagName("TR")[1]), ie_RowFixFinish(oElement), oElement
- }
- function toolTip_init() {
- return document && document.body ? (gToolTipContent = $x("gToolTipContent"), gToolTip = $x("dhtmltooltip"), gToolTip || (gToolTip = $dom_AddTag(document.body, "DIV"), gToolTip.id = "dhtmltooltip", gToolTip.className = "htmldbToolTip", gToolTip.style.position = "absolute", gToolTip.style.border = "1px solid black", gToolTip.style.padding = "2px", gToolTip.style.backgroundColor = "", gToolTip.style.visibility = "hidden", gToolTip.style.zIndex = 1e4), gToopTipPointer = $x("dhtmlpointer"), gToopTipPointer || (gToopTipPointer = $dom_AddTag(document.body, "IMG"), gToopTipPointer.id = "dhtmlpointer", gToopTipPointer.src = htmldb_Img_Dir + gToolTipGraphic, gToopTipPointer.style.position = "absolute", gToopTipPointer.style.zIndex = 10001), !0) : !1
- }
- function toolTip_disable() {
- toolTip_init() && (tt_target = null, gToolTip.style.visibility = "hidden", gToolTip.style.backgroundColor = "", gToolTip.style.width = "", gToopTipPointer.style.visibility = "hidden", gToolTipContent ? gToolTipContent.innerHTML = "" : gToolTip.innerHTML = "")
- }
- function toolTip_enable(evt, obj, tip, width, color) {
- evt = evt ? evt : window.event ? event : null;
- var target_x = evt.pageX ? evt.pageX : evt.clientX + getScrollXY()[0],
- target_y = evt.pageY ? evt.pageY : evt.clientY + getScrollXY()[1];
- if (toolTip_init()) {
- tt_target = obj, tip || (tip = obj.getAttribute("htmldb:tip")), gToolTipContent ? gToolTipContent.innerHTML = tip : gToolTip.innerHTML = tip, width && (gToolTip.style.width = width + "px"), color ? gToolTip.style.backgroundColor = color : gToolTip.style.backgroundColor = "lightyellow", gToopTipPointer.style.left = 10 + target_x + "px", gToopTipPointer.style.top = 15 + target_y + "px", gToolTip.style.left = 7 + target_x + "px", gToolTip.style.top = 28 + target_y + "px", gToolTip.style.visibility = "visible", gToolTip.style.zIndex = 1e4, gToopTipPointer.style.zIndex = 10001, gToopTipPointer.style.visibility = "visible";
- try {
- obj.addEventListener("mouseout", toolTip_disable, !1)
- } catch (e) {
- obj.attachEvent("onmouseout", toolTip_disable)
- }
- }
- return !1
- }
- function toolTip_follow(evt, obj) {
- evt = evt ? evt : window.event ? event : null;
- var target_x = evt.pageX ? evt.pageX : evt.clientX + getScrollXY()[0],
- target_y = evt.pageY ? evt.pageY : evt.clientY + getScrollXY()[1];
- return gToolTip && (gToolTip.style.left = 7 + target_x + "px", gToolTip.style.top = 28 + target_y + "px", gToolTip.style.visibility = "visible", gToolTip.style.zIndex = 1e4, gToopTipPointer.style.left = 10 + target_x + "px", gToopTipPointer.style.top = 15 + target_y + "px", gToopTipPointer.style.zIndex = 10001, gToopTipPointer.style.visibility = "visible"), !1
- }
- function dhtml_ShuttleObject(pThis, pThat) {
- this.Select1 = $x(pThis), this.Select2 = $x(pThat), this.Select1ArrayInit = this.Select1.cloneNode(!0), this.Select2ArrayInit = this.Select2.cloneNode(!0), this.Op1Init = [], this.Op2Init = [], this.Op1Init = this.Select1ArrayInit.options, this.Op2Init = this.Select2ArrayInit.options, this.move = function() {
- var l_A = $f_SelectedOptions(this.Select1);
- $x(l_A) && (l_A = [l_A]);
- for (var l_AL = l_A.length, i = 0; l_AL > i; i++) this.Select2.appendChild(l_A[i])
- }, this.remove = function() {
- var l_A = $f_SelectedOptions(this.Select2);
- $x(l_A) && (l_A = [l_A]);
- for (var l_AL = l_A.length, i = 0; l_AL > i; i++) this.Select1.appendChild(l_A[i])
- }, this.reset = function() {
- this.Select1.options.length = 0, this.Select2.options.length = 0;
- for (var L_Count1 = this.Op1Init.length, i = 0; L_Count1 > i; i++) this.Select1.options[i] = new Option(this.Op1Init[i].text, this.Op1Init[i].value);
- for (var L_Count2 = this.Op2Init.length, i2 = 0; L_Count2 > i2; i2++) this.Select2.options[i2] = new Option(this.Op2Init[i2].text, this.Op2Init[i2].value)
- }, this.move_all = function() {
- for (var i = 0, len = this.Select1.options.length; len > i; i++) this.Select1.options[i].selected = !0;
- this.move()
- }, this.remove_all = function() {
- for (var i = 0, len = this.Select2.options.length; len > i; i++) this.Select2.options[i].selected = !0;
- this.remove()
- }, this.sort = function(pShuttle, pDir) {
- var i, lLength = pShuttle.options.length;
- if ("U" == pDir)
- for (i = 0; lLength > i; i++) pShuttle.options[i].selected && "U" == pDir && i && pShuttle.insertBefore(pShuttle.options[i], pShuttle.options[i - 1]);
- else if ("D" == pDir)
- for (i = lLength - 1; i >= 0; i--) pShuttle.options[i].selected && "D" == pDir && i != lLength - 1 && pShuttle.insertBefore(pShuttle.options[i], pShuttle.options[i + 2]);
- else {
- var l_Opt = [];
- for (i = 0; lLength > i; i++) pShuttle.options[i].selected && (l_Opt[l_Opt.length] = pShuttle.options[i]);
- if ("B" == pDir)
- for (i = 0; i < l_Opt.length; i++) pShuttle.appendChild(l_Opt[i]);
- else if ("T" == pDir)
- for (i = l_Opt.length - 1; i >= 0; i--) pShuttle.insertBefore(l_Opt[i], pShuttle.firstChild)
- }
- }, this.sort1 = function(pDir) {
- this.sort(this.Select1, pDir)
- }, this.sort2 = function(pDir) {
- this.sort(this.Select2, pDir)
- }
- }
- function hideShow(objectID, imgID, showImg, hideImg) {
- var theImg = $x(imgID),
- theDiv = $x(objectID);
- "none" == theDiv.style.display || "" == theDiv.style.display || null == theDiv.style ? (theImg.src = hideImg, $x(objectID).style.display = "block") : (theImg.src = showImg, $x(objectID).style.display = "none")
- }(null === apex.spreadsheet || "object" != typeof apex.spreadsheet) && (apex.spreadsheet = {}), (null === apex.items || "object" != typeof apex.items) && (apex.items = {}), (null === apex.ajax || "object" != typeof apex.ajax) && (apex.ajax = {}), (null === apex.dhtml || "object" != typeof apex.dhtml) && (apex.dhtml = {}), (null === apex.worksheet || "object" != typeof apex.worksheet) && (apex.worksheet = {}), apex.ajax = {
- clob: function(pReturn) {
- function _get(pValue) {
- that.ajax.addParam("x05", "GET"), that.ajax.GetAsync(that._return)
- }
- function _set(pValue) {
- that.ajax.addParam("x05", "SET"), that.ajax.AddArrayClob(pValue, 1), that.ajax.GetAsync(that._return)
- }
- function _return() {
- if (1 == p.readyState);
- else if (2 == p.readyState);
- else if (3 != p.readyState) return 4 == p.readyState ? p : !1
- }
- var that = this;
- this.ajax = new htmldb_Get(null, $x("pFlowId").value, "APXWGT", 0), this.ajax.addParam("p_widget_name", "apex_utility"), this.ajax.addParam("x04", "CLOB_CONTENT"), this._get = _get, this._set = _set, this._return = pReturn ? pReturn : _return
- },
- test: function(pReturn) {
- function _get(pValue) {
- that.ajax.GetAsync(that._return)
- }
- function _set(pValue) {}
- function _return(pValue) {}
- var that = this;
- this.ajax = new htmldb_Get(null, $x("pFlowId").value, "APXWGT", 0), this.ajax.addParam("p_widget_name", "apex_utility"), this._get = _get, this._set = _set, this._return = pReturn ? pReturn : _return
- },
- widget: function(pWidget, pReturn) {
- function _get(pValue) {
- that.ajax.GetAsync(that._return)
- }
- function _set(pValue) {}
- function _return(pValue) {}
- var that = this;
- this.ajax = new htmldb_Get(null, $x("pFlowId").value, "APXWGT", 0), this.ajax.addParam("p_widget_name", pWidget), this._get = _get, this._set = _set, this._return = pReturn ? pReturn : _return
- },
- ondemand: function(pWidget, pReturn) {
- function _get(pValue) {
- that.ajax.GetAsync(that._return)
- }
- function _set(pValue) {}
- function _return(pValue) {}
- var that = this;
- this.ajax = new htmldb_Get(null, $x("pFlowId").value, "APPLICATION_PROCESS=" + pWidget, 0), this._get = _get, this._set = _set, this._return = pReturn ? pReturn : _return
- },
- url: function(pUrl, pReturn) {
- function _get(pValue) {
- that.ajax.GetAsync(that._return)
- }
- function _set(pValue) {}
- function _return(pValue) {}
- var that = this;
- this.ajax = new htmldb_Get(null, null, null, null, null, "f", pUrl), this._get = _get, this._set = _set, this._return = pReturn ? pReturn : _return
- }
- };
- var gResult = null,
- gNode = null;
- htmldb_Get.prototype.GetAsync = function(pCallback) {
- var lRequest;
- try {
- lRequest = new XMLHttpRequest
- } catch (e) {
- lRequest = new ActiveXObject("Msxml2.XMLHTTP")
- }
- try {
- new Date;
- if (lRequest.open("POST", this.base, !0), lRequest) return lRequest.onreadystatechange = function() {
- p = lRequest, pCallback(lRequest)
- }, lRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), lRequest.send(null == this.queryString ? this.params : this.queryString), lRequest
- } catch (e) {
- return !1
- }
- }, htmldb_Get.prototype.AddArray = function(pArray, pFnumber) {
- var lFName = "f";
- pFnumber = $nvl(pFnumber, 1), lFName += 10 > pFnumber ? "0" + pFnumber : pFnumber;
- for (var i = 0, len = pArray.length; len > i; i++) this.addParam(lFName, pArray[i]);
- return this
- }, htmldb_Get.prototype.AddArrayItems = function(pArray, pFnumber) {
- var lFName = "f";
- pFnumber = $nvl(pFnumber, 1), lFName += 10 > pFnumber ? "0" + pFnumber : pFnumber;
- for (var i = 0, len = pArray.length; len > i; i++) this.addParam(lFName, $nvl($v(pArray[i])), "");
- return this
- }, htmldb_Get.prototype.AddNameValue = function(pName, pValue, pFnumber) {
- var lFName = "f",
- lFName2 = "f";
- return pFnumber = $nvl(pFnumber, 1), pFnumber2 = pFnumber + 1, lFName += 10 > pFnumber ? "0" + pFnumber : pFnumber, lFName2 += pFnumber2 < 10 ? "0" + pFnumber2 : pFnumber2, this.addParam(lFName, pName), this.addParam(lFName2, $nvl(pValue), ""), this
- }, htmldb_Get.prototype.AddArrayItems2 = function(pArray, pFnumber, pKey) {
- var lFName = "f",
- lFName2 = "f";
- pFnumber = $nvl(pFnumber, 1), pFnumber2 = pFnumber + 1, lFName += 10 > pFnumber ? "0" + pFnumber : pFnumber, lFName2 += pFnumber2 < 10 ? "0" + pFnumber2 : pFnumber2;
- for (var i = 0, len = pArray.length; len > i; i++) {
- var lTest = $x(pArray[i]);
- lTest && 0 != lTest.id.length && (pKey ? this.addParam(lFName, apex.jQuery(lTest).attr(pKey)) : this.addParam(lFName, lTest.id))
- }
- for (var i = 0, len = pArray.length; len > i; i++) {
- var lTest = $x(pArray[i]);
- lTest && 0 != lTest.id.length && this.addParam(lFName2, $nvl($v(lTest)), "")
- }
- return this
- }, htmldb_Get.prototype.AddArrayClob = function(pText, pFnumber) {
- var lArray = $s_Split(pText, 4e3);
- return this.AddArray(lArray, pFnumber), this
- }, htmldb_Get.prototype.AddPageItems = function(pArray) {
- for (var i = 0, len = pArray.length; len > i; i++) $x(pArray[i]) && this.add($x(pArray[i]).id, $v(pArray[i]))
- }, htmldb_Get.prototype.AddGlobals = function(p_widget_mod, p_widget_action, p_widget_action_mod, p_widget_num_return, x01, x02, x03, x04, x05, x06, x07, x08, x09, x10) {
- return this.addParam("p_widget_mod", p_widget_mod), this.addParam("p_widget_action", p_widget_action), this.addParam("p_widget_action_mod", p_widget_action_mod), this.addParam("p_widget_num_return", p_widget_num_return), this.addParam("x01", x01), this.addParam("x02", x02), this.addParam("x03", x03), this.addParam("x04", x04), this.addParam("x05", x05), this.addParam("x06", x06), this.addParam("x07", x07), this.addParam("x08", x08), this.addParam("x09", x09), this.addParam("x10", x10), this
- };
- var gDebug = !0,
- gkeyPressTime, gLastTab = !1,
- gRegex = !1,
- ie = document.all ? !0 : !1;
- ie && (document.expando = !0);
- var gDebugWindow = !1;
- $item = $x_object;
- var gToggleWithImageA = "pseudoButtonActive",
- gToggleWithImageI = "pseudoButtonInactive",
- gCurrentRow = !1,
- htmldb_ch = !1,
- gChangeCheck = !1,
- gCurrentAppMenu = !1,
- gCurrentAppMenuImage = !1,
- $gCurrentAnchorList = !1,
- gSubMenuArray = [],
- g_Single_Menu = !1,
- g_Single_Menu_Count = 0,
- g_dhtmlMenu = "dhtmlMenu",
- g_dhtmlMenuOn = "dhtmlMenuOn",
- g_CheckedArray_IE, gLastRowMoved = null,
- gLastRowMovedColor = "#CCCCCC",
- gLastRowHighlight = !0,
- tt_target, gToolTipGraphic = "arrow2.gif",
- gToolTip = !1,
- gToopTipPointer = !1,
- gToolTipContent = !1;
- apex.security = {},
- function(security, $, undefined) {
- "use strict";
- security.framebreaker = function(pMode) {
- self != top && (null == pMode || "D" === pMode || "S" === pMode && top.location.host != self.location.host) ? (document.documentElement.style.visibility = "hidden", $(function() {
- document.write("X")
- }), top.location = self.location) : document.documentElement.style.visibility = "visible"
- }
- }(apex.security, apex.jQuery);
- apex.widget = {
- waitPopup: function(pContent) {
- var lWaitPopup$, lPopup$, lSpinner;
- return pContent ? (lWaitPopup$ = apex.jQuery('<div id="apex_wait_popup" class="apex_wait_popup"></div><div id="apex_wait_overlay" class="apex_wait_overlay"></div>').prependTo("body"), lPopup$ = lWaitPopup$.first(), pContent.indexOf("<img") >= 0 && lPopup$.hide(), window.setTimeout(function() {
- lPopup$.html(pContent).find("img").hide().on("load", function() {
- $(this).show(), lPopup$.show()
- })
- }, 10)) : (lWaitPopup$ = apex.jQuery('<div id="apex_wait_overlay" class="apex_wait_overlay"></div>').prependTo("body"), window.setTimeout(function() {
- void 0 !== lWaitPopup$ && (lSpinner = apex.util.showSpinner())
- }, 10), lWaitPopup$.css("visibility", "visible")), {
- remove: function() {
- void 0 !== lSpinner && lSpinner.remove(), lWaitPopup$.remove(), lWaitPopup$ = void 0
- }
- }
- }
- }, apex.widget.initPageItem = function(pName, pOptions) {
- apex.item(pName, pOptions)
- }, apex.widget.textareaClob = {
- upload: function(pItemName, pRequest) {
- var lClob = new apex.ajax.clob(function() {
- if (1 === p.readyState);
- else if (2 === p.readyState);
- else if (3 === p.readyState);
- else {
- if (4 !== p.readyState) return !1;
- $s(pItemName, ""), apex.submit(pRequest)
- }
- });
- lClob._set($v(pItemName))
- }
- };
- apex.widget.util = {},
- function(util, $) {
- util.cascadingLov = function(pList, pAjaxIdentifier, pData, pOptions) {
- var lList$ = $(pList, apex.gPageContext$),
- lQueueName = lList$[0] ? lList$[0].id : "lov",
- lOptions = $.extend({
- optimizeRefresh: !0,
- queue: {
- name: lQueueName,
- action: "replace"
- }
- }, pOptions),
- lNullFound = !1;
- return lOptions.refreshObject || (lOptions.refreshObject = lList$), lOptions.loadingIndicator || (lOptions.loadingIndicator = lList$), lOptions.optimizeRefresh && ($(lOptions.dependingOn, apex.gPageContext$).each(function() {
- return apex.item(this).isEmpty() ? (lNullFound = !0, !1) : void 0
- }), lNullFound) ? (lOptions.refreshObject.trigger("apexbeforerefresh"), $.isFunction(lOptions.clear) && lOptions.clear(), lList$.change(), void lOptions.refreshObject.trigger("apexafterrefresh")) : (pData.pageItems = $(pData.pageItems, apex.gPageContext$).add(lOptions.dependingOn), apex.server.plugin(pAjaxIdentifier, pData, lOptions))
- }, util.callPopupLov = function(pAjaxIdentifier, pData, pOptions) {
- var lUrl, lWindow, lData = pData || {},
- lOptions = pOptions || {};
- return lOptions.filterOutput && (lData.x02 = lOptions.filterValue), lUrl = apex.server.pluginUrl(pAjaxIdentifier, lData), lWindow = window.open(lUrl, "winLovList_" + $v("pInstance"), lOptions.windowParameters), null === lWindow.opener && (lWindow.opener = self), lWindow.focus(), !1
- }, util.enableIcon = function($pContainer, pHref, pClickHandler) {
- $pContainer.find("img").css({
- opacity: 1,
- cursor: ""
- }).parent("a").attr("href", pHref), pClickHandler && $pContainer.click(pClickHandler)
- }, util.disableIcon = function($pContainer) {
- $pContainer.find("img").css({
- opacity: .5,
- cursor: "default"
- }).parent("a").removeAttr("href").unbind("click")
- }
- }(apex.widget.util, apex.jQuery);
- apex.da = {},
- function(da, $, event, util, undefined) {
- "use strict";
- da.gEventList = [], da.gCancelActions = !1, da.init = function() {
- $(da.gEventList).each(function() {
- var lDefaults, lEvent, lSelector, lLiveSelector$;
- lDefaults = {
- name: null,
- bindDelegateTo: null
- }, lEvent = $.extend(lDefaults, this), lSelector = da.constructSelector({
- elementType: lEvent.triggeringElementType,
- element: lEvent.triggeringElement,
- regionId: lEvent.triggeringRegionId,
- buttonId: lEvent.triggeringButtonId
- }), -1 === $.inArray(lEvent.bindEventType, ["ready", "pageinit"]) && ("bind" === lEvent.bindType ? $(lSelector, apex.gPageContext$).on(lEvent.bindEventType, function(pBrowserEvent, pData) {
- da.actions(this, lEvent, pBrowserEvent, pData)
- }) : "live" === lEvent.bindType ? (lLiveSelector$ = lEvent.bindDelegateTo ? $(lEvent.bindDelegateTo, apex.gPageContext$) : apex.gPageContext$, lLiveSelector$.on(lEvent.bindEventType, lSelector, function(pBrowserEvent, pData) {
- da.actions(this, lEvent, pBrowserEvent, pData)
- })) : "one" === lEvent.bindType && $(lSelector, apex.gPageContext$).one(lEvent.bindEventType, function(pBrowserEvent, pData) {
- da.actions(this, lEvent, pBrowserEvent, pData)
- })), da.actions(lSelector, lEvent, "load")
- })
- }, da.constructSelector = function(pOptions) {
- var lLen, lDefaults, lOptions, lSelector = "";
- switch (lDefaults = {
- elementType: null,
- element: null,
- regionId: null,
- buttonId: null,
- triggeringElement: null,
- eventTarget: null
- }, lOptions = $.extend(lDefaults, pOptions), lOptions.elementType) {
- case "ITEM":
- lSelector = "#" + lOptions.element.replace(/,/g, ",#");
- break;
- case "REGION":
- lSelector = "#" + util.escapeCSS(lOptions.regionId);
- break;
- case "BUTTON":
- lSelector = "#" + util.escapeCSS(lOptions.buttonId);
- break;
- case "JAVASCRIPT_EXPRESSION":
- lSelector = lOptions.element();
- break;
- case "DOM_OBJECT":
- apex.debug.deprecated("DOM Object selector"), lSelector = "#" + lOptions.element.replace(/,/g, ",#");
- try {
- lLen = $(lSelector, apex.gPageContext$).length
- } catch (ex) {
- lLen = 0
- }
- if (0 === lLen) try {
- lSelector = eval(lOptions.element)
- } catch (err) {
- lSelector = lOptions.element
- }
- break;
- case "JQUERY_SELECTOR":
- lSelector = lOptions.element;
- break;
- case "TRIGGERING_ELEMENT":
- lSelector = lOptions.triggeringElement;
- break;
- case "EVENT_SOURCE":
- lSelector = lOptions.eventTarget;
- break;
- default:
- lSelector = apex.gPageContext$
- }
- return "#" === lSelector && (lSelector = undefined), lSelector
- }, da.doAction = function(pTriggeringElement, pSelector, pAction, pBrowserEvent, pData, pDynamicActionName, pResumeCallback) {
- var lContext = {
- triggeringElement: pTriggeringElement,
- affectedElements: $(pSelector, apex.gPageContext$),
- action: pAction,
- browserEvent: pBrowserEvent,
- data: pData,
- resumeCallback: pResumeCallback
- };
- return pAction.javascriptFunction ? (apex.debug.log("Dynamic Action Fired: " + pDynamicActionName + " (" + pAction.action + ")", lContext), pAction.javascriptFunction.call(lContext)) : void 0
- }, da.doActions = function(pEvent, pStartWithAction, pBrowserEvent, pData, pConditionResult, pTriggeringElement) {
- for (var lActionCount = pEvent.actionList.length, lActionIterator = pStartWithAction; lActionCount > lActionIterator; lActionIterator++) {
- var lDefaults, lAction, lSelector, lWaitCallback;
- if (da.gCancelActions) return !1;
- if (lDefaults = {
- eventResult: null,
- executeOnPageInit: !1,
- stopExecutionOnError: !0,
- action: null,
- affectedElementsType: null,
- affectedRegionId: null,
- affectedElements: null,
- javascriptFunction: null,
- ajaxIdentifier: null,
- attribute01: null,
- attribute02: null,
- attribute03: null,
- attribute04: null,
- attribute05: null,
- attribute06: null,
- attribute07: null,
- attribute08: null,
- attribute09: null,
- attribute10: null,
- attribute11: null,
- attribute12: null,
- attribute13: null,
- attribute14: null,
- attribute15: null
- }, lAction = $.extend(lDefaults, pEvent.actionList[lActionIterator]), ("load" !== pBrowserEvent || "load" === pBrowserEvent && (lAction.executeOnPageInit || -1 !== $.inArray(pEvent.bindEventType, ["ready", "pageinit"]))) && lAction.eventResult === pConditionResult && (lSelector = da.constructSelector({
- elementType: lAction.affectedElementsType,
- element: lAction.affectedElements,
- regionId: lAction.affectedRegionId,
- buttonId: lAction.affectedButtonId,
- triggeringElement: pTriggeringElement,
- eventTarget: pBrowserEvent.target
- }), lAction.waitForResult && (lWaitCallback = function(pErrorOccurred) {
- da.gCancelActions = lAction.stopExecutionOnError && pErrorOccurred, da.doActions(pEvent, lActionIterator + 1, pBrowserEvent, pData, pConditionResult, pTriggeringElement)
- }), da.doAction(pTriggeringElement, lSelector, lAction, pBrowserEvent, pData, pEvent.name, lWaitCallback) === !1 && lAction.stopExecutionOnError && (da.gCancelActions = !0), lAction.waitForResult)) return !1
- }
- }, da.actions = function(pSelector, pEvent, pBrowserEvent, pData) {
- function _getConditionResult(pElement) {
- var lConditionResult, lExpressionArray, lContext, lApexItem = apex.item(pElement.id),
- lValue = lApexItem.getValue();
- switch (pEvent.triggeringConditionType) {
- case "EQUALS":
- $.isArray(lValue) ? (lConditionResult = !1, $.each(lValue, function(index, value) {
- return lConditionResult = value === pEvent.triggeringExpression, lConditionResult ? !1 : void 0
- })) : lConditionResult = lValue === pEvent.triggeringExpression;
- break;
- case "NOT_EQUALS":
- $.isArray(lValue) ? (lConditionResult = !0, $.each(lValue, function(index, value) {
- return lConditionResult = value !== pEvent.triggeringExpression, lConditionResult ? void 0 : !1
- })) : lConditionResult = lValue !== pEvent.triggeringExpression;
- break;
- case "IN_LIST":
- lExpressionArray = pEvent.triggeringExpression.split(","), $.isArray(lValue) ? (lConditionResult = !1, $.each(lValue, function(index, value) {
- return lConditionResult = -1 !== $.inArray(value, lExpressionArray), lConditionResult ? !1 : void 0
- })) : lConditionResult = -1 !== $.inArray(lValue, lExpressionArray);
- break;
- case "NOT_IN_LIST":
- lExpressionArray = pEvent.triggeringExpression.split(","), $.isArray(lValue) ? (lConditionResult = !0, $.each(lValue, function(index, value) {
- return lConditionResult = -1 === $.inArray(value, lExpressionArray), lConditionResult ? void 0 : !1
- })) : lConditionResult = -1 === $.inArray(lValue, lExpressionArray);
- break;
- case "GREATER_THAN":
- $.isArray(lValue) ? (lConditionResult = !0, $.each(lValue, function(index, value) {
- return lConditionResult = value > parseFloat(pEvent.triggeringExpression, 10), lConditionResult ? void 0 : !1
- })) : lConditionResult = lValue > parseFloat(pEvent.triggeringExpression, 10);
- break;
- case "GREATER_THAN_OR_EQUAL":
- $.isArray(lValue) ? (lConditionResult = !0, $.each(lValue, function(index, value) {
- return lConditionResult = value >= parseFloat(pEvent.triggeringExpression, 10), lConditionResult ? void 0 : !1
- })) : lConditionResult = lValue >= parseFloat(pEvent.triggeringExpression, 10);
- break;
- case "LESS_THAN":
- $.isArray(lValue) ? (lConditionResult = !0, $.each(lValue, function(index, value) {
- return lConditionResult = value < parseFloat(pEvent.triggeringExpression, 10), lConditionResult ? void 0 : !1
- })) : lConditionResult = lValue < parseFloat(pEvent.triggeringExpression, 10);
- break;
- case "LESS_THAN_OR_EQUAL":
- $.isArray(lValue) ? (lConditionResult = !0, $.each(lValue, function(index, value) {
- return lConditionResult = value <= parseFloat(pEvent.triggeringExpression, 10), lConditionResult ? void 0 : !1
- })) : lConditionResult = lValue <= parseFloat(pEvent.triggeringExpression, 10);
- break;
- case "NULL":
- lConditionResult = lApexItem.isEmpty();
- break;
- case "NOT_NULL":
- lConditionResult = !lApexItem.isEmpty();
- break;
- case "JAVASCRIPT_EXPRESSION":
- lContext = {
- triggeringElement: pElement,
- browserEvent: pBrowserEvent,
- data: pData
- }, lConditionResult = pEvent.triggeringExpression.call(lContext);
- break;
- default:
- lConditionResult = !0
- }
- return lConditionResult
- }
- event.gCancelFlag = !1, da.gCancelActions = !1, $(pSelector, apex.gPageContext$).each(function() {
- da.doActions(pEvent, 0, pBrowserEvent, pData, _getConditionResult(this), this), da.gCancelActions = !1
- })
- }, da.resume = function(pCallback, pErrorOccurred) {
- $.isFunction(pCallback) && pCallback(pErrorOccurred)
- }, da.handleAjaxErrors = function(pjqXHR, pTextStatus, pErrorThrown, pResumeCallback) {
- var lMsg;
- 0 !== pjqXHR.status && (lMsg = "APEX" === pTextStatus ? pErrorThrown : "Error: " + pTextStatus + " - " + pErrorThrown, $.isFunction(window.onerror) ? window.onerror(lMsg, null, null) : window.alert(lMsg)), da.resume(pResumeCallback, !0)
- }
- }(apex.da, apex.jQuery, apex.event, apex.util);
- ! function(da, server, item, $) {
- "use strict";
- da.show = function() {
- var lShowRow;
- this.affectedElements && (lShowRow = "Y" === this.action.attribute01, this.affectedElements.each(function() {
- item(this).show(lShowRow)
- }))
- }, da.hide = function() {
- var lHideRow;
- this.affectedElements && (lHideRow = "Y" === this.action.attribute01, this.affectedElements.each(function() {
- item(this).hide(lHideRow)
- }))
- }, da.enable = function() {
- this.affectedElements && this.affectedElements.each(function() {
- item(this).enable()
- })
- }, da.disable = function() {
- this.affectedElements && this.affectedElements.each(function() {
- item(this).disable()
- })
- }, da.setValue = function() {
- function _setValue(pValue) {
- lAffectedElements$.each(function(i) {
- $s(this, pValue, null, lSuppressChangeEvent)
- }), da.resume(lResumeCallback, !1)
- }
- function _clear() {
- lAsync && lAffectedElements$.each(function() {
- $s(this, "", null, !0)
- })
- }
- function _success(pData) {
- var lAffectedElementArray, lValue;
- if ("SQL_STATEMENT" === lSetType)
- if ("ITEM" === lAction.affectedElementsType) {
- lAffectedElementArray = lAction.affectedElements.split(",");
- for (var i = 0, len = lAffectedElementArray.length; len > i; i++) lValue = "undefined" != typeof pData.values[i] ? pData.values[i] : "", $s(lAffectedElementArray[i], lValue, null, lSuppressChangeEvent);
- da.resume(lResumeCallback, !1)
- } else _setValue(pData.values[0]);
- else _setValue(pData.value)
- }
- function _error(pjqXHR, pTextStatus, pErrorThrown) {
- da.handleAjaxErrors(pjqXHR, pTextStatus, pErrorThrown, lResumeCallback)
- }
- var lAction = this.action,
- lSetType = lAction.attribute01,
- lStaticAssignment = lAction.attribute02,
- lPageItemsToSubmit = lAction.attribute04,
- lJavaScriptExpression = lAction.attribute05,
- lSuppressChangeEvent = "Y" === lAction.attribute09,
- lDialogReturnItem = lAction.attribute10,
- lAsync = !lAction.waitForResult,
- lAffectedElements$ = this.affectedElements,
- lResumeCallback = this.resumeCallback;
- "STATIC_ASSIGNMENT" === lSetType ? _setValue(lStaticAssignment) : "SQL_STATEMENT" === lSetType || "PLSQL_EXPRESSION" === lSetType || "FUNCTION_BODY" === lSetType ? server.plugin(lAction.ajaxIdentifier, {
- pageItems: lPageItemsToSubmit
- }, {
- loadingIndicator: lAffectedElements$,
- clear: _clear,
- success: _success,
- error: _error,
- async: lAsync
- }) : "JAVASCRIPT_EXPRESSION" === lSetType ? _setValue(lJavaScriptExpression.call(this)) : "DIALOG_RETURN_ITEM" === lSetType && _setValue(this.data[lDialogReturnItem])
- }, da.executePlSqlCode = function() {
- function _clear() {
- lAsync && $(lPageItemsToReturn, apex.gPageContext$).each(function() {
- $s(this, "", null, !0)
- })
- }
- function _success(pData) {
- var lItemCount, lItemArray;
- if (pData && pData.item) {
- lItemCount = pData.item.length, lItemArray = pData.item;
- for (var lItemIterator = 0; lItemCount > lItemIterator; lItemIterator++) $s(lItemArray[lItemIterator].id, lItemArray[lItemIterator].value, null, lSuppressChangeEvent)
- }
- da.resume(lResumeCallback, !1)
- }
- function _error(pjqXHR, pTextStatus, pErrorThrown) {
- da.handleAjaxErrors(pjqXHR, pTextStatus, pErrorThrown, lResumeCallback)
- }
- var lAction = this.action,
- lPageItemsToSubmit = lAction.attribute01,
- lPageItemsToReturn = lAction.attribute02,
- lSuppressChangeEvent = "Y" === lAction.attribute04,
- lAsync = !lAction.waitForResult,
- lResumeCallback = this.resumeCallback;
- server.plugin(lAction.ajaxIdentifier, {
- pageItems: lPageItemsToSubmit
- }, {
- dataType: lPageItemsToReturn ? "json" : "",
- loadingIndicator: lPageItemsToReturn,
- clear: _clear,
- success: _success,
- error: _error,
- async: lAsync
- })
- }, da.clear = function() {
- this.affectedElements && this.affectedElements.each(function() {
- $s(this, "", "")
- })
- }, da.addClass = function() {
- this.affectedElements && this.affectedElements.addClass(this.action.attribute01)
- }, da.removeClass = function() {
- this.affectedElements && (this.action.attribute01 ? this.affectedElements.removeClass(this.action.attribute01) : this.affectedElements.removeClass())
- }, da.setCSS = function() {
- var lAction = this.action;
- this.affectedElements.each(function() {
- item(this).setStyle(lAction.attribute01, lAction.attribute02)
- })
- }, da.setFocus = function() {
- this.affectedElements.each(function() {
- item(this).setFocus()
- })
- }, da.submitPage = function() {
- var lAction = this.action,
- lRequest = lAction.attribute01,
- lShowProcessing = "Y" === lAction.attribute02;
- apex.submit({
- request: lRequest,
- showWait: lShowProcessing
- })
- }, da.refresh = function() {
- this.affectedElements && this.affectedElements.trigger("apexrefresh")
- }, da.cancelEvent = function() {
- apex.event.gCancelFlag = !0, da.gCancelActions = !0, this.browserEvent.stopImmediatePropagation(), this.browserEvent.preventDefault()
- }, da.showAlert = function() {
- window.alert(this.action.attribute01)
- }, da.askConfirm = function() {
- confirm(this.action.attribute01) || (apex.event.gCancelFlag = !0, da.gCancelActions = !0)
- }
- }(apex.da, apex.server, apex.item, apex.jQuery);
- /*! jQuery UI - v1.10.4 - 2014-10-15
- * http://jqueryui.com
- * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.resizable.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-drop.js
- * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
- (function(e, t) {
- function i(t, i) {
- var a, n, r, o = t.nodeName.toLowerCase();
- return "area" === o ? (a = t.parentNode, n = a.name, t.href && n && "map" === a.nodeName.toLowerCase() ? (r = e("img[usemap=#" + n + "]")[0], !!r && s(r)) : !1) : (/input|select|textarea|button|object/.test(o) ? !t.disabled : "a" === o ? t.href || i : i) && s(t)
- }
- function s(t) {
- return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function() {
- return "hidden" === e.css(this, "visibility")
- }).length
- }
- var a = 0,
- n = /^ui-id-\d+$/;
- e.ui = e.ui || {}, e.extend(e.ui, {
- version: "1.10.4",
- keyCode: {
- BACKSPACE: 8,
- COMMA: 188,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- LEFT: 37,
- NUMPAD_ADD: 107,
- NUMPAD_DECIMAL: 110,
- NUMPAD_DIVIDE: 111,
- NUMPAD_ENTER: 108,
- NUMPAD_MULTIPLY: 106,
- NUMPAD_SUBTRACT: 109,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SPACE: 32,
- TAB: 9,
- UP: 38
- }
- }), e.fn.extend({
- focus: function(t) {
- return function(i, s) {
- return "number" == typeof i ? this.each(function() {
- var t = this;
- setTimeout(function() {
- e(t).focus(), s && s.call(t)
- }, i)
- }) : t.apply(this, arguments)
- }
- }(e.fn.focus),
- scrollParent: function() {
- var t;
- return t = e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function() {
- return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
- }).eq(0) : this.parents().filter(function() {
- return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
- }).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t
- },
- zIndex: function(i) {
- if (i !== t) return this.css("zIndex", i);
- if (this.length)
- for (var s, a, n = e(this[0]); n.length && n[0] !== document;) {
- if (s = n.css("position"), ("absolute" === s || "relative" === s || "fixed" === s) && (a = parseInt(n.css("zIndex"), 10), !isNaN(a) && 0 !== a)) return a;
- n = n.parent()
- }
- return 0
- },
- uniqueId: function() {
- return this.each(function() {
- this.id || (this.id = "ui-id-" + ++a)
- })
- },
- removeUniqueId: function() {
- return this.each(function() {
- n.test(this.id) && e(this).removeAttr("id")
- })
- }
- }), e.extend(e.expr[":"], {
- data: e.expr.createPseudo ? e.expr.createPseudo(function(t) {
- return function(i) {
- return !!e.data(i, t)
- }
- }) : function(t, i, s) {
- return !!e.data(t, s[3])
- },
- focusable: function(t) {
- return i(t, !isNaN(e.attr(t, "tabindex")))
- },
- tabbable: function(t) {
- var s = e.attr(t, "tabindex"),
- a = isNaN(s);
- return (a || s >= 0) && i(t, !a)
- }
- }), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function(i, s) {
- function a(t, i, s, a) {
- return e.each(n, function() {
- i -= parseFloat(e.css(t, "padding" + this)) || 0, s && (i -= parseFloat(e.css(t, "border" + this + "Width")) || 0), a && (i -= parseFloat(e.css(t, "margin" + this)) || 0)
- }), i
- }
- var n = "Width" === s ? ["Left", "Right"] : ["Top", "Bottom"],
- r = s.toLowerCase(),
- o = {
- innerWidth: e.fn.innerWidth,
- innerHeight: e.fn.innerHeight,
- outerWidth: e.fn.outerWidth,
- outerHeight: e.fn.outerHeight
- };
- e.fn["inner" + s] = function(i) {
- return i === t ? o["inner" + s].call(this) : this.each(function() {
- e(this).css(r, a(this, i) + "px")
- })
- }, e.fn["outer" + s] = function(t, i) {
- return "number" != typeof t ? o["outer" + s].call(this, t) : this.each(function() {
- e(this).css(r, a(this, t, !0, i) + "px")
- })
- }
- }), e.fn.addBack || (e.fn.addBack = function(e) {
- return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
- }), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function(t) {
- return function(i) {
- return arguments.length ? t.call(this, e.camelCase(i)) : t.call(this)
- }
- }(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart" in document.createElement("div"), e.fn.extend({
- disableSelection: function() {
- return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function(e) {
- e.preventDefault()
- })
- },
- enableSelection: function() {
- return this.unbind(".ui-disableSelection")
- }
- }), e.extend(e.ui, {
- plugin: {
- add: function(t, i, s) {
- var a, n = e.ui[t].prototype;
- for (a in s) n.plugins[a] = n.plugins[a] || [], n.plugins[a].push([i, s[a]])
- },
- call: function(e, t, i) {
- var s, a = e.plugins[t];
- if (a && e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType)
- for (s = 0; a.length > s; s++) e.options[a[s][0]] && a[s][1].apply(e.element, i)
- }
- },
- hasScroll: function(t, i) {
- if ("hidden" === e(t).css("overflow")) return !1;
- var s = i && "left" === i ? "scrollLeft" : "scrollTop",
- a = !1;
- return t[s] > 0 ? !0 : (t[s] = 1, a = t[s] > 0, t[s] = 0, a)
- }
- })
- })(jQuery);
- (function(e, t) {
- var i = 0,
- s = Array.prototype.slice,
- a = e.cleanData;
- e.cleanData = function(t) {
- for (var i, s = 0; null != (i = t[s]); s++) try {
- e(i).triggerHandler("remove")
- } catch (n) {}
- a(t)
- }, e.widget = function(i, s, a) {
- var n, r, o, h, l = {},
- u = i.split(".")[0];
- i = i.split(".")[1], n = u + "-" + i, a || (a = s, s = e.Widget), e.expr[":"][n.toLowerCase()] = function(t) {
- return !!e.data(t, n)
- }, e[u] = e[u] || {}, r = e[u][i], o = e[u][i] = function(e, i) {
- return this._createWidget ? (arguments.length && this._createWidget(e, i), t) : new o(e, i)
- }, e.extend(o, r, {
- version: a.version,
- _proto: e.extend({}, a),
- _childConstructors: []
- }), h = new s, h.options = e.widget.extend({}, h.options), e.each(a, function(i, a) {
- return e.isFunction(a) ? (l[i] = function() {
- var e = function() {
- return s.prototype[i].apply(this, arguments)
- },
- t = function(e) {
- return s.prototype[i].apply(this, e)
- };
- return function() {
- var i, s = this._super,
- n = this._superApply;
- return this._super = e, this._superApply = t, i = a.apply(this, arguments), this._super = s, this._superApply = n, i
- }
- }(), t) : (l[i] = a, t)
- }), o.prototype = e.widget.extend(h, {
- widgetEventPrefix: r ? h.widgetEventPrefix || i : i
- }, l, {
- constructor: o,
- namespace: u,
- widgetName: i,
- widgetFullName: n
- }), r ? (e.each(r._childConstructors, function(t, i) {
- var s = i.prototype;
- e.widget(s.namespace + "." + s.widgetName, o, i._proto)
- }), delete r._childConstructors) : s._childConstructors.push(o), e.widget.bridge(i, o)
- }, e.widget.extend = function(i) {
- for (var a, n, r = s.call(arguments, 1), o = 0, h = r.length; h > o; o++)
- for (a in r[o]) n = r[o][a], r[o].hasOwnProperty(a) && n !== t && (i[a] = e.isPlainObject(n) ? e.isPlainObject(i[a]) ? e.widget.extend({}, i[a], n) : e.widget.extend({}, n) : n);
- return i
- }, e.widget.bridge = function(i, a) {
- var n = a.prototype.widgetFullName || i;
- e.fn[i] = function(r) {
- var o = "string" == typeof r,
- h = s.call(arguments, 1),
- l = this;
- return r = !o && h.length ? e.widget.extend.apply(null, [r].concat(h)) : r, o ? this.each(function() {
- var s, a = e.data(this, n);
- return a ? e.isFunction(a[r]) && "_" !== r.charAt(0) ? (s = a[r].apply(a, h), s !== a && s !== t ? (l = s && s.jquery ? l.pushStack(s.get()) : s, !1) : t) : e.error("no such method '" + r + "' for " + i + " widget instance") : e.error("cannot call methods on " + i + " prior to initialization; " + "attempted to call method '" + r + "'")
- }) : this.each(function() {
- var t = e.data(this, n);
- t ? t.option(r || {})._init() : e.data(this, n, new a(r, this))
- }), l
- }
- }, e.Widget = function() {}, e.Widget._childConstructors = [], e.Widget.prototype = {
- widgetName: "widget",
- widgetEventPrefix: "",
- defaultElement: "<div>",
- options: {
- disabled: !1,
- create: null
- },
- _createWidget: function(t, s) {
- s = e(s || this.defaultElement || this)[0], this.element = e(s), this.uuid = i++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this.bindings = e(), this.hoverable = e(), this.focusable = e(), s !== this && (e.data(s, this.widgetFullName, this), this._on(!0, this.element, {
- remove: function(e) {
- e.target === s && this.destroy()
- }
- }), this.document = e(s.style ? s.ownerDocument : s.document || s), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init()
- },
- _getCreateOptions: e.noop,
- _getCreateEventData: e.noop,
- _create: e.noop,
- _init: e.noop,
- destroy: function() {
- this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")
- },
- _destroy: e.noop,
- widget: function() {
- return this.element
- },
- option: function(i, s) {
- var a, n, r, o = i;
- if (0 === arguments.length) return e.widget.extend({}, this.options);
- if ("string" == typeof i)
- if (o = {}, a = i.split("."), i = a.shift(), a.length) {
- for (n = o[i] = e.widget.extend({}, this.options[i]), r = 0; a.length - 1 > r; r++) n[a[r]] = n[a[r]] || {}, n = n[a[r]];
- if (i = a.pop(), 1 === arguments.length) return n[i] === t ? null : n[i];
- n[i] = s
- } else {
- if (1 === arguments.length) return this.options[i] === t ? null : this.options[i];
- o[i] = s
- }
- return this._setOptions(o), this
- },
- _setOptions: function(e) {
- var t;
- for (t in e) this._setOption(t, e[t]);
- return this
- },
- _setOption: function(e, t) {
- return this.options[e] = t, "disabled" === e && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!t).attr("aria-disabled", t), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")), this
- },
- enable: function() {
- return this._setOption("disabled", !1)
- },
- disable: function() {
- return this._setOption("disabled", !0)
- },
- _on: function(i, s, a) {
- var n, r = this;
- "boolean" != typeof i && (a = s, s = i, i = !1), a ? (s = n = e(s), this.bindings = this.bindings.add(s)) : (a = s, s = this.element, n = this.widget()), e.each(a, function(a, o) {
- function h() {
- return i || r.options.disabled !== !0 && !e(this).hasClass("ui-state-disabled") ? ("string" == typeof o ? r[o] : o).apply(r, arguments) : t
- }
- "string" != typeof o && (h.guid = o.guid = o.guid || h.guid || e.guid++);
- var l = a.match(/^(\w+)\s*(.*)$/),
- u = l[1] + r.eventNamespace,
- d = l[2];
- d ? n.delegate(d, u, h) : s.bind(u, h)
- })
- },
- _off: function(e, t) {
- t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.unbind(t).undelegate(t)
- },
- _delay: function(e, t) {
- function i() {
- return ("string" == typeof e ? s[e] : e).apply(s, arguments)
- }
- var s = this;
- return setTimeout(i, t || 0)
- },
- _hoverable: function(t) {
- this.hoverable = this.hoverable.add(t), this._on(t, {
- mouseenter: function(t) {
- e(t.currentTarget).addClass("ui-state-hover")
- },
- mouseleave: function(t) {
- e(t.currentTarget).removeClass("ui-state-hover")
- }
- })
- },
- _focusable: function(t) {
- this.focusable = this.focusable.add(t), this._on(t, {
- focusin: function(t) {
- e(t.currentTarget).addClass("ui-state-focus")
- },
- focusout: function(t) {
- e(t.currentTarget).removeClass("ui-state-focus")
- }
- })
- },
- _trigger: function(t, i, s) {
- var a, n, r = this.options[t];
- if (s = s || {}, i = e.Event(i), i.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), i.target = this.element[0], n = i.originalEvent)
- for (a in n) a in i || (i[a] = n[a]);
- return this.element.trigger(i, s), !(e.isFunction(r) && r.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented())
- }
- }, e.each({
- show: "fadeIn",
- hide: "fadeOut"
- }, function(t, i) {
- e.Widget.prototype["_" + t] = function(s, a, n) {
- "string" == typeof a && (a = {
- effect: a
- });
- var r, o = a ? a === !0 || "number" == typeof a ? i : a.effect || i : t;
- a = a || {}, "number" == typeof a && (a = {
- duration: a
- }), r = !e.isEmptyObject(a), a.complete = n, a.delay && s.delay(a.delay), r && e.effects && e.effects.effect[o] ? s[t](a) : o !== t && s[o] ? s[o](a.duration, a.easing, n) : s.queue(function(i) {
- e(this)[t](), n && n.call(s[0]), i()
- })
- }
- })
- })(jQuery);
- (function(e) {
- var t = !1;
- e(document).mouseup(function() {
- t = !1
- }), e.widget("ui.mouse", {
- version: "1.10.4",
- options: {
- cancel: "input,textarea,button,select,option",
- distance: 1,
- delay: 0
- },
- _mouseInit: function() {
- var t = this;
- this.element.bind("mousedown." + this.widgetName, function(e) {
- return t._mouseDown(e)
- }).bind("click." + this.widgetName, function(i) {
- return !0 === e.data(i.target, t.widgetName + ".preventClickEvent") ? (e.removeData(i.target, t.widgetName + ".preventClickEvent"), i.stopImmediatePropagation(), !1) : undefined
- }), this.started = !1
- },
- _mouseDestroy: function() {
- this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate)
- },
- _mouseDown: function(i) {
- if (!t) {
- this._mouseStarted && this._mouseUp(i), this._mouseDownEvent = i;
- var s = this,
- a = 1 === i.which,
- n = "string" == typeof this.options.cancel && i.target.nodeName ? e(i.target).closest(this.options.cancel).length : !1;
- return a && !n && this._mouseCapture(i) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function() {
- s.mouseDelayMet = !0
- }, this.options.delay)), this._mouseDistanceMet(i) && this._mouseDelayMet(i) && (this._mouseStarted = this._mouseStart(i) !== !1, !this._mouseStarted) ? (i.preventDefault(), !0) : (!0 === e.data(i.target, this.widgetName + ".preventClickEvent") && e.removeData(i.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function(e) {
- return s._mouseMove(e)
- }, this._mouseUpDelegate = function(e) {
- return s._mouseUp(e)
- }, e(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), i.preventDefault(), t = !0, !0)) : !0
- }
- },
- _mouseMove: function(t) {
- return e.ui.ie && (!document.documentMode || 9 > document.documentMode) && !t.button ? this._mouseUp(t) : this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted)
- },
- _mouseUp: function(t) {
- return e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)), !1
- },
- _mouseDistanceMet: function(e) {
- return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance
- },
- _mouseDelayMet: function() {
- return this.mouseDelayMet
- },
- _mouseStart: function() {},
- _mouseDrag: function() {},
- _mouseStop: function() {},
- _mouseCapture: function() {
- return !0
- }
- })
- })(jQuery);
- (function(e, t) {
- function i(e, t, i) {
- return [parseFloat(e[0]) * (p.test(e[0]) ? t / 100 : 1), parseFloat(e[1]) * (p.test(e[1]) ? i / 100 : 1)]
- }
- function s(t, i) {
- return parseInt(e.css(t, i), 10) || 0
- }
- function a(t) {
- var i = t[0];
- return 9 === i.nodeType ? {
- width: t.width(),
- height: t.height(),
- offset: {
- top: 0,
- left: 0
- }
- } : e.isWindow(i) ? {
- width: t.width(),
- height: t.height(),
- offset: {
- top: t.scrollTop(),
- left: t.scrollLeft()
- }
- } : i.preventDefault ? {
- width: 0,
- height: 0,
- offset: {
- top: i.pageY,
- left: i.pageX
- }
- } : {
- width: t.outerWidth(),
- height: t.outerHeight(),
- offset: t.offset()
- }
- }
- e.ui = e.ui || {};
- var n, r = Math.max,
- o = Math.abs,
- h = Math.round,
- l = /left|center|right/,
- u = /top|center|bottom/,
- d = /[\+\-]\d+(\.[\d]+)?%?/,
- c = /^\w+/,
- p = /%$/,
- f = e.fn.position;
- e.position = {
- scrollbarWidth: function() {
- if (n !== t) return n;
- var i, s, a = e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),
- r = a.children()[0];
- return e("body").append(a), i = r.offsetWidth, a.css("overflow", "scroll"), s = r.offsetWidth, i === s && (s = a[0].clientWidth), a.remove(), n = i - s
- },
- getScrollInfo: function(t) {
- var i = t.isWindow || t.isDocument ? "" : t.element.css("overflow-x"),
- s = t.isWindow || t.isDocument ? "" : t.element.css("overflow-y"),
- a = "scroll" === i || "auto" === i && t.width < t.element[0].scrollWidth,
- n = "scroll" === s || "auto" === s && t.height < t.element[0].scrollHeight;
- return {
- width: n ? e.position.scrollbarWidth() : 0,
- height: a ? e.position.scrollbarWidth() : 0
- }
- },
- getWithinInfo: function(t) {
- var i = e(t || window),
- s = e.isWindow(i[0]),
- a = !!i[0] && 9 === i[0].nodeType;
- return {
- element: i,
- isWindow: s,
- isDocument: a,
- offset: i.offset() || {
- left: 0,
- top: 0
- },
- scrollLeft: i.scrollLeft(),
- scrollTop: i.scrollTop(),
- width: s ? i.width() : i.outerWidth(),
- height: s ? i.height() : i.outerHeight()
- }
- }
- }, e.fn.position = function(t) {
- if (!t || !t.of) return f.apply(this, arguments);
- t = e.extend({}, t);
- var n, p, m, g, v, y, b = e(t.of),
- _ = e.position.getWithinInfo(t.within),
- x = e.position.getScrollInfo(_),
- k = (t.collision || "flip").split(" "),
- w = {};
- return y = a(b), b[0].preventDefault && (t.at = "left top"), p = y.width, m = y.height, g = y.offset, v = e.extend({}, g), e.each(["my", "at"], function() {
- var e, i, s = (t[this] || "").split(" ");
- 1 === s.length && (s = l.test(s[0]) ? s.concat(["center"]) : u.test(s[0]) ? ["center"].concat(s) : ["center", "center"]), s[0] = l.test(s[0]) ? s[0] : "center", s[1] = u.test(s[1]) ? s[1] : "center", e = d.exec(s[0]), i = d.exec(s[1]), w[this] = [e ? e[0] : 0, i ? i[0] : 0], t[this] = [c.exec(s[0])[0], c.exec(s[1])[0]]
- }), 1 === k.length && (k[1] = k[0]), "right" === t.at[0] ? v.left += p : "center" === t.at[0] && (v.left += p / 2), "bottom" === t.at[1] ? v.top += m : "center" === t.at[1] && (v.top += m / 2), n = i(w.at, p, m), v.left += n[0], v.top += n[1], this.each(function() {
- var a, l, u = e(this),
- d = u.outerWidth(),
- c = u.outerHeight(),
- f = s(this, "marginLeft"),
- y = s(this, "marginTop"),
- D = d + f + s(this, "marginRight") + x.width,
- T = c + y + s(this, "marginBottom") + x.height,
- S = e.extend({}, v),
- M = i(w.my, u.outerWidth(), u.outerHeight());
- "right" === t.my[0] ? S.left -= d : "center" === t.my[0] && (S.left -= d / 2), "bottom" === t.my[1] ? S.top -= c : "center" === t.my[1] && (S.top -= c / 2), S.left += M[0], S.top += M[1], e.support.offsetFractions || (S.left = h(S.left), S.top = h(S.top)), a = {
- marginLeft: f,
- marginTop: y
- }, e.each(["left", "top"], function(i, s) {
- e.ui.position[k[i]] && e.ui.position[k[i]][s](S, {
- targetWidth: p,
- targetHeight: m,
- elemWidth: d,
- elemHeight: c,
- collisionPosition: a,
- collisionWidth: D,
- collisionHeight: T,
- offset: [n[0] + M[0], n[1] + M[1]],
- my: t.my,
- at: t.at,
- within: _,
- elem: u
- })
- }), t.using && (l = function(e) {
- var i = g.left - S.left,
- s = i + p - d,
- a = g.top - S.top,
- n = a + m - c,
- h = {
- target: {
- element: b,
- left: g.left,
- top: g.top,
- width: p,
- height: m
- },
- element: {
- element: u,
- left: S.left,
- top: S.top,
- width: d,
- height: c
- },
- horizontal: 0 > s ? "left" : i > 0 ? "right" : "center",
- vertical: 0 > n ? "top" : a > 0 ? "bottom" : "middle"
- };
- d > p && p > o(i + s) && (h.horizontal = "center"), c > m && m > o(a + n) && (h.vertical = "middle"), h.important = r(o(i), o(s)) > r(o(a), o(n)) ? "horizontal" : "vertical", t.using.call(this, e, h)
- }), u.offset(e.extend(S, {
- using: l
- }))
- })
- }, e.ui.position = {
- fit: {
- left: function(e, t) {
- var i, s = t.within,
- a = s.isWindow ? s.scrollLeft : s.offset.left,
- n = s.width,
- o = e.left - t.collisionPosition.marginLeft,
- h = a - o,
- l = o + t.collisionWidth - n - a;
- t.collisionWidth > n ? h > 0 && 0 >= l ? (i = e.left + h + t.collisionWidth - n - a, e.left += h - i) : e.left = l > 0 && 0 >= h ? a : h > l ? a + n - t.collisionWidth : a : h > 0 ? e.left += h : l > 0 ? e.left -= l : e.left = r(e.left - o, e.left)
- },
- top: function(e, t) {
- var i, s = t.within,
- a = s.isWindow ? s.scrollTop : s.offset.top,
- n = t.within.height,
- o = e.top - t.collisionPosition.marginTop,
- h = a - o,
- l = o + t.collisionHeight - n - a;
- t.collisionHeight > n ? h > 0 && 0 >= l ? (i = e.top + h + t.collisionHeight - n - a, e.top += h - i) : e.top = l > 0 && 0 >= h ? a : h > l ? a + n - t.collisionHeight : a : h > 0 ? e.top += h : l > 0 ? e.top -= l : e.top = r(e.top - o, e.top)
- }
- },
- flip: {
- left: function(e, t) {
- var i, s, a = t.within,
- n = a.offset.left + a.scrollLeft,
- r = a.width,
- h = a.isWindow ? a.scrollLeft : a.offset.left,
- l = e.left - t.collisionPosition.marginLeft,
- u = l - h,
- d = l + t.collisionWidth - r - h,
- c = "left" === t.my[0] ? -t.elemWidth : "right" === t.my[0] ? t.elemWidth : 0,
- p = "left" === t.at[0] ? t.targetWidth : "right" === t.at[0] ? -t.targetWidth : 0,
- f = -2 * t.offset[0];
- 0 > u ? (i = e.left + c + p + f + t.collisionWidth - r - n, (0 > i || o(u) > i) && (e.left += c + p + f)) : d > 0 && (s = e.left - t.collisionPosition.marginLeft + c + p + f - h, (s > 0 || d > o(s)) && (e.left += c + p + f))
- },
- top: function(e, t) {
- var i, s, a = t.within,
- n = a.offset.top + a.scrollTop,
- r = a.height,
- h = a.isWindow ? a.scrollTop : a.offset.top,
- l = e.top - t.collisionPosition.marginTop,
- u = l - h,
- d = l + t.collisionHeight - r - h,
- c = "top" === t.my[1],
- p = c ? -t.elemHeight : "bottom" === t.my[1] ? t.elemHeight : 0,
- f = "top" === t.at[1] ? t.targetHeight : "bottom" === t.at[1] ? -t.targetHeight : 0,
- m = -2 * t.offset[1];
- 0 > u ? (s = e.top + p + f + m + t.collisionHeight - r - n, e.top + p + f + m > u && (0 > s || o(u) > s) && (e.top += p + f + m)) : d > 0 && (i = e.top - t.collisionPosition.marginTop + p + f + m - h, e.top + p + f + m > d && (i > 0 || d > o(i)) && (e.top += p + f + m))
- }
- },
- flipfit: {
- left: function() {
- e.ui.position.flip.left.apply(this, arguments), e.ui.position.fit.left.apply(this, arguments)
- },
- top: function() {
- e.ui.position.flip.top.apply(this, arguments), e.ui.position.fit.top.apply(this, arguments)
- }
- }
- },
- function() {
- var t, i, s, a, n, r = document.getElementsByTagName("body")[0],
- o = document.createElement("div");
- t = document.createElement(r ? "div" : "body"), s = {
- visibility: "hidden",
- width: 0,
- height: 0,
- border: 0,
- margin: 0,
- background: "none"
- }, r && e.extend(s, {
- position: "absolute",
- left: "-1000px",
- top: "-1000px"
- });
- for (n in s) t.style[n] = s[n];
- t.appendChild(o), i = r || document.documentElement, i.insertBefore(t, i.firstChild), o.style.cssText = "position: absolute; left: 10.7432222px;", a = e(o).offset().left, e.support.offsetFractions = a > 10 && 11 > a, t.innerHTML = "", i.removeChild(t)
- }()
- })(jQuery);
- (function(e) {
- e.widget("ui.draggable", e.ui.mouse, {
- version: "1.10.4",
- widgetEventPrefix: "drag",
- options: {
- addClasses: !0,
- appendTo: "parent",
- axis: !1,
- connectToSortable: !1,
- containment: !1,
- cursor: "auto",
- cursorAt: !1,
- grid: !1,
- handle: !1,
- helper: "original",
- iframeFix: !1,
- opacity: !1,
- refreshPositions: !1,
- revert: !1,
- revertDuration: 500,
- scope: "default",
- scroll: !0,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- snap: !1,
- snapMode: "both",
- snapTolerance: 20,
- stack: !1,
- zIndex: !1,
- drag: null,
- start: null,
- stop: null
- },
- _create: function() {
- "original" !== this.options.helper || /^(?:r|a|f)/.test(this.element.css("position")) || (this.element[0].style.position = "relative"), this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"), this._mouseInit()
- },
- _destroy: function() {
- this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"), this._mouseDestroy()
- },
- _mouseCapture: function(t) {
- var i = this.options;
- return this.helper || i.disabled || e(t.target).closest(".ui-resizable-handle").length > 0 ? !1 : (this.handle = this._getHandle(t), this.handle ? (e(i.iframeFix === !0 ? "iframe" : i.iframeFix).each(function() {
- e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({
- width: this.offsetWidth + "px",
- height: this.offsetHeight + "px",
- position: "absolute",
- opacity: "0.001",
- zIndex: 1e3
- }).css(e(this).offset()).appendTo("body")
- }), !0) : !1)
- },
- _mouseStart: function(t) {
- var i = this.options;
- return this.helper = this._createHelper(t), this.helper.addClass("ui-draggable-dragging"), this._cacheHelperProportions(), e.ui.ddmanager && (e.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(), this.offsetParent = this.helper.offsetParent(), this.offsetParentCssPosition = this.offsetParent.css("position"), this.offset = this.positionAbs = this.element.offset(), this.offset = {
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- }, this.offset.scroll = !1, e.extend(this.offset, {
- click: {
- left: t.pageX - this.offset.left,
- top: t.pageY - this.offset.top
- },
- parent: this._getParentOffset(),
- relative: this._getRelativeOffset()
- }), this.originalPosition = this.position = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, i.cursorAt && this._adjustOffsetFromHelper(i.cursorAt), this._setContainment(), this._trigger("start", t) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), e.ui.ddmanager && !i.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this._mouseDrag(t, !0), e.ui.ddmanager && e.ui.ddmanager.dragStart(this, t), !0)
- },
- _mouseDrag: function(t, i) {
- if ("fixed" === this.offsetParentCssPosition && (this.offset.parent = this._getParentOffset()), this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"), !i) {
- var s = this._uiHash();
- if (this._trigger("drag", t, s) === !1) return this._mouseUp({}), !1;
- this.position = s.position
- }
- return this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"), this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"), e.ui.ddmanager && e.ui.ddmanager.drag(this, t), !1
- },
- _mouseStop: function(t) {
- var i = this,
- s = !1;
- return e.ui.ddmanager && !this.options.dropBehaviour && (s = e.ui.ddmanager.drop(this, t)), this.dropped && (s = this.dropped, this.dropped = !1), "original" !== this.options.helper || e.contains(this.element[0].ownerDocument, this.element[0]) ? ("invalid" === this.options.revert && !s || "valid" === this.options.revert && s || this.options.revert === !0 || e.isFunction(this.options.revert) && this.options.revert.call(this.element, s) ? e(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
- i._trigger("stop", t) !== !1 && i._clear()
- }) : this._trigger("stop", t) !== !1 && this._clear(), !1) : !1
- },
- _mouseUp: function(t) {
- return e("div.ui-draggable-iframeFix").each(function() {
- this.parentNode.removeChild(this)
- }), e.ui.ddmanager && e.ui.ddmanager.dragStop(this, t), e.ui.mouse.prototype._mouseUp.call(this, t)
- },
- cancel: function() {
- return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(), this
- },
- _getHandle: function(t) {
- return this.options.handle ? !!e(t.target).closest(this.element.find(this.options.handle)).length : !0
- },
- _createHelper: function(t) {
- var i = this.options,
- s = e.isFunction(i.helper) ? e(i.helper.apply(this.element[0], [t])) : "clone" === i.helper ? this.element.clone().removeAttr("id") : this.element;
- return s.parents("body").length || s.appendTo("parent" === i.appendTo ? this.element[0].parentNode : i.appendTo), s[0] === this.element[0] || /(fixed|absolute)/.test(s.css("position")) || s.css("position", "absolute"), s
- },
- _adjustOffsetFromHelper: function(t) {
- "string" == typeof t && (t = t.split(" ")), e.isArray(t) && (t = {
- left: +t[0],
- top: +t[1] || 0
- }), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top)
- },
- _getParentOffset: function() {
- var t = this.offsetParent.offset();
- return "absolute" === this.cssPosition && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && e.ui.ie) && (t = {
- top: 0,
- left: 0
- }), {
- top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
- left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
- }
- },
- _getRelativeOffset: function() {
- if ("relative" === this.cssPosition) {
- var e = this.element.position();
- return {
- top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
- left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
- }
- }
- return {
- top: 0,
- left: 0
- }
- },
- _cacheMargins: function() {
- this.margins = {
- left: parseInt(this.element.css("marginLeft"), 10) || 0,
- top: parseInt(this.element.css("marginTop"), 10) || 0,
- right: parseInt(this.element.css("marginRight"), 10) || 0,
- bottom: parseInt(this.element.css("marginBottom"), 10) || 0
- }
- },
- _cacheHelperProportions: function() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- }
- },
- _setContainment: function() {
- var t, i, s, a = this.options;
- return a.containment ? "window" === a.containment ? (this.containment = [e(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, e(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, e(window).scrollLeft() + e(window).width() - this.helperProportions.width - this.margins.left, e(window).scrollTop() + (e(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], undefined) : "document" === a.containment ? (this.containment = [0, 0, e(document).width() - this.helperProportions.width - this.margins.left, (e(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], undefined) : a.containment.constructor === Array ? (this.containment = a.containment, undefined) : ("parent" === a.containment && (a.containment = this.helper[0].parentNode), i = e(a.containment), s = i[0], s && (t = "hidden" !== i.css("overflow"), this.containment = [(parseInt(i.css("borderLeftWidth"), 10) || 0) + (parseInt(i.css("paddingLeft"), 10) || 0), (parseInt(i.css("borderTopWidth"), 10) || 0) + (parseInt(i.css("paddingTop"), 10) || 0), (t ? Math.max(s.scrollWidth, s.offsetWidth) : s.offsetWidth) - (parseInt(i.css("borderRightWidth"), 10) || 0) - (parseInt(i.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (t ? Math.max(s.scrollHeight, s.offsetHeight) : s.offsetHeight) - (parseInt(i.css("borderBottomWidth"), 10) || 0) - (parseInt(i.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relative_container = i), undefined) : (this.containment = null, undefined)
- },
- _convertPositionTo: function(t, i) {
- i || (i = this.position);
- var s = "absolute" === t ? 1 : -1,
- a = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent;
- return this.offset.scroll || (this.offset.scroll = {
- top: a.scrollTop(),
- left: a.scrollLeft()
- }), {
- top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : this.offset.scroll.top) * s,
- left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : this.offset.scroll.left) * s
- }
- },
- _generatePosition: function(t) {
- var i, s, a, n, r = this.options,
- o = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
- h = t.pageX,
- l = t.pageY;
- return this.offset.scroll || (this.offset.scroll = {
- top: o.scrollTop(),
- left: o.scrollLeft()
- }), this.originalPosition && (this.containment && (this.relative_container ? (s = this.relative_container.offset(), i = [this.containment[0] + s.left, this.containment[1] + s.top, this.containment[2] + s.left, this.containment[3] + s.top]) : i = this.containment, t.pageX - this.offset.click.left < i[0] && (h = i[0] + this.offset.click.left), t.pageY - this.offset.click.top < i[1] && (l = i[1] + this.offset.click.top), t.pageX - this.offset.click.left > i[2] && (h = i[2] + this.offset.click.left), t.pageY - this.offset.click.top > i[3] && (l = i[3] + this.offset.click.top)), r.grid && (a = r.grid[1] ? this.originalPageY + Math.round((l - this.originalPageY) / r.grid[1]) * r.grid[1] : this.originalPageY, l = i ? a - this.offset.click.top >= i[1] || a - this.offset.click.top > i[3] ? a : a - this.offset.click.top >= i[1] ? a - r.grid[1] : a + r.grid[1] : a, n = r.grid[0] ? this.originalPageX + Math.round((h - this.originalPageX) / r.grid[0]) * r.grid[0] : this.originalPageX, h = i ? n - this.offset.click.left >= i[0] || n - this.offset.click.left > i[2] ? n : n - this.offset.click.left >= i[0] ? n - r.grid[0] : n + r.grid[0] : n)), {
- top: l - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : this.offset.scroll.top),
- left: h - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : this.offset.scroll.left)
- }
- },
- _clear: function() {
- this.helper.removeClass("ui-draggable-dragging"), this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1
- },
- _trigger: function(t, i, s) {
- return s = s || this._uiHash(), e.ui.plugin.call(this, t, [i, s]), "drag" === t && (this.positionAbs = this._convertPositionTo("absolute")), e.Widget.prototype._trigger.call(this, t, i, s)
- },
- plugins: {},
- _uiHash: function() {
- return {
- helper: this.helper,
- position: this.position,
- originalPosition: this.originalPosition,
- offset: this.positionAbs
- }
- }
- }), e.ui.plugin.add("draggable", "connectToSortable", {
- start: function(t, i) {
- var s = e(this).data("ui-draggable"),
- a = s.options,
- n = e.extend({}, i, {
- item: s.element
- });
- s.sortables = [], e(a.connectToSortable).each(function() {
- var i = e.data(this, "ui-sortable");
- i && !i.options.disabled && (s.sortables.push({
- instance: i,
- shouldRevert: i.options.revert
- }), i.refreshPositions(), i._trigger("activate", t, n))
- })
- },
- stop: function(t, i) {
- var s = e(this).data("ui-draggable"),
- a = e.extend({}, i, {
- item: s.element
- });
- e.each(s.sortables, function() {
- this.instance.isOver ? (this.instance.isOver = 0, s.cancelHelperRemoval = !0, this.instance.cancelHelperRemoval = !1, this.shouldRevert && (this.instance.options.revert = this.shouldRevert), this.instance._mouseStop(t), this.instance.options.helper = this.instance.options._helper, "original" === s.options.helper && this.instance.currentItem.css({
- top: "auto",
- left: "auto"
- })) : (this.instance.cancelHelperRemoval = !1, this.instance._trigger("deactivate", t, a))
- })
- },
- drag: function(t, i) {
- var s = e(this).data("ui-draggable"),
- a = this;
- e.each(s.sortables, function() {
- var n = !1,
- r = this;
- this.instance.positionAbs = s.positionAbs, this.instance.helperProportions = s.helperProportions, this.instance.offset.click = s.offset.click, this.instance._intersectsWith(this.instance.containerCache) && (n = !0, e.each(s.sortables, function() {
- return this.instance.positionAbs = s.positionAbs, this.instance.helperProportions = s.helperProportions, this.instance.offset.click = s.offset.click, this !== r && this.instance._intersectsWith(this.instance.containerCache) && e.contains(r.instance.element[0], this.instance.element[0]) && (n = !1), n
- })), n ? (this.instance.isOver || (this.instance.isOver = 1, this.instance.currentItem = e(a).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", !0), this.instance.options._helper = this.instance.options.helper, this.instance.options.helper = function() {
- return i.helper[0]
- }, t.target = this.instance.currentItem[0], this.instance._mouseCapture(t, !0), this.instance._mouseStart(t, !0, !0), this.instance.offset.click.top = s.offset.click.top, this.instance.offset.click.left = s.offset.click.left, this.instance.offset.parent.left -= s.offset.parent.left - this.instance.offset.parent.left, this.instance.offset.parent.top -= s.offset.parent.top - this.instance.offset.parent.top, s._trigger("toSortable", t), s.dropped = this.instance.element, s.currentItem = s.element, this.instance.fromOutside = s), this.instance.currentItem && this.instance._mouseDrag(t)) : this.instance.isOver && (this.instance.isOver = 0, this.instance.cancelHelperRemoval = !0, this.instance.options.revert = !1, this.instance._trigger("out", t, this.instance._uiHash(this.instance)), this.instance._mouseStop(t, !0), this.instance.options.helper = this.instance.options._helper, this.instance.currentItem.remove(), this.instance.placeholder && this.instance.placeholder.remove(), s._trigger("fromSortable", t), s.dropped = !1)
- })
- }
- }), e.ui.plugin.add("draggable", "cursor", {
- start: function() {
- var t = e("body"),
- i = e(this).data("ui-draggable").options;
- t.css("cursor") && (i._cursor = t.css("cursor")), t.css("cursor", i.cursor)
- },
- stop: function() {
- var t = e(this).data("ui-draggable").options;
- t._cursor && e("body").css("cursor", t._cursor)
- }
- }), e.ui.plugin.add("draggable", "opacity", {
- start: function(t, i) {
- var s = e(i.helper),
- a = e(this).data("ui-draggable").options;
- s.css("opacity") && (a._opacity = s.css("opacity")), s.css("opacity", a.opacity)
- },
- stop: function(t, i) {
- var s = e(this).data("ui-draggable").options;
- s._opacity && e(i.helper).css("opacity", s._opacity)
- }
- }), e.ui.plugin.add("draggable", "scroll", {
- start: function() {
- var t = e(this).data("ui-draggable");
- t.scrollParent[0] !== document && "HTML" !== t.scrollParent[0].tagName && (t.overflowOffset = t.scrollParent.offset())
- },
- drag: function(t) {
- var i = e(this).data("ui-draggable"),
- s = i.options,
- a = !1;
- i.scrollParent[0] !== document && "HTML" !== i.scrollParent[0].tagName ? (s.axis && "x" === s.axis || (i.overflowOffset.top + i.scrollParent[0].offsetHeight - t.pageY < s.scrollSensitivity ? i.scrollParent[0].scrollTop = a = i.scrollParent[0].scrollTop + s.scrollSpeed : t.pageY - i.overflowOffset.top < s.scrollSensitivity && (i.scrollParent[0].scrollTop = a = i.scrollParent[0].scrollTop - s.scrollSpeed)), s.axis && "y" === s.axis || (i.overflowOffset.left + i.scrollParent[0].offsetWidth - t.pageX < s.scrollSensitivity ? i.scrollParent[0].scrollLeft = a = i.scrollParent[0].scrollLeft + s.scrollSpeed : t.pageX - i.overflowOffset.left < s.scrollSensitivity && (i.scrollParent[0].scrollLeft = a = i.scrollParent[0].scrollLeft - s.scrollSpeed))) : (s.axis && "x" === s.axis || (t.pageY - e(document).scrollTop() < s.scrollSensitivity ? a = e(document).scrollTop(e(document).scrollTop() - s.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < s.scrollSensitivity && (a = e(document).scrollTop(e(document).scrollTop() + s.scrollSpeed))), s.axis && "y" === s.axis || (t.pageX - e(document).scrollLeft() < s.scrollSensitivity ? a = e(document).scrollLeft(e(document).scrollLeft() - s.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < s.scrollSensitivity && (a = e(document).scrollLeft(e(document).scrollLeft() + s.scrollSpeed)))), a !== !1 && e.ui.ddmanager && !s.dropBehaviour && e.ui.ddmanager.prepareOffsets(i, t)
- }
- }), e.ui.plugin.add("draggable", "snap", {
- start: function() {
- var t = e(this).data("ui-draggable"),
- i = t.options;
- t.snapElements = [], e(i.snap.constructor !== String ? i.snap.items || ":data(ui-draggable)" : i.snap).each(function() {
- var i = e(this),
- s = i.offset();
- this !== t.element[0] && t.snapElements.push({
- item: this,
- width: i.outerWidth(),
- height: i.outerHeight(),
- top: s.top,
- left: s.left
- })
- })
- },
- drag: function(t, i) {
- var s, a, n, r, o, h, l, u, d, c, p = e(this).data("ui-draggable"),
- m = p.options,
- f = m.snapTolerance,
- g = i.offset.left,
- v = g + p.helperProportions.width,
- y = i.offset.top,
- b = y + p.helperProportions.height;
- for (d = p.snapElements.length - 1; d >= 0; d--) o = p.snapElements[d].left, h = o + p.snapElements[d].width, l = p.snapElements[d].top, u = l + p.snapElements[d].height, o - f > v || g > h + f || l - f > b || y > u + f || !e.contains(p.snapElements[d].item.ownerDocument, p.snapElements[d].item) ? (p.snapElements[d].snapping && p.options.snap.release && p.options.snap.release.call(p.element, t, e.extend(p._uiHash(), {
- snapItem: p.snapElements[d].item
- })), p.snapElements[d].snapping = !1) : ("inner" !== m.snapMode && (s = f >= Math.abs(l - b), a = f >= Math.abs(u - y), n = f >= Math.abs(o - v), r = f >= Math.abs(h - g), s && (i.position.top = p._convertPositionTo("relative", {
- top: l - p.helperProportions.height,
- left: 0
- }).top - p.margins.top), a && (i.position.top = p._convertPositionTo("relative", {
- top: u,
- left: 0
- }).top - p.margins.top), n && (i.position.left = p._convertPositionTo("relative", {
- top: 0,
- left: o - p.helperProportions.width
- }).left - p.margins.left), r && (i.position.left = p._convertPositionTo("relative", {
- top: 0,
- left: h
- }).left - p.margins.left)), c = s || a || n || r, "outer" !== m.snapMode && (s = f >= Math.abs(l - y), a = f >= Math.abs(u - b), n = f >= Math.abs(o - g), r = f >= Math.abs(h - v), s && (i.position.top = p._convertPositionTo("relative", {
- top: l,
- left: 0
- }).top - p.margins.top), a && (i.position.top = p._convertPositionTo("relative", {
- top: u - p.helperProportions.height,
- left: 0
- }).top - p.margins.top), n && (i.position.left = p._convertPositionTo("relative", {
- top: 0,
- left: o
- }).left - p.margins.left), r && (i.position.left = p._convertPositionTo("relative", {
- top: 0,
- left: h - p.helperProportions.width
- }).left - p.margins.left)), !p.snapElements[d].snapping && (s || a || n || r || c) && p.options.snap.snap && p.options.snap.snap.call(p.element, t, e.extend(p._uiHash(), {
- snapItem: p.snapElements[d].item
- })), p.snapElements[d].snapping = s || a || n || r || c)
- }
- }), e.ui.plugin.add("draggable", "stack", {
- start: function() {
- var t, i = this.data("ui-draggable").options,
- s = e.makeArray(e(i.stack)).sort(function(t, i) {
- return (parseInt(e(t).css("zIndex"), 10) || 0) - (parseInt(e(i).css("zIndex"), 10) || 0)
- });
- s.length && (t = parseInt(e(s[0]).css("zIndex"), 10) || 0, e(s).each(function(i) {
- e(this).css("zIndex", t + i)
- }), this.css("zIndex", t + s.length))
- }
- }), e.ui.plugin.add("draggable", "zIndex", {
- start: function(t, i) {
- var s = e(i.helper),
- a = e(this).data("ui-draggable").options;
- s.css("zIndex") && (a._zIndex = s.css("zIndex")), s.css("zIndex", a.zIndex)
- },
- stop: function(t, i) {
- var s = e(this).data("ui-draggable").options;
- s._zIndex && e(i.helper).css("zIndex", s._zIndex)
- }
- })
- })(jQuery);
- (function(e) {
- function t(e) {
- return parseInt(e, 10) || 0
- }
- function i(e) {
- return !isNaN(parseInt(e, 10))
- }
- e.widget("ui.resizable", e.ui.mouse, {
- version: "1.10.4",
- widgetEventPrefix: "resize",
- options: {
- alsoResize: !1,
- animate: !1,
- animateDuration: "slow",
- animateEasing: "swing",
- aspectRatio: !1,
- autoHide: !1,
- containment: !1,
- ghost: !1,
- grid: !1,
- handles: "e,s,se",
- helper: !1,
- maxHeight: null,
- maxWidth: null,
- minHeight: 10,
- minWidth: 10,
- zIndex: 90,
- resize: null,
- start: null,
- stop: null
- },
- _create: function() {
- var t, i, s, a, n, r = this,
- o = this.options;
- if (this.element.addClass("ui-resizable"), e.extend(this, {
- _aspectRatio: !!o.aspectRatio,
- aspectRatio: o.aspectRatio,
- originalElement: this.element,
- _proportionallyResizeElements: [],
- _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
- }), this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i) && (this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
- position: this.element.css("position"),
- width: this.element.outerWidth(),
- height: this.element.outerHeight(),
- top: this.element.css("top"),
- left: this.element.css("left")
- })), this.element = this.element.parent().data("ui-resizable", this.element.data("ui-resizable")), this.elementIsWrapper = !0, this.element.css({
- marginLeft: this.originalElement.css("marginLeft"),
- marginTop: this.originalElement.css("marginTop"),
- marginRight: this.originalElement.css("marginRight"),
- marginBottom: this.originalElement.css("marginBottom")
- }), this.originalElement.css({
- marginLeft: 0,
- marginTop: 0,
- marginRight: 0,
- marginBottom: 0
- }), this.originalResizeStyle = this.originalElement.css("resize"), this.originalElement.css("resize", "none"), this._proportionallyResizeElements.push(this.originalElement.css({
- position: "static",
- zoom: 1,
- display: "block"
- })), this.originalElement.css({
- margin: this.originalElement.css("margin")
- }), this._proportionallyResize()), this.handles = o.handles || (e(".ui-resizable-handle", this.element).length ? {
- n: ".ui-resizable-n",
- e: ".ui-resizable-e",
- s: ".ui-resizable-s",
- w: ".ui-resizable-w",
- se: ".ui-resizable-se",
- sw: ".ui-resizable-sw",
- ne: ".ui-resizable-ne",
- nw: ".ui-resizable-nw"
- } : "e,s,se"), this.handles.constructor === String)
- for ("all" === this.handles && (this.handles = "n,e,s,w,se,sw,ne,nw"), t = this.handles.split(","), this.handles = {}, i = 0; t.length > i; i++) s = e.trim(t[i]), n = "ui-resizable-" + s, a = e("<div class='ui-resizable-handle " + n + "'></div>"), a.css({
- zIndex: o.zIndex
- }), "se" === s && a.addClass("ui-icon ui-icon-gripsmall-diagonal-se"), this.handles[s] = ".ui-resizable-" + s, this.element.append(a);
- this._renderAxis = function(t) {
- var i, s, a, n;
- t = t || this.element;
- for (i in this.handles) this.handles[i].constructor === String && (this.handles[i] = e(this.handles[i], this.element).show()), this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i) && (s = e(this.handles[i], this.element), n = /sw|ne|nw|se|n|s/.test(i) ? s.outerHeight() : s.outerWidth(), a = ["padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left"].join(""), t.css(a, n), this._proportionallyResize()), e(this.handles[i]).length
- }, this._renderAxis(this.element), this._handles = e(".ui-resizable-handle", this.element).disableSelection(), this._handles.mouseover(function() {
- r.resizing || (this.className && (a = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), r.axis = a && a[1] ? a[1] : "se")
- }), o.autoHide && (this._handles.hide(), e(this.element).addClass("ui-resizable-autohide").mouseenter(function() {
- o.disabled || (e(this).removeClass("ui-resizable-autohide"), r._handles.show())
- }).mouseleave(function() {
- o.disabled || r.resizing || (e(this).addClass("ui-resizable-autohide"), r._handles.hide())
- })), this._mouseInit()
- },
- _destroy: function() {
- this._mouseDestroy();
- var t, i = function(t) {
- e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()
- };
- return this.elementIsWrapper && (i(this.element), t = this.element, this.originalElement.css({
- position: t.css("position"),
- width: t.outerWidth(),
- height: t.outerHeight(),
- top: t.css("top"),
- left: t.css("left")
- }).insertAfter(t), t.remove()), this.originalElement.css("resize", this.originalResizeStyle), i(this.originalElement), this
- },
- _mouseCapture: function(t) {
- var i, s, a = !1;
- for (i in this.handles) s = e(this.handles[i])[0], (s === t.target || e.contains(s, t.target)) && (a = !0);
- return !this.options.disabled && a
- },
- _mouseStart: function(i) {
- var s, a, n, r = this.options,
- o = this.element.position(),
- h = this.element;
- return this.resizing = !0, /absolute/.test(h.css("position")) ? h.css({
- position: "absolute",
- top: h.css("top"),
- left: h.css("left")
- }) : h.is(".ui-draggable") && h.css({
- position: "absolute",
- top: o.top,
- left: o.left
- }), this._renderProxy(), s = t(this.helper.css("left")), a = t(this.helper.css("top")), r.containment && (s += e(r.containment).scrollLeft() || 0, a += e(r.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = {
- left: s,
- top: a
- }, this.size = this._helper ? {
- width: this.helper.width(),
- height: this.helper.height()
- } : {
- width: h.width(),
- height: h.height()
- }, this.originalSize = this._helper ? {
- width: h.outerWidth(),
- height: h.outerHeight()
- } : {
- width: h.width(),
- height: h.height()
- }, this.originalPosition = {
- left: s,
- top: a
- }, this.sizeDiff = {
- width: h.outerWidth() - h.width(),
- height: h.outerHeight() - h.height()
- }, this.originalMousePosition = {
- left: i.pageX,
- top: i.pageY
- }, this.aspectRatio = "number" == typeof r.aspectRatio ? r.aspectRatio : this.originalSize.width / this.originalSize.height || 1, n = e(".ui-resizable-" + this.axis).css("cursor"), e("body").css("cursor", "auto" === n ? this.axis + "-resize" : n), h.addClass("ui-resizable-resizing"), this._propagate("start", i), !0
- },
- _mouseDrag: function(t) {
- var i, s = this.helper,
- a = {},
- n = this.originalMousePosition,
- r = this.axis,
- o = this.position.top,
- h = this.position.left,
- l = this.size.width,
- u = this.size.height,
- d = t.pageX - n.left || 0,
- c = t.pageY - n.top || 0,
- p = this._change[r];
- return p ? (i = p.apply(this, [t, d, c]), this._updateVirtualBoundaries(t.shiftKey), (this._aspectRatio || t.shiftKey) && (i = this._updateRatio(i, t)), i = this._respectSize(i, t), this._updateCache(i), this._propagate("resize", t), this.position.top !== o && (a.top = this.position.top + "px"), this.position.left !== h && (a.left = this.position.left + "px"), this.size.width !== l && (a.width = this.size.width + "px"), this.size.height !== u && (a.height = this.size.height + "px"), s.css(a), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), e.isEmptyObject(a) || this._trigger("resize", t, this.ui()), !1) : !1
- },
- _mouseStop: function(t) {
- this.resizing = !1;
- var i, s, a, n, r, o, h, l = this.options,
- u = this;
- return this._helper && (i = this._proportionallyResizeElements, s = i.length && /textarea/i.test(i[0].nodeName), a = s && e.ui.hasScroll(i[0], "left") ? 0 : u.sizeDiff.height, n = s ? 0 : u.sizeDiff.width, r = {
- width: u.helper.width() - n,
- height: u.helper.height() - a
- }, o = parseInt(u.element.css("left"), 10) + (u.position.left - u.originalPosition.left) || null, h = parseInt(u.element.css("top"), 10) + (u.position.top - u.originalPosition.top) || null, l.animate || this.element.css(e.extend(r, {
- top: h,
- left: o
- })), u.helper.height(u.size.height), u.helper.width(u.size.width), this._helper && !l.animate && this._proportionallyResize()), e("body").css("cursor", "auto"), this.element.removeClass("ui-resizable-resizing"), this._propagate("stop", t), this._helper && this.helper.remove(), !1
- },
- _updateVirtualBoundaries: function(e) {
- var t, s, a, n, r, o = this.options;
- r = {
- minWidth: i(o.minWidth) ? o.minWidth : 0,
- maxWidth: i(o.maxWidth) ? o.maxWidth : 1 / 0,
- minHeight: i(o.minHeight) ? o.minHeight : 0,
- maxHeight: i(o.maxHeight) ? o.maxHeight : 1 / 0
- }, (this._aspectRatio || e) && (t = r.minHeight * this.aspectRatio, a = r.minWidth / this.aspectRatio, s = r.maxHeight * this.aspectRatio, n = r.maxWidth / this.aspectRatio, t > r.minWidth && (r.minWidth = t), a > r.minHeight && (r.minHeight = a), r.maxWidth > s && (r.maxWidth = s), r.maxHeight > n && (r.maxHeight = n)), this._vBoundaries = r
- },
- _updateCache: function(e) {
- this.offset = this.helper.offset(), i(e.left) && (this.position.left = e.left), i(e.top) && (this.position.top = e.top), i(e.height) && (this.size.height = e.height), i(e.width) && (this.size.width = e.width)
- },
- _updateRatio: function(e) {
- var t = this.position,
- s = this.size,
- a = this.axis;
- return i(e.height) ? e.width = e.height * this.aspectRatio : i(e.width) && (e.height = e.width / this.aspectRatio), "sw" === a && (e.left = t.left + (s.width - e.width), e.top = null), "nw" === a && (e.top = t.top + (s.height - e.height), e.left = t.left + (s.width - e.width)), e
- },
- _respectSize: function(e) {
- var t = this._vBoundaries,
- s = this.axis,
- a = i(e.width) && t.maxWidth && t.maxWidth < e.width,
- n = i(e.height) && t.maxHeight && t.maxHeight < e.height,
- r = i(e.width) && t.minWidth && t.minWidth > e.width,
- o = i(e.height) && t.minHeight && t.minHeight > e.height,
- h = this.originalPosition.left + this.originalSize.width,
- l = this.position.top + this.size.height,
- u = /sw|nw|w/.test(s),
- d = /nw|ne|n/.test(s);
- return r && (e.width = t.minWidth), o && (e.height = t.minHeight), a && (e.width = t.maxWidth), n && (e.height = t.maxHeight), r && u && (e.left = h - t.minWidth), a && u && (e.left = h - t.maxWidth), o && d && (e.top = l - t.minHeight), n && d && (e.top = l - t.maxHeight), e.width || e.height || e.left || !e.top ? e.width || e.height || e.top || !e.left || (e.left = null) : e.top = null, e
- },
- _proportionallyResize: function() {
- if (this._proportionallyResizeElements.length) {
- var e, t, i, s, a, n = this.helper || this.element;
- for (e = 0; this._proportionallyResizeElements.length > e; e++) {
- if (a = this._proportionallyResizeElements[e], !this.borderDif)
- for (this.borderDif = [], i = [a.css("borderTopWidth"), a.css("borderRightWidth"), a.css("borderBottomWidth"), a.css("borderLeftWidth")], s = [a.css("paddingTop"), a.css("paddingRight"), a.css("paddingBottom"), a.css("paddingLeft")], t = 0; i.length > t; t++) this.borderDif[t] = (parseInt(i[t], 10) || 0) + (parseInt(s[t], 10) || 0);
- a.css({
- height: n.height() - this.borderDif[0] - this.borderDif[2] || 0,
- width: n.width() - this.borderDif[1] - this.borderDif[3] || 0
- })
- }
- }
- },
- _renderProxy: function() {
- var t = this.element,
- i = this.options;
- this.elementOffset = t.offset(), this._helper ? (this.helper = this.helper || e("<div style='overflow:hidden;'></div>"), this.helper.addClass(this._helper).css({
- width: this.element.outerWidth() - 1,
- height: this.element.outerHeight() - 1,
- position: "absolute",
- left: this.elementOffset.left + "px",
- top: this.elementOffset.top + "px",
- zIndex: ++i.zIndex
- }), this.helper.appendTo("body").disableSelection()) : this.helper = this.element
- },
- _change: {
- e: function(e, t) {
- return {
- width: this.originalSize.width + t
- }
- },
- w: function(e, t) {
- var i = this.originalSize,
- s = this.originalPosition;
- return {
- left: s.left + t,
- width: i.width - t
- }
- },
- n: function(e, t, i) {
- var s = this.originalSize,
- a = this.originalPosition;
- return {
- top: a.top + i,
- height: s.height - i
- }
- },
- s: function(e, t, i) {
- return {
- height: this.originalSize.height + i
- }
- },
- se: function(t, i, s) {
- return e.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [t, i, s]))
- },
- sw: function(t, i, s) {
- return e.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [t, i, s]))
- },
- ne: function(t, i, s) {
- return e.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [t, i, s]))
- },
- nw: function(t, i, s) {
- return e.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [t, i, s]))
- }
- },
- _propagate: function(t, i) {
- e.ui.plugin.call(this, t, [i, this.ui()]), "resize" !== t && this._trigger(t, i, this.ui())
- },
- plugins: {},
- ui: function() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- }
- }
- }), e.ui.plugin.add("resizable", "animate", {
- stop: function(t) {
- var i = e(this).data("ui-resizable"),
- s = i.options,
- a = i._proportionallyResizeElements,
- n = a.length && /textarea/i.test(a[0].nodeName),
- r = n && e.ui.hasScroll(a[0], "left") ? 0 : i.sizeDiff.height,
- o = n ? 0 : i.sizeDiff.width,
- h = {
- width: i.size.width - o,
- height: i.size.height - r
- },
- l = parseInt(i.element.css("left"), 10) + (i.position.left - i.originalPosition.left) || null,
- u = parseInt(i.element.css("top"), 10) + (i.position.top - i.originalPosition.top) || null;
- i.element.animate(e.extend(h, u && l ? {
- top: u,
- left: l
- } : {}), {
- duration: s.animateDuration,
- easing: s.animateEasing,
- step: function() {
- var s = {
- width: parseInt(i.element.css("width"), 10),
- height: parseInt(i.element.css("height"), 10),
- top: parseInt(i.element.css("top"), 10),
- left: parseInt(i.element.css("left"), 10)
- };
- a && a.length && e(a[0]).css({
- width: s.width,
- height: s.height
- }), i._updateCache(s), i._propagate("resize", t)
- }
- })
- }
- }), e.ui.plugin.add("resizable", "containment", {
- start: function() {
- var i, s, a, n, r, o, h, l = e(this).data("ui-resizable"),
- u = l.options,
- d = l.element,
- c = u.containment,
- p = c instanceof e ? c.get(0) : /parent/.test(c) ? d.parent().get(0) : c;
- p && (l.containerElement = e(p), /document/.test(c) || c === document ? (l.containerOffset = {
- left: 0,
- top: 0
- }, l.containerPosition = {
- left: 0,
- top: 0
- }, l.parentData = {
- element: e(document),
- left: 0,
- top: 0,
- width: e(document).width(),
- height: e(document).height() || document.body.parentNode.scrollHeight
- }) : (i = e(p), s = [], e(["Top", "Right", "Left", "Bottom"]).each(function(e, a) {
- s[e] = t(i.css("padding" + a))
- }), l.containerOffset = i.offset(), l.containerPosition = i.position(), l.containerSize = {
- height: i.innerHeight() - s[3],
- width: i.innerWidth() - s[1]
- }, a = l.containerOffset, n = l.containerSize.height, r = l.containerSize.width, o = e.ui.hasScroll(p, "left") ? p.scrollWidth : r, h = e.ui.hasScroll(p) ? p.scrollHeight : n, l.parentData = {
- element: p,
- left: a.left,
- top: a.top,
- width: o,
- height: h
- }))
- },
- resize: function(t) {
- var i, s, a, n, r = e(this).data("ui-resizable"),
- o = r.options,
- h = r.containerOffset,
- l = r.position,
- u = r._aspectRatio || t.shiftKey,
- d = {
- top: 0,
- left: 0
- },
- c = r.containerElement;
- c[0] !== document && /static/.test(c.css("position")) && (d = h), l.left < (r._helper ? h.left : 0) && (r.size.width = r.size.width + (r._helper ? r.position.left - h.left : r.position.left - d.left), u && (r.size.height = r.size.width / r.aspectRatio), r.position.left = o.helper ? h.left : 0), l.top < (r._helper ? h.top : 0) && (r.size.height = r.size.height + (r._helper ? r.position.top - h.top : r.position.top), u && (r.size.width = r.size.height * r.aspectRatio), r.position.top = r._helper ? h.top : 0), r.offset.left = r.parentData.left + r.position.left, r.offset.top = r.parentData.top + r.position.top, i = Math.abs((r._helper ? r.offset.left - d.left : r.offset.left - d.left) + r.sizeDiff.width), s = Math.abs((r._helper ? r.offset.top - d.top : r.offset.top - h.top) + r.sizeDiff.height), a = r.containerElement.get(0) === r.element.parent().get(0), n = /relative|absolute/.test(r.containerElement.css("position")), a && n && (i -= Math.abs(r.parentData.left)), i + r.size.width >= r.parentData.width && (r.size.width = r.parentData.width - i, u && (r.size.height = r.size.width / r.aspectRatio)), s + r.size.height >= r.parentData.height && (r.size.height = r.parentData.height - s, u && (r.size.width = r.size.height * r.aspectRatio))
- },
- stop: function() {
- var t = e(this).data("ui-resizable"),
- i = t.options,
- s = t.containerOffset,
- a = t.containerPosition,
- n = t.containerElement,
- r = e(t.helper),
- o = r.offset(),
- h = r.outerWidth() - t.sizeDiff.width,
- l = r.outerHeight() - t.sizeDiff.height;
- t._helper && !i.animate && /relative/.test(n.css("position")) && e(this).css({
- left: o.left - a.left - s.left,
- width: h,
- height: l
- }), t._helper && !i.animate && /static/.test(n.css("position")) && e(this).css({
- left: o.left - a.left - s.left,
- width: h,
- height: l
- })
- }
- }), e.ui.plugin.add("resizable", "alsoResize", {
- start: function() {
- var t = e(this).data("ui-resizable"),
- i = t.options,
- s = function(t) {
- e(t).each(function() {
- var t = e(this);
- t.data("ui-resizable-alsoresize", {
- width: parseInt(t.width(), 10),
- height: parseInt(t.height(), 10),
- left: parseInt(t.css("left"), 10),
- top: parseInt(t.css("top"), 10)
- })
- })
- };
- "object" != typeof i.alsoResize || i.alsoResize.parentNode ? s(i.alsoResize) : i.alsoResize.length ? (i.alsoResize = i.alsoResize[0], s(i.alsoResize)) : e.each(i.alsoResize, function(e) {
- s(e)
- })
- },
- resize: function(t, i) {
- var s = e(this).data("ui-resizable"),
- a = s.options,
- n = s.originalSize,
- r = s.originalPosition,
- o = {
- height: s.size.height - n.height || 0,
- width: s.size.width - n.width || 0,
- top: s.position.top - r.top || 0,
- left: s.position.left - r.left || 0
- },
- h = function(t, s) {
- e(t).each(function() {
- var t = e(this),
- a = e(this).data("ui-resizable-alsoresize"),
- n = {},
- r = s && s.length ? s : t.parents(i.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
- e.each(r, function(e, t) {
- var i = (a[t] || 0) + (o[t] || 0);
- i && i >= 0 && (n[t] = i || null)
- }), t.css(n)
- })
- };
- "object" != typeof a.alsoResize || a.alsoResize.nodeType ? h(a.alsoResize) : e.each(a.alsoResize, function(e, t) {
- h(e, t)
- })
- },
- stop: function() {
- e(this).removeData("resizable-alsoresize")
- }
- }), e.ui.plugin.add("resizable", "ghost", {
- start: function() {
- var t = e(this).data("ui-resizable"),
- i = t.options,
- s = t.size;
- t.ghost = t.originalElement.clone(), t.ghost.css({
- opacity: .25,
- display: "block",
- position: "relative",
- height: s.height,
- width: s.width,
- margin: 0,
- left: 0,
- top: 0
- }).addClass("ui-resizable-ghost").addClass("string" == typeof i.ghost ? i.ghost : ""), t.ghost.appendTo(t.helper)
- },
- resize: function() {
- var t = e(this).data("ui-resizable");
- t.ghost && t.ghost.css({
- position: "relative",
- height: t.size.height,
- width: t.size.width
- })
- },
- stop: function() {
- var t = e(this).data("ui-resizable");
- t.ghost && t.helper && t.helper.get(0).removeChild(t.ghost.get(0))
- }
- }), e.ui.plugin.add("resizable", "grid", {
- resize: function() {
- var t = e(this).data("ui-resizable"),
- i = t.options,
- s = t.size,
- a = t.originalSize,
- n = t.originalPosition,
- r = t.axis,
- o = "number" == typeof i.grid ? [i.grid, i.grid] : i.grid,
- h = o[0] || 1,
- l = o[1] || 1,
- u = Math.round((s.width - a.width) / h) * h,
- d = Math.round((s.height - a.height) / l) * l,
- c = a.width + u,
- p = a.height + d,
- f = i.maxWidth && c > i.maxWidth,
- m = i.maxHeight && p > i.maxHeight,
- g = i.minWidth && i.minWidth > c,
- v = i.minHeight && i.minHeight > p;
- i.grid = o, g && (c += h), v && (p += l), f && (c -= h), m && (p -= l), /^(se|s|e)$/.test(r) ? (t.size.width = c, t.size.height = p) : /^(ne)$/.test(r) ? (t.size.width = c, t.size.height = p, t.position.top = n.top - d) : /^(sw)$/.test(r) ? (t.size.width = c, t.size.height = p, t.position.left = n.left - u) : (p - l > 0 ? (t.size.height = p, t.position.top = n.top - d) : (t.size.height = l, t.position.top = n.top + a.height - l), c - h > 0 ? (t.size.width = c, t.position.left = n.left - u) : (t.size.width = h, t.position.left = n.left + a.width - h))
- }
- })
- })(jQuery);
- (function(e) {
- var t, i = "ui-button ui-widget ui-state-default ui-corner-all",
- s = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
- a = function() {
- var t = e(this);
- setTimeout(function() {
- t.find(":ui-button").button("refresh")
- }, 1)
- },
- n = function(t) {
- var i = t.name,
- s = t.form,
- a = e([]);
- return i && (i = i.replace(/'/g, "\\'"), a = s ? e(s).find("[name='" + i + "']") : e("[name='" + i + "']", t.ownerDocument).filter(function() {
- return !this.form
- })), a
- };
- e.widget("ui.button", {
- version: "1.10.4",
- defaultElement: "<button>",
- options: {
- disabled: null,
- text: !0,
- label: null,
- icons: {
- primary: null,
- secondary: null
- }
- },
- _create: function() {
- this.element.closest("form").unbind("reset" + this.eventNamespace).bind("reset" + this.eventNamespace, a), "boolean" != typeof this.options.disabled ? this.options.disabled = !!this.element.prop("disabled") : this.element.prop("disabled", this.options.disabled), this._determineButtonType(), this.hasTitle = !!this.buttonElement.attr("title");
- var s = this,
- r = this.options,
- o = "checkbox" === this.type || "radio" === this.type,
- h = o ? "" : "ui-state-active";
- null === r.label && (r.label = "input" === this.type ? this.buttonElement.val() : this.buttonElement.html()), this._hoverable(this.buttonElement), this.buttonElement.addClass(i).attr("role", "button").bind("mouseenter" + this.eventNamespace, function() {
- r.disabled || this === t && e(this).addClass("ui-state-active")
- }).bind("mouseleave" + this.eventNamespace, function() {
- r.disabled || e(this).removeClass(h)
- }).bind("click" + this.eventNamespace, function(e) {
- r.disabled && (e.preventDefault(), e.stopImmediatePropagation())
- }), this._on({
- focus: function() {
- this.buttonElement.addClass("ui-state-focus")
- },
- blur: function() {
- this.buttonElement.removeClass("ui-state-focus")
- }
- }), o && this.element.bind("change" + this.eventNamespace, function() {
- s.refresh()
- }), "checkbox" === this.type ? this.buttonElement.bind("click" + this.eventNamespace, function() {
- return r.disabled ? !1 : undefined
- }) : "radio" === this.type ? this.buttonElement.bind("click" + this.eventNamespace, function() {
- if (r.disabled) return !1;
- e(this).addClass("ui-state-active"), s.buttonElement.attr("aria-pressed", "true");
- var t = s.element[0];
- n(t).not(t).map(function() {
- return e(this).button("widget")[0]
- }).removeClass("ui-state-active").attr("aria-pressed", "false")
- }) : (this.buttonElement.bind("mousedown" + this.eventNamespace, function() {
- return r.disabled ? !1 : (e(this).addClass("ui-state-active"), t = this, s.document.one("mouseup", function() {
- t = null
- }), undefined)
- }).bind("mouseup" + this.eventNamespace, function() {
- return r.disabled ? !1 : (e(this).removeClass("ui-state-active"), undefined)
- }).bind("keydown" + this.eventNamespace, function(t) {
- return r.disabled ? !1 : ((t.keyCode === e.ui.keyCode.SPACE || t.keyCode === e.ui.keyCode.ENTER) && e(this).addClass("ui-state-active"), undefined)
- }).bind("keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
- e(this).removeClass("ui-state-active")
- }), this.buttonElement.is("a") && this.buttonElement.keyup(function(t) {
- t.keyCode === e.ui.keyCode.SPACE && e(this).click()
- })), this._setOption("disabled", r.disabled), this._resetButton()
- },
- _determineButtonType: function() {
- var e, t, i;
- this.type = this.element.is("[type=checkbox]") ? "checkbox" : this.element.is("[type=radio]") ? "radio" : this.element.is("input") ? "input" : "button", "checkbox" === this.type || "radio" === this.type ? (e = this.element.parents().last(), t = "label[for='" + this.element.attr("id") + "']", this.buttonElement = e.find(t), this.buttonElement.length || (e = e.length ? e.siblings() : this.element.siblings(), this.buttonElement = e.filter(t), this.buttonElement.length || (this.buttonElement = e.find(t))), this.element.addClass("ui-helper-hidden-accessible"), i = this.element.is(":checked"), i && this.buttonElement.addClass("ui-state-active"), this.buttonElement.prop("aria-pressed", i)) : this.buttonElement = this.element
- },
- widget: function() {
- return this.buttonElement
- },
- _destroy: function() {
- this.element.removeClass("ui-helper-hidden-accessible"), this.buttonElement.removeClass(i + " ui-state-active " + s).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()), this.hasTitle || this.buttonElement.removeAttr("title")
- },
- _setOption: function(e, t) {
- return this._super(e, t), "disabled" === e ? (this.element.prop("disabled", !!t), t && this.buttonElement.removeClass("ui-state-focus"), undefined) : (this._resetButton(), undefined)
- },
- refresh: function() {
- var t = this.element.is("input, button") ? this.element.is(":disabled") : this.element.hasClass("ui-button-disabled");
- t !== this.options.disabled && this._setOption("disabled", t), "radio" === this.type ? n(this.element[0]).each(function() {
- e(this).is(":checked") ? e(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true") : e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed", "false")
- }) : "checkbox" === this.type && (this.element.is(":checked") ? this.buttonElement.addClass("ui-state-active").attr("aria-pressed", "true") : this.buttonElement.removeClass("ui-state-active").attr("aria-pressed", "false"))
- },
- _resetButton: function() {
- if ("input" === this.type) return this.options.label && this.element.val(this.options.label), undefined;
- var t = this.buttonElement.removeClass(s),
- i = e("<span></span>", this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),
- a = this.options.icons,
- n = a.primary && a.secondary,
- r = [];
- a.primary || a.secondary ? (this.options.text && r.push("ui-button-text-icon" + (n ? "s" : a.primary ? "-primary" : "-secondary")), a.primary && t.prepend("<span class='ui-button-icon-primary ui-icon " + a.primary + "'></span>"), a.secondary && t.append("<span class='ui-button-icon-secondary ui-icon " + a.secondary + "'></span>"), this.options.text || (r.push(n ? "ui-button-icons-only" : "ui-button-icon-only"), this.hasTitle || t.attr("title", e.trim(i)))) : r.push("ui-button-text-only"), t.addClass(r.join(" "))
- }
- }), e.widget("ui.buttonset", {
- version: "1.10.4",
- options: {
- items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
- },
- _create: function() {
- this.element.addClass("ui-buttonset")
- },
- _init: function() {
- this.refresh()
- },
- _setOption: function(e, t) {
- "disabled" === e && this.buttons.button("option", e, t), this._super(e, t)
- },
- refresh: function() {
- var t = "rtl" === this.element.css("direction");
- this.buttons = this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function() {
- return e(this).button("widget")[0]
- }).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t ? "ui-corner-right" : "ui-corner-left").end().filter(":last").addClass(t ? "ui-corner-left" : "ui-corner-right").end().end()
- },
- _destroy: function() {
- this.element.removeClass("ui-buttonset"), this.buttons.map(function() {
- return e(this).button("widget")[0]
- }).removeClass("ui-corner-left ui-corner-right").end().button("destroy")
- }
- })
- })(jQuery);
- (function(e, t) {
- function i() {
- this._curInst = null, this._keyEvent = !1, this._disabledInputs = [], this._datepickerShowing = !1, this._inDialog = !1, this._mainDivId = "ui-datepicker-div", this._inlineClass = "ui-datepicker-inline", this._appendClass = "ui-datepicker-append", this._triggerClass = "ui-datepicker-trigger", this._dialogClass = "ui-datepicker-dialog", this._disableClass = "ui-datepicker-disabled", this._unselectableClass = "ui-datepicker-unselectable", this._currentClass = "ui-datepicker-current-day", this._dayOverClass = "ui-datepicker-days-cell-over", this.regional = [], this.regional[""] = {
- closeText: "Done",
- prevText: "Prev",
- nextText: "Next",
- currentText: "Today",
- monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
- monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
- dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
- dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
- dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
- weekHeader: "Wk",
- dateFormat: "mm/dd/yy",
- firstDay: 0,
- isRTL: !1,
- showMonthAfterYear: !1,
- yearSuffix: ""
- }, this._defaults = {
- showOn: "focus",
- showAnim: "fadeIn",
- showOptions: {},
- defaultDate: null,
- appendText: "",
- buttonText: "...",
- buttonImage: "",
- buttonImageOnly: !1,
- hideIfNoPrevNext: !1,
- navigationAsDateFormat: !1,
- gotoCurrent: !1,
- changeMonth: !1,
- changeYear: !1,
- yearRange: "c-10:c+10",
- showOtherMonths: !1,
- selectOtherMonths: !1,
- showWeek: !1,
- calculateWeek: this.iso8601Week,
- shortYearCutoff: "+10",
- minDate: null,
- maxDate: null,
- duration: "fast",
- beforeShowDay: null,
- beforeShow: null,
- onSelect: null,
- onChangeMonthYear: null,
- onClose: null,
- numberOfMonths: 1,
- showCurrentAtPos: 0,
- stepMonths: 1,
- stepBigMonths: 12,
- altField: "",
- altFormat: "",
- constrainInput: !0,
- showButtonPanel: !1,
- autoSize: !1,
- disabled: !1
- }, e.extend(this._defaults, this.regional[""]), this.dpDiv = s(e("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))
- }
- function s(t) {
- var i = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
- return t.delegate(i, "mouseout", function() {
- e(this).removeClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).removeClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).removeClass("ui-datepicker-next-hover")
- }).delegate(i, "mouseover", function() {
- e.datepicker._isDisabledDatepicker(n.inline ? t.parent()[0] : n.input[0]) || (e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"), e(this).addClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).addClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).addClass("ui-datepicker-next-hover"))
- })
- }
- function a(t, i) {
- e.extend(t, i);
- for (var s in i) null == i[s] && (t[s] = i[s]);
- return t
- }
- e.extend(e.ui, {
- datepicker: {
- version: "1.10.4"
- }
- });
- var n, r = "datepicker";
- e.extend(i.prototype, {
- markerClassName: "hasDatepicker",
- maxRows: 4,
- _widgetDatepicker: function() {
- return this.dpDiv
- },
- setDefaults: function(e) {
- return a(this._defaults, e || {}), this
- },
- _attachDatepicker: function(t, i) {
- var s, a, n;
- s = t.nodeName.toLowerCase(), a = "div" === s || "span" === s, t.id || (this.uuid += 1, t.id = "dp" + this.uuid), n = this._newInst(e(t), a), n.settings = e.extend({}, i || {}), "input" === s ? this._connectDatepicker(t, n) : a && this._inlineDatepicker(t, n)
- },
- _newInst: function(t, i) {
- var a = t[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1");
- return {
- id: a,
- input: t,
- selectedDay: 0,
- selectedMonth: 0,
- selectedYear: 0,
- drawMonth: 0,
- drawYear: 0,
- inline: i,
- dpDiv: i ? s(e("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) : this.dpDiv
- }
- },
- _connectDatepicker: function(t, i) {
- var s = e(t);
- i.append = e([]), i.trigger = e([]), s.hasClass(this.markerClassName) || (this._attachments(s, i), s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp), this._autoSize(i), e.data(t, r, i), i.settings.disabled && this._disableDatepicker(t))
- },
- _attachments: function(t, i) {
- var s, a, n, r = this._get(i, "appendText"),
- o = this._get(i, "isRTL");
- i.append && i.append.remove(), r && (i.append = e("<span class='" + this._appendClass + "'>" + r + "</span>"), t[o ? "before" : "after"](i.append)), t.unbind("focus", this._showDatepicker), i.trigger && i.trigger.remove(), s = this._get(i, "showOn"), ("focus" === s || "both" === s) && t.focus(this._showDatepicker), ("button" === s || "both" === s) && (a = this._get(i, "buttonText"), n = this._get(i, "buttonImage"), i.trigger = e(this._get(i, "buttonImageOnly") ? e("<img/>").addClass(this._triggerClass).attr({
- src: n,
- alt: a,
- title: a
- }) : e("<button type='button'></button>").addClass(this._triggerClass).html(n ? e("<img/>").attr({
- src: n,
- alt: a,
- title: a
- }) : a)), t[o ? "before" : "after"](i.trigger), i.trigger.click(function() {
- return e.datepicker._datepickerShowing && e.datepicker._lastInput === t[0] ? e.datepicker._hideDatepicker() : e.datepicker._datepickerShowing && e.datepicker._lastInput !== t[0] ? (e.datepicker._hideDatepicker(), e.datepicker._showDatepicker(t[0])) : e.datepicker._showDatepicker(t[0]), !1
- }))
- },
- _autoSize: function(e) {
- if (this._get(e, "autoSize") && !e.inline) {
- var t, i, s, a, n = new Date(2009, 11, 20),
- r = this._get(e, "dateFormat");
- r.match(/[DM]/) && (t = function(e) {
- for (i = 0, s = 0, a = 0; e.length > a; a++) e[a].length > i && (i = e[a].length, s = a);
- return s
- }, n.setMonth(t(this._get(e, r.match(/MM/) ? "monthNames" : "monthNamesShort"))), n.setDate(t(this._get(e, r.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - n.getDay())), e.input.attr("size", this._formatDate(e, n).length)
- }
- },
- _inlineDatepicker: function(t, i) {
- var s = e(t);
- s.hasClass(this.markerClassName) || (s.addClass(this.markerClassName).append(i.dpDiv), e.data(t, r, i), this._setDate(i, this._getDefaultDate(i), !0), this._updateDatepicker(i), this._updateAlternate(i), i.settings.disabled && this._disableDatepicker(t), i.dpDiv.css("display", "block"))
- },
- _dialogDatepicker: function(t, i, s, n, o) {
- var h, l, u, d, c, p = this._dialogInst;
- return p || (this.uuid += 1, h = "dp" + this.uuid, this._dialogInput = e("<input type='text' id='" + h + "' style='position: absolute; top: -100px; width: 0px;'/>"), this._dialogInput.keydown(this._doKeyDown), e("body").append(this._dialogInput), p = this._dialogInst = this._newInst(this._dialogInput, !1), p.settings = {}, e.data(this._dialogInput[0], r, p)), a(p.settings, n || {}), i = i && i.constructor === Date ? this._formatDate(p, i) : i, this._dialogInput.val(i), this._pos = o ? o.length ? o : [o.pageX, o.pageY] : null, this._pos || (l = document.documentElement.clientWidth, u = document.documentElement.clientHeight, d = document.documentElement.scrollLeft || document.body.scrollLeft, c = document.documentElement.scrollTop || document.body.scrollTop, this._pos = [l / 2 - 100 + d, u / 2 - 150 + c]), this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"), p.settings.onSelect = s, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), e.blockUI && e.blockUI(this.dpDiv), e.data(this._dialogInput[0], r, p), this
- },
- _destroyDatepicker: function(t) {
- var i, s = e(t),
- a = e.data(t, r);
- s.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), e.removeData(t, r), "input" === i ? (a.append.remove(), a.trigger.remove(), s.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp)) : ("div" === i || "span" === i) && s.removeClass(this.markerClassName).empty())
- },
- _enableDatepicker: function(t) {
- var i, s, a = e(t),
- n = e.data(t, r);
- a.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), "input" === i ? (t.disabled = !1, n.trigger.filter("button").each(function() {
- this.disabled = !1
- }).end().filter("img").css({
- opacity: "1.0",
- cursor: ""
- })) : ("div" === i || "span" === i) && (s = a.children("." + this._inlineClass), s.children().removeClass("ui-state-disabled"), s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !1)), this._disabledInputs = e.map(this._disabledInputs, function(e) {
- return e === t ? null : e
- }))
- },
- _disableDatepicker: function(t) {
- var i, s, a = e(t),
- n = e.data(t, r);
- a.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), "input" === i ? (t.disabled = !0, n.trigger.filter("button").each(function() {
- this.disabled = !0
- }).end().filter("img").css({
- opacity: "0.5",
- cursor: "default"
- })) : ("div" === i || "span" === i) && (s = a.children("." + this._inlineClass), s.children().addClass("ui-state-disabled"), s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !0)), this._disabledInputs = e.map(this._disabledInputs, function(e) {
- return e === t ? null : e
- }), this._disabledInputs[this._disabledInputs.length] = t)
- },
- _isDisabledDatepicker: function(e) {
- if (!e) return !1;
- for (var t = 0; this._disabledInputs.length > t; t++)
- if (this._disabledInputs[t] === e) return !0;
- return !1
- },
- _getInst: function(t) {
- try {
- return e.data(t, r)
- } catch (i) {
- throw "Missing instance data for this datepicker"
- }
- },
- _optionDatepicker: function(i, s, n) {
- var r, o, h, l, u = this._getInst(i);
- return 2 === arguments.length && "string" == typeof s ? "defaults" === s ? e.extend({}, e.datepicker._defaults) : u ? "all" === s ? e.extend({}, u.settings) : this._get(u, s) : null : (r = s || {}, "string" == typeof s && (r = {}, r[s] = n), u && (this._curInst === u && this._hideDatepicker(), o = this._getDateDatepicker(i, !0), h = this._getMinMaxDate(u, "min"), l = this._getMinMaxDate(u, "max"), a(u.settings, r), null !== h && r.dateFormat !== t && r.minDate === t && (u.settings.minDate = this._formatDate(u, h)), null !== l && r.dateFormat !== t && r.maxDate === t && (u.settings.maxDate = this._formatDate(u, l)), "disabled" in r && (r.disabled ? this._disableDatepicker(i) : this._enableDatepicker(i)), this._attachments(e(i), u), this._autoSize(u), this._setDate(u, o), this._updateAlternate(u), this._updateDatepicker(u)), t)
- },
- _changeDatepicker: function(e, t, i) {
- this._optionDatepicker(e, t, i)
- },
- _refreshDatepicker: function(e) {
- var t = this._getInst(e);
- t && this._updateDatepicker(t)
- },
- _setDateDatepicker: function(e, t) {
- var i = this._getInst(e);
- i && (this._setDate(i, t), this._updateDatepicker(i), this._updateAlternate(i))
- },
- _getDateDatepicker: function(e, t) {
- var i = this._getInst(e);
- return i && !i.inline && this._setDateFromField(i, t), i ? this._getDate(i) : null
- },
- _doKeyDown: function(t) {
- var i, s, a, n = e.datepicker._getInst(t.target),
- r = !0,
- o = n.dpDiv.is(".ui-datepicker-rtl");
- if (n._keyEvent = !0, e.datepicker._datepickerShowing) switch (t.keyCode) {
- case 9:
- e.datepicker._hideDatepicker(), r = !1;
- break;
- case 13:
- return a = e("td." + e.datepicker._dayOverClass + ":not(." + e.datepicker._currentClass + ")", n.dpDiv), a[0] && e.datepicker._selectDay(t.target, n.selectedMonth, n.selectedYear, a[0]), i = e.datepicker._get(n, "onSelect"), i ? (s = e.datepicker._formatDate(n), i.apply(n.input ? n.input[0] : null, [s, n])) : e.datepicker._hideDatepicker(), !1;
- case 27:
- e.datepicker._hideDatepicker();
- break;
- case 33:
- e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(n, "stepBigMonths") : -e.datepicker._get(n, "stepMonths"), "M");
- break;
- case 34:
- e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(n, "stepBigMonths") : +e.datepicker._get(n, "stepMonths"), "M");
- break;
- case 35:
- (t.ctrlKey || t.metaKey) && e.datepicker._clearDate(t.target), r = t.ctrlKey || t.metaKey;
- break;
- case 36:
- (t.ctrlKey || t.metaKey) && e.datepicker._gotoToday(t.target), r = t.ctrlKey || t.metaKey;
- break;
- case 37:
- (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, o ? 1 : -1, "D"), r = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(n, "stepBigMonths") : -e.datepicker._get(n, "stepMonths"), "M");
- break;
- case 38:
- (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, -7, "D"), r = t.ctrlKey || t.metaKey;
- break;
- case 39:
- (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, o ? -1 : 1, "D"), r = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(n, "stepBigMonths") : +e.datepicker._get(n, "stepMonths"), "M");
- break;
- case 40:
- (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, 7, "D"), r = t.ctrlKey || t.metaKey;
- break;
- default:
- r = !1
- } else 36 === t.keyCode && t.ctrlKey ? e.datepicker._showDatepicker(this) : r = !1;
- r && (t.preventDefault(), t.stopPropagation())
- },
- _doKeyPress: function(i) {
- var s, a, n = e.datepicker._getInst(i.target);
- return e.datepicker._get(n, "constrainInput") ? (s = e.datepicker._possibleChars(e.datepicker._get(n, "dateFormat")), a = String.fromCharCode(null == i.charCode ? i.keyCode : i.charCode), i.ctrlKey || i.metaKey || " " > a || !s || s.indexOf(a) > -1) : t
- },
- _doKeyUp: function(t) {
- var i, s = e.datepicker._getInst(t.target);
- if (s.input.val() !== s.lastVal) try {
- i = e.datepicker.parseDate(e.datepicker._get(s, "dateFormat"), s.input ? s.input.val() : null, e.datepicker._getFormatConfig(s)), i && (e.datepicker._setDateFromField(s), e.datepicker._updateAlternate(s), e.datepicker._updateDatepicker(s))
- } catch (a) {}
- return !0
- },
- _showDatepicker: function(t) {
- if (t = t.target || t, "input" !== t.nodeName.toLowerCase() && (t = e("input", t.parentNode)[0]), !e.datepicker._isDisabledDatepicker(t) && e.datepicker._lastInput !== t) {
- var i, s, n, r, o, h, l;
- i = e.datepicker._getInst(t), e.datepicker._curInst && e.datepicker._curInst !== i && (e.datepicker._curInst.dpDiv.stop(!0, !0), i && e.datepicker._datepickerShowing && e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])), s = e.datepicker._get(i, "beforeShow"), n = s ? s.apply(t, [t, i]) : {}, n !== !1 && (a(i.settings, n), i.lastVal = null, e.datepicker._lastInput = t, e.datepicker._setDateFromField(i), e.datepicker._inDialog && (t.value = ""), e.datepicker._pos || (e.datepicker._pos = e.datepicker._findPos(t), e.datepicker._pos[1] += t.offsetHeight), r = !1, e(t).parents().each(function() {
- return r |= "fixed" === e(this).css("position"), !r
- }), o = {
- left: e.datepicker._pos[0],
- top: e.datepicker._pos[1]
- }, e.datepicker._pos = null, i.dpDiv.empty(), i.dpDiv.css({
- position: "absolute",
- display: "block",
- top: "-1000px"
- }), e.datepicker._updateDatepicker(i), o = e.datepicker._checkOffset(i, o, r), i.dpDiv.css({
- position: e.datepicker._inDialog && e.blockUI ? "static" : r ? "fixed" : "absolute",
- display: "none",
- left: o.left + "px",
- top: o.top + "px"
- }), i.inline || (h = e.datepicker._get(i, "showAnim"), l = e.datepicker._get(i, "duration"), i.dpDiv.zIndex(e(t).zIndex() + 1), e.datepicker._datepickerShowing = !0, e.effects && e.effects.effect[h] ? i.dpDiv.show(h, e.datepicker._get(i, "showOptions"), l) : i.dpDiv[h || "show"](h ? l : null), e.datepicker._shouldFocusInput(i) && i.input.focus(), e.datepicker._curInst = i))
- }
- },
- _updateDatepicker: function(t) {
- this.maxRows = 4, n = t, t.dpDiv.empty().append(this._generateHTML(t)), this._attachHandlers(t), t.dpDiv.find("." + this._dayOverClass + " a").mouseover();
- var i, s = this._getNumberOfMonths(t),
- a = s[1],
- r = 17;
- t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""), a > 1 && t.dpDiv.addClass("ui-datepicker-multi-" + a).css("width", r * a + "em"), t.dpDiv[(1 !== s[0] || 1 !== s[1] ? "add" : "remove") + "Class"]("ui-datepicker-multi"), t.dpDiv[(this._get(t, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"), t === e.datepicker._curInst && e.datepicker._datepickerShowing && e.datepicker._shouldFocusInput(t) && t.input.focus(), t.yearshtml && (i = t.yearshtml, setTimeout(function() {
- i === t.yearshtml && t.yearshtml && t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml), i = t.yearshtml = null
- }, 0))
- },
- _shouldFocusInput: function(e) {
- return e.input && e.input.is(":visible") && !e.input.is(":disabled") && !e.input.is(":focus")
- },
- _checkOffset: function(t, i, s) {
- var a = t.dpDiv.outerWidth(),
- n = t.dpDiv.outerHeight(),
- r = t.input ? t.input.outerWidth() : 0,
- o = t.input ? t.input.outerHeight() : 0,
- h = document.documentElement.clientWidth + (s ? 0 : e(document).scrollLeft()),
- l = document.documentElement.clientHeight + (s ? 0 : e(document).scrollTop());
- return i.left -= this._get(t, "isRTL") ? a - r : 0, i.left -= s && i.left === t.input.offset().left ? e(document).scrollLeft() : 0, i.top -= s && i.top === t.input.offset().top + o ? e(document).scrollTop() : 0, i.left -= Math.min(i.left, i.left + a > h && h > a ? Math.abs(i.left + a - h) : 0), i.top -= Math.min(i.top, i.top + n > l && l > n ? Math.abs(n + o) : 0), i
- },
- _findPos: function(t) {
- for (var i, s = this._getInst(t), a = this._get(s, "isRTL"); t && ("hidden" === t.type || 1 !== t.nodeType || e.expr.filters.hidden(t));) t = t[a ? "previousSibling" : "nextSibling"];
- return i = e(t).offset(), [i.left, i.top]
- },
- _hideDatepicker: function(t) {
- var i, s, a, n, o = this._curInst;
- !o || t && o !== e.data(t, r) || this._datepickerShowing && (i = this._get(o, "showAnim"), s = this._get(o, "duration"), a = function() {
- e.datepicker._tidyDialog(o)
- }, e.effects && (e.effects.effect[i] || e.effects[i]) ? o.dpDiv.hide(i, e.datepicker._get(o, "showOptions"), s, a) : o.dpDiv["slideDown" === i ? "slideUp" : "fadeIn" === i ? "fadeOut" : "hide"](i ? s : null, a), i || a(), this._datepickerShowing = !1, n = this._get(o, "onClose"), n && n.apply(o.input ? o.input[0] : null, [o.input ? o.input.val() : "", o]), this._lastInput = null, this._inDialog && (this._dialogInput.css({
- position: "absolute",
- left: "0",
- top: "-100px"
- }), e.blockUI && (e.unblockUI(), e("body").append(this.dpDiv))), this._inDialog = !1)
- },
- _tidyDialog: function(e) {
- e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")
- },
- _checkExternalClick: function(t) {
- if (e.datepicker._curInst) {
- var i = e(t.target),
- s = e.datepicker._getInst(i[0]);
- (i[0].id !== e.datepicker._mainDivId && 0 === i.parents("#" + e.datepicker._mainDivId).length && !i.hasClass(e.datepicker.markerClassName) && !i.closest("." + e.datepicker._triggerClass).length && e.datepicker._datepickerShowing && (!e.datepicker._inDialog || !e.blockUI) || i.hasClass(e.datepicker.markerClassName) && e.datepicker._curInst !== s) && e.datepicker._hideDatepicker()
- }
- },
- _adjustDate: function(t, i, s) {
- var a = e(t),
- n = this._getInst(a[0]);
- this._isDisabledDatepicker(a[0]) || (this._adjustInstDate(n, i + ("M" === s ? this._get(n, "showCurrentAtPos") : 0), s), this._updateDatepicker(n))
- },
- _gotoToday: function(t) {
- var i, s = e(t),
- a = this._getInst(s[0]);
- this._get(a, "gotoCurrent") && a.currentDay ? (a.selectedDay = a.currentDay, a.drawMonth = a.selectedMonth = a.currentMonth, a.drawYear = a.selectedYear = a.currentYear) : (i = new Date, a.selectedDay = i.getDate(), a.drawMonth = a.selectedMonth = i.getMonth(), a.drawYear = a.selectedYear = i.getFullYear()), this._notifyChange(a), this._adjustDate(s)
- },
- _selectMonthYear: function(t, i, s) {
- var a = e(t),
- n = this._getInst(a[0]);
- n["selected" + ("M" === s ? "Month" : "Year")] = n["draw" + ("M" === s ? "Month" : "Year")] = parseInt(i.options[i.selectedIndex].value, 10), this._notifyChange(n), this._adjustDate(a)
- },
- _selectDay: function(t, i, s, a) {
- var n, r = e(t);
- e(a).hasClass(this._unselectableClass) || this._isDisabledDatepicker(r[0]) || (n = this._getInst(r[0]), n.selectedDay = n.currentDay = e("a", a).html(), n.selectedMonth = n.currentMonth = i, n.selectedYear = n.currentYear = s, this._selectDate(t, this._formatDate(n, n.currentDay, n.currentMonth, n.currentYear)))
- },
- _clearDate: function(t) {
- var i = e(t);
- this._selectDate(i, "")
- },
- _selectDate: function(t, i) {
- var s, a = e(t),
- n = this._getInst(a[0]);
- i = null != i ? i : this._formatDate(n), n.input && n.input.val(i), this._updateAlternate(n), s = this._get(n, "onSelect"), s ? s.apply(n.input ? n.input[0] : null, [i, n]) : n.input && n.input.trigger("change"), n.inline ? this._updateDatepicker(n) : (this._hideDatepicker(), this._lastInput = n.input[0], "object" != typeof n.input[0] && n.input.focus(), this._lastInput = null)
- },
- _updateAlternate: function(t) {
- var i, s, a, n = this._get(t, "altField");
- n && (i = this._get(t, "altFormat") || this._get(t, "dateFormat"), s = this._getDate(t), a = this.formatDate(i, s, this._getFormatConfig(t)), e(n).each(function() {
- e(this).val(a)
- }))
- },
- noWeekends: function(e) {
- var t = e.getDay();
- return [t > 0 && 6 > t, ""]
- },
- iso8601Week: function(e) {
- var t, i = new Date(e.getTime());
- return i.setDate(i.getDate() + 4 - (i.getDay() || 7)), t = i.getTime(), i.setMonth(0), i.setDate(1), Math.floor(Math.round((t - i) / 864e5) / 7) + 1
- },
- parseDate: function(i, s, a) {
- if (null == i || null == s) throw "Invalid arguments";
- if (s = "object" == typeof s ? "" + s : s + "", "" === s) return null;
- var n, r, o, h, l = 0,
- u = (a ? a.shortYearCutoff : null) || this._defaults.shortYearCutoff,
- d = "string" != typeof u ? u : (new Date).getFullYear() % 100 + parseInt(u, 10),
- c = (a ? a.dayNamesShort : null) || this._defaults.dayNamesShort,
- p = (a ? a.dayNames : null) || this._defaults.dayNames,
- m = (a ? a.monthNamesShort : null) || this._defaults.monthNamesShort,
- f = (a ? a.monthNames : null) || this._defaults.monthNames,
- g = -1,
- v = -1,
- y = -1,
- b = -1,
- _ = !1,
- x = function(e) {
- var t = i.length > n + 1 && i.charAt(n + 1) === e;
- return t && n++, t
- },
- k = function(e) {
- var t = x(e),
- i = "@" === e ? 14 : "!" === e ? 20 : "y" === e && t ? 4 : "o" === e ? 3 : 2,
- a = RegExp("^\\d{1," + i + "}"),
- n = s.substring(l).match(a);
- if (!n) throw "Missing number at position " + l;
- return l += n[0].length, parseInt(n[0], 10)
- },
- w = function(i, a, n) {
- var r = -1,
- o = e.map(x(i) ? n : a, function(e, t) {
- return [
- [t, e]
- ]
- }).sort(function(e, t) {
- return -(e[1].length - t[1].length)
- });
- if (e.each(o, function(e, i) {
- var a = i[1];
- return s.substr(l, a.length).toLowerCase() === a.toLowerCase() ? (r = i[0], l += a.length, !1) : t
- }), -1 !== r) return r + 1;
- throw "Unknown name at position " + l
- },
- D = function() {
- if (s.charAt(l) !== i.charAt(n)) throw "Unexpected literal at position " + l;
- l++
- };
- for (n = 0; i.length > n; n++)
- if (_) "'" !== i.charAt(n) || x("'") ? D() : _ = !1;
- else switch (i.charAt(n)) {
- case "d":
- y = k("d");
- break;
- case "D":
- w("D", c, p);
- break;
- case "o":
- b = k("o");
- break;
- case "m":
- v = k("m");
- break;
- case "M":
- v = w("M", m, f);
- break;
- case "y":
- g = k("y");
- break;
- case "@":
- h = new Date(k("@")), g = h.getFullYear(), v = h.getMonth() + 1, y = h.getDate();
- break;
- case "!":
- h = new Date((k("!") - this._ticksTo1970) / 1e4), g = h.getFullYear(), v = h.getMonth() + 1, y = h.getDate();
- break;
- case "'":
- x("'") ? D() : _ = !0;
- break;
- default:
- D()
- }
- if (s.length > l && (o = s.substr(l), !/^\s+/.test(o))) throw "Extra/unparsed characters found in date: " + o;
- if (-1 === g ? g = (new Date).getFullYear() : 100 > g && (g += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (d >= g ? 0 : -100)), b > -1)
- for (v = 1, y = b;;) {
- if (r = this._getDaysInMonth(g, v - 1), r >= y) break;
- v++, y -= r
- }
- if (h = this._daylightSavingAdjust(new Date(g, v - 1, y)), h.getFullYear() !== g || h.getMonth() + 1 !== v || h.getDate() !== y) throw "Invalid date";
- return h
- },
- ATOM: "yy-mm-dd",
- COOKIE: "D, dd M yy",
- ISO_8601: "yy-mm-dd",
- RFC_822: "D, d M y",
- RFC_850: "DD, dd-M-y",
- RFC_1036: "D, d M y",
- RFC_1123: "D, d M yy",
- RFC_2822: "D, d M yy",
- RSS: "D, d M y",
- TICKS: "!",
- TIMESTAMP: "@",
- W3C: "yy-mm-dd",
- _ticksTo1970: 1e7 * 60 * 60 * 24 * (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)),
- formatDate: function(e, t, i) {
- if (!t) return "";
- var s, a = (i ? i.dayNamesShort : null) || this._defaults.dayNamesShort,
- n = (i ? i.dayNames : null) || this._defaults.dayNames,
- r = (i ? i.monthNamesShort : null) || this._defaults.monthNamesShort,
- o = (i ? i.monthNames : null) || this._defaults.monthNames,
- h = function(t) {
- var i = e.length > s + 1 && e.charAt(s + 1) === t;
- return i && s++, i
- },
- l = function(e, t, i) {
- var s = "" + t;
- if (h(e))
- for (; i > s.length;) s = "0" + s;
- return s
- },
- u = function(e, t, i, s) {
- return h(e) ? s[t] : i[t]
- },
- d = "",
- c = !1;
- if (t)
- for (s = 0; e.length > s; s++)
- if (c) "'" !== e.charAt(s) || h("'") ? d += e.charAt(s) : c = !1;
- else switch (e.charAt(s)) {
- case "d":
- d += l("d", t.getDate(), 2);
- break;
- case "D":
- d += u("D", t.getDay(), a, n);
- break;
- case "o":
- d += l("o", Math.round((new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime() - new Date(t.getFullYear(), 0, 0).getTime()) / 864e5), 3);
- break;
- case "m":
- d += l("m", t.getMonth() + 1, 2);
- break;
- case "M":
- d += u("M", t.getMonth(), r, o);
- break;
- case "y":
- d += h("y") ? t.getFullYear() : (10 > t.getYear() % 100 ? "0" : "") + t.getYear() % 100;
- break;
- case "@":
- d += t.getTime();
- break;
- case "!":
- d += 1e4 * t.getTime() + this._ticksTo1970;
- break;
- case "'":
- h("'") ? d += "'" : c = !0;
- break;
- default:
- d += e.charAt(s)
- }
- return d
- },
- _possibleChars: function(e) {
- var t, i = "",
- s = !1,
- a = function(i) {
- var s = e.length > t + 1 && e.charAt(t + 1) === i;
- return s && t++, s
- };
- for (t = 0; e.length > t; t++)
- if (s) "'" !== e.charAt(t) || a("'") ? i += e.charAt(t) : s = !1;
- else switch (e.charAt(t)) {
- case "d":
- case "m":
- case "y":
- case "@":
- i += "0123456789";
- break;
- case "D":
- case "M":
- return null;
- case "'":
- a("'") ? i += "'" : s = !0;
- break;
- default:
- i += e.charAt(t)
- }
- return i
- },
- _get: function(e, i) {
- return e.settings[i] !== t ? e.settings[i] : this._defaults[i]
- },
- _setDateFromField: function(e, t) {
- if (e.input.val() !== e.lastVal) {
- var i = this._get(e, "dateFormat"),
- s = e.lastVal = e.input ? e.input.val() : null,
- a = this._getDefaultDate(e),
- n = a,
- r = this._getFormatConfig(e);
- try {
- n = this.parseDate(i, s, r) || a
- } catch (o) {
- s = t ? "" : s
- }
- e.selectedDay = n.getDate(), e.drawMonth = e.selectedMonth = n.getMonth(), e.drawYear = e.selectedYear = n.getFullYear(), e.currentDay = s ? n.getDate() : 0, e.currentMonth = s ? n.getMonth() : 0, e.currentYear = s ? n.getFullYear() : 0, this._adjustInstDate(e)
- }
- },
- _getDefaultDate: function(e) {
- return this._restrictMinMax(e, this._determineDate(e, this._get(e, "defaultDate"), new Date))
- },
- _determineDate: function(t, i, s) {
- var a = function(e) {
- var t = new Date;
- return t.setDate(t.getDate() + e), t
- },
- n = function(i) {
- try {
- return e.datepicker.parseDate(e.datepicker._get(t, "dateFormat"), i, e.datepicker._getFormatConfig(t))
- } catch (s) {}
- for (var a = (i.toLowerCase().match(/^c/) ? e.datepicker._getDate(t) : null) || new Date, n = a.getFullYear(), r = a.getMonth(), o = a.getDate(), h = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, l = h.exec(i); l;) {
- switch (l[2] || "d") {
- case "d":
- case "D":
- o += parseInt(l[1], 10);
- break;
- case "w":
- case "W":
- o += 7 * parseInt(l[1], 10);
- break;
- case "m":
- case "M":
- r += parseInt(l[1], 10), o = Math.min(o, e.datepicker._getDaysInMonth(n, r));
- break;
- case "y":
- case "Y":
- n += parseInt(l[1], 10), o = Math.min(o, e.datepicker._getDaysInMonth(n, r))
- }
- l = h.exec(i)
- }
- return new Date(n, r, o)
- },
- r = null == i || "" === i ? s : "string" == typeof i ? n(i) : "number" == typeof i ? isNaN(i) ? s : a(i) : new Date(i.getTime());
- return r = r && "Invalid Date" == "" + r ? s : r, r && (r.setHours(0), r.setMinutes(0), r.setSeconds(0), r.setMilliseconds(0)), this._daylightSavingAdjust(r)
- },
- _daylightSavingAdjust: function(e) {
- return e ? (e.setHours(e.getHours() > 12 ? e.getHours() + 2 : 0), e) : null
- },
- _setDate: function(e, t, i) {
- var s = !t,
- a = e.selectedMonth,
- n = e.selectedYear,
- r = this._restrictMinMax(e, this._determineDate(e, t, new Date));
- e.selectedDay = e.currentDay = r.getDate(), e.drawMonth = e.selectedMonth = e.currentMonth = r.getMonth(), e.drawYear = e.selectedYear = e.currentYear = r.getFullYear(), a === e.selectedMonth && n === e.selectedYear || i || this._notifyChange(e), this._adjustInstDate(e), e.input && e.input.val(s ? "" : this._formatDate(e))
- },
- _getDate: function(e) {
- var t = !e.currentYear || e.input && "" === e.input.val() ? null : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay));
- return t
- },
- _attachHandlers: function(t) {
- var i = this._get(t, "stepMonths"),
- s = "#" + t.id.replace(/\\\\/g, "\\");
- t.dpDiv.find("[data-handler]").map(function() {
- var t = {
- prev: function() {
- e.datepicker._adjustDate(s, -i, "M")
- },
- next: function() {
- e.datepicker._adjustDate(s, +i, "M")
- },
- hide: function() {
- e.datepicker._hideDatepicker()
- },
- today: function() {
- e.datepicker._gotoToday(s)
- },
- selectDay: function() {
- return e.datepicker._selectDay(s, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this), !1
- },
- selectMonth: function() {
- return e.datepicker._selectMonthYear(s, this, "M"), !1
- },
- selectYear: function() {
- return e.datepicker._selectMonthYear(s, this, "Y"), !1
- }
- };
- e(this).bind(this.getAttribute("data-event"), t[this.getAttribute("data-handler")])
- })
- },
- _generateHTML: function(e) {
- var t, i, s, a, n, r, o, h, l, u, d, c, p, m, f, g, v, y, b, _, x, k, w, D, T, S, M, N, C, A, P, I, F, H, z, E, j, L, O, W = new Date,
- R = this._daylightSavingAdjust(new Date(W.getFullYear(), W.getMonth(), W.getDate())),
- Y = this._get(e, "isRTL"),
- J = this._get(e, "showButtonPanel"),
- B = this._get(e, "hideIfNoPrevNext"),
- K = this._get(e, "navigationAsDateFormat"),
- V = this._getNumberOfMonths(e),
- U = this._get(e, "showCurrentAtPos"),
- q = this._get(e, "stepMonths"),
- G = 1 !== V[0] || 1 !== V[1],
- Q = this._daylightSavingAdjust(e.currentDay ? new Date(e.currentYear, e.currentMonth, e.currentDay) : new Date(9999, 9, 9)),
- $ = this._getMinMaxDate(e, "min"),
- X = this._getMinMaxDate(e, "max"),
- Z = e.drawMonth - U,
- et = e.drawYear;
- if (0 > Z && (Z += 12, et--), X)
- for (t = this._daylightSavingAdjust(new Date(X.getFullYear(), X.getMonth() - V[0] * V[1] + 1, X.getDate())), t = $ && $ > t ? $ : t; this._daylightSavingAdjust(new Date(et, Z, 1)) > t;) Z--, 0 > Z && (Z = 11, et--);
- for (e.drawMonth = Z, e.drawYear = et, i = this._get(e, "prevText"), i = K ? this.formatDate(i, this._daylightSavingAdjust(new Date(et, Z - q, 1)), this._getFormatConfig(e)) : i, s = this._canAdjustMonth(e, -1, et, Z) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "e" : "w") + "'>" + i + "</span></a>" : B ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "e" : "w") + "'>" + i + "</span></a>", a = this._get(e, "nextText"), a = K ? this.formatDate(a, this._daylightSavingAdjust(new Date(et, Z + q, 1)), this._getFormatConfig(e)) : a, n = this._canAdjustMonth(e, 1, et, Z) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='" + a + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "w" : "e") + "'>" + a + "</span></a>" : B ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + a + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "w" : "e") + "'>" + a + "</span></a>", r = this._get(e, "currentText"), o = this._get(e, "gotoCurrent") && e.currentDay ? Q : R, r = K ? this.formatDate(r, o, this._getFormatConfig(e)) : r, h = e.inline ? "" : "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(e, "closeText") + "</button>", l = J ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (Y ? h : "") + (this._isInRange(e, o) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>" + r + "</button>" : "") + (Y ? "" : h) + "</div>" : "", u = parseInt(this._get(e, "firstDay"), 10), u = isNaN(u) ? 0 : u, d = this._get(e, "showWeek"), c = this._get(e, "dayNames"), p = this._get(e, "dayNamesMin"), m = this._get(e, "monthNames"), f = this._get(e, "monthNamesShort"), g = this._get(e, "beforeShowDay"), v = this._get(e, "showOtherMonths"), y = this._get(e, "selectOtherMonths"), b = this._getDefaultDate(e), _ = "", k = 0; V[0] > k; k++) {
- for (w = "", this.maxRows = 4, D = 0; V[1] > D; D++) {
- if (T = this._daylightSavingAdjust(new Date(et, Z, e.selectedDay)), S = " ui-corner-all", M = "", G) {
- if (M += "<div class='ui-datepicker-group", V[1] > 1) switch (D) {
- case 0:
- M += " ui-datepicker-group-first", S = " ui-corner-" + (Y ? "right" : "left");
- break;
- case V[1] - 1:
- M += " ui-datepicker-group-last", S = " ui-corner-" + (Y ? "left" : "right");
- break;
- default:
- M += " ui-datepicker-group-middle", S = ""
- }
- M += "'>"
- }
- for (M += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + S + "'>" + (/all|left/.test(S) && 0 === k ? Y ? n : s : "") + (/all|right/.test(S) && 0 === k ? Y ? s : n : "") + this._generateMonthYearHeader(e, Z, et, $, X, k > 0 || D > 0, m, f) + "</div><table class='ui-datepicker-calendar'><thead>" + "<tr>", N = d ? "<th class='ui-datepicker-week-col'>" + this._get(e, "weekHeader") + "</th>" : "", x = 0; 7 > x; x++) C = (x + u) % 7, N += "<th" + ((x + u + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + "<span title='" + c[C] + "'>" + p[C] + "</span></th>";
- for (M += N + "</tr></thead><tbody>", A = this._getDaysInMonth(et, Z), et === e.selectedYear && Z === e.selectedMonth && (e.selectedDay = Math.min(e.selectedDay, A)), P = (this._getFirstDayOfMonth(et, Z) - u + 7) % 7, I = Math.ceil((P + A) / 7), F = G ? this.maxRows > I ? this.maxRows : I : I, this.maxRows = F, H = this._daylightSavingAdjust(new Date(et, Z, 1 - P)), z = 0; F > z; z++) {
- for (M += "<tr>", E = d ? "<td class='ui-datepicker-week-col'>" + this._get(e, "calculateWeek")(H) + "</td>" : "", x = 0; 7 > x; x++) j = g ? g.apply(e.input ? e.input[0] : null, [H]) : [!0, ""], L = H.getMonth() !== Z, O = L && !y || !j[0] || $ && $ > H || X && H > X, E += "<td class='" + ((x + u + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (L ? " ui-datepicker-other-month" : "") + (H.getTime() === T.getTime() && Z === e.selectedMonth && e._keyEvent || b.getTime() === H.getTime() && b.getTime() === T.getTime() ? " " + this._dayOverClass : "") + (O ? " " + this._unselectableClass + " ui-state-disabled" : "") + (L && !v ? "" : " " + j[1] + (H.getTime() === Q.getTime() ? " " + this._currentClass : "") + (H.getTime() === R.getTime() ? " ui-datepicker-today" : "")) + "'" + (L && !v || !j[2] ? "" : " title='" + j[2].replace(/'/g, "'") + "'") + (O ? "" : " data-handler='selectDay' data-event='click' data-month='" + H.getMonth() + "' data-year='" + H.getFullYear() + "'") + ">" + (L && !v ? " " : O ? "<span class='ui-state-default'>" + H.getDate() + "</span>" : "<a class='ui-state-default" + (H.getTime() === R.getTime() ? " ui-state-highlight" : "") + (H.getTime() === Q.getTime() ? " ui-state-active" : "") + (L ? " ui-priority-secondary" : "") + "' href='#'>" + H.getDate() + "</a>") + "</td>", H.setDate(H.getDate() + 1), H = this._daylightSavingAdjust(H);
- M += E + "</tr>"
- }
- Z++, Z > 11 && (Z = 0, et++), M += "</tbody></table>" + (G ? "</div>" + (V[0] > 0 && D === V[1] - 1 ? "<div class='ui-datepicker-row-break'></div>" : "") : ""), w += M
- }
- _ += w
- }
- return _ += l, e._keyEvent = !1, _
- },
- _generateMonthYearHeader: function(e, t, i, s, a, n, r, o) {
- var h, l, u, d, c, p, m, f, g = this._get(e, "changeMonth"),
- v = this._get(e, "changeYear"),
- y = this._get(e, "showMonthAfterYear"),
- b = "<div class='ui-datepicker-title'>",
- _ = "";
- if (n || !g) _ += "<span class='ui-datepicker-month'>" + r[t] + "</span>";
- else {
- for (h = s && s.getFullYear() === i, l = a && a.getFullYear() === i, _ += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>", u = 0; 12 > u; u++)(!h || u >= s.getMonth()) && (!l || a.getMonth() >= u) && (_ += "<option value='" + u + "'" + (u === t ? " selected='selected'" : "") + ">" + o[u] + "</option>");
- _ += "</select>"
- }
- if (y || (b += _ + (!n && g && v ? "" : " ")), !e.yearshtml)
- if (e.yearshtml = "", n || !v) b += "<span class='ui-datepicker-year'>" + i + "</span>";
- else {
- for (d = this._get(e, "yearRange").split(":"), c = (new Date).getFullYear(), p = function(e) {
- var t = e.match(/c[+\-].*/) ? i + parseInt(e.substring(1), 10) : e.match(/[+\-].*/) ? c + parseInt(e, 10) : parseInt(e, 10);
- return isNaN(t) ? c : t
- }, m = p(d[0]), f = Math.max(m, p(d[1] || "")), m = s ? Math.max(m, s.getFullYear()) : m, f = a ? Math.min(f, a.getFullYear()) : f, e.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; f >= m; m++) e.yearshtml += "<option value='" + m + "'" + (m === i ? " selected='selected'" : "") + ">" + m + "</option>";
- e.yearshtml += "</select>", b += e.yearshtml, e.yearshtml = null
- }
- return b += this._get(e, "yearSuffix"), y && (b += (!n && g && v ? "" : " ") + _), b += "</div>"
- },
- _adjustInstDate: function(e, t, i) {
- var s = e.drawYear + ("Y" === i ? t : 0),
- a = e.drawMonth + ("M" === i ? t : 0),
- n = Math.min(e.selectedDay, this._getDaysInMonth(s, a)) + ("D" === i ? t : 0),
- r = this._restrictMinMax(e, this._daylightSavingAdjust(new Date(s, a, n)));
- e.selectedDay = r.getDate(), e.drawMonth = e.selectedMonth = r.getMonth(), e.drawYear = e.selectedYear = r.getFullYear(), ("M" === i || "Y" === i) && this._notifyChange(e)
- },
- _restrictMinMax: function(e, t) {
- var i = this._getMinMaxDate(e, "min"),
- s = this._getMinMaxDate(e, "max"),
- a = i && i > t ? i : t;
- return s && a > s ? s : a
- },
- _notifyChange: function(e) {
- var t = this._get(e, "onChangeMonthYear");
- t && t.apply(e.input ? e.input[0] : null, [e.selectedYear, e.selectedMonth + 1, e])
- },
- _getNumberOfMonths: function(e) {
- var t = this._get(e, "numberOfMonths");
- return null == t ? [1, 1] : "number" == typeof t ? [1, t] : t
- },
- _getMinMaxDate: function(e, t) {
- return this._determineDate(e, this._get(e, t + "Date"), null)
- },
- _getDaysInMonth: function(e, t) {
- return 32 - this._daylightSavingAdjust(new Date(e, t, 32)).getDate()
- },
- _getFirstDayOfMonth: function(e, t) {
- return new Date(e, t, 1).getDay()
- },
- _canAdjustMonth: function(e, t, i, s) {
- var a = this._getNumberOfMonths(e),
- n = this._daylightSavingAdjust(new Date(i, s + (0 > t ? t : a[0] * a[1]), 1));
- return 0 > t && n.setDate(this._getDaysInMonth(n.getFullYear(), n.getMonth())), this._isInRange(e, n)
- },
- _isInRange: function(e, t) {
- var i, s, a = this._getMinMaxDate(e, "min"),
- n = this._getMinMaxDate(e, "max"),
- r = null,
- o = null,
- h = this._get(e, "yearRange");
- return h && (i = h.split(":"), s = (new Date).getFullYear(), r = parseInt(i[0], 10), o = parseInt(i[1], 10), i[0].match(/[+\-].*/) && (r += s), i[1].match(/[+\-].*/) && (o += s)), (!a || t.getTime() >= a.getTime()) && (!n || t.getTime() <= n.getTime()) && (!r || t.getFullYear() >= r) && (!o || o >= t.getFullYear())
- },
- _getFormatConfig: function(e) {
- var t = this._get(e, "shortYearCutoff");
- return t = "string" != typeof t ? t : (new Date).getFullYear() % 100 + parseInt(t, 10), {
- shortYearCutoff: t,
- dayNamesShort: this._get(e, "dayNamesShort"),
- dayNames: this._get(e, "dayNames"),
- monthNamesShort: this._get(e, "monthNamesShort"),
- monthNames: this._get(e, "monthNames")
- }
- },
- _formatDate: function(e, t, i, s) {
- t || (e.currentDay = e.selectedDay, e.currentMonth = e.selectedMonth, e.currentYear = e.selectedYear);
- var a = t ? "object" == typeof t ? t : this._daylightSavingAdjust(new Date(s, i, t)) : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay));
- return this.formatDate(this._get(e, "dateFormat"), a, this._getFormatConfig(e))
- }
- }), e.fn.datepicker = function(t) {
- if (!this.length) return this;
- e.datepicker.initialized || (e(document).mousedown(e.datepicker._checkExternalClick), e.datepicker.initialized = !0), 0 === e("#" + e.datepicker._mainDivId).length && e("body").append(e.datepicker.dpDiv);
- var i = Array.prototype.slice.call(arguments, 1);
- return "string" != typeof t || "isDisabled" !== t && "getDate" !== t && "widget" !== t ? "option" === t && 2 === arguments.length && "string" == typeof arguments[1] ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(i)) : this.each(function() {
- "string" == typeof t ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this].concat(i)) : e.datepicker._attachDatepicker(this, t)
- }) : e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(i))
- }, e.datepicker = new i, e.datepicker.initialized = !1, e.datepicker.uuid = (new Date).getTime(), e.datepicker.version = "1.10.4"
- })(jQuery);
- (function(e) {
- var t = {
- buttons: !0,
- height: !0,
- maxHeight: !0,
- maxWidth: !0,
- minHeight: !0,
- minWidth: !0,
- width: !0
- },
- i = {
- maxHeight: !0,
- maxWidth: !0,
- minHeight: !0,
- minWidth: !0
- };
- e.widget("ui.dialog", {
- version: "1.10.4",
- options: {
- appendTo: "body",
- autoOpen: !0,
- buttons: [],
- closeOnEscape: !0,
- closeText: "close",
- dialogClass: "",
- draggable: !0,
- hide: null,
- height: "auto",
- maxHeight: null,
- maxWidth: null,
- minHeight: 150,
- minWidth: 150,
- modal: !1,
- position: {
- my: "center",
- at: "center",
- of: window,
- collision: "fit",
- using: function(t) {
- var i = e(this).css(t).offset().top;
- 0 > i && e(this).css("top", t.top - i)
- }
- },
- resizable: !0,
- show: null,
- title: null,
- width: 300,
- beforeClose: null,
- close: null,
- drag: null,
- dragStart: null,
- dragStop: null,
- focus: null,
- open: null,
- resize: null,
- resizeStart: null,
- resizeStop: null
- },
- _create: function() {
- this.originalCss = {
- display: this.element[0].style.display,
- width: this.element[0].style.width,
- minHeight: this.element[0].style.minHeight,
- maxHeight: this.element[0].style.maxHeight,
- height: this.element[0].style.height
- }, this.originalPosition = {
- parent: this.element.parent(),
- index: this.element.parent().children().index(this.element)
- }, this.originalTitle = this.element.attr("title"), this.options.title = this.options.title || this.originalTitle, this._createWrapper(), this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog), this._createTitlebar(), this._createButtonPane(), this.options.draggable && e.fn.draggable && this._makeDraggable(), this.options.resizable && e.fn.resizable && this._makeResizable(), this._isOpen = !1
- },
- _init: function() {
- this.options.autoOpen && this.open()
- },
- _appendTo: function() {
- var t = this.options.appendTo;
- return t && (t.jquery || t.nodeType) ? e(t) : this.document.find(t || "body").eq(0)
- },
- _destroy: function() {
- var e, t = this.originalPosition;
- this._destroyOverlay(), this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(), this.uiDialog.stop(!0, !0).remove(), this.originalTitle && this.element.attr("title", this.originalTitle), e = t.parent.children().eq(t.index), e.length && e[0] !== this.element[0] ? e.before(this.element) : t.parent.append(this.element)
- },
- widget: function() {
- return this.uiDialog
- },
- disable: e.noop,
- enable: e.noop,
- close: function(t) {
- var i, s = this;
- if (this._isOpen && this._trigger("beforeClose", t) !== !1) {
- if (this._isOpen = !1, this._destroyOverlay(), !this.opener.filter(":focusable").focus().length) try {
- i = this.document[0].activeElement, i && "body" !== i.nodeName.toLowerCase() && e(i).blur()
- } catch (a) {}
- this._hide(this.uiDialog, this.options.hide, function() {
- s._trigger("close", t)
- })
- }
- },
- isOpen: function() {
- return this._isOpen
- },
- moveToTop: function() {
- this._moveToTop()
- },
- _moveToTop: function(e, t) {
- var i = !!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;
- return i && !t && this._trigger("focus", e), i
- },
- open: function() {
- var t = this;
- return this._isOpen ? (this._moveToTop() && this._focusTabbable(), undefined) : (this._isOpen = !0, this.opener = e(this.document[0].activeElement), this._size(), this._position(), this._createOverlay(), this._moveToTop(null, !0), this._show(this.uiDialog, this.options.show, function() {
- t._focusTabbable(), t._trigger("focus")
- }), this._trigger("open"), undefined)
- },
- _focusTabbable: function() {
- var e = this.element.find("[autofocus]");
- e.length || (e = this.element.find(":tabbable")), e.length || (e = this.uiDialogButtonPane.find(":tabbable")), e.length || (e = this.uiDialogTitlebarClose.filter(":tabbable")), e.length || (e = this.uiDialog), e.eq(0).focus()
- },
- _keepFocus: function(t) {
- function i() {
- var t = this.document[0].activeElement,
- i = this.uiDialog[0] === t || e.contains(this.uiDialog[0], t);
- i || this._focusTabbable()
- }
- t.preventDefault(), i.call(this), this._delay(i)
- },
- _createWrapper: function() {
- this.uiDialog = e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " + this.options.dialogClass).hide().attr({
- tabIndex: -1,
- role: "dialog"
- }).appendTo(this._appendTo()), this._on(this.uiDialog, {
- keydown: function(t) {
- if (this.options.closeOnEscape && !t.isDefaultPrevented() && t.keyCode && t.keyCode === e.ui.keyCode.ESCAPE) return t.preventDefault(), this.close(t), undefined;
- if (t.keyCode === e.ui.keyCode.TAB) {
- var i = this.uiDialog.find(":tabbable"),
- s = i.filter(":first"),
- a = i.filter(":last");
- t.target !== a[0] && t.target !== this.uiDialog[0] || t.shiftKey ? t.target !== s[0] && t.target !== this.uiDialog[0] || !t.shiftKey || (a.focus(1), t.preventDefault()) : (s.focus(1), t.preventDefault())
- }
- },
- mousedown: function(e) {
- this._moveToTop(e) && this._focusTabbable()
- }
- }), this.element.find("[aria-describedby]").length || this.uiDialog.attr({
- "aria-describedby": this.element.uniqueId().attr("id")
- })
- },
- _createTitlebar: function() {
- var t;
- this.uiDialogTitlebar = e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog), this._on(this.uiDialogTitlebar, {
- mousedown: function(t) {
- e(t.target).closest(".ui-dialog-titlebar-close") || this.uiDialog.focus()
- }
- }), this.uiDialogTitlebarClose = e("<button type='button'></button>").button({
- label: this.options.closeText,
- icons: {
- primary: "ui-icon-closethick"
- },
- text: !1
- }).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar), this._on(this.uiDialogTitlebarClose, {
- click: function(e) {
- e.preventDefault(), this.close(e)
- }
- }), t = e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar), this._title(t), this.uiDialog.attr({
- "aria-labelledby": t.attr("id")
- })
- },
- _title: function(e) {
- this.options.title || e.html(" "), e.text(this.options.title)
- },
- _createButtonPane: function() {
- this.uiDialogButtonPane = e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"), this.uiButtonSet = e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane), this._createButtons()
- },
- _createButtons: function() {
- var t = this,
- i = this.options.buttons;
- return this.uiDialogButtonPane.remove(), this.uiButtonSet.empty(), e.isEmptyObject(i) || e.isArray(i) && !i.length ? (this.uiDialog.removeClass("ui-dialog-buttons"), undefined) : (e.each(i, function(i, s) {
- var a, n;
- s = e.isFunction(s) ? {
- click: s,
- text: i
- } : s, s = e.extend({
- type: "button"
- }, s), a = s.click, s.click = function() {
- a.apply(t.element[0], arguments)
- }, n = {
- icons: s.icons,
- text: s.showText
- }, delete s.icons, delete s.showText, e("<button></button>", s).button(n).appendTo(t.uiButtonSet)
- }), this.uiDialog.addClass("ui-dialog-buttons"), this.uiDialogButtonPane.appendTo(this.uiDialog), undefined)
- },
- _makeDraggable: function() {
- function t(e) {
- return {
- position: e.position,
- offset: e.offset
- }
- }
- var i = this,
- s = this.options;
- this.uiDialog.draggable({
- cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
- handle: ".ui-dialog-titlebar",
- containment: "document",
- start: function(s, a) {
- e(this).addClass("ui-dialog-dragging"), i._blockFrames(), i._trigger("dragStart", s, t(a))
- },
- drag: function(e, s) {
- i._trigger("drag", e, t(s))
- },
- stop: function(a, n) {
- s.position = [n.position.left - i.document.scrollLeft(), n.position.top - i.document.scrollTop()], e(this).removeClass("ui-dialog-dragging"), i._unblockFrames(), i._trigger("dragStop", a, t(n))
- }
- })
- },
- _makeResizable: function() {
- function t(e) {
- return {
- originalPosition: e.originalPosition,
- originalSize: e.originalSize,
- position: e.position,
- size: e.size
- }
- }
- var i = this,
- s = this.options,
- a = s.resizable,
- n = this.uiDialog.css("position"),
- r = "string" == typeof a ? a : "n,e,s,w,se,sw,ne,nw";
- this.uiDialog.resizable({
- cancel: ".ui-dialog-content",
- containment: "document",
- alsoResize: this.element,
- maxWidth: s.maxWidth,
- maxHeight: s.maxHeight,
- minWidth: s.minWidth,
- minHeight: this._minHeight(),
- handles: r,
- start: function(s, a) {
- e(this).addClass("ui-dialog-resizing"), i._blockFrames(), i._trigger("resizeStart", s, t(a))
- },
- resize: function(e, s) {
- i._trigger("resize", e, t(s))
- },
- stop: function(a, n) {
- s.height = e(this).height(), s.width = e(this).width(), e(this).removeClass("ui-dialog-resizing"), i._unblockFrames(), i._trigger("resizeStop", a, t(n))
- }
- }).css("position", n)
- },
- _minHeight: function() {
- var e = this.options;
- return "auto" === e.height ? e.minHeight : Math.min(e.minHeight, e.height)
- },
- _position: function() {
- var e = this.uiDialog.is(":visible");
- e || this.uiDialog.show(), this.uiDialog.position(this.options.position), e || this.uiDialog.hide()
- },
- _setOptions: function(s) {
- var a = this,
- n = !1,
- r = {};
- e.each(s, function(e, s) {
- a._setOption(e, s), e in t && (n = !0), e in i && (r[e] = s)
- }), n && (this._size(), this._position()), this.uiDialog.is(":data(ui-resizable)") && this.uiDialog.resizable("option", r)
- },
- _setOption: function(e, t) {
- var i, s, a = this.uiDialog;
- "dialogClass" === e && a.removeClass(this.options.dialogClass).addClass(t), "disabled" !== e && (this._super(e, t), "appendTo" === e && this.uiDialog.appendTo(this._appendTo()), "buttons" === e && this._createButtons(), "closeText" === e && this.uiDialogTitlebarClose.button({
- label: "" + t
- }), "draggable" === e && (i = a.is(":data(ui-draggable)"), i && !t && a.draggable("destroy"), !i && t && this._makeDraggable()), "position" === e && this._position(), "resizable" === e && (s = a.is(":data(ui-resizable)"), s && !t && a.resizable("destroy"), s && "string" == typeof t && a.resizable("option", "handles", t), s || t === !1 || this._makeResizable()), "title" === e && this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))
- },
- _size: function() {
- var e, t, i, s = this.options;
- this.element.show().css({
- width: "auto",
- minHeight: 0,
- maxHeight: "none",
- height: 0
- }), s.minWidth > s.width && (s.width = s.minWidth), e = this.uiDialog.css({
- height: "auto",
- width: s.width
- }).outerHeight(), t = Math.max(0, s.minHeight - e), i = "number" == typeof s.maxHeight ? Math.max(0, s.maxHeight - e) : "none", "auto" === s.height ? this.element.css({
- minHeight: t,
- maxHeight: i,
- height: "auto"
- }) : this.element.height(Math.max(0, s.height - e)), this.uiDialog.is(":data(ui-resizable)") && this.uiDialog.resizable("option", "minHeight", this._minHeight())
- },
- _blockFrames: function() {
- this.iframeBlocks = this.document.find("iframe").map(function() {
- var t = e(this);
- return e("<div>").css({
- position: "absolute",
- width: t.outerWidth(),
- height: t.outerHeight()
- }).appendTo(t.parent()).offset(t.offset())[0]
- })
- },
- _unblockFrames: function() {
- this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks)
- },
- _allowInteraction: function(t) {
- return e(t.target).closest(".ui-dialog").length ? !0 : !!e(t.target).closest(".ui-datepicker").length
- },
- _createOverlay: function() {
- if (this.options.modal) {
- var t = this,
- i = this.widgetFullName;
- e.ui.dialog.overlayInstances || this._delay(function() {
- e.ui.dialog.overlayInstances && this.document.bind("focusin.dialog", function(s) {
- t._allowInteraction(s) || (s.preventDefault(), e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())
- })
- }), this.overlay = e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()), this._on(this.overlay, {
- mousedown: "_keepFocus"
- }), e.ui.dialog.overlayInstances++
- }
- },
- _destroyOverlay: function() {
- this.options.modal && this.overlay && (e.ui.dialog.overlayInstances--, e.ui.dialog.overlayInstances || this.document.unbind("focusin.dialog"), this.overlay.remove(), this.overlay = null)
- }
- }), e.ui.dialog.overlayInstances = 0, e.uiBackCompat !== !1 && e.widget("ui.dialog", e.ui.dialog, {
- _position: function() {
- var t, i = this.options.position,
- s = [],
- a = [0, 0];
- i ? (("string" == typeof i || "object" == typeof i && "0" in i) && (s = i.split ? i.split(" ") : [i[0], i[1]], 1 === s.length && (s[1] = s[0]), e.each(["left", "top"], function(e, t) {
- +s[e] === s[e] && (a[e] = s[e], s[e] = t)
- }), i = {
- my: s[0] + (0 > a[0] ? a[0] : "+" + a[0]) + " " + s[1] + (0 > a[1] ? a[1] : "+" + a[1]),
- at: s.join(" ")
- }), i = e.extend({}, e.ui.dialog.prototype.options.position, i)) : i = e.ui.dialog.prototype.options.position, t = this.uiDialog.is(":visible"), t || this.uiDialog.show(), this.uiDialog.position(i), t || this.uiDialog.hide()
- }
- })
- })(jQuery);
- (function(e) {
- function t(t, i) {
- var s = (t.attr("aria-describedby") || "").split(/\s+/);
- s.push(i), t.data("ui-tooltip-id", i).attr("aria-describedby", e.trim(s.join(" ")))
- }
- function i(t) {
- var i = t.data("ui-tooltip-id"),
- s = (t.attr("aria-describedby") || "").split(/\s+/),
- a = e.inArray(i, s); - 1 !== a && s.splice(a, 1), t.removeData("ui-tooltip-id"), s = e.trim(s.join(" ")), s ? t.attr("aria-describedby", s) : t.removeAttr("aria-describedby")
- }
- var s = 0;
- e.widget("ui.tooltip", {
- version: "1.10.4",
- options: {
- content: function() {
- var t = e(this).attr("title") || "";
- return e("<a>").text(t).html()
- },
- hide: !0,
- items: "[title]:not([disabled])",
- position: {
- my: "left top+15",
- at: "left bottom",
- collision: "flipfit flip"
- },
- show: !0,
- tooltipClass: null,
- track: !1,
- close: null,
- open: null
- },
- _create: function() {
- this._on({
- mouseover: "open",
- focusin: "open"
- }), this.tooltips = {}, this.parents = {}, this.options.disabled && this._disable()
- },
- _setOption: function(t, i) {
- var s = this;
- return "disabled" === t ? (this[i ? "_disable" : "_enable"](), this.options[t] = i, void 0) : (this._super(t, i), "content" === t && e.each(this.tooltips, function(e, t) {
- s._updateContent(t)
- }), void 0)
- },
- _disable: function() {
- var t = this;
- e.each(this.tooltips, function(i, s) {
- var a = e.Event("blur");
- a.target = a.currentTarget = s[0], t.close(a, !0)
- }), this.element.find(this.options.items).addBack().each(function() {
- var t = e(this);
- t.is("[title]") && t.data("ui-tooltip-title", t.attr("title")).attr("title", "")
- })
- },
- _enable: function() {
- this.element.find(this.options.items).addBack().each(function() {
- var t = e(this);
- t.data("ui-tooltip-title") && t.attr("title", t.data("ui-tooltip-title"))
- })
- },
- open: function(t) {
- var i = this,
- s = e(t ? t.target : this.element).closest(this.options.items);
- s.length && !s.data("ui-tooltip-id") && (s.attr("title") && s.data("ui-tooltip-title", s.attr("title")), s.data("ui-tooltip-open", !0), t && "mouseover" === t.type && s.parents().each(function() {
- var t, s = e(this);
- s.data("ui-tooltip-open") && (t = e.Event("blur"), t.target = t.currentTarget = this, i.close(t, !0)), s.attr("title") && (s.uniqueId(), i.parents[this.id] = {
- element: this,
- title: s.attr("title")
- }, s.attr("title", ""))
- }), this._updateContent(s, t))
- },
- _updateContent: function(e, t) {
- var i, s = this.options.content,
- a = this,
- n = t ? t.type : null;
- return "string" == typeof s ? this._open(t, e, s) : (i = s.call(e[0], function(i) {
- e.data("ui-tooltip-open") && a._delay(function() {
- t && (t.type = n), this._open(t, e, i)
- })
- }), i && this._open(t, e, i), void 0)
- },
- _open: function(i, s, a) {
- function n(e) {
- l.of = e, r.is(":hidden") || r.position(l)
- }
- var r, o, h, l = e.extend({}, this.options.position);
- if (a) {
- if (r = this._find(s), r.length) return r.find(".ui-tooltip-content").html(a), void 0;
- s.is("[title]") && (i && "mouseover" === i.type ? s.attr("title", "") : s.removeAttr("title")), r = this._tooltip(s), t(s, r.attr("id")), r.find(".ui-tooltip-content").html(a), this.options.track && i && /^mouse/.test(i.type) ? (this._on(this.document, {
- mousemove: n
- }), n(i)) : r.position(e.extend({
- of: s
- }, this.options.position)), r.hide(), this._show(r, this.options.show), this.options.show && this.options.show.delay && (h = this.delayedShow = setInterval(function() {
- r.is(":visible") && (n(l.of), clearInterval(h))
- }, e.fx.interval)), this._trigger("open", i, {
- tooltip: r
- }), o = {
- keyup: function(t) {
- if (t.keyCode === e.ui.keyCode.ESCAPE) {
- var i = e.Event(t);
- i.currentTarget = s[0], this.close(i, !0)
- }
- },
- remove: function() {
- this._removeTooltip(r)
- }
- }, i && "mouseover" !== i.type || (o.mouseleave = "close"), i && "focusin" !== i.type || (o.focusout = "close"), this._on(!0, s, o)
- }
- },
- close: function(t) {
- var s = this,
- a = e(t ? t.currentTarget : this.element),
- n = this._find(a);
- this.closing || (clearInterval(this.delayedShow), a.data("ui-tooltip-title") && a.attr("title", a.data("ui-tooltip-title")), i(a), n.stop(!0), this._hide(n, this.options.hide, function() {
- s._removeTooltip(e(this))
- }), a.removeData("ui-tooltip-open"), this._off(a, "mouseleave focusout keyup"), a[0] !== this.element[0] && this._off(a, "remove"), this._off(this.document, "mousemove"), t && "mouseleave" === t.type && e.each(this.parents, function(t, i) {
- e(i.element).attr("title", i.title), delete s.parents[t]
- }), this.closing = !0, this._trigger("close", t, {
- tooltip: n
- }), this.closing = !1)
- },
- _tooltip: function(t) {
- var i = "ui-tooltip-" + s++,
- a = e("<div>").attr({
- id: i,
- role: "tooltip"
- }).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content " + (this.options.tooltipClass || ""));
- return e("<div>").addClass("ui-tooltip-content").appendTo(a), a.appendTo(this.document[0].body), this.tooltips[i] = t, a
- },
- _find: function(t) {
- var i = t.data("ui-tooltip-id");
- return i ? e("#" + i) : e()
- },
- _removeTooltip: function(e) {
- e.remove(), delete this.tooltips[e.attr("id")]
- },
- _destroy: function() {
- var t = this;
- e.each(this.tooltips, function(i, s) {
- var a = e.Event("blur");
- a.target = a.currentTarget = s[0], t.close(a, !0), e("#" + i).remove(), s.data("ui-tooltip-title") && (s.attr("title", s.data("ui-tooltip-title")), s.removeData("ui-tooltip-title"))
- })
- }
- })
- })(jQuery);
- (function(e, t) {
- var i = "ui-effects-";
- e.effects = {
- effect: {}
- },
- function(e, t) {
- function i(e, t, i) {
- var s = d[t.type] || {};
- return null == e ? i || !t.def ? null : t.def : (e = s.floor ? ~~e : parseFloat(e), isNaN(e) ? t.def : s.mod ? (e + s.mod) % s.mod : 0 > e ? 0 : e > s.max ? s.max : e)
- }
- function s(i) {
- var s = l(),
- a = s._rgba = [];
- return i = i.toLowerCase(), f(h, function(e, n) {
- var r, o = n.re.exec(i),
- h = o && n.parse(o),
- l = n.space || "rgba";
- return h ? (r = s[l](h), s[u[l].cache] = r[u[l].cache], a = s._rgba = r._rgba, !1) : t
- }), a.length ? ("0,0,0,0" === a.join() && e.extend(a, n.transparent), s) : n[i]
- }
- function a(e, t, i) {
- return i = (i + 1) % 1, 1 > 6 * i ? e + 6 * (t - e) * i : 1 > 2 * i ? t : 2 > 3 * i ? e + 6 * (t - e) * (2 / 3 - i) : e
- }
- var n, r = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
- o = /^([\-+])=\s*(\d+\.?\d*)/,
- h = [{
- re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
- parse: function(e) {
- return [e[1], e[2], e[3], e[4]]
- }
- }, {
- re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
- parse: function(e) {
- return [2.55 * e[1], 2.55 * e[2], 2.55 * e[3], e[4]]
- }
- }, {
- re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
- parse: function(e) {
- return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]
- }
- }, {
- re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
- parse: function(e) {
- return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)]
- }
- }, {
- re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
- space: "hsla",
- parse: function(e) {
- return [e[1], e[2] / 100, e[3] / 100, e[4]]
- }
- }],
- l = e.Color = function(t, i, s, a) {
- return new e.Color.fn.parse(t, i, s, a)
- },
- u = {
- rgba: {
- props: {
- red: {
- idx: 0,
- type: "byte"
- },
- green: {
- idx: 1,
- type: "byte"
- },
- blue: {
- idx: 2,
- type: "byte"
- }
- }
- },
- hsla: {
- props: {
- hue: {
- idx: 0,
- type: "degrees"
- },
- saturation: {
- idx: 1,
- type: "percent"
- },
- lightness: {
- idx: 2,
- type: "percent"
- }
- }
- }
- },
- d = {
- "byte": {
- floor: !0,
- max: 255
- },
- percent: {
- max: 1
- },
- degrees: {
- mod: 360,
- floor: !0
- }
- },
- c = l.support = {},
- p = e("<p>")[0],
- f = e.each;
- p.style.cssText = "background-color:rgba(1,1,1,.5)", c.rgba = p.style.backgroundColor.indexOf("rgba") > -1, f(u, function(e, t) {
- t.cache = "_" + e, t.props.alpha = {
- idx: 3,
- type: "percent",
- def: 1
- }
- }), l.fn = e.extend(l.prototype, {
- parse: function(a, r, o, h) {
- if (a === t) return this._rgba = [null, null, null, null], this;
- (a.jquery || a.nodeType) && (a = e(a).css(r), r = t);
- var d = this,
- c = e.type(a),
- p = this._rgba = [];
- return r !== t && (a = [a, r, o, h], c = "array"), "string" === c ? this.parse(s(a) || n._default) : "array" === c ? (f(u.rgba.props, function(e, t) {
- p[t.idx] = i(a[t.idx], t)
- }), this) : "object" === c ? (a instanceof l ? f(u, function(e, t) {
- a[t.cache] && (d[t.cache] = a[t.cache].slice())
- }) : f(u, function(t, s) {
- var n = s.cache;
- f(s.props, function(e, t) {
- if (!d[n] && s.to) {
- if ("alpha" === e || null == a[e]) return;
- d[n] = s.to(d._rgba)
- }
- d[n][t.idx] = i(a[e], t, !0)
- }), d[n] && 0 > e.inArray(null, d[n].slice(0, 3)) && (d[n][3] = 1, s.from && (d._rgba = s.from(d[n])))
- }), this) : t
- },
- is: function(e) {
- var i = l(e),
- s = !0,
- a = this;
- return f(u, function(e, n) {
- var r, o = i[n.cache];
- return o && (r = a[n.cache] || n.to && n.to(a._rgba) || [], f(n.props, function(e, i) {
- return null != o[i.idx] ? s = o[i.idx] === r[i.idx] : t
- })), s
- }), s
- },
- _space: function() {
- var e = [],
- t = this;
- return f(u, function(i, s) {
- t[s.cache] && e.push(i)
- }), e.pop()
- },
- transition: function(e, t) {
- var s = l(e),
- a = s._space(),
- n = u[a],
- r = 0 === this.alpha() ? l("transparent") : this,
- o = r[n.cache] || n.to(r._rgba),
- h = o.slice();
- return s = s[n.cache], f(n.props, function(e, a) {
- var n = a.idx,
- r = o[n],
- l = s[n],
- u = d[a.type] || {};
- null !== l && (null === r ? h[n] = l : (u.mod && (l - r > u.mod / 2 ? r += u.mod : r - l > u.mod / 2 && (r -= u.mod)), h[n] = i((l - r) * t + r, a)))
- }), this[a](h)
- },
- blend: function(t) {
- if (1 === this._rgba[3]) return this;
- var i = this._rgba.slice(),
- s = i.pop(),
- a = l(t)._rgba;
- return l(e.map(i, function(e, t) {
- return (1 - s) * a[t] + s * e
- }))
- },
- toRgbaString: function() {
- var t = "rgba(",
- i = e.map(this._rgba, function(e, t) {
- return null == e ? t > 2 ? 1 : 0 : e
- });
- return 1 === i[3] && (i.pop(), t = "rgb("), t + i.join() + ")"
- },
- toHslaString: function() {
- var t = "hsla(",
- i = e.map(this.hsla(), function(e, t) {
- return null == e && (e = t > 2 ? 1 : 0), t && 3 > t && (e = Math.round(100 * e) + "%"), e
- });
- return 1 === i[3] && (i.pop(), t = "hsl("), t + i.join() + ")"
- },
- toHexString: function(t) {
- var i = this._rgba.slice(),
- s = i.pop();
- return t && i.push(~~(255 * s)), "#" + e.map(i, function(e) {
- return e = (e || 0).toString(16), 1 === e.length ? "0" + e : e
- }).join("")
- },
- toString: function() {
- return 0 === this._rgba[3] ? "transparent" : this.toRgbaString()
- }
- }), l.fn.parse.prototype = l.fn, u.hsla.to = function(e) {
- if (null == e[0] || null == e[1] || null == e[2]) return [null, null, null, e[3]];
- var t, i, s = e[0] / 255,
- a = e[1] / 255,
- n = e[2] / 255,
- r = e[3],
- o = Math.max(s, a, n),
- h = Math.min(s, a, n),
- l = o - h,
- u = o + h,
- d = .5 * u;
- return t = h === o ? 0 : s === o ? 60 * (a - n) / l + 360 : a === o ? 60 * (n - s) / l + 120 : 60 * (s - a) / l + 240, i = 0 === l ? 0 : .5 >= d ? l / u : l / (2 - u), [Math.round(t) % 360, i, d, null == r ? 1 : r]
- }, u.hsla.from = function(e) {
- if (null == e[0] || null == e[1] || null == e[2]) return [null, null, null, e[3]];
- var t = e[0] / 360,
- i = e[1],
- s = e[2],
- n = e[3],
- r = .5 >= s ? s * (1 + i) : s + i - s * i,
- o = 2 * s - r;
- return [Math.round(255 * a(o, r, t + 1 / 3)), Math.round(255 * a(o, r, t)), Math.round(255 * a(o, r, t - 1 / 3)), n]
- }, f(u, function(s, a) {
- var n = a.props,
- r = a.cache,
- h = a.to,
- u = a.from;
- l.fn[s] = function(s) {
- if (h && !this[r] && (this[r] = h(this._rgba)), s === t) return this[r].slice();
- var a, o = e.type(s),
- d = "array" === o || "object" === o ? s : arguments,
- c = this[r].slice();
- return f(n, function(e, t) {
- var s = d["object" === o ? e : t.idx];
- null == s && (s = c[t.idx]), c[t.idx] = i(s, t)
- }), u ? (a = l(u(c)), a[r] = c, a) : l(c)
- }, f(n, function(t, i) {
- l.fn[t] || (l.fn[t] = function(a) {
- var n, r = e.type(a),
- h = "alpha" === t ? this._hsla ? "hsla" : "rgba" : s,
- l = this[h](),
- u = l[i.idx];
- return "undefined" === r ? u : ("function" === r && (a = a.call(this, u), r = e.type(a)), null == a && i.empty ? this : ("string" === r && (n = o.exec(a), n && (a = u + parseFloat(n[2]) * ("+" === n[1] ? 1 : -1))), l[i.idx] = a, this[h](l)))
- })
- })
- }), l.hook = function(t) {
- var i = t.split(" ");
- f(i, function(t, i) {
- e.cssHooks[i] = {
- set: function(t, a) {
- var n, r, o = "";
- if ("transparent" !== a && ("string" !== e.type(a) || (n = s(a)))) {
- if (a = l(n || a), !c.rgba && 1 !== a._rgba[3]) {
- for (r = "backgroundColor" === i ? t.parentNode : t;
- ("" === o || "transparent" === o) && r && r.style;) try {
- o = e.css(r, "backgroundColor"), r = r.parentNode
- } catch (h) {}
- a = a.blend(o && "transparent" !== o ? o : "_default")
- }
- a = a.toRgbaString()
- }
- try {
- t.style[i] = a
- } catch (h) {}
- }
- }, e.fx.step[i] = function(t) {
- t.colorInit || (t.start = l(t.elem, i), t.end = l(t.end), t.colorInit = !0), e.cssHooks[i].set(t.elem, t.start.transition(t.end, t.pos))
- }
- })
- }, l.hook(r), e.cssHooks.borderColor = {
- expand: function(e) {
- var t = {};
- return f(["Top", "Right", "Bottom", "Left"], function(i, s) {
- t["border" + s + "Color"] = e
- }), t
- }
- }, n = e.Color.names = {
- aqua: "#00ffff",
- black: "#000000",
- blue: "#0000ff",
- fuchsia: "#ff00ff",
- gray: "#808080",
- green: "#008000",
- lime: "#00ff00",
- maroon: "#800000",
- navy: "#000080",
- olive: "#808000",
- purple: "#800080",
- red: "#ff0000",
- silver: "#c0c0c0",
- teal: "#008080",
- white: "#ffffff",
- yellow: "#ffff00",
- transparent: [null, null, null, 0],
- _default: "#ffffff"
- }
- }(jQuery),
- function() {
- function i(t) {
- var i, s, a = t.ownerDocument.defaultView ? t.ownerDocument.defaultView.getComputedStyle(t, null) : t.currentStyle,
- n = {};
- if (a && a.length && a[0] && a[a[0]])
- for (s = a.length; s--;) i = a[s], "string" == typeof a[i] && (n[e.camelCase(i)] = a[i]);
- else
- for (i in a) "string" == typeof a[i] && (n[i] = a[i]);
- return n
- }
- function s(t, i) {
- var s, a, r = {};
- for (s in i) a = i[s], t[s] !== a && (n[s] || (e.fx.step[s] || !isNaN(parseFloat(a))) && (r[s] = a));
- return r
- }
- var a = ["add", "remove", "toggle"],
- n = {
- border: 1,
- borderBottom: 1,
- borderColor: 1,
- borderLeft: 1,
- borderRight: 1,
- borderTop: 1,
- borderWidth: 1,
- margin: 1,
- padding: 1
- };
- e.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function(t, i) {
- e.fx.step[i] = function(e) {
- ("none" !== e.end && !e.setAttr || 1 === e.pos && !e.setAttr) && (jQuery.style(e.elem, i, e.end), e.setAttr = !0)
- }
- }), e.fn.addBack || (e.fn.addBack = function(e) {
- return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
- }), e.effects.animateClass = function(t, n, r, o) {
- var h = e.speed(n, r, o);
- return this.queue(function() {
- var n, r = e(this),
- o = r.attr("class") || "",
- l = h.children ? r.find("*").addBack() : r;
- l = l.map(function() {
- var t = e(this);
- return {
- el: t,
- start: i(this)
- }
- }), n = function() {
- e.each(a, function(e, i) {
- t[i] && r[i + "Class"](t[i])
- })
- }, n(), l = l.map(function() {
- return this.end = i(this.el[0]), this.diff = s(this.start, this.end), this
- }), r.attr("class", o), l = l.map(function() {
- var t = this,
- i = e.Deferred(),
- s = e.extend({}, h, {
- queue: !1,
- complete: function() {
- i.resolve(t)
- }
- });
- return this.el.animate(this.diff, s), i.promise()
- }), e.when.apply(e, l.get()).done(function() {
- n(), e.each(arguments, function() {
- var t = this.el;
- e.each(this.diff, function(e) {
- t.css(e, "")
- })
- }), h.complete.call(r[0])
- })
- })
- }, e.fn.extend({
- addClass: function(t) {
- return function(i, s, a, n) {
- return s ? e.effects.animateClass.call(this, {
- add: i
- }, s, a, n) : t.apply(this, arguments)
- }
- }(e.fn.addClass),
- removeClass: function(t) {
- return function(i, s, a, n) {
- return arguments.length > 1 ? e.effects.animateClass.call(this, {
- remove: i
- }, s, a, n) : t.apply(this, arguments)
- }
- }(e.fn.removeClass),
- toggleClass: function(i) {
- return function(s, a, n, r, o) {
- return "boolean" == typeof a || a === t ? n ? e.effects.animateClass.call(this, a ? {
- add: s
- } : {
- remove: s
- }, n, r, o) : i.apply(this, arguments) : e.effects.animateClass.call(this, {
- toggle: s
- }, a, n, r)
- }
- }(e.fn.toggleClass),
- switchClass: function(t, i, s, a, n) {
- return e.effects.animateClass.call(this, {
- add: i,
- remove: t
- }, s, a, n)
- }
- })
- }(),
- function() {
- function s(t, i, s, a) {
- return e.isPlainObject(t) && (i = t, t = t.effect), t = {
- effect: t
- }, null == i && (i = {}), e.isFunction(i) && (a = i, s = null, i = {}), ("number" == typeof i || e.fx.speeds[i]) && (a = s, s = i, i = {}), e.isFunction(s) && (a = s, s = null), i && e.extend(t, i), s = s || i.duration, t.duration = e.fx.off ? 0 : "number" == typeof s ? s : s in e.fx.speeds ? e.fx.speeds[s] : e.fx.speeds._default, t.complete = a || i.complete, t
- }
- function a(t) {
- return !t || "number" == typeof t || e.fx.speeds[t] ? !0 : "string" != typeof t || e.effects.effect[t] ? e.isFunction(t) ? !0 : "object" != typeof t || t.effect ? !1 : !0 : !0
- }
- e.extend(e.effects, {
- version: "1.10.4",
- save: function(e, t) {
- for (var s = 0; t.length > s; s++) null !== t[s] && e.data(i + t[s], e[0].style[t[s]])
- },
- restore: function(e, s) {
- var a, n;
- for (n = 0; s.length > n; n++) null !== s[n] && (a = e.data(i + s[n]), a === t && (a = ""), e.css(s[n], a))
- },
- setMode: function(e, t) {
- return "toggle" === t && (t = e.is(":hidden") ? "show" : "hide"), t
- },
- getBaseline: function(e, t) {
- var i, s;
- switch (e[0]) {
- case "top":
- i = 0;
- break;
- case "middle":
- i = .5;
- break;
- case "bottom":
- i = 1;
- break;
- default:
- i = e[0] / t.height
- }
- switch (e[1]) {
- case "left":
- s = 0;
- break;
- case "center":
- s = .5;
- break;
- case "right":
- s = 1;
- break;
- default:
- s = e[1] / t.width
- }
- return {
- x: s,
- y: i
- }
- },
- createWrapper: function(t) {
- if (t.parent().is(".ui-effects-wrapper")) return t.parent();
- var i = {
- width: t.outerWidth(!0),
- height: t.outerHeight(!0),
- "float": t.css("float")
- },
- s = e("<div></div>").addClass("ui-effects-wrapper").css({
- fontSize: "100%",
- background: "transparent",
- border: "none",
- margin: 0,
- padding: 0
- }),
- a = {
- width: t.width(),
- height: t.height()
- },
- n = document.activeElement;
- try {
- n.id
- } catch (r) {
- n = document.body
- }
- return t.wrap(s), (t[0] === n || e.contains(t[0], n)) && e(n).focus(), s = t.parent(), "static" === t.css("position") ? (s.css({
- position: "relative"
- }), t.css({
- position: "relative"
- })) : (e.extend(i, {
- position: t.css("position"),
- zIndex: t.css("z-index")
- }), e.each(["top", "left", "bottom", "right"], function(e, s) {
- i[s] = t.css(s), isNaN(parseInt(i[s], 10)) && (i[s] = "auto")
- }), t.css({
- position: "relative",
- top: 0,
- left: 0,
- right: "auto",
- bottom: "auto"
- })), t.css(a), s.css(i).show()
- },
- removeWrapper: function(t) {
- var i = document.activeElement;
- return t.parent().is(".ui-effects-wrapper") && (t.parent().replaceWith(t), (t[0] === i || e.contains(t[0], i)) && e(i).focus()), t
- },
- setTransition: function(t, i, s, a) {
- return a = a || {}, e.each(i, function(e, i) {
- var n = t.cssUnit(i);
- n[0] > 0 && (a[i] = n[0] * s + n[1])
- }), a
- }
- }), e.fn.extend({
- effect: function() {
- function t(t) {
- function s() {
- e.isFunction(n) && n.call(a[0]), e.isFunction(t) && t()
- }
- var a = e(this),
- n = i.complete,
- o = i.mode;
- (a.is(":hidden") ? "hide" === o : "show" === o) ? (a[o](), s()) : r.call(a[0], i, s)
- }
- var i = s.apply(this, arguments),
- a = i.mode,
- n = i.queue,
- r = e.effects.effect[i.effect];
- return e.fx.off || !r ? a ? this[a](i.duration, i.complete) : this.each(function() {
- i.complete && i.complete.call(this)
- }) : n === !1 ? this.each(t) : this.queue(n || "fx", t)
- },
- show: function(e) {
- return function(t) {
- if (a(t)) return e.apply(this, arguments);
- var i = s.apply(this, arguments);
- return i.mode = "show", this.effect.call(this, i)
- }
- }(e.fn.show),
- hide: function(e) {
- return function(t) {
- if (a(t)) return e.apply(this, arguments);
- var i = s.apply(this, arguments);
- return i.mode = "hide", this.effect.call(this, i)
- }
- }(e.fn.hide),
- toggle: function(e) {
- return function(t) {
- if (a(t) || "boolean" == typeof t) return e.apply(this, arguments);
- var i = s.apply(this, arguments);
- return i.mode = "toggle", this.effect.call(this, i)
- }
- }(e.fn.toggle),
- cssUnit: function(t) {
- var i = this.css(t),
- s = [];
- return e.each(["em", "px", "%", "pt"], function(e, t) {
- i.indexOf(t) > 0 && (s = [parseFloat(i), t])
- }), s
- }
- })
- }(),
- function() {
- var t = {};
- e.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function(e, i) {
- t[i] = function(t) {
- return Math.pow(t, e + 2)
- }
- }), e.extend(t, {
- Sine: function(e) {
- return 1 - Math.cos(e * Math.PI / 2)
- },
- Circ: function(e) {
- return 1 - Math.sqrt(1 - e * e)
- },
- Elastic: function(e) {
- return 0 === e || 1 === e ? e : -Math.pow(2, 8 * (e - 1)) * Math.sin((80 * (e - 1) - 7.5) * Math.PI / 15)
- },
- Back: function(e) {
- return e * e * (3 * e - 2)
- },
- Bounce: function(e) {
- for (var t, i = 4;
- ((t = Math.pow(2, --i)) - 1) / 11 > e;);
- return 1 / Math.pow(4, 3 - i) - 7.5625 * Math.pow((3 * t - 2) / 22 - e, 2)
- }
- }), e.each(t, function(t, i) {
- e.easing["easeIn" + t] = i, e.easing["easeOut" + t] = function(e) {
- return 1 - i(1 - e)
- }, e.easing["easeInOut" + t] = function(e) {
- return .5 > e ? i(2 * e) / 2 : 1 - i(-2 * e + 2) / 2
- }
- })
- }()
- })(jQuery);
- (function(e) {
- e.effects.effect.drop = function(t, i) {
- var s, a = e(this),
- n = ["position", "top", "bottom", "left", "right", "opacity", "height", "width"],
- r = e.effects.setMode(a, t.mode || "hide"),
- o = "show" === r,
- h = t.direction || "left",
- l = "up" === h || "down" === h ? "top" : "left",
- u = "up" === h || "left" === h ? "pos" : "neg",
- d = {
- opacity: o ? 1 : 0
- };
- e.effects.save(a, n), a.show(), e.effects.createWrapper(a), s = t.distance || a["top" === l ? "outerHeight" : "outerWidth"](!0) / 2, o && a.css("opacity", 0).css(l, "pos" === u ? -s : s), d[l] = (o ? "pos" === u ? "+=" : "-=" : "pos" === u ? "-=" : "+=") + s, a.animate(d, {
- queue: !1,
- duration: t.duration,
- easing: t.easing,
- complete: function() {
- "hide" === r && a.hide(), e.effects.restore(a, n), e.effects.removeWrapper(a), i()
- }
- })
- }
- })(jQuery);
- ! function(widget, $, util) {
- widget.checkboxAndRadio = function(pSelector, pType, pOptions) {
- function _clear() {
- $.mobile ? gFieldset$.children("div.ui-controlgroup-controls").empty() : gFieldset$.children(":not(legend)").remove()
- }
- function _triggerRefresh() {
- gFieldset$.trigger("apexrefresh")
- }
- function _addResult(pData) {
- $.mobile ? ($("div.ui-controlgroup-controls", gFieldset$).append(pData.html), $(":" + pType, gFieldset$).checkboxradio(), gFieldset$.controlgroup()) : gFieldset$.append(pData.html), pData.hasOwnProperty("default") && $s(gFieldset$[0], pData["default"])
- }
- function refresh() {
- var lOptions = {
- optimizeRefresh: gOptions.optimizeRefresh,
- dependingOn: $(gOptions.dependingOnSelector, apex.gPageContext$),
- success: _addResult,
- clear: _clear
- };
- widget.util.cascadingLov(gFieldset$, gOptions.ajaxIdentifier, {
- x01: gOptions.inputName,
- pageItems: $(gOptions.pageItemsToSubmit, apex.gPageContext$)
- }, lOptions)
- }
- var gOptions = $.extend({
- action: null,
- nullValue: "",
- inputName: null
- }, pOptions),
- gFieldset$ = $(pSelector, apex.gPageContext$);
- $(pSelector, apex.gPageContext$).each(function() {
- var lFieldset = this;
- widget.initPageItem(this.id, {
- enable: function() {
- $(":" + pType, lFieldset).prop("disabled", !1).removeClass("apex_disabled_multi")
- },
- disable: function() {
- $(":" + pType, lFieldset).prop("disabled", !0).addClass("apex_disabled_multi")
- },
- setValue: function(pValue) {
- var $lRadios = $(":" + pType, lFieldset),
- lValueArray = [];
- $lRadios.prop("checked", !1), "checkbox" === pType ? lValueArray = apex.util.toArray(pValue) : lValueArray[0] = pValue;
- for (var i = 0; i < lValueArray.length; i++) $lRadios.filter("[value='" + util.escapeCSS(lValueArray[i]) + "']").prop("checked", !0)
- },
- getValue: function() {
- var lReturn, $lRadio;
- return "checkbox" === pType ? (lReturn = [], $(":checked", lFieldset).each(function() {
- lReturn[lReturn.length] = this.value
- })) : ($lRadio = $(pSelector + " :checked", apex.gPageContext$), lReturn = 0 === $lRadio.length ? "" : $lRadio.val()), lReturn
- },
- afterModify: function() {
- $.mobile && $(":" + pType, lFieldset).checkboxradio("refresh")
- },
- nullValue: gOptions.nullValue,
- setFocusTo: $(":" + pType, lFieldset).first(),
- loadingIndicator: function(pLoadingIndicator$) {
- var lLoadingIndicator$;
- return lLoadingIndicator$ = $.mobile ? pLoadingIndicator$.appendTo($("div.ui-controlgroup-controls", gFieldset$)) : pLoadingIndicator$.appendTo(gFieldset$)
- }
- })
- }), gOptions.dependingOnSelector && $(gOptions.dependingOnSelector, apex.gPageContext$).change(_triggerRefresh), gFieldset$.bind("apexrefresh", refresh), "REDIRECT_SET_VALUE" === gOptions.action ? gFieldset$.find("input").click(function() {
- location.href = "f?p=" + $v("pFlowId") + ":" + $v("pFlowStepId") + ":" + $v("pInstance") + "::" + $v("pdebug") + "::" + gFieldset$.attr("id") + ":" + $v(gFieldset$.attr("id"))
- }) : "SUBMIT" === gOptions.action && gFieldset$.find("input").click(function() {
- apex.submit(gFieldset$.attr("id"))
- })
- }
- }(apex.widget, apex.jQuery, apex.util);
- ! function(widget, $) {
- widget.datepicker = function(pSelector, pOptions, pFormat, pLocale) {
- var lOnSelectCallBack = null;
- (!pOptions.showTime || pOptions.showTime && "inline" == pOptions.showOn) && (lOnSelectCallBack = function(dateText, inst) {
- if (inst.inline) {
- var altField = inst.settings.altField;
- 0 === altField.indexOf("#") && (altField = altField.substr(1, altField.length)), altField && $s(altField, dateText)
- } else $s(inst.id, dateText)
- });
- var lLang = pLocale,
- lOptions = $.extend({
- dateFormat: pFormat,
- duration: "",
- constrainInput: !1,
- onSelect: lOnSelectCallBack,
- locale: lLang
- }, pOptions),
- lLocale = $.datepicker.regional[pLocale];
- delete lLocale.maxDate, delete lLocale.minDate, delete lLocale.defaultDate, delete lLocale.dateFormat, delete lLocale.yearRange, delete lLocale.numberOfMonths, delete lLocale.altField, lOptions = $.extend(lLocale, lOptions);
- $(pSelector, apex.gPageContext$).datepicker(lOptions);
- $(pSelector, apex.gPageContext$).each(function() {
- widget.initPageItem(this.id, {
- enable: function() {
- $("#" + this.id, apex.gPageContext$).datepicker("enable").removeClass("apex_disabled")
- },
- disable: function() {
- $("#" + this.id, apex.gPageContext$).datepicker("disable").addClass("apex_disabled")
- },
- show: function() {
- $("#" + this.id, apex.gPageContext$).parent().children().show()
- },
- hide: function() {
- $("#" + this.id, apex.gPageContext$).parent().children().hide()
- }
- })
- })
- }
- }(apex.widget, apex.jQuery);
- ! function(widget, $) {
- widget.popupLov = function(pSelector, pOptions) {
- function _triggerRefresh() {
- gPopupLov.trigger("apexrefresh")
- }
- function refresh() {
- gPopupLov.trigger("apexbeforerefresh"), $s(gPopupLov.attr("id"), gOptions.nullValue, gOptions.nullValue), gPopupLov.trigger("apexafterrefresh")
- }
- function _callPopup() {
- return widget.util.callPopupLov(gOptions.ajaxIdentifier, {
- pageItems: $(gOptions.pageItemsToSubmit, apex.gPageContext$).add(gOptions.dependingOnSelector)
- }, {
- filterOutput: gOptions.filterWithValue,
- filterValue: gPopupLov.val(),
- windowParameters: gOptions.windowParameters
- }), !1
- }
- var gOptions = $.extend({
- dependingOnSelector: null,
- optimizeRefresh: !0,
- pageItemsToSubmit: null,
- nullValue: "",
- filterWithValue: !1,
- windowParameters: null,
- inputField: "NOT_ENTERABLE"
- }, pOptions),
- gPopupLov = $(pSelector, apex.gPageContext$),
- gEnterable = "ENTERABLE" == gOptions.inputField;
- $(pSelector, apex.gPageContext$).each(function() {
- widget.initPageItem(this.id, {
- enable: function() {
- widget.util.enableIcon($("#" + this.id + "_holder", apex.gPageContext$).find("a"), "#", _callPopup), gEnterable ? gPopupLov.prop("disabled", !1).removeClass("apex_disabled") : $("#" + this.id + "_HIDDENVALUE", apex.gPageContext$).prop("disabled", !1)
- },
- disable: function() {
- widget.util.disableIcon($(gPopupLov).closest("tr")), gEnterable ? gPopupLov.prop("disabled", !0).addClass("apex_disabled") : $("#" + this.id + "_HIDDENVALUE", apex.gPageContext$).prop("disabled", !0)
- },
- show: function() {
- $("#" + this.id, apex.gPageContext$).closest("tr").show()
- },
- hide: function() {
- $("#" + this.id, apex.gPageContext$).closest("tr").hide()
- },
- setValue: function(pValue, pDisplayValue) {
- gEnterable ? $("#" + this.id, apex.gPageContext$).val(pValue) : ($("#" + this.id + "_HIDDENVALUE", apex.gPageContext$).val(pValue), $("#" + this.id, apex.gPageContext$).val(pDisplayValue))
- },
- getValue: function() {
- var lReturn;
- return lReturn = gEnterable ? $("#" + this.id, apex.gPageContext$).val() : $("#" + this.id + "_HIDDENVALUE", apex.gPageContext$).val()
- },
- setFocusTo: function() {
- return gEnterable ? $(pSelector, apex.gPageContext$) : $(pSelector + "_fieldset a", apex.gPageContext$)
- },
- nullValue: gOptions.nullValue
- })
- }), $(pSelector + "_fieldset a", apex.gPageContext$).click(_callPopup), gOptions.dependingOnSelector && $(gOptions.dependingOnSelector, apex.gPageContext$).change(_triggerRefresh), gPopupLov.bind("apexrefresh", refresh)
- }
- }(apex.widget, apex.jQuery);
- ! function(widget, $) {
- widget.selectList = function(pSelector, pOptions) {
- function _setValue(pValue) {
- gSelectList$.val(pValue), -1 === gSelectList$[0].selectedIndex && 1 === parseInt($nvl(gSelectList$.attr("size"), "1"), 10) && gSelectList$.children("option").first().prop("selected", !0)
- }
- function _clearList() {
- "nullValue" in pOptions ? $('option[value!="' + apex.util.escapeCSS(gOptions.nullValue) + '"]', gSelectList$).remove() : $("option", gSelectList$).remove(), $.mobile && gSelectList$.selectmenu("refresh", !0)
- }
- function _addResult(pData) {
- var lHtml = "";
- $.each(pData.values, function() {
- lHtml = lHtml + '<option value="' + this.r + '" ' + gOptions.optionAttributes + ">" + this.d + "</option>"
- }), gSelectList$.append(lHtml), $.mobile && gSelectList$.selectmenu("refresh", !0), $s(gSelectList$[0], pData["default"])
- }
- function refresh() {
- widget.util.cascadingLov(gSelectList$, gOptions.ajaxIdentifier, {
- pageItems: $(gOptions.pageItemsToSubmit, apex.gPageContext$)
- }, {
- optimizeRefresh: gOptions.optimizeRefresh,
- dependingOn: $(gOptions.dependingOnSelector, apex.gPageContext$),
- success: _addResult,
- clear: _clearList
- })
- }
- var gOptions = $.extend({
- optionAttributes: null,
- nullValue: ""
- }, pOptions),
- gSelectList$ = $(pSelector, apex.gPageContext$);
- gSelectList$.each(function() {
- $.mobile ? widget.initPageItem(this.id, {
- setValue: _setValue,
- enable: function() {
- gSelectList$.selectmenu("enable")
- },
- disable: function() {
- gSelectList$.selectmenu("disable")
- },
- afterModify: function() {
- gSelectList$.selectmenu("refresh")
- },
- nullValue: gOptions.nullValue
- }) : widget.initPageItem(this.id, {
- setValue: _setValue,
- nullValue: gOptions.nullValue
- })
- }), gOptions.dependingOnSelector && $(gOptions.dependingOnSelector, apex.gPageContext$).bind("apexbeforerefresh", _clearList).change(refresh), gSelectList$.bind("apexrefresh", refresh)
- }
- }(apex.widget, apex.jQuery);
- ! function(widget, $, undefined) {
- widget.textarea = function(pId, pOptions) {
- function resizable() {
- function startResize(pEvent) {
- return gOffsetX = gTextarea.width() - pEvent.pageX, gOffsetY = gTextarea.height() - pEvent.pageY, gTextarea.css("opacity", .25), $(document).bind("mousemove.apex_startResize", function(pE) {
- return performResize(pE, "se-resize" === $(pEvent.currentTarget).css("cursor"))
- }).bind("mouseup.apex_startResize", endResize), !1
- }
- function performResize(pEvent, pSetWidth) {
- var lWidth;
- return gTextarea.height(Math.max(gMinHeight, gOffsetY + pEvent.pageY) + "px"), pSetWidth && (lWidth = Math.max(gMinWidth, gOffsetX + pEvent.pageX), gTextarea.width(lWidth)), !1
- }
- function endResize(pEvent) {
- $(document).unbind("mousemove.apex_startResize").unbind("mouseup.apex_startResize"), gTextarea.css("opacity", 1)
- }
- var gMinWidth, gMinHeight, gOffsetX = null,
- gOffsetY = null;
- gMinWidth = parseInt(gTextarea.css("min-width"), 10) || 20, gMinHeight = parseInt(gTextarea.css("min-height"), 10) || 20, gTextarea.after('<div class="apex_size_bar"><div class="apex_size_grip"></div></div>'), $("div.apex_size_bar, div.apex_size_grip", gTextarea.parent()).mousedown(startResize), gTextarea.parent().css("display:inline-block")
- }
- function charCount() {
- var lLength = gTextarea.val().replace(/\n/g, "xx").length,
- lPctFull = lLength / gOptions.maxChar * 100;
- lLength >= gOptions.maxChar ? (gTextarea.val(gTextarea.val().substr(0, gOptions.maxChar)), gTextarea.css("color", "red"), gCounter.html(gOptions.maxChar)) : (gTextarea.css("color", "black"), gCounter.html(lLength)), lLength > 0 ? gCountDiv.show() : gCountDiv.hide(), lPctFull > 95 ? gCountDiv.css("color", "red") : lPctFull >= 90 ? gCountDiv.css("color", "#EAA914") : gCountDiv.css("color", "black")
- }
- var gTextarea = $("#" + pId, apex.gPageContext$),
- gOptions = $.extend({
- isResizable: !1,
- hasCharCounter: !1,
- maxChar: null
- }, pOptions);
- if (0 !== gTextarea.length) {
- if (gOptions.isResizable && ("string" == typeof document.documentElement.style.resize ? gTextarea.css("resize", "both") : resizable()), gOptions.hasCharCounter) {
- var gCountDiv = $("#" + pId + "_CHAR_COUNT", apex.gPageContext$),
- gCounter = $("#" + pId + "_CHAR_COUNTER", apex.gPageContext$);
- gTextarea.change(charCount).keyup(charCount).focus(charCount), charCount()
- }
- apex.widget.initPageItem(pId, {
- show: function() {
- gTextarea.closest("fieldset").show()
- },
- hide: function() {
- gTextarea.closest("fieldset").hide()
- }
- })
- }
- }
- }(apex.widget, apex.jQuery);
- ! function(widget, $) {
- widget.yesNo = function(pPageItemId) {
- $.mobile && widget.initPageItem(pPageItemId, {
- enable: function() {
- $(this.node).slider("enable")
- },
- disable: function() {
- $(this.node).slider("disable")
- },
- afterModify: function() {
- $(this.node).slider("refresh")
- }
- })
- }
- }(apex.widget, apex.jQuery);
- ! function(util, debug, lang, $, undefined) {
- "use strict";
- function renderIcon(out, iconType, iconName) {
- out.markup("<span").attr("class", iconType + " " + iconName).markup("></span>")
- }
- function menuResize() {
- var i, $menu, $item, x, y;
- for (menuLauncher ? (x = $(menuLauncher), y = null) : (x = originalX, y = originalY), placeMenu({
- $menu: menuStack[0],
- subMenu: !1,
- x: x,
- y: y,
- slide: !1
- }), i = 1; i < menuStack.length; i++) $menu = menuStack[i], $item = $menu.parents(SEL_ITEM).eq(0), placeMenu({
- $menu: $menu,
- subMenu: !0,
- x: $item,
- slide: !1
- })
- }
- function menubarResize() {
- $(SEL_MENUBAR).each(function() {
- $(this).menu("resize")
- })
- }
- function startTrackingMenus() {
- isTracking || (isTracking = !0, $(window).on("blur.menuTracking", function() {
- menuManager.closeAll(!0)
- }), $("html").on("mousedown.menuTracking", function(e) {
- var $target = $(e.target);
- 0 !== $target.closest(SEL_MENU).length || menuLauncher && 0 !== $target.closest(menuLauncher).length || menuManager.closeAll(!0)
- }).on("mousemove.menuTracking", function(e) {
- var $target, menu;
- (lastTrackingMouseX !== e.pageX || lastTrackingMouseY !== e.pageY) && (lastTrackingMouseX = e.pageX, lastTrackingMouseY = e.pageY, $target = $(e.target), menu = $target.parents(SEL_MENU)[0], !menu && currentMenuBar && (menu = $target.parent(SEL_MENUBAR)[0]), !menu && lastMenu && lastMenu !== menu && $(lastMenu).focus(), lastMenu = menu)
- }), apex.tooltipManager && apex.tooltipManager.disableTooltips())
- }
- function stopTrackingMenus() {
- $(window).off(".menuTracking"), $("html").off(".menuTracking"), isTracking = !1, apex.tooltipManager && apex.tooltipManager.enableTooltips()
- }
- function getMenuScrollParent($menu) {
- return $menu.children().children(SEL_MENU_SCROLL)
- }
- function focusMenuLauncher() {
- var $menuLauncher;
- menuLauncher && ($menuLauncher = $(menuLauncher), $menuLauncher.is(SEL_ITEM) ? $menuLauncher.find(SEL_FOCUSABLE).focus() : $menuLauncher.focus())
- }
- function placeMenu(o) {
- var out, menuh, maxMenuHeight, scale, itemHeight, $menu = o.$menu,
- posInfo = {},
- isVisible = "none" !== $menu.css("display");
- isVisible || $menu.css({
- display: "block",
- position: "absolute",
- top: -99999,
- left: 0
- }), o.minWidth && $menu.css("min-width", o.minWidth), "true" !== $menu.attr("data-custom") && (itemHeight = $menu.find("li").first().outerHeight(), maxMenuHeight = $(window).height(), scale = maxMenuHeight > 1e3 ? .6 : maxMenuHeight > 500 ? .75 : .9, maxMenuHeight = Math.floor(maxMenuHeight * scale / itemHeight) * itemHeight - itemHeight, menuh = $menu.height(), menuh > maxMenuHeight ? (0 === getMenuScrollParent($menu).length && (out = util.htmlBuilder(), out.markup("<div").attr("class", C_MENU_SCROLL_BTN + " " + C_UP).markup(">"), renderIcon(out, C_DEFAULT_ICON_TYPE, C_ICON_SCROLL_UP), out.markup("</div>"), $menu.children().first().addClass(C_MENU_SCROLLABLE).prepend(out.toString()).append(out.toString().replace(C_ICON_SCROLL_UP, C_ICON_SCROLL_DOWN).replace(C_UP, C_DOWN)).children("ul").first().wrap("<div class='" + C_MENU_SCROLL + "'></div>")), getMenuScrollParent($menu).height(maxMenuHeight)[0].scrollTop = 0, $menu.find(SEL_MENU_SCROLL_BTN + "." + C_UP).addClass(C_DISABLED)) : getMenuScrollParent($menu).length > 0 && ($menu.children().first().removeClass(C_MENU_SCROLLABLE).children(SEL_MENU_SCROLL_BTN).remove(), $menu.find("ul").first().unwrap())), "number" == typeof o.x && "number" == typeof o.y ? (originalX = o.x, originalY = o.y, posInfo.of = $.Event("click", {
- pageX: originalX,
- pageY: originalY
- })) : (originalX = originalY = null, posInfo.of = o.x), currentIsRtl ? o.subMenu ? (posInfo.my = "right top", posInfo.at = "left top") : (posInfo.my = "right top", posInfo.at = "right bottom") : o.subMenu ? (posInfo.my = "left top", posInfo.at = "right top") : (posInfo.my = "left top", posInfo.at = "left bottom"), posInfo.collision = "flipfit flipfit", $menu.position(posInfo), $menu.css("display", isVisible ? "block" : "none"), isVisible || (o.slide ? $menu.slideDown(200) : $menu.show(), o.focus && $menu.focus())
- }
- function itemIsMenuBarItem($item) {
- return $item.parent().parent().hasClass(C_MENUBAR)
- }
- function findItemById(menu, id) {
- var theItem = null;
- return $.each(menu.items, function(i, item) {
- return item.id === id ? (theItem = item, !1) : "subMenu" === item.type && (theItem = findItemById(item.menu, id), null !== theItem) ? !1 : void 0
- }), theItem
- }
- function getChoiceFromId(id) {
- var choice = null,
- index = id.search(/_c[0-9]+$/);
- return index >= 0 && (choice = 1 * id.substring(index + 2)), choice
- }
- function invokeItem(item, choice, menuOptions, typeOverride, delay) {
- function doAction() {
- var menuOpened;
- $(document.body).on("dialogopen.menu", function(e) {
- var dialog$ = $(e.target);
- menuOpened = !0, dialog$.dialog("option", "modal") && dialog$.on("dialogclose.menu", function(e) {
- dialog$.off("dialogclose.menu"), focusMenuLauncher()
- })
- }), setTimeout(function() {
- $(document.body).off("dialogopen.menu")
- }, 150), "string" == typeof item.action && apex.actions ? (debug.info("Invoke action menu item '" + (item.label || apex.actions.lookup(item.action).label) + "'"), actionTookFocus = apex.actions.invoke(item.action, {}, menuLauncher) || !1) : (debug.info("Invoke action menu item '" + item.label + "'"), item.action ? actionTookFocus = item.action(menuOptions, menuLauncher) || !1 : item.href && (apex.navigation.redirect(item.href), actionTookFocus = !0)), menuOpened && (actionTookFocus = !0)
- }
- var value, isAction = !1,
- type = typeOverride || item.type;
- try {
- if ("toggle" === type) "string" == typeof item.action && apex.actions && (item = apex.actions.lookup(item.action), isAction = !0), value = !item.get(), debug.info("Invoke toggle menu item '" + (item.label || (value ? item.onLabel : item.offLabel)) + "' value now " + value), item.set(value), isAction && apex.actions.update(item.name), actionTaken = !0;
- else if ("radioGroup" === type) value = item.choices[choice].value, debug.info("Invoke choice menu item '" + item.choices[choice].label + "' value now " + value), item.set(value), actionTaken = !0;
- else if ("action" === type) delay ? setTimeout(function() {
- doAction()
- }, 210) : doAction(), actionTaken = !0;
- else if ("subMenu" === type) return !1
- } catch (ex) {
- debug.error("Error in menu action.", ex)
- }
- return !0
- }
- function descendentIsCurrent(item, clear) {
- var i, curItem;
- if (item.menu && item.menu.items)
- for (i = 0; i < item.menu.items.length; i++)
- if (curItem = item.menu.items[i], curItem.current || descendentIsCurrent(curItem, clear)) return clear && curItem.current && delete curItem.current, !0;
- return !1
- }
- function getLabelFromMessage(item) {
- item.labelKey && (item.label = lang.getMessage(item.labelKey)), item.onLabelKey && (item.onLabel = lang.getMessage(item.onLabelKey)), item.offLabelKey && (item.offLabel = lang.getMessage(item.offLabelKey))
- }
- function setItemFocus(item$) {
- item$.is(SEL_FOCUSABLE) ? item$.focus() : item$.find(SEL_FOCUSABLE).first().focus()
- }
- function getItemsForMenu(menu$) {
- var parentItem, items$;
- return parentItem = menu$.closest(SEL_MENU_ITEM)[0], items$ = menu$.find(SEL_MENU_ITEM).not(function(index, element) {
- var p = $(element).parent().closest(SEL_MENU_ITEM)[0];
- return p !== parentItem
- })
- }
- function getItemLabel(item$) {
- var label$ = item$.children(SEL_MENUITEM_LABEL);
- return 0 === label$.length && (label$ = item$.children(SEL_ITEM_INNER).find(SEL_MENUITEM_LABEL)), label$
- }
- var currentMenu = null,
- currentMenuBar = null,
- currentIsRtl = !1,
- menuLauncher = null,
- actionTookFocus = !1,
- actionTaken = !1,
- menuStack = [],
- menuLayoutDone = [],
- isTracking = !1,
- keepTracking = !1,
- originalX = null,
- originalY = null,
- lastMouseX = 0,
- lastMouseY = 0,
- lastTrackingMouseX = 0,
- lastTrackingMouseY = 0,
- subMenuDelayID = null,
- subMenuCloseDelayID = null,
- closeDelayMenu = null,
- lastMenu = null,
- lastItem = null,
- C_MENUBAR = "a-MenuBar",
- SEL_MENUBAR = ".a-MenuBar",
- C_MENUBAR_TABS = "a-MenuBar--tabs",
- C_MENU = "a-Menu",
- SEL_MENU = ".a-Menu",
- C_MENU_TOP = "a-Menu--top",
- C_MENU_CONTENT = "a-Menu-content",
- SEL_MENU_CONTENT = "." + C_MENU_CONTENT,
- C_MENU_SCROLL = "a-Menu-scroll",
- SEL_MENU_SCROLL = ".a-Menu-scroll",
- C_MENU_SCROLL_BTN = "a-Menu-scrollBtn",
- SEL_MENU_SCROLL_BTN = ".a-Menu-scrollBtn",
- C_MENU_SCROLLABLE = "a-Menu--scrollable",
- C_UP = "a-Menu-scrollBtn--up",
- C_DOWN = "a-Menu-scrollBtn--down",
- C_ICON_SCROLL_UP = "icon-menu-scroll-up",
- C_ICON_SCROLL_DOWN = "icon-menu-scroll-down",
- C_ITEM = "a-Menu-item",
- SEL_MENU_ITEM = "." + C_ITEM,
- SEL_ITEM = ".a-Menu-item, .a-MenuBar-item",
- SEL_ITEM_INNER = ".a-Menu-inner",
- SEL_ITEM_IN_MENU = ".a-Menu-item, .a-MenuBar-item, .a-Menu-content",
- SEL_ITEM_OR_BTN = SEL_ITEM_IN_MENU + ", " + SEL_MENU_SCROLL_BTN,
- C_ITEM_DEFAULT = "a-Menu-item--default",
- C_BAR_ITEM = "a-MenuBar-item",
- C_BAR_OVERFLOW = "a-MenuBar-item--overflow",
- C_OVERFLOW = "a-MenuBar--overflow",
- C_STATUS_COL = "a-Menu-statusCol",
- C_LABEL = "a-Menu-label",
- C_ACCEL = "a-Menu-accel",
- C_BAR_LABEL = "a-MenuBar-label",
- SEL_LABEL = ".a-Menu-label",
- SEL_MENUITEM_LABEL = ".a-Menu-label,.a-MenuBar-label",
- C_SUBMENU_COL = "a-Menu-subMenuCol",
- SEL_SUBMENU_COL = ".a-Menu-subMenuCol",
- C_SPLIT_MENU = "a-Menu--split",
- C_CURRENT_MENU = "a-Menu--current",
- C_HSEP = "a-Menu-hSeparator",
- C_ITEM_SEP = "a-Menu-itemSep",
- SEL_ITEM_SEP = ".a-Menu-itemSep",
- C_DISABLED = "is-disabled",
- C_FOCUSED = "is-focused",
- C_ACTIVE = "is-active",
- SEL_FOCUSED = ".is-focused",
- SEL_FOCUSABLE = "a, button, .a-Menu-label, .a-MenuBar-label",
- C_EXPANDED = "is-expanded",
- SEL_EXPANDED = ".is-expanded",
- C_DEFAULT_ICON_TYPE = "a-Icon",
- SEL_MENUBUTTON = "button.js-menuButton",
- C_RTL = "u-RTL",
- A_EXPANDED = "aria-expanded",
- A_DISABLED = "aria-disabled",
- A_HASPOPUP = "aria-haspopup",
- A_CHECKED = "aria-checked",
- keys = $.ui.keyCode;
- $(document).ready(function() {
- $(window).on("apexwindowresized", function() {
- menubarResize(), isTracking && menuResize()
- })
- });
- var menuManager = {
- openMenu: function($menu, $menuBar, x, y, slide, focus) {
- var minWidth = 0;
- this.closeAll(), currentMenu = $menu[0], currentMenuBar = $menuBar ? $menuBar[0] : null, currentIsRtl = $(currentMenuBar || currentMenu).hasClass(C_RTL), menuLauncher = "object" == typeof x && x.get ? x[0] : null, actionTookFocus = !1, actionTaken = !1, keepTracking = !0, 0 === menuStack.length && startTrackingMenus(), menuStack.push($menu), keepTracking = !1, menuLayoutDone = [], $menuBar && (x.addClass(C_EXPANDED).children(SEL_MENUITEM_LABEL).attr(A_EXPANDED, "true"), minWidth = x.outerWidth()), placeMenu({
- $menu: $menu,
- subMenu: !1,
- x: x,
- y: y,
- slide: slide,
- focus: focus,
- minWidth: minWidth
- })
- },
- isCurrentMenu: function(menu) {
- return currentMenu && currentMenu === menu
- },
- isCurrentMenuBar: function(menubar) {
- return currentMenuBar && currentMenuBar === menubar
- },
- isMenuOpen: function(menu) {
- var i;
- for (i = 0; i < menuStack.length; i++)
- if (menuStack[i] === menu) return !0;
- return !1
- },
- openSubMenu: function($item, $menu, menuBarItem, slide, focus) {
- this.closeOpenSiblings($item, menuBarItem), menuStack.push($menu), placeMenu({
- $menu: $menu,
- subMenu: !0,
- x: $item,
- slide: slide,
- focus: focus
- }), $item.addClass(C_EXPANDED).children(SEL_ITEM_INNER).find(SEL_MENUITEM_LABEL).attr(A_EXPANDED, "true")
- },
- closeOpenSiblings: function($item, menuBarItem) {
- var $openSubMenu = $item.parent().find(SEL_EXPANDED);
- for (menuBarItem && (keepTracking = !0); $openSubMenu.length > 0;) this.closeLast(!1), $openSubMenu = $item.parent().find(SEL_EXPANDED);
- keepTracking = !1
- },
- closeLast: function(focus) {
- var $menu, $item, $label;
- menuStack.length > 0 ? ($menu = menuStack.pop(), $item = $menu.parents(SEL_ITEM).eq(0), $item.length > 0 && ($label = getItemLabel($item), $item.removeClass(C_EXPANDED).children(SEL_ITEM_INNER), $label.attr(A_EXPANDED, "false"), focus && $item.find(SEL_FOCUSABLE).eq(0).focus()), $menu.hide(), 0 === menuStack.length && (!menuLauncher || actionTookFocus || keepTracking || setTimeout(function() {
- focusMenuLauncher()
- }, 10), currentMenuBar && ($label = getItemLabel($(currentMenu).find(SEL_EXPANDED)), $(currentMenu).find(SEL_EXPANDED).removeClass(C_EXPANDED), $label.attr(A_EXPANDED, "false")), (currentMenuBar || currentMenu) && $(currentMenuBar || currentMenu).data("apex-menu")._trigger("afterClose", {}, {
- actionTookFocus: actionTookFocus,
- actionTaken: actionTaken,
- launcher: menuLauncher
- }), currentMenu = null, keepTracking || (currentMenuBar = null, stopTrackingMenus()))) : (currentMenu = null, currentMenuBar = null, stopTrackingMenus())
- },
- closeAll: function(force) {
- for (; menuStack.length > 0;) this.closeLast(!1);
- force && (currentMenu = null, currentMenuBar = null, stopTrackingMenus())
- }
- };
- $.widget("apex.menu", {
- version: "5.0",
- widgetEventPrefix: "menu",
- options: {
- menubar: !1,
- menubarShowSubMenuIcon: null,
- menubarOverflow: !1,
- iconType: C_DEFAULT_ICON_TYPE,
- behaveLikeTabs: !1,
- tabBehavior: "EXIT",
- useLinks: !0,
- slide: !1,
- firstItemIsDefault: !1,
- items: null,
- idPrefix: null,
- customContent: !1,
- asyncFetchMenu: null,
- beforeOpen: null,
- afterClose: null
- },
- isActive: !1,
- scrollTimerId: null,
- forwardKey: keys.RIGHT,
- backwardKey: keys.LEFT,
- _create: function() {
- var i, wheelEvent, o = this.options,
- $ctrl = this.element;
- if (o.menubar && o.customContent) throw "Menubar cannot have custom content";
- if (o.items || o.customContent === !0 || (o.items = this._parseMenuMarkup($ctrl, o.menubar).items), !o.menubar && (o.customContent || o.asyncFetchMenu) || o.items && 0 !== o.items.length || debug.error("Menu has no menu items"), "rtl" === $ctrl.css("direction") && ($ctrl.addClass(C_RTL), o.menubar || $ctrl.attr("dir", "rtl"), this.forwardKey = keys.LEFT, this.backwardKey = keys.RIGHT), $ctrl.attr("tabindex", -1).attr("role", o.menubar ? "menubar" : "menu").addClass(o.menubar ? C_MENUBAR : C_MENU), o.menubar) {
- if (o.menubarOverflow && $ctrl.addClass(C_OVERFLOW), null === o.menubarShowSubMenuIcon)
- for (o.menubarShowSubMenuIcon = !1, i = 0; i < o.items.length; i++)
- if ("subMenu" !== o.items[i].type) {
- o.menubarShowSubMenuIcon = !0;
- break
- }
- this.refresh(), o.behaveLikeTabs && $ctrl.addClass(C_MENUBAR_TABS), o.firstItemIsDefault && debug.warn("Invalid options for menu bar ignored")
- } else $("body").append($ctrl), $ctrl.hide(), (o.menubarOverflow || o.menubarShowSubMenuIcon || o.behaveLikeTabs) && debug.warn("Invalid options for popup menu ignored");
- "onwheel" in $ctrl[0] || !this._eventHandlers.wheel || (wheelEvent = document.onmousewheel !== undefined ? "mousewheel" : "DOMMouseScroll", this._eventHandlers[wheelEvent] = this._eventHandlers.wheel, delete this._eventHandlers.wheel), this._on(this._eventHandlers)
- },
- _eventHandlers: {
- mousedown: function(e) {
- var item, id, onDropDown, $target;
- 1 !== e.which || e.shiftKey || e.ctrlKey || ($target = $(e.target).closest(SEL_ITEM_OR_BTN), e.preventDefault(), $target.length > 0 && !$target.hasClass(C_MENU_CONTENT) && !$target.hasClass(C_DISABLED) && ($target.is(SEL_MENU_SCROLL_BTN) ? ($target.addClass(C_ACTIVE), this._startScrolling($target.closest(SEL_MENU), $target.hasClass(C_UP))) : itemIsMenuBarItem($target) && (id = $target[0].id, item = this._getMenuItemFromId(id), "subMenu" === item.type && (onDropDown = 0 !== $(e.target).closest(SEL_SUBMENU_COL).length, (onDropDown || !item.action && !item.href) && this.toggle($target)))))
- },
- mouseup: function(e) {
- var item, choice, id, isMenuBarItem, type, onDropDown, $target;
- 1 !== e.which || e.shiftKey || e.ctrlKey || ($target = $(e.target).closest(SEL_ITEM_IN_MENU), e.preventDefault(), $target.length > 0 && !$target.hasClass(C_MENU_CONTENT) && (id = $target[0].id, item = this._getMenuItemFromId(id), type = item.type, isMenuBarItem = itemIsMenuBarItem($target), "subMenu" === type && isMenuBarItem && (onDropDown = 0 !== $(e.target).closest(SEL_SUBMENU_COL).length, onDropDown || !item.action && !item.href || (type = "action", menuManager.closeOpenSiblings($target, isMenuBarItem))), "subMenu" === type && isMenuBarItem || !$target.is(SEL_ITEM) || $target.hasClass(C_DISABLED) || "display" === type || (choice = getChoiceFromId(id), invokeItem(item, choice, this.options, type) && menuManager.closeAll())))
- },
- click: function(e) {
- var $target, id, item, choice;
- return "A" === e.target.nodeName && (1 !== e.which || e.shiftKey || e.ctrlKey) ? void(this.keyboardActivate = !1) : (e.preventDefault(), void(this.keyboardActivate && (this.keyboardActivate = !1, $target = $(e.target).closest(SEL_ITEM_IN_MENU), $target.length > 0 && !$target.hasClass(C_MENU_CONTENT) && (id = $target[0].id, item = this._getMenuItemFromId(id), $target.is(SEL_ITEM) && !$target.hasClass(C_DISABLED) && (choice = getChoiceFromId(id), invokeItem(item, choice, this.options, "subMenu" === item.type ? "action" : item.type) && menuManager.closeAll())))))
- },
- mousemove: function(e) {
- function checkDelayClose() {
- var $expanded = $item.parent().find(SEL_EXPANDED);
- $expanded.length > 0 && !subMenuCloseDelayID && ($expanded.removeClass(C_EXPANDED), closeDelayMenu = $expanded.find(SEL_MENU)[0], subMenuCloseDelayID = setTimeout(function() {
- $expanded.addClass(C_EXPANDED), subMenuCloseDelayID = null, closeDelayMenu = null, menuManager.closeOpenSiblings($item, isMenuBarItem)
- }, 250))
- }
- var isMenuBarItem, $target, $item, $menu, self = this;
- if (lastMouseX !== e.pageX || lastMouseY !== e.pageY) {
- if (lastMouseX = e.pageX, lastMouseY = e.pageY, $target = $(e.target), subMenuCloseDelayID && $target.closest(SEL_MENU)[0] === closeDelayMenu && ($(closeDelayMenu).parent().addClass(C_EXPANDED), closeDelayMenu = null, clearTimeout(subMenuCloseDelayID), subMenuCloseDelayID = null), $item = $target.closest(SEL_ITEM_SEP), $item.length > 0 && $item[0] !== lastItem) return subMenuDelayID && (clearTimeout(subMenuDelayID), subMenuDelayID = null), isMenuBarItem = itemIsMenuBarItem($item), checkDelayClose(), lastItem = $item[0], $menu = $target.closest(SEL_MENU).eq(0), void($menu.length > 0 && !$menu.hasClass(C_FOCUSED) && $menu.focus());
- if ($item = $target.closest(SEL_ITEM), $item.length > 0) {
- if (!$item.hasClass(C_FOCUSED) && "true" !== getItemLabel($item).attr(A_EXPANDED)) {
- if (subMenuDelayID && (clearTimeout(subMenuDelayID), subMenuDelayID = null), isMenuBarItem = itemIsMenuBarItem($item), isMenuBarItem && isTracking ? (clearTimeout(subMenuCloseDelayID), subMenuCloseDelayID = null, menuManager.closeOpenSiblings($item, isMenuBarItem)) : checkDelayClose(), this.options.menubar && !menuManager.isCurrentMenuBar(this.element[0]) && !this.isActive) return this.element.find(SEL_FOCUSED).removeClass(C_FOCUSED), void $item.addClass(C_FOCUSED);
- setItemFocus($item), !$item.hasClass(C_DISABLED) && $item.find(SEL_MENU).length > 0 && "true" !== getItemLabel($item).attr(A_EXPANDED) && (isMenuBarItem ? menuManager.isCurrentMenuBar(this.element[0]) && this.open($item) : subMenuDelayID = setTimeout(function() {
- subMenuDelayID = null, menuManager.openSubMenu($item, $item.children(SEL_MENU).first(), isMenuBarItem, self.options.slide, !0)
- }, 300))
- }
- lastItem = $item[0]
- } else $target.closest(SEL_MENU).first().focus()
- }
- },
- mouseleave: function(e) {
- subMenuDelayID && (clearTimeout(subMenuDelayID), subMenuDelayID = null), this.options.menubar && (menuManager.isCurrentMenuBar(this.element[0]) || this.isActive || this.element.find(SEL_FOCUSED).removeClass(C_FOCUSED))
- },
- wheel: function(e) {
- var sp, $menu = $(e.target).closest(SEL_MENU),
- deltaY = e.originalEvent.deltaY || e.originalEvent.detail || -1 / 40 * e.originalEvent.wheelDelta;
- if ($menu.length) {
- if (e.preventDefault(), sp = getMenuScrollParent($menu)[0], !sp) return;
- (e.originalEvent.deltaMode === undefined || 1 === e.originalEvent.deltaMode) && (deltaY = 30 * deltaY), sp.scrollTop += deltaY, this._checkScrollBounds($menu, sp)
- }
- },
- keydown: function(e) {
- function moveNext(noWrap) {
- var i;
- if (cur$.hasClass(C_MENU)) next$ = cur$.find(SEL_MENU_CONTENT).first().find(SEL_ITEM).first();
- else {
- if (i = items$.index(cur$), i += 1, i >= items$.length) {
- if (noWrap) return !1;
- i = 0
- }
- next$ = items$.eq(i)
- }
- return setItemFocus(next$), cur$ = next$, sp && self._checkScrollBounds(thisMenu$, sp), !0
- }
- function movePrev(noWrap) {
- var i;
- if (cur$.hasClass(C_MENU)) next$ = cur$.find(SEL_MENU_CONTENT).first().find(SEL_ITEM).last();
- else {
- if (i = items$.index(cur$), i -= 1, 0 > i) {
- if (noWrap) return !1;
- i = items$.length - 1
- }
- next$ = items$.eq(i)
- }
- return setItemFocus(next$), cur$ = next$, sp && self._checkScrollBounds(thisMenu$, sp), !0
- }
- function openMenu() {
- self.toggle(cur$), cur$.hasClass(C_SPLIT_MENU) ? cur$.find(SEL_FOCUSABLE).eq(0).focus() : (next$ = cur$.find(SEL_MENU_CONTENT).first().find(SEL_ITEM).first(), setItemFocus(next$))
- }
- var cur$, items$, menu$, next$, $ctrl, isMenuBarItem, sp, thisMenu$, index, tabbable$, id, item, type, choice, tabBehavior, self = this,
- kc = e.which;
- if (!e.altKey)
- if ($ctrl = this.element, this.keyboardActivate = !1, $ctrl.hasClass(C_FOCUSED) ? (cur$ = $ctrl, $ctrl.find(SEL_EXPANDED).first().each(function() {
- cur$ = $(this)
- })) : cur$ = $ctrl.find(SEL_FOCUSED), thisMenu$ = cur$.closest(SEL_MENU + "," + SEL_MENUBAR), sp = getMenuScrollParent(thisMenu$)[0], isMenuBarItem = cur$.is(SEL_MENUBAR) || itemIsMenuBarItem(cur$), items$ = isMenuBarItem ? $ctrl.find("." + C_BAR_ITEM) : getItemsForMenu(thisMenu$), kc === keys.UP || kc === keys.DOWN) isMenuBarItem ? cur$.children(SEL_MENU).length > 0 && !cur$.hasClass(C_DISABLED) && (cur$.hasClass(C_SPLIT_MENU) && menuManager.isCurrentMenu(cur$.children(SEL_MENU)[0]) ? (next$ = cur$.find("ul").first().children(SEL_ITEM).first(), next$.find(SEL_FOCUSABLE).focus()) : openMenu()) : kc === keys.UP ? movePrev() : moveNext(), e.preventDefault();
- else if (kc === this.forwardKey) isMenuBarItem ? (moveNext(), menuManager.closeOpenSiblings(cur$, !0), menuManager.isCurrentMenuBar($ctrl[0]) && cur$.children(SEL_MENU).length > 0 && !cur$.hasClass(C_DISABLED) && openMenu()) : (next$ = cur$.children(SEL_MENU), next$.length > 0 && !cur$.hasClass(C_DISABLED) ? (menuManager.openSubMenu(cur$, next$, !1, this.options.slide, !1), next$ = next$.find("ul").first().children(SEL_ITEM).first(), setItemFocus(next$)) : this.options.menubar && (cur$ = $ctrl.find(SEL_EXPANDED).eq(0), items$ = $ctrl.find("." + C_BAR_ITEM), moveNext(), menuManager.closeOpenSiblings(cur$, itemIsMenuBarItem(cur$)), cur$.children(SEL_MENU).length > 0 && !cur$.hasClass(C_DISABLED) && openMenu())), e.preventDefault();
- else if (kc === self.backwardKey) isMenuBarItem ? (movePrev(), menuManager.closeOpenSiblings(cur$, !0), menuManager.isCurrentMenuBar(self.element[0]) && cur$.children(SEL_MENU).length > 0 && !cur$.hasClass(C_DISABLED) && openMenu()) : (next$ = cur$.parents(SEL_ITEM).eq(0), next$.length > 0 && !itemIsMenuBarItem(next$) ? menuManager.closeLast(!0) : this.options.menubar && (cur$ = $ctrl.find(SEL_EXPANDED).eq(0), items$ = $ctrl.find("." + C_BAR_ITEM), movePrev(), menuManager.closeOpenSiblings(cur$, itemIsMenuBarItem(cur$)), cur$.children(SEL_MENU).length > 0 && !cur$.hasClass(C_DISABLED) && openMenu())), e.preventDefault();
- else if (kc === keys.TAB) isMenuBarItem ? ("EXIT" === this.options.tabBehavior || e.shiftKey) && (actionTookFocus = !0, menuManager.closeAll()) : (tabBehavior = this.options.tabBehavior, "NEXT" === tabBehavior && (e.shiftKey ? movePrev(!0) || (tabBehavior = "EXIT") : moveNext(!0) || (tabBehavior = "EXIT")), "EXIT" === tabBehavior && menuLauncher && (actionTookFocus = !0, menuManager.closeAll(), tabbable$ = $(":tabbable"), this.options.menubar ? (index = tabbable$.index($(menuLauncher).find(":tabbable")), 0 > index && (index = tabbable$.index(this.element.find(":tabbable")))) : index = tabbable$.index(menuLauncher), index > 0 && index < tabbable$.length ? index += e.shiftKey ? -1 : 1 : tabbable$.length > 0 && (index = 0), index >= 0 && tabbable$[index].focus()), e.preventDefault());
- else if (kc === keys.ESCAPE) menuManager.closeLast(!0), e.preventDefault();
- else if (kc === keys.ENTER || kc === keys.SPACE) {
- if (cur$ = $ctrl.hasClass(C_FOCUSED) ? $ctrl : $ctrl.find(SEL_FOCUSED), cur$.hasClass(C_DISABLED) || !cur$.is(SEL_ITEM)) return void e.preventDefault();
- if (id = cur$[0].id, item = this._getMenuItemFromId(id), type = item.type, isMenuBarItem = itemIsMenuBarItem(cur$), "subMenu" === type && isMenuBarItem && (item.action || item.href) && (type = "action", menuManager.closeOpenSiblings(cur$, isMenuBarItem)), "subMenu" === type) isMenuBarItem ? (self.toggle(cur$), next$ = cur$.find(SEL_MENU_CONTENT).first().find(SEL_ITEM).first(), setItemFocus(next$)) : (menu$ = cur$.children(SEL_MENU), menu$.length > 0 && (menuManager.openSubMenu(cur$, menu$, !1, this.options.slide, !1), next$ = menu$.find("ul").first().children(SEL_ITEM).first(), setItemFocus(next$)));
- else {
- if (("A" !== e.target.nodeName || kc !== keys.SPACE) && ("action" === type || kc === keys.SPACE && "BUTTON" === e.target.nodeName)) return void(this.keyboardActivate = !0);
- "display" !== type && (choice = getChoiceFromId(id), invokeItem(item, choice, this.options, type, kc === keys.SPACE) && (actionTookFocus = !0, menuManager.closeAll()))
- }
- e.preventDefault()
- }
- },
- keypress: function(e) {
- var ch, sp, next$, cur$, ctrl$, thisMenu$, items$, label$, index = -1;
- if (0 !== e.which && (ctrl$ = this.element, ctrl$.hasClass(C_FOCUSED) ? (cur$ = ctrl$.find(SEL_MENU_CONTENT).first().find(SEL_ITEM).first(), index = 0) : cur$ = ctrl$.find(SEL_FOCUSED), thisMenu$ = cur$.closest(SEL_MENU), 0 !== thisMenu$.length))
- for (items$ = getItemsForMenu(thisMenu$), 0 > index && (index = items$.index(cur$) + 1, index >= items$.length && (index = 0)), next$ = items$.eq(index), ch = String.fromCharCode(e.which).toLowerCase();;) {
- if (label$ = next$.filter(".a-Menu-label"), 0 === label$.length && (label$ = next$.find(".a-Menu-label")), label$.text().charAt(0).toLowerCase() === ch) {
- setItemFocus(next$), sp = getMenuScrollParent(thisMenu$)[0], sp && this._checkScrollBounds(thisMenu$, sp);
- break
- }
- if (index += 1, index >= items$.length && (index = 0), next$ = items$.eq(index), next$[0] === cur$[0]) break
- }
- },
- focusin: function(e) {
- var $target = $(e.target);
- this.isActive || this.element.find(SEL_FOCUSED).removeClass(C_FOCUSED), $target.is(SEL_MENU) ? $target.addClass(C_FOCUSED) : $target.closest(SEL_ITEM).addClass(C_FOCUSED), this.isActive = !0
- },
- focusout: function(e) {
- var $target = $(e.target);
- $target.is(SEL_MENU) ? $target.removeClass(C_FOCUSED) : $target.closest(SEL_ITEM).removeClass(C_FOCUSED), this.isActive = !1
- },
- focus: function() {
- this.element.addClass(C_FOCUSED)
- },
- blur: function() {
- this.element.removeClass(C_FOCUSED)
- }
- },
- _destroy: function() {
- var o = this.options,
- $ctrl = this.element;
- isTracking && menuManager.isMenuOpen(this.element) && (debug.warn("Menu destroyed while still tracking menus."), menuManager.closeAll(!0)), $ctrl.empty().removeClass((o.menubar ? C_MENUBAR + " " + C_MENUBAR_TABS : C_MENU) + " " + C_RTL + " " + C_OVERFLOW).removeAttr("role")
- },
- _setOption: function(key, value) {
- var overflowItem, items, item, overflowList, o = this.options;
- if ("menubar" === key) throw "The menubar option cannot be set";
- if (o.menubar ? ("customContent" === key || "firstItemIsDefault" === key) && debug.warn("Option " + key + " ignored when menubar is true") : ("menubarOverflow" === key || "menubarShowSubMenuIcon" === key || "behaveLikeTabs" === key) && debug.warn("Option " + key + " ignored when menubar is false"), this._super(key, value), "menubarOverflow" === key && o.menubar && (this.element.toggleClass(C_OVERFLOW, value), !value && (items = o.items, overflowItem = items[items.length - 1], overflowItem && overflowItem._overflow))) {
- for (overflowList = overflowItem.menu.items; overflowList.length > 0;) item = overflowList.shift(), "subMenu" === item.type && (item.action || item.href) && item.menu.items.shift(), items.splice(items.length - 1, 0, item);
- items.pop()
- }
- },
- refresh: function() {
- var owns, $ctrl = this.element,
- o = this.options,
- idprefix = o.idPrefix || $ctrl[0].id || "menu",
- out = util.htmlBuilder();
- return o.menubar && (owns = this._renderMenubar(out, idprefix, o), $ctrl.html(out.toString()), this._processMenuCustomMarkup(), this.resize()), this
- },
- resize: function() {
- var owns, $ctrl = this.element,
- o = this.options,
- idprefix = o.idPrefix || $ctrl[0].id || "menu",
- out = util.htmlBuilder();
- return o.menubar && o.menubarOverflow && this._adjustMenubarForSize(idprefix, o) && (owns = this._renderMenubar(out, idprefix, o), $ctrl.html(out.toString()), this._processMenuCustomMarkup()), this
- },
- toggle: function(x, y) {
- var $menu = this.element;
- if (this.options.menubar && ($menu = null, "number" == typeof x ? (x = this.element.children("ul").children("li").eq(x), x.length > 0 && ($menu = x.children(SEL_MENU))) : x.is(SEL_ITEM) && ($menu = x.children(SEL_MENU)), !$menu || 1 !== $menu.length)) throw "Invalid menu bar menu";
- return menuManager.isCurrentMenu($menu[0]) ? menuManager.closeAll() : this.open(x, y), this
- },
- open: function(x, y) {
- function finish() {
- var owns;
- self._trigger("beforeOpen", {}, menuArg), menu.customContent ? ("string" == typeof menu.customContent && ($menu.empty().append($("#" + util.escapeCSS(menu.customContent)).show()), menu.customContent = !0), self._parseCustomMarkup($menu, idprefix, menu)) : (out.clear(), owns = self._renderMenu(out, idprefix, menu, isPopup), $menu.html(out.toString()))
- }
- var i, menu, $menu, $menubar, idprefix, menuArg, isPopup, isAsync = !1,
- self = this,
- o = this.options,
- out = util.htmlBuilder();
- if (o.menubar) {
- if ($menubar = this.element, $menu = null, "number" == typeof x ? (x = this.element.children("ul").children("li").eq(x), x.length > 0 && ($menu = x.children(SEL_MENU))) : x.is(SEL_ITEM) && ($menu = x.children(SEL_MENU)), !$menu || 1 !== $menu.length) throw "Invalid menu bar menu";
- if (idprefix = x[0].id, menu = this._getMenuItemFromId(idprefix), !menu || "subMenu" !== menu.type || !menu.menu) throw "Can't open menu " + x;
- menuArg = menu, menu = menu.menu, isPopup = !1
- } else $menubar = null, menu = o, menuArg = {
- menu: menu
- }, $menu = this.element, idprefix = o.idPrefix || this.element[0].id || "menu", isPopup = !0;
- if ($.isFunction(o.asyncFetchMenu)) {
- if (!isTracking && o.menubar)
- for (i = 0; i < o.items.length; i++) o.items[i]._fetched = !1;
- o.menubar && menuArg._fetched === !0 ? finish() : (self._renderMenu(out, idprefix, {
- items: [{
- type: "action",
- disabled: !0,
- label: apex.lang.getMessage("APEX.PROCESSING")
- }]
- }, isPopup), $menu.html(out.toString()), isAsync = !0, o.asyncFetchMenu(menu, function(status) {
- var focusItem$;
- if (menuManager.isCurrentMenu($menu[0])) {
- if (status === !1) return void menuManager.closeAll(!0);
- focusItem$ = $menu.find(SEL_FOCUSED).first(), finish(), menuResize(), focusItem$.length ? setItemFocus($menu.find(SEL_ITEM).first()) : $menu.focus()
- }
- }), o.menubar && (menuArg._fetched = !0))
- } else finish();
- return isAsync || 0 !== menu.items.length ? menuManager.openMenu($menu, $menubar, x, y, o.slide, o.menubar || y !== !1) : (debug.error("Menu has no items"), self._trigger("afterClose", {}, {
- actionTookFocus: !1,
- actionTaken: !1,
- launcher: null
- })), this
- },
- find: function(id) {
- var o = this.options;
- return findItemById(o, id)
- },
- setCurrentMenuItem: function(item) {
- var curItem, prevItem, i = 0,
- menuItems = this.options.items;
- if (!this.options.menubar || !this.options.behaveLikeTabs) return void debug.warn("setCurrentMenuItem ignored");
- if ("string" == typeof item && (item = this.find(item)), item) {
- for (i = 0; i < menuItems.length; i++) curItem = menuItems[i], curItem.current && (prevItem = curItem, delete curItem.current), descendentIsCurrent(curItem, !0);
- for (item.current = !0, i = 0; i < menuItems.length; i++)
- if (curItem = menuItems[i], descendentIsCurrent(curItem)) {
- curItem.current = !0, getLabelFromMessage(prevItem), this.element.find("." + C_CURRENT_MENU).removeClass(C_CURRENT_MENU).find(".a-MenuBar-label").text(prevItem.label), this.element.children("ul").children("li").eq(i).addClass(C_CURRENT_MENU).find(".a-MenuBar-label").append(" <span class='u-VisuallyHidden'>current</span>");
- break
- }
- }
- },
- _parseMenuMarkup: function($el, isMenubar) {
- var self = this,
- menu = {
- items: []
- };
- return $el.children("ul").children("li").each(function(i) {
- var item, icon, index, id, customId, customContent$, $item = $(this),
- $a = $item.children("a").eq(0),
- $span = $item.children("span").eq(0);
- if (item = {
- type: "action"
- }, $a.length > 0 ? (item.label = $a.text(), item.href = $a.attr("href")) : $span.length > 0 ? item.label = $span.text() : item.type = "separator", "separator" === item.href && (item.type = "separator", delete item.href, delete item.label), id = $item.attr("data-id"), id && (item.id = id), "true" === $item.attr("data-hide") && (item.hide = !0), "true" === $item.attr("data-disabled") && (item.disabled = !0), "true" === $item.attr("data-current") && (item.current = !0), icon = $item.attr("data-icon"), icon && (index = icon.indexOf(" "), index >= 0 ? (item.iconType = icon.substring(0, index), item.icon = icon.substring(index + 1)) : item.icon = icon), "separator" !== item.type && ($item.children("ul").length > 0 || "true" === $item.attr("data-custom")))
- if (item.type = "subMenu", "true" !== $item.attr("data-custom")) item.menu = self._parseMenuMarkup($item, !1);
- else {
- if (!isMenubar) throw "Attribute data-custom only allowed at menubar level";
- customContent$ = $item.children(SEL_MENU_CONTENT).eq(0), customId = customContent$[0].id, customId || (customId = customContent$[0].id = (self.options.idPrefix || self.element[0].id || "menu") + "_cm_" + i), $(document.body).append(customContent$), customContent$.hide(), item.menu = {
- customContent: customId
- }
- }
- "action" === item.type && id && apex.actions && apex.actions.lookup(id) && (item.action = id, delete item.href, delete item.label, delete item.disabled, delete item.icon, delete item.iconType), menu.items.push(item)
- }), menu
- },
- _parseCustomMarkup: function($menu, idprefix, menu) {
- menu.items || (menu.items = []), $menu.attr("data-custom", "true"), 0 === $menu.find(SEL_MENU_CONTENT).length && $menu.children().first().addClass(C_MENU_CONTENT), $menu.find(SEL_FOCUSABLE).each(function(index) {
- var menuId, item, item$, f$;
- f$ = $(this), item$ = f$.closest(SEL_MENU_ITEM), f$.attr("role", "menuitem"), 0 === item$.length && (item$ = $(this), item$.addClass(C_ITEM)), item$.hasClass(C_LABEL) || 0 !== item$.find(SEL_LABEL).length || f$.addClass(C_LABEL), item$[0].id = idprefix + "_" + index, "A" === this.nodeName && this.href ? (item = {
- type: "action",
- label: f$.text(),
- href: this.href
- }, menu.items[index] = item) : "BUTTON" === this.nodeName ? (item = {
- type: "action",
- label: f$.text(),
- action: function() {}
- }, menu.items[index] = item) : (f$.attr("tabindex", "-1"), menu.items[index] || (item = {
- type: "display",
- label: f$.text(),
- disabled: !0
- }, menu.items[index] = item)), menuId = item$.attr("data-id"), menuId && (item.id = menuId, "action" === item.type && menuId && apex.actions && apex.actions.lookup(menuId) && (item.action = menuId, delete item.href, delete item.label, delete item.disabled, delete item.icon, delete item.iconType))
- })
- },
- _processMenuCustomMarkup: function() {
- var self = this;
- this.element.find("." + C_BAR_ITEM).each(function() {
- var menu$ = $(this).children(SEL_MENU),
- idprefix = this.id,
- menu = self._getMenuItemFromId(idprefix).menu;
- menu && menu.customContent && ("string" == typeof menu.customContent && (menu$.empty().append($("#" + util.escapeCSS(menu.customContent)).show()), menu.customContent = !0), self._parseCustomMarkup(menu$, idprefix, menu))
- })
- },
- _getMenuItemFromId: function(id) {
- var i, mi, o = this.options,
- idParts = id.split("_"),
- path = [],
- item = null;
- for (i = idParts.length - 1, idParts[i].match(/^c[0-9]+$/) && (i -= 1); i > 0 && idParts[i].match(/^[0-9]+$/); i--) path.unshift(1 * idParts[i]);
- for (mi = o.items,
- i = 0; i < path.length; i++) {
- if (item = mi[path[i]], !item || i < path.length - 1 && !item.menu) return null;
- item.menu && (mi = item.menu.items)
- }
- return item
- },
- _itemIsHidden: function(item) {
- var hide = item.hide,
- o = this.options;
- return $.isFunction(hide) && (hide = item.hide(o)), hide
- },
- _itemIsDisabled: function(item) {
- var disabled = item.disabled,
- o = this.options;
- return $.isFunction(disabled) && (disabled = item.disabled(o)), disabled
- },
- _renderMenubar: function(out, idprefix, menubar) {
- var owns = "",
- self = this,
- focusItem = 0,
- o = this.options,
- tabAll = "NEXT" === o.tabBehavior;
- return o.behaveLikeTabs && $.each(menubar.items, function(i, item) {
- return descendentIsCurrent(item) && (item.current = !0), item.current ? (focusItem = i, !1) : void 0
- }), this.element.find("." + C_MENU_TOP).filter("[data-custom]").each(function() {
- var save$ = $(this).children().eq(0),
- item = self._getMenuItemFromId(save$.closest(SEL_ITEM)[0].id);
- item.menu.customContent = save$[0].id, $(document.body).append(save$)
- }), out.markup("<ul>"), $.each(menubar.items, function(i, item) {
- var label, itemClass, disabled, action, type = item.type,
- id = idprefix + "_" + i;
- if ("action" === item.type && "string" == typeof item.action) {
- if (!apex.actions) throw "Action name requires apex.actions";
- action = apex.actions.lookup(item.action), action ? (item.hide = !1, action.label && !item.label && (item.label = action.label), action.disabled !== undefined && (item.disabled = action.disabled), action.href && !item.href && (item.href = action.href)) : (debug.warn("Unknown action name " + item.action + " (item hidden)."), item.hide = !0)
- }
- if (!self._itemIsHidden(item)) {
- if (itemClass = C_BAR_ITEM, disabled = self._itemIsDisabled(item), disabled && (itemClass += " " + C_DISABLED), "subMenu" === item.type && (item.action || item.href) && (itemClass += " " + C_SPLIT_MENU), o.behaveLikeTabs && item.current && (itemClass += " " + C_CURRENT_MENU), item._overflow && (itemClass += " " + C_BAR_OVERFLOW), "action" !== type && "subMenu" !== type) throw "Menu item type not supported in menubar: " + type;
- out.markup("<li").attr("id", id).attr("class", itemClass).markup(">"), owns += " " + id + "i", getLabelFromMessage(item), label = item.label, (item.icon || item.iconType) && debug.warn("Menu bar items cannot have icons."), item.accelerator && debug.warn("Menu bar items cannot have accelerators."), disabled ? out.markup("<span role='menuitem'").attr("class", C_BAR_LABEL).attr("tabindex", tabAll || i === focusItem ? "0" : "-1").attr("id", id + "i").optionalAttr(A_DISABLED, disabled ? "true" : null).optionalAttr(A_HASPOPUP, "subMenu" === type ? "true" : null).markup(">").content(label).markup("</span>") : item.href && o.useLinks ? (out.markup("<a role='menuitem'").attr("class", C_BAR_LABEL).attr("id", id + "i").attr("href", item.href).optionalAttr("tabindex", tabAll || i === focusItem ? null : "-1").optionalAttr(A_HASPOPUP, "subMenu" === type ? "true" : null).markup(">").content(label), o.behaveLikeTabs && item.current && out.markup(" <span class='u-VisuallyHidden'>current</span>"), out.markup("</a>")) : (out.markup("<button type='button' role='menuitem'").attr("class", C_BAR_LABEL).attr("id", id + "i").optionalAttr("tabindex", tabAll || i === focusItem ? null : "-1").optionalAttr(A_HASPOPUP, "subMenu" === type ? "true" : null), item._overflow ? out.attr("title", label).markup("><span class='a-Icon icon-down-chevron'></span>") : (out.markup(">").content(label), o.behaveLikeTabs && item.current && out.markup(" <span class='u-VisuallyHidden'>current</span>")), out.markup("</button>")), "subMenu" === type && ((item.action || item.href || o.menubarShowSubMenuIcon) && !item._overflow && (out.markup("<span class='" + C_SUBMENU_COL + "'>"), renderIcon(out, C_DEFAULT_ICON_TYPE, !o.menubarShowSubMenuIcon || item.action || item.href ? "icon-menu-split-drop-down" : "icon-menu-drop-down"), out.markup("</span>")), out.markup("<div").attr("id", id + "m").markup(" class='" + C_MENU + " " + C_MENU_TOP + "' role='menu' tabindex='-1' style='display:none;'></div>")), out.markup("</li>")
- }
- }), out.markup("</ul>"), $.trim(owns)
- },
- _renderMenu: function(out, idprefix, menu, isPopup) {
- function separator() {
- delayAddSeparator = !1, itemCount > 0 && (out.markup("<li class='").markup(C_ITEM_SEP).markup("' role='separator'><div class='a-Menu-inner'><span class='a-Menu-labelContainer'><span class='").markup(C_STATUS_COL).markup("'></span><span class='").markup(C_HSEP).markup("'></span></span><span class='a-Menu-accelContainer'></span></div></li>"), itemCount += 1)
- }
- function statusColumn(type, icon) {
- out.markup("<span class='" + C_STATUS_COL + "'>"), (icon || "" === icon) && renderIcon(out, type, icon), out.markup("</span>")
- }
- function labelAccel(accelerator) {
- out.markup("<span").attr("class", C_ACCEL).markup("> ").content(accelerator).markup("</span>")
- }
- function labelColumn(id, disabled, label, accelerator, href, role, checked, submenu) {
- var closeTag;
- disabled ? (out.markup("<span tabindex='-1'").optionalAttr(A_DISABLED, disabled ? "true" : null), closeTag = "</span>") : href && o.useLinks ? (out.markup("<a").attr("href", href), closeTag = "</a>") : (out.markup("<button type='button'"), closeTag = "</button>"), out.attr("id", id).attr("role", role).attr("class", C_LABEL).optionalAttr(A_HASPOPUP, submenu ? "true" : null).optionalAttr(A_CHECKED, null !== checked && checked ? "true" : null).markup(">"), out.content(label), accelerator && out.markup(" <span class='u-VisuallyHidden'>").content(accelerator).markup("</span>"), out.markup(closeTag).markup("</span><span class='a-Menu-accelContainer'>"), accelerator && labelAccel(accelerator)
- }
- function noSubMenu() {
- out.markup("<span class='" + C_SUBMENU_COL + "'></span>")
- }
- var owns = "",
- o = this.options,
- self = this,
- isRtl = this.element.hasClass(C_RTL),
- delayAddSeparator = !1,
- itemCount = 0,
- subMenuIcon = "icon-menu-sub";
- return isRtl && (subMenuIcon = "icon-menu-sub-rtl"), out.markup("<div class='" + C_MENU_CONTENT + "'><ul>"), $.each(menu.items, function(i, item) {
- var state, label, itemClass, icon, iconType, disabled, role, accelerator, labelId, subOut, subOwns, href, action = null,
- type = item.type,
- id = idprefix + "_" + i;
- if (getLabelFromMessage(item), icon = item.icon, iconType = item.iconType, label = item.label, href = item.href, accelerator = item.accelerator, ("action" === item.type || "toggle" === item.type) && "string" == typeof item.action) {
- if (!apex.actions) throw "Action name requires apex.actions";
- action = apex.actions.lookup(item.action), action ? (item.hide = !1, action.icon && !item.icon && (icon = action.icon), action.iconType && !item.iconType && (iconType = action.iconType), action.label && !item.label && (label = action.label), action.shortcut && !item.accelerator && (accelerator = action.shortcut), action.disabled !== undefined && (item.disabled = action.disabled), action.href !== undefined && (href = action.href)) : (debug.warn("Unknown action name " + item.action + " (item hidden)."), item.hide = !0)
- }
- self._itemIsHidden(item) || (itemClass = "separator" === type ? C_ITEM_SEP : C_ITEM, disabled = self._itemIsDisabled(item), disabled && (itemClass += " " + C_DISABLED), 0 === i && isPopup && o.firstItemIsDefault && (itemClass += " " + C_ITEM_DEFAULT), "radioGroup" === type ? (delayAddSeparator = !0, state = item.get(), $.each(item.choices, function(j, choice) {
- var rid = id + "_c" + j,
- checked = state === choice.value;
- itemClass = C_ITEM, disabled = choice.disabled, $.isFunction(disabled) && (disabled = choice.disabled(o)), disabled && (itemClass += " " + C_DISABLED), choice.icon && debug.warn("Radio menu items cannot have icons."), delayAddSeparator && separator(), out.markup("<li").attr("id", rid).attr("class", itemClass).markup("><div class='a-Menu-inner'><span class='a-Menu-labelContainer'>"), statusColumn(C_DEFAULT_ICON_TYPE, checked ? "icon-menu-radio" : ""), getLabelFromMessage(choice), labelId = rid + "i", owns += " " + labelId, labelColumn(labelId, disabled, choice.label, null, null, "menuitemradio", checked), noSubMenu(), out.markup("</span></div></li>"), itemCount += 1
- }), delayAddSeparator = !0) : "separator" === type ? delayAddSeparator = !0 : (role = "toggle" === type ? "menuitemcheckbox" : "menuitem", delayAddSeparator && separator(), labelId = id + "i", out.markup("<li id='").attr(id).markup("' class='").attr(itemClass).markup("'><div class='a-Menu-inner'><span class='a-Menu-labelContainer'>"), "action" === type || "display" === type ? (statusColumn(iconType || o.iconType, icon), labelColumn(labelId, disabled, label, accelerator, href || "", role, null), noSubMenu(), out.markup("</span></div>")) : "toggle" === type ? (action && (item = action), state = item.get(), item.icon && !action && debug.warn("Toggle menu items cannot have icons."), item.label && (item.onLabel || item.offLabel) && debug.warn("Toggle menu items should not have both label and on/offLabel properties."), label = item.label, icon = state ? "icon-menu-check" : "", label || (icon = null, label = state ? item.onLabel : item.offLabel, role = "menuitem", state = null), statusColumn(C_DEFAULT_ICON_TYPE, icon), labelColumn(labelId, disabled, label, accelerator, null, role, state), noSubMenu(), out.markup("</span></div>")) : "subMenu" === type && (statusColumn(item.iconType || o.iconType, item.icon), labelColumn(labelId, disabled, item.label, null, "", role, null, !0), item.accelerator && debug.warn("Sub menu items cannot have accelerators."), out.markup("<span class='" + C_SUBMENU_COL + "'>"), renderIcon(out, C_DEFAULT_ICON_TYPE, subMenuIcon), out.markup("</span></span></div>"), subOut = util.htmlBuilder(), subOwns = self._renderMenu(subOut, id, item.menu, !1), out.markup("<div class='" + C_MENU + "' role='menu' tabindex='-1'").attr("id", labelId + "m").markup(">" + subOut.toString()), out.markup("</div>")), owns += " " + labelId, out.markup("</li>"), itemCount += 1))
- }), out.markup("</ul></div>"), $.trim(owns)
- },
- _checkScrollBounds: function($menu, sp) {
- return $menu.find(SEL_MENU_SCROLL_BTN).removeClass(C_DISABLED), sp.scrollTop <= 0 ? ($menu.find(SEL_MENU_SCROLL_BTN + "." + C_UP).addClass(C_DISABLED), sp.scrollTop = 0, !0) : sp.scrollTop >= sp.scrollHeight - sp.clientHeight ? ($menu.find(SEL_MENU_SCROLL_BTN + "." + C_DOWN).addClass(C_DISABLED), sp.scrollTop = sp.scrollHeight - sp.clientHeight, !0) : !1
- },
- _startScrolling: function($menu, up) {
- function scroll() {
- return sp.scrollTop += up ? -10 : 10, self._checkScrollBounds($menu, sp) ? void self._stopScrolling() : (self.scrollTimerId = setTimeout(function() {
- scroll()
- }, times[timeIndex]), void(timeIndex < times.length - 1 && (timeIndex += 1)))
- }
- var self = this,
- timeIndex = 0,
- times = [100, 99, 96, 91, 84, 75, 64, 51, 36, 19],
- sp = getMenuScrollParent($menu)[0];
- this.scrollTimerId && this._stopScrolling(), $(document).on("mouseup.menuScrolling", function() {
- self._stopScrolling()
- }).on("mousemove.menuScrolling", function(event) {
- 0 === $(event.target).closest(SEL_MENU_SCROLL_BTN).length && self._stopScrolling()
- }), scroll()
- },
- _stopScrolling: function() {
- clearTimeout(this.scrollTimerId), this.scrollTimerId = null, this.element.find(SEL_MENU_SCROLL_BTN).removeClass(C_ACTIVE), $(document).off(".menuScrolling")
- },
- _adjustMenubarForSize: function(idprefix, menubar) {
- var i, overflowList, item, count, overflowItem, save$, item$, adjusted = !1,
- itemsWidth = 0,
- barWidth = this.element.width() - 2,
- items = menubar.items;
- for (overflowItem = items[items.length - 1], overflowItem && overflowItem._overflow || (overflowItem = null), i = 0; i < items.length; i++) item = items[i], item.hide ? item._width = 0 : item._width = $("#" + util.escapeCSS(idprefix + "_" + i)).outerWidth(!0), itemsWidth += item._width;
- if (itemsWidth > barWidth)
- for (overflowItem || (overflowItem = {
- type: "subMenu",
- _overflow: !0,
- label: lang.getMessage("APEX.MENU.OVERFLOW_LABEL"),
- menu: {
- items: []
- }
- }, items.push(overflowItem)), overflowList = overflowItem.menu.items, i = items.length - 2; i >= 0 && itemsWidth > barWidth;) item = items[i], items.splice(i, 1), "subMenu" === item.type && (item.action || item.href) && item.menu.items.unshift({
- type: "action",
- label: item.label,
- labelKey: item.labelKey,
- href: item.href,
- action: item.action,
- disabled: item.disabled
- }), "subMenu" === item.type && item.menu.customContent && (item$ = $("#" + util.escapeCSS(idprefix + "_" + i)), save$ = item$.children(SEL_MENU).children().eq(0), save$.hide(), item.menu.customContent = save$[0].id, $(document.body).append(save$), item$.children(SEL_MENU).attr("data-custom", null)), overflowList.unshift(item), itemsWidth -= item._width !== undefined ? item._width : 0, adjusted = !0, i -= 1;
- else if (overflowItem) {
- for (overflowList = overflowItem.menu.items, count = 0, i = 0; i < overflowList.length && 3 > count; i++) overflowList[i]._width > 0 && (count += 1);
- for (1 === count && (itemsWidth -= this.element.find("." + C_BAR_OVERFLOW).outerWidth(!0)), delete overflowItem.current; overflowList.length > 0 && (item = overflowList[0], itemsWidth += item._width !== undefined ? item._width : 0, !(itemsWidth > barWidth));) overflowList.shift(), "subMenu" === item.type && (item.action || item.href) && item.menu.items.shift(), items.splice(items.length - 1, 0, item), adjusted = !0;
- 0 === overflowList.length && items.pop()
- }
- return adjusted
- }
- }), $.ui.dialog && $.widget("ui.dialog", $.ui.dialog, {
- _allowInteraction: function(event) {
- return $(event.target).closest(SEL_MENU).length > 0 || this._super(event)
- }
- }), $(document).ready(function() {
- function toggleMenu(btn$, focus, openOnly) {
- var $menu, menuId = btn$.attr("data-menu");
- menuId && (btn$.addClass(C_ACTIVE).attr(A_EXPANDED, "true"), $menu = $("#" + util.escapeCSS(menuId)), openOnly && menuManager.isCurrentMenu($menu[0]) || $menu.menu("toggle", btn$, !1).on("menuafterclose.menubutton", function(event, result) {
- $(this).off(".menubutton"), btn$.removeClass(C_ACTIVE).attr(A_EXPANDED, "false")
- }), focus && setItemFocus($menu.find(SEL_ITEM).first()))
- }
- $("body").on("click", SEL_MENUBUTTON, function(e) {
- toggleMenu($(this), !0, !1)
- }).on("keydown", SEL_MENUBUTTON, function(e) {
- e.which === keys.DOWN ? (e.preventDefault(), toggleMenu($(this), !0, !0)) : e.which === keys.TAB && (actionTookFocus = !0, menuManager.closeAll())
- }), $(SEL_MENUBUTTON).attr(A_HASPOPUP, "true").attr(A_EXPANDED, "false"), $("body").on("apexafterrefresh", function(event) {
- $(event.target).find(SEL_MENUBUTTON).attr(A_HASPOPUP, "true").attr(A_EXPANDED, "false")
- })
- })
- }(apex.util, apex.debug, apex.lang, apex.jQuery);
- var ToggleCore = function(pOptions) {
- return function() {
- pOptions = jQuery.extend({}, {
- useSessionStorage: !0,
- defaultExpandedPreference: !1,
- onClick: function() {},
- onResize: function() {},
- onInitialize: function() {
- userPreference ? forceExpand() : forceCollapse()
- },
- onCollapse: function() {},
- onExpand: function() {}
- }, pOptions);
- var key = pOptions.key,
- defaultExpandedPreference = pOptions.defaultExpandedPreference,
- onExpand = pOptions.onExpand,
- onCollapse = pOptions.onCollapse,
- onResize = pOptions.onResize,
- onClick = pOptions.onClick,
- onInitialize = pOptions.onInitialize,
- content = pOptions.content,
- contentClassExpanded = pOptions.contentClassExpanded,
- contentClassCollapsed = pOptions.contentClassCollapsed,
- controllingElement$ = pOptions.controllingElement,
- controllingElementSelector = pOptions.controllingElementSelector,
- useSessionStorage = pOptions.useSessionStorage,
- sessionStorage = apex.storage.getScopedSessionStorage({
- prefix: key,
- usePageId: !0,
- useAppId: !0
- }),
- expanded = !1,
- userPreference = defaultExpandedPreference;
- if (useSessionStorage) {
- var storedContractedPreference = sessionStorage.getItem("preferenceForExpanded");
- storedContractedPreference && (userPreference = "true" == storedContractedPreference)
- }(!controllingElement$ || controllingElement$.length < 1) && (controllingElement$ = $(controllingElementSelector)), controllingElement$ && controllingElement$.click(function(pEvent) {
- onClick.call(toggleCore), toggle(), controllingElement$.focus(), pEvent.preventDefault()
- });
- var setUserPreference = function(pUserPreference) {
- userPreference = pUserPreference, useSessionStorage && sessionStorage.setItem("preferenceForExpanded", userPreference)
- },
- forceExpand = function() {
- expanded = !1, expand.call(toggleCore)
- },
- forceCollapse = function() {
- expanded = !0, collapse.call(toggleCore)
- },
- expand = function(pUserWantsToSetPreference) {
- expanded || (expanded = !0, pUserWantsToSetPreference && setUserPreference(expanded), content.removeClass(contentClassCollapsed).addClass(contentClassExpanded), onExpand())
- },
- collapse = function(pUserWantsToSetPreference) {
- expanded && (expanded = !1, pUserWantsToSetPreference && setUserPreference(expanded), content.addClass(contentClassCollapsed).removeClass(contentClassExpanded), onCollapse())
- },
- toggle = function() {
- expanded ? collapse.call(toggleCore, !0) : expand.call(toggleCore, !0)
- },
- toggleCore = {
- key: key,
- setUserPreference: setUserPreference,
- doesUserPreferExpanded: function() {
- return userPreference
- },
- isExpanded: function() {
- return expanded
- },
- toggle: function() {
- toggle.call(toggleCore)
- },
- expand: function() {
- expand.call(toggleCore)
- },
- collapse: function() {
- collapse.call(toggleCore)
- },
- forceExpand: forceExpand,
- forceCollapse: forceCollapse,
- resize: function() {
- onResize.call(toggleCore)
- },
- initialize: function() {
- onInitialize.call(toggleCore)
- }
- };
- return toggleCore
- }()
- };
- ! function($, lang, util, undefined) {
- "use strict";
- var C_COLLAPSIBLE = "a-Collapsible",
- C_COLLAPSIBLE_CONTENT = C_COLLAPSIBLE + "-content",
- C_COLLAPSIBLE_HEADING = C_COLLAPSIBLE + "-heading",
- C_IS_EXPANDED = "is-expanded",
- C_IS_COLLAPSED = "is-collapsed",
- C_ICON = "a-Icon",
- C_ICON_COLLAPSIBLE = C_ICON + " " + C_COLLAPSIBLE + "-icon",
- SEL_C = ".",
- SEL_COLLAPSIBLE = SEL_C + C_COLLAPSIBLE,
- A_CONTROLS = "aria-controls",
- A_EXPANDED = "aria-expanded",
- A_HIDDEN = "aria-hidden";
- $.widget("apex.collapsible", {
- version: "5.0",
- widgetEventPrefix: "collapsible",
- baseId: null,
- heading$: null,
- controllingElement$: null,
- content$: null,
- isContentIdSetByWidget: !1,
- isHeadingIdSetByWidget: !1,
- isControllingElementALink: !1,
- core: null,
- expandedClass: C_IS_EXPANDED,
- collapsedClass: C_IS_COLLAPSED,
- options: {
- heading: "h1,h2,h3,h4,h5,h6",
- controllingElement: "button,a",
- content: null,
- collapsed: !0,
- doCollapse: !0,
- universalTheme: !1,
- expandedClass: null,
- collapsedClass: null
- },
- _create: function() {
- var lContentId, lHeadingId, me = this,
- out = util.htmlBuilder(),
- o = this.options,
- lCollapsibleCount = $(SEL_COLLAPSIBLE).length;
- this.baseId = this.element.id || "a_Collapsible" + (lCollapsibleCount + 1), this.element.addClass(C_COLLAPSIBLE), o.expandedClass && (this.expandedClass += " " + o.expandedClass), o.collapsedClass && (this.collapsedClass += " " + o.collapsedClass), this.heading$ = this.element.find(o.heading).first(), this.heading$.addClass(C_COLLAPSIBLE_HEADING), this.controllingElement$ = this.element.find(o.controllingElement).first(), this.controllingElement$.text() || (lHeadingId = this.heading$[0].id, lHeadingId || (lHeadingId = this.baseId + "_heading", this.heading$[0].id = lHeadingId, this.isHeadingIdSetByWidget = !0), this.controllingElement$.attr("aria-labelledby", lHeadingId)), o.universalTheme ? this.content$ = o.content : o.content ? this.content$ = this.element.find(o.content).first() : this.content$ = this.heading$.next(), this.content$.addClass(C_COLLAPSIBLE_CONTENT), lContentId = this.content$[0].id, lContentId || (lContentId = this.baseId + "_content", this.content$[0].id = lContentId, this.isContentIdSetByWidget = !0), this.controllingElement$.attr(A_CONTROLS, lContentId).attr(A_EXPANDED, !o.collapsed), this.controllingElement$.is("a") && (this.isControllingElementALink = !0), out.markup("<span").attr("class", C_ICON_COLLAPSIBLE).attr("aria-hidden", !0).markup(">").markup("</span>"), this.controllingElement$.prepend(out.toString()), this.isControllingElementALink && (this.controllingElement$.attr("role", "button"), this._on(this.controllingElement$, {
- keypress: function(pEvent) {
- pEvent.which === $.ui.keyCode.SPACE && (me.core.toggle(), pEvent.preventDefault())
- }
- })), this.core = ToggleCore({
- key: me.baseId,
- controllingElement: this.controllingElement$,
- content: me.element,
- contentClassExpanded: this.expandedClass,
- contentClassCollapsed: this.collapsedClass,
- defaultExpandedPreference: !o.collapsed,
- useSessionStorage: !1,
- onExpand: function() {
- me.content$.attr(A_HIDDEN, "false"), o.doCollapse && me.content$.show(), me.controllingElement$.attr(A_EXPANDED, "true"), me._trigger("expand")
- },
- onCollapse: function() {
- me.content$.attr(A_HIDDEN, "true"), o.doCollapse && me.content$.hide(), me.controllingElement$.attr(A_EXPANDED, "false"), me._trigger("collapse")
- }
- }), this.core.initialize()
- },
- _destroy: function() {
- this.element.removeClass(C_COLLAPSIBLE + " " + this.collapsedClass + " " + this.expandedClass), this.controllingElement$.removeAttr(A_EXPANDED).removeAttr(A_CONTROLS), this._off(this.controllingElement$), this.isContentIdSetByWidget && this.content$.removeAttr("id"), this.isHeadingIdSetByWidget && this.heading$.removeAttr("id"), this.heading$.removeClass(C_COLLAPSIBLE_HEADING), this.content$.removeAttr(A_HIDDEN).removeClass(C_COLLAPSIBLE_CONTENT), this.options.doCollapse && this.content$.show()
- },
- expand: function() {
- this.core.expand()
- },
- collapse: function() {
- this.core.collapse()
- },
- toggle: function() {
- this.core.toggle()
- },
- getCore: function() {
- return this.core
- }
- })
- }(apex.jQuery, apex.lang, apex.util);
- apex.theme = {},
- function(theme, navigation, $, lang, util, undefined) {
- "use strict";
- var C_HELP_DLG = "apex_popup_field_help",
- SEL_HELP_DLG = "#" + C_HELP_DLG,
- C_HELP_AREA = "apex_popup_help_area",
- SEL_HELP_AREA = "#" + C_HELP_AREA,
- gFieldHelpReturnFocusTo = null;
- theme.popupFieldHelpClassic = function(pItemId, pSessionId, pUrl) {
- var url;
- url = pUrl ? pUrl : "wwv_flow_item_help.show_help?p_item_id=" + pItemId + "&p_session=" + pSessionId, navigation.popup({
- url: url + "&p_output_format=HTML",
- name: "Help",
- width: 500,
- height: 350
- })
- }, theme.popupFieldHelp = function(pItemId, pSessionId, pUrl) {
- function cleanTitle(title) {
- var result, t$ = $("<span></span>");
- return result = title.replace(/&#?\w+;/g, function(m) {
- return t$.html(m), t$.text()
- })
- }
- var url;
- gFieldHelpReturnFocusTo = document.activeElement || null, url = pUrl ? pUrl : "wwv_flow_item_help.show_help?p_item_id=" + pItemId + "&p_session=" + pSessionId, $x("pScreenReaderMode") ? theme.popupFieldHelpClassic(pItemId, pSessionId, pUrl) : $.getJSON(url + "&p_output_format=JSON", function(pData) {
- var lDialog$ = util.getTopApex().jQuery(SEL_HELP_DLG),
- lDialogArea$ = util.getTopApex().jQuery(SEL_HELP_AREA);
- 0 === lDialog$.length ? (0 === lDialogArea$.length && util.getTopApex().jQuery("#wwvFlowForm").after("<div id='" + C_HELP_AREA + "'></div>"), lDialog$ = util.getTopApex().jQuery("<div id='" + C_HELP_DLG + "' tabindex='0'>" + pData.helpText + "</div>"), lDialog$.dialog({
- title: cleanTitle(pData.title),
- appendTo: SEL_HELP_AREA,
- dialogClass: "ui-dialog--helpDialog",
- width: 500,
- height: 350,
- create: function() {
- lDialog$.closest(".ui-dialog").css("position", "fixed")
- },
- resize: function() {
- lDialog$.closest(".ui-dialog").css("position", "fixed")
- },
- close: function() {
- gFieldHelpReturnFocusTo && $(gFieldHelpReturnFocusTo).focus()
- }
- }).keydown(function(event) {
- 117 === event.which && event.altKey && gFieldHelpReturnFocusTo && $(gFieldHelpReturnFocusTo).focus()
- })) : lDialog$.html(pData.helpText).dialog("option", "title", cleanTitle(pData.title)).dialog("open"), lDialog$.focus()
- })
- }, $(document).ready(function() {
- $(document.body).on("click", ".js-itemHelp", function() {
- var itemId = $(this).attr("data-itemhelp");
- itemId && theme.popupFieldHelp(itemId, $v("pInstance"))
- }).on("keydown", function(event) {
- 112 === event.which && event.altKey && $(event.target).parents().each(function() {
- var helpElement$, itemId;
- if (this.id && /_CONTAINER$/.test(this.id) || "TD" === this.nodeName) {
- if (helpElement$ = $(this).find(".js-itemHelp"), helpElement$.length && (itemId = helpElement$.attr("data-itemhelp"))) return theme.popupFieldHelp(itemId, $v("pInstance")), !1;
- if ("TD" !== this.nodeName) return !1
- }
- })
- }), $(document.body).on("dialogopen dialogclose", function(event) {
- var dlg$ = $(event.target);
- !dlg$.is(SEL_HELP_DLG) && dlg$.dialog("option", "modal") && $(SEL_HELP_DLG).dialog("close")
- }), $(document.body).on("click", "label", function(pEvent) {
- var lItem$, lLabelFor = $(this).attr("for");
- lLabelFor && (lItem$ = $("#" + util.escapeCSS(lLabelFor)), lItem$.is("input,textarea,select") && !lItem$.prop("disabled") && lItem$.is(":visible") || 0 !== $(this).find("a").length || (apex.item(lLabelFor).setFocus(), pEvent.preventDefault()))
- }), $(".js-regionDialog").each(function() {
- var inst$ = $(this),
- size = /js-dialog-size(\d+)x(\d+)/.exec(this.className),
- options = {
- autoOpen: !1,
- closeText: apex.lang.getMessage("APEX.DIALOG.CLOSE"),
- modal: inst$.hasClass("js-modal"),
- resizable: inst$.hasClass("js-resizable"),
- draggable: inst$.hasClass("js-draggable"),
- create: function() {
- $(this).closest(".ui-dialog").css("position", "fixed")
- }
- },
- placeholder$ = $("<div style='display:none'></div>");
- size && (options.width = size[1], options.height = size[2]), $.each(["width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight"], function(i, prop) {
- var attrValue = parseInt(inst$.attr("data-" + prop.toLowerCase()), 10);
- isNaN(attrValue) || (options[prop] = attrValue)
- }), $.each(["appendTo", "dialogClass"], function(i, prop) {
- var attrValue = inst$.attr("data-" + prop.toLowerCase());
- attrValue && (options[prop] = attrValue)
- }), options.appendTo && "#" === options.appendTo.substring(0, 1) && 0 === $(options.appendTo).length && $("#wwvFlowForm").after('<div id="' + util.escapeHTML(options.appendTo.substring(1)) + '"></div>'), inst$.before(placeholder$), inst$.dialog(options).on("dialogopen", function() {
- options.modal && apex.navigation.beginFreezeScroll()
- }).on("dialogresize", function() {
- $(this).closest(".ui-dialog").css("position", "fixed")
- }).on("dialogclose", function() {
- options.modal && apex.navigation.endFreezeScroll()
- }), $(apex.gPageContext$).on("apexpagesubmit", function() {
- inst$.dialog("close").css("display", "none"), placeholder$.replaceWith(inst$)
- })
- })
- }), theme.pageResizeInit = function() {
- $("#wwvFlowForm").addClass("resize"), $("body > link").hide(), $("body").css("overflow", "hidden"), $(".resize").each(function() {
- "flex" === $(this).css("display") && $(this).css("display", "block")
- }), $("body").on("resize", function(event) {
- var h, w, resize$, pos, parent$ = $(event.target);
- "BODY" === event.target.nodeName ? (h = document.documentElement.clientHeight, w = document.documentElement.clientWidth) : (h = parent$.height(), w = parent$.width()), resize$ = parent$.children(".resize").filter(":visible"), resize$.length > 0 && (parent$.children(":not(.resize)").filter(":visible").each(function() {
- pos = $(this).css("position"), "fixed" !== pos && "absolute" !== pos && (h -= $(this).outerHeight(!0))
- }), h = Math.floor(h / resize$.length), resize$.each(function() {
- var el$ = $(this);
- util.setOuterHeight(el$, h), util.setOuterWidth(el$, w), el$.filter(":visible").trigger("resize")
- })), event.stopPropagation()
- }), $(".ui-accordion.resize").on("resize", function(event) {
- event.target === this && ($(this).accordion("refresh"), event.stopPropagation())
- }), $(".ui-tabs.resize").on("resize", function(event) {
- event.target === this && ($(this).tabs("refresh").children(".ui-tabs-panel.resize").trigger("resize"), event.stopPropagation())
- }), $(window).on("apexwindowresized", function() {
- $("body").trigger("resize")
- }), $("body").trigger("resize")
- }, theme.defaultStickyTop = function() {
- return 0
- }, theme.initWizardProgressBar = function(pBaseClass) {
- var lBaseClass = pBaseClass ? pBaseClass : "t-WizardSteps",
- lBaseClassSelector = "." + lBaseClass;
- $(lBaseClassSelector).find(lBaseClassSelector + "-step.is-active").find("span" + lBaseClassSelector + "-labelState").text(lang.getMessage("APEX.ACTIVE_STATE")).end().prevAll(lBaseClassSelector + "-step").addClass("is-complete").find("span" + lBaseClassSelector + "-labelState").text(lang.getMessage("APEX.COMPLETED_STATE"))
- }, theme.initResponsiveDialogs = function() {
- $("body").on("dialogopen", ".ui-dialog-content", function() {
- var uiDialogContent$ = $(this),
- uiDialog$ = uiDialogContent$.closest(".ui-dialog");
- if (!(uiDialog$.find(".utr-container").length > 0)) {
- uiDialog$.css("maxWidth", "100%");
- var uiButtonPane$ = uiDialog$.find(".ui-dialog-buttonpane"),
- uiButtonPaneHeight = 0;
- uiButtonPane$.length > 0 && (uiButtonPaneHeight = uiButtonPane$.outerHeight() + 20);
- var initialHeight = uiDialogContent$.height();
- uiDialogContent$.dialog("option", "show") && (initialHeight = parseInt(uiDialogContent$.dialog("option", "height"), 10));
- var minHeight = parseInt(uiDialogContent$.dialog("option", "minHeight"), 10);
- minHeight || (minHeight = 0);
- var onPageResize = function() {
- var offset = uiDialog$.offset(),
- window$ = $(window);
- offset.top -= window$.scrollTop(), offset.left -= window$.scrollLeft();
- var windowWidth = window$.width(),
- dialogWidth = uiDialog$.outerWidth();
- offset.left + dialogWidth > windowWidth && uiDialog$.css("left", windowWidth - dialogWidth);
- var windowHeight = $(window).height(),
- dialogHeight = uiDialog$.height();
- if (initialHeight + uiButtonPaneHeight > windowHeight) {
- var newHeight = windowHeight - uiDialog$.find(".ui-dialog-titlebar").outerHeight() - uiButtonPaneHeight;
- uiDialogContent$.height(Math.max(newHeight, minHeight)), dialogHeight = uiDialog$.height()
- } else windowHeight > initialHeight + uiButtonPaneHeight && uiDialogContent$.height(initialHeight);
- if (offset.top + dialogHeight > windowHeight) {
- var scrollOffset = 0;
- "absolute" === uiDialog$.css("position") && (scrollOffset = window$.scrollTop()), uiDialog$.css("top", Math.max(windowHeight - dialogHeight + scrollOffset, 0))
- }
- };
- $(window).on("apexwindowresized", onPageResize), setTimeout(function() {
- onPageResize()
- }, 250), uiDialogContent$.on("dialogclose", function() {
- $(window).off("apexwindowresized", onPageResize)
- })
- }
- })
- }
- }(apex.theme, apex.navigation, apex.jQuery, apex.lang, apex.util);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement