diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp index 8669f6c057..62569effd9 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp @@ -24,15 +24,15 @@ ${nf.bulletin.board.style.tags} - - - + + + - + ${nf.bulletin.board.script.tags} diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp index acdd1478a2..8f50c1fa7e 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp @@ -28,16 +28,14 @@ - - + + - - - - - + + + @@ -48,7 +46,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp index 33fdbb0183..867ea3fac2 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp @@ -24,19 +24,19 @@ ${nf.cluster.style.tags} - - + + - + - + - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp index 5b901136fd..2d3576dd2f 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp @@ -24,19 +24,19 @@ ${nf.counters.style.tags} - - + + - + - + - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp index 47eb9ec74a..db064ff24e 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp @@ -24,19 +24,19 @@ ${nf.history.style.tags} - - + + - + - + - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp index 742dd3213b..59e8512453 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp @@ -25,20 +25,20 @@ - - + + - + - + - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp index 983fac9f1e..0c57e65826 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp @@ -25,12 +25,12 @@ - - + + - - + + @@ -38,7 +38,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp index d4c41ab537..da479d6a09 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp @@ -24,20 +24,20 @@ ${nf.templates.style.tags} - - + + - + - + - + - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp index a1b511f9bf..ff2bbf1522 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp @@ -25,20 +25,20 @@ - - + + - + - + - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp index ee915c1ed7..8eea811ef8 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp @@ -53,3 +53,4 @@ +
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/secure-port-configuration.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/secure-port-configuration.jsp index 200ef72810..bd870188f6 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/secure-port-configuration.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/secure-port-configuration.jsp @@ -78,4 +78,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/view-single-node-dialog.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/view-single-node-dialog.jsp index 9570de5daf..4a3338cf3d 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/view-single-node-dialog.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/view-single-node-dialog.jsp @@ -21,3 +21,4 @@=i.length)return n;var r=[],u=o[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],o=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(ta.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return o[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},ta.set=function(n){var t=new v;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},o(v,{has:s,add:function(n){return this._[c(n+="")]=!0,n},remove:f,values:h,size:g,empty:p,forEach:function(n){for(var t in this._)n.call(this,l(t))}}),ta.behavior={},ta.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ta.event=null,ta.requote=function(n){return n.replace(Ma,"\\$&")};var Ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,xa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},ba=function(n,t){return t.querySelector(n)},_a=function(n,t){return t.querySelectorAll(n)},wa=ia.matches||ia[m(ia,"matchesSelector")],Sa=function(n,t){return wa.call(n,t)};"function"==typeof Sizzle&&(ba=function(n,t){return Sizzle(n,t)[0]||null},_a=Sizzle,Sa=Sizzle.matchesSelector),ta.selection=function(){return Na};var ka=ta.selection.prototype=[];ka.select=function(n){var t,e,r,u,i=[];n=k(n);for(var o=-1,a=this.length;++o=0&&(e=n.slice(0,t),n=n.slice(t+1)),Ea.hasOwnProperty(e)?{space:Ea[e],local:n}:n}},ka.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ta.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(A(t,n[t]));return this}return this.each(A(n,t))},ka.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=z(n)).length,u=-1;if(t=e.classList){for(;++u =0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=hl.get(e)||fl,r=gl.get(r)||Et,Mu(r(e.apply(null,ea.call(arguments,1))))},ta.interpolateHcl=Lu,ta.interpolateHsl=Tu,ta.interpolateLab=Ru,ta.interpolateRound=Du,ta.transform=function(n){var t=ua.createElementNS(ta.ns.prefix.svg,"g");return(ta.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Pu(e?e.matrix:pl)})(n)},Pu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var pl={a:1,b:0,c:0,d:1,e:0,f:0};ta.interpolateTransform=Hu,ta.layout={},ta.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++ea";
-
-
- all = div.getElementsByTagName("*");
- a = div.getElementsByTagName("a")[ 0 ];
-
- // Can't get basic test support
- if (!all || !all.length || !a) {
- return {};
- }
-
- // First batch of supports tests
- select = document.createElement("select");
- opt = select.appendChild(document.createElement("option"));
- input = div.getElementsByTagName("input")[ 0 ];
-
- support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: (div.firstChild.nodeType === 3),
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
- // Get the style information from getAttribute
- // (IE uses .cssText instead)
- style: /top/.test(a.getAttribute("style")),
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: (a.getAttribute("href") === "/a"),
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.55/.test(a.style.opacity),
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
- // Make sure unknown elements (like HTML5 elems) are handled appropriately
- unknownElems: !!div.getElementsByTagName("nav").length,
- // Make sure that if no value is specified for a checkbox
- // that it defaults to "on".
- // (WebKit defaults to "" instead)
- checkOn: (input.value === "on"),
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: opt.selected,
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
- getSetAttribute: div.className !== "t",
- // Tests for enctype support on a form(#6743)
- enctype: !!document.createElement("form").enctype,
- // Will be defined later
- submitBubbles: true,
- changeBubbles: true,
- focusinBubbles: false,
- deleteExpando: true,
- noCloneEvent: true,
- inlineBlockNeedsLayout: false,
- shrinkWrapBlocks: false,
- reliableMarginRight: true
- };
-
- // Make sure checked status is properly cloned
- input.checked = true;
- support.noCloneChecked = input.cloneNode(true).checked;
-
- // Make sure that the options inside disabled selects aren't marked as disabled
- // (WebKit marks them as disabled)
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Test to see if it's possible to delete an expando from an element
- // Fails in Internet Explorer
- try {
- delete div.test;
- } catch (e) {
- support.deleteExpando = false;
- }
-
- if (!div.addEventListener && div.attachEvent && div.fireEvent) {
- div.attachEvent("onclick", function () {
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- support.noCloneEvent = false;
- });
- div.cloneNode(true).fireEvent("onclick");
- }
-
- // Check if a radio maintains its value
- // after being appended to the DOM
- input = document.createElement("input");
- input.value = "t";
- input.setAttribute("type", "radio");
- support.radioValue = input.value === "t";
-
- input.setAttribute("checked", "checked");
- div.appendChild(input);
- fragment = document.createDocumentFragment();
- fragment.appendChild(div.lastChild);
-
- // WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
-
- div.innerHTML = "";
-
- // Figure out if the W3C box model works as expected
- div.style.width = div.style.paddingLeft = "1px";
-
- // We don't want to do body-related feature tests on frameset
- // documents, which lack a body. So we use
- // document.getElementsByTagName("body")[0], which is undefined in
- // frameset documents, while document.body isn’t. (7398)
- body = document.getElementsByTagName("body")[ 0 ];
- // We use our own, invisible, body unless the body is already present
- // in which case we use a div (#9239)
- testElement = document.createElement(body ? "div" : "body");
- testElementStyle = {
- visibility: "hidden",
- width: 0,
- height: 0,
- border: 0,
- margin: 0,
- background: "none"
- };
- if (body) {
- jQuery.extend(testElementStyle, {
- position: "absolute",
- left: "-999px",
- top: "-999px"
- });
- }
- for (i in testElementStyle) {
- testElement.style[ i ] = testElementStyle[ i ];
- }
- testElement.appendChild(div);
- testElementParent = body || documentElement;
- testElementParent.insertBefore(testElement, testElementParent.firstChild);
-
- // Check if a disconnected checkbox will retain its checked
- // value of true after appended to the DOM (IE6/7)
- support.appendChecked = input.checked;
-
- support.boxModel = div.offsetWidth === 2;
-
- if ("zoom" in div.style) {
- // Check if natively block-level elements act like inline-block
- // elements when setting their display to 'inline' and giving
- // them layout
- // (IE < 8 does this)
- div.style.display = "inline";
- div.style.zoom = 1;
- support.inlineBlockNeedsLayout = (div.offsetWidth === 2);
-
- // Check if elements with layout shrink-wrap their children
- // (IE 6 does this)
- div.style.display = "";
- div.innerHTML = "";
- support.shrinkWrapBlocks = (div.offsetWidth !== 2);
- }
-
- div.innerHTML = "
";
- tds = div.getElementsByTagName("td");
-
- // Check if table cells still have offsetWidth/Height when they are set
- // to display:none and there are still other visible table cells in a
- // table row; if so, offsetWidth/Height are not reliable for use when
- // determining if an element has been hidden directly using
- // display:none (it is still safe to use offsets if a parent element is
- // hidden; don safety goggles and see bug #4512 for more information).
- // (only IE 8 fails this test)
- isSupported = (tds[ 0 ].offsetHeight === 0);
-
- tds[ 0 ].style.display = "";
- tds[ 1 ].style.display = "none";
-
- // Check if empty table cells still have offsetWidth/Height
- // (IE < 8 fail this test)
- support.reliableHiddenOffsets = isSupported && (tds[ 0 ].offsetHeight === 0);
- div.innerHTML = "";
-
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. For more
- // info see bug #3333
- // Fails in WebKit before Feb 2011 nightlies
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- if (document.defaultView && document.defaultView.getComputedStyle) {
- marginDiv = document.createElement("div");
- marginDiv.style.width = "0";
- marginDiv.style.marginRight = "0";
- div.appendChild(marginDiv);
- support.reliableMarginRight =
- (parseInt((document.defaultView.getComputedStyle(marginDiv, null) || {marginRight: 0}).marginRight, 10) || 0) === 0;
- }
-
- // Technique from Juriy Zaytsev
- // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
- // We only care about the case where non-standard event systems
- // are used, namely in IE. Short-circuiting here helps us to
- // avoid an eval call (in setAttribute) which can cause CSP
- // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
- if (div.attachEvent) {
- for (i in {
- submit: 1,
- change: 1,
- focusin: 1
- }) {
- eventName = "on" + i;
- isSupported = (eventName in div);
- if (!isSupported) {
- div.setAttribute(eventName, "return;");
- isSupported = (typeof div[ eventName ] === "function");
- }
- support[ i + "Bubbles" ] = isSupported;
- }
- }
-
- // Run fixed position tests at doc ready to avoid a crash
- // related to the invisible body in IE8
- jQuery(function () {
- var container, outer, inner, table, td, offsetSupport,
- conMarginTop = 1,
- ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",
- vb = "visibility:hidden;border:0;",
- style = "style='" + ptlm + "border:5px solid #000;padding:0;'",
- html = "t " +
- "
";
-
- // Reconstruct a container
- body = document.getElementsByTagName("body")[0];
- if (!body) {
- // Return for frameset docs that don't have a body
- // These tests cannot be done
- return;
- }
-
- container = document.createElement("div");
- container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
- body.insertBefore(container, body.firstChild);
-
- // Construct a test element
- testElement = document.createElement("div");
- testElement.style.cssText = ptlm + vb;
-
- testElement.innerHTML = html;
- container.appendChild(testElement);
- outer = testElement.firstChild;
- inner = outer.firstChild;
- td = outer.nextSibling.firstChild.firstChild;
-
- offsetSupport = {
- doesNotAddBorder: (inner.offsetTop !== 5),
- doesAddBorderForTableAndCells: (td.offsetTop === 5)
- };
-
- inner.style.position = "fixed";
- inner.style.top = "20px";
-
- // safari subtracts parent border width here which is 5px
- offsetSupport.fixedPosition = (inner.offsetTop === 20 || inner.offsetTop === 15);
- inner.style.position = inner.style.top = "";
-
- outer.style.overflow = "hidden";
- outer.style.position = "relative";
-
- offsetSupport.subtractsBorderForOverflowNotVisible = (inner.offsetTop === -5);
- offsetSupport.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== conMarginTop);
-
- body.removeChild(container);
- testElement = container = null;
-
- jQuery.extend(support, offsetSupport);
- });
-
- testElement.innerHTML = "";
- testElementParent.removeChild(testElement);
-
- // Null connected elements to avoid leaks in IE
- testElement = fragment = select = opt = body = marginDiv = div = input = null;
-
- return support;
- })();
-
-// Keep track of boxModel
- jQuery.boxModel = jQuery.support.boxModel;
-
-
-
-
- var rbrace = /^(?:\{.*\}|\[.*\])$/,
- rmultiDash = /([A-Z])/g;
-
- jQuery.extend({
- cache: {},
- // Please use with caution
- uuid: 0,
- // Unique for each copy of jQuery on the page
- // Non-digits removed to match rinlinejQuery
- expando: "jQuery" + (jQuery.fn.jquery + Math.random()).replace(/\D/g, ""),
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- // Ban all objects except for Flash (which handle expandos)
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- "applet": true
- },
- hasData: function (elem) {
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
- return !!elem && !isEmptyDataObject(elem);
- },
- data: function (elem, name, data, pvt /* Internal Use Only */) {
- if (!jQuery.acceptData(elem)) {
- return;
- }
-
- var privateCache, thisCache, ret,
- internalKey = jQuery.expando,
- getByName = typeof name === "string",
- // We have to handle DOM nodes and JS objects differently because IE6-7
- // can't GC object references properly across the DOM-JS boundary
- isNode = elem.nodeType,
- // Only DOM nodes need the global jQuery cache; JS object data is
- // attached directly to the object so GC can occur automatically
- cache = isNode ? jQuery.cache : elem,
- // Only defining an ID for JS objects if its cache already exists allows
- // the code to shortcut on the same path as a DOM node with no cache
- id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando,
- isEvents = name === "events";
-
- // Avoid doing any more work than we need to when trying to get data on an
- // object that has no data at all
- if ((!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined) {
- return;
- }
-
- if (!id) {
- // Only DOM nodes need a new unique ID for each element since their data
- // ends up in the global cache
- if (isNode) {
- elem[ jQuery.expando ] = id = ++jQuery.uuid;
- } else {
- id = jQuery.expando;
- }
- }
-
- if (!cache[ id ]) {
- cache[ id ] = {};
-
- // Avoids exposing jQuery metadata on plain JS objects when the object
- // is serialized using JSON.stringify
- if (!isNode) {
- cache[ id ].toJSON = jQuery.noop;
- }
- }
-
- // An object can be passed to jQuery.data instead of a key/value pair; this gets
- // shallow copied over onto the existing cache
- if (typeof name === "object" || typeof name === "function") {
- if (pvt) {
- cache[ id ] = jQuery.extend(cache[ id ], name);
- } else {
- cache[ id ].data = jQuery.extend(cache[ id ].data, name);
- }
- }
-
- privateCache = thisCache = cache[ id ];
-
- // jQuery data() is stored in a separate object inside the object's internal data
- // cache in order to avoid key collisions between internal data and user-defined
- // data.
- if (!pvt) {
- if (!thisCache.data) {
- thisCache.data = {};
- }
-
- thisCache = thisCache.data;
- }
-
- if (data !== undefined) {
- thisCache[ jQuery.camelCase(name) ] = data;
- }
-
- // Users should not attempt to inspect the internal events object using jQuery.data,
- // it is undocumented and subject to change. But does anyone listen? No.
- if (isEvents && !thisCache[ name ]) {
- return privateCache.events;
- }
-
- // Check for both converted-to-camel and non-converted data property names
- // If a data property was specified
- if (getByName) {
-
- // First Try to find as-is property data
- ret = thisCache[ name ];
-
- // Test for null|undefined property data
- if (ret == null) {
-
- // Try to find the camelCased property
- ret = thisCache[ jQuery.camelCase(name) ];
- }
- } else {
- ret = thisCache;
- }
-
- return ret;
- },
- removeData: function (elem, name, pvt /* Internal Use Only */) {
- if (!jQuery.acceptData(elem)) {
- return;
- }
-
- var thisCache, i, l,
- // Reference to internal data cache key
- internalKey = jQuery.expando,
- isNode = elem.nodeType,
- // See jQuery.data for more information
- cache = isNode ? jQuery.cache : elem,
- // See jQuery.data for more information
- id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
- // If there is already no cache entry for this object, there is no
- // purpose in continuing
- if (!cache[ id ]) {
- return;
- }
-
- if (name) {
-
- thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
- if (thisCache) {
-
- // Support space separated names
- if (jQuery.isArray(name)) {
- name = name;
- } else if (name in thisCache) {
- name = [name];
- } else {
-
- // split the camel cased version by spaces
- name = jQuery.camelCase(name);
- if (name in thisCache) {
- name = [name];
- } else {
- name = name.split(" ");
- }
- }
-
- for (i = 0, l = name.length; i < l; i++) {
- delete thisCache[ name[i] ];
- }
-
- // If there is no data left in the cache, we want to continue
- // and let the cache object itself get destroyed
- if (!(pvt ? isEmptyDataObject : jQuery.isEmptyObject)(thisCache)) {
- return;
- }
- }
- }
-
- // See jQuery.data for more information
- if (!pvt) {
- delete cache[ id ].data;
-
- // Don't destroy the parent cache unless the internal data object
- // had been the only thing left in it
- if (!isEmptyDataObject(cache[ id ])) {
- return;
- }
- }
-
- // Browsers that fail expando deletion also refuse to delete expandos on
- // the window, but it will allow it on all other JS objects; other browsers
- // don't care
- // Ensure that `cache` is not a window object #10080
- if (jQuery.support.deleteExpando || !cache.setInterval) {
- delete cache[ id ];
- } else {
- cache[ id ] = null;
- }
-
- // We destroyed the cache and need to eliminate the expando on the node to avoid
- // false lookups in the cache for entries that no longer exist
- if (isNode) {
- // IE does not allow us to delete expando properties from nodes,
- // nor does it have a removeAttribute function on Document nodes;
- // we must handle all of these cases
- if (jQuery.support.deleteExpando) {
- delete elem[ jQuery.expando ];
- } else if (elem.removeAttribute) {
- elem.removeAttribute(jQuery.expando);
- } else {
- elem[ jQuery.expando ] = null;
- }
- }
- },
- // For internal use only.
- _data: function (elem, name, data) {
- return jQuery.data(elem, name, data, true);
- },
- // A method for determining if a DOM node can handle the data expando
- acceptData: function (elem) {
- if (elem.nodeName) {
- var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
- if (match) {
- return !(match === true || elem.getAttribute("classid") !== match);
- }
- }
-
- return true;
- }
- });
-
- jQuery.fn.extend({
- data: function (key, value) {
- var parts, attr, name,
- data = null;
-
- if (typeof key === "undefined") {
- if (this.length) {
- data = jQuery.data(this[0]);
-
- if (this[0].nodeType === 1 && !jQuery._data(this[0], "parsedAttrs")) {
- attr = this[0].attributes;
- for (var i = 0, l = attr.length; i < l; i++) {
- name = attr[i].name;
-
- if (name.indexOf("data-") === 0) {
- name = jQuery.camelCase(name.substring(5));
-
- dataAttr(this[0], name, data[ name ]);
- }
- }
- jQuery._data(this[0], "parsedAttrs", true);
- }
- }
-
- return data;
-
- } else if (typeof key === "object") {
- return this.each(function () {
- jQuery.data(this, key);
- });
- }
-
- parts = key.split(".");
- parts[1] = parts[1] ? "." + parts[1] : "";
-
- if (value === undefined) {
- data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
- // Try to fetch any internally stored data first
- if (data === undefined && this.length) {
- data = jQuery.data(this[0], key);
- data = dataAttr(this[0], key, data);
- }
-
- return data === undefined && parts[1] ?
- this.data(parts[0]) :
- data;
-
- } else {
- return this.each(function () {
- var $this = jQuery(this),
- args = [parts[0], value];
-
- $this.triggerHandler("setData" + parts[1] + "!", args);
- jQuery.data(this, key, value);
- $this.triggerHandler("changeData" + parts[1] + "!", args);
- });
- }
- },
- removeData: function (key) {
- return this.each(function () {
- jQuery.removeData(this, key);
- });
- }
- });
-
- function dataAttr(elem, key, data) {
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if (data === undefined && elem.nodeType === 1) {
-
- var name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase();
-
- data = elem.getAttribute(name);
-
- if (typeof data === "string") {
- try {
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null :
- jQuery.isNumeric(data) ? parseFloat(data) :
- rbrace.test(data) ? jQuery.parseJSON(data) :
- data;
- } catch (e) {
- }
-
- // Make sure we set the data so it isn't changed later
- jQuery.data(elem, key, data);
-
- } else {
- data = undefined;
- }
- }
-
- return data;
- }
-
-// checks a cache object for emptiness
- function isEmptyDataObject(obj) {
- for (var name in obj) {
-
- // if the public data object is empty, the private is still empty
- if (name === "data" && jQuery.isEmptyObject(obj[name])) {
- continue;
- }
- if (name !== "toJSON") {
- return false;
- }
- }
-
- return true;
- }
-
-
-
-
- function handleQueueMarkDefer(elem, type, src) {
- var deferDataKey = type + "defer",
- queueDataKey = type + "queue",
- markDataKey = type + "mark",
- defer = jQuery._data(elem, deferDataKey);
- if (defer &&
- (src === "queue" || !jQuery._data(elem, queueDataKey)) &&
- (src === "mark" || !jQuery._data(elem, markDataKey))) {
- // Give room for hard-coded callbacks to fire first
- // and eventually mark/queue something else on the element
- setTimeout(function () {
- if (!jQuery._data(elem, queueDataKey) &&
- !jQuery._data(elem, markDataKey)) {
- jQuery.removeData(elem, deferDataKey, true);
- defer.fire();
- }
- }, 0);
- }
- }
-
- jQuery.extend({
- _mark: function (elem, type) {
- if (elem) {
- type = (type || "fx") + "mark";
- jQuery._data(elem, type, (jQuery._data(elem, type) || 0) + 1);
- }
- },
- _unmark: function (force, elem, type) {
- if (force !== true) {
- type = elem;
- elem = force;
- force = false;
- }
- if (elem) {
- type = type || "fx";
- var key = type + "mark",
- count = force ? 0 : ((jQuery._data(elem, key) || 1) - 1);
- if (count) {
- jQuery._data(elem, key, count);
- } else {
- jQuery.removeData(elem, key, true);
- handleQueueMarkDefer(elem, type, "mark");
- }
- }
- },
- queue: function (elem, type, data) {
- var q;
- if (elem) {
- type = (type || "fx") + "queue";
- q = jQuery._data(elem, type);
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if (data) {
- if (!q || jQuery.isArray(data)) {
- q = jQuery._data(elem, type, jQuery.makeArray(data));
- } else {
- q.push(data);
- }
- }
- return q || [];
- }
- },
- dequeue: function (elem, type) {
- type = type || "fx";
-
- var queue = jQuery.queue(elem, type),
- fn = queue.shift(),
- hooks = {};
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if (fn === "inprogress") {
- fn = queue.shift();
- }
-
- if (fn) {
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if (type === "fx") {
- queue.unshift("inprogress");
- }
-
- jQuery._data(elem, type + ".run", hooks);
- fn.call(elem, function () {
- jQuery.dequeue(elem, type);
- }, hooks);
- }
-
- if (!queue.length) {
- jQuery.removeData(elem, type + "queue " + type + ".run", true);
- handleQueueMarkDefer(elem, type, "queue");
- }
- }
- });
-
- jQuery.fn.extend({
- queue: function (type, data) {
- if (typeof type !== "string") {
- data = type;
- type = "fx";
- }
-
- if (data === undefined) {
- return jQuery.queue(this[0], type);
- }
- return this.each(function () {
- var queue = jQuery.queue(this, type, data);
-
- if (type === "fx" && queue[0] !== "inprogress") {
- jQuery.dequeue(this, type);
- }
- });
- },
- dequeue: function (type) {
- return this.each(function () {
- jQuery.dequeue(this, type);
- });
- },
- // Based off of the plugin by Clint Helfers, with permission.
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
- delay: function (time, type) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue(type, function (next, hooks) {
- var timeout = setTimeout(next, time);
- hooks.stop = function () {
- clearTimeout(timeout);
- };
- });
- },
- clearQueue: function (type) {
- return this.queue(type || "fx", []);
- },
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function (type, object) {
- if (typeof type !== "string") {
- object = type;
- type = undefined;
- }
- type = type || "fx";
- var defer = jQuery.Deferred(),
- elements = this,
- i = elements.length,
- count = 1,
- deferDataKey = type + "defer",
- queueDataKey = type + "queue",
- markDataKey = type + "mark",
- tmp;
- function resolve() {
- if (!(--count)) {
- defer.resolveWith(elements, [elements]);
- }
- }
- while (i--) {
- if ((tmp = jQuery.data(elements[ i ], deferDataKey, undefined, true) ||
- (jQuery.data(elements[ i ], queueDataKey, undefined, true) ||
- jQuery.data(elements[ i ], markDataKey, undefined, true)) &&
- jQuery.data(elements[ i ], deferDataKey, jQuery.Callbacks("once memory"), true))) {
- count++;
- tmp.add(resolve);
- }
- }
- resolve();
- return defer.promise();
- }
- });
-
-
-
-
- var rclass = /[\n\t\r]/g,
- rspace = /\s+/,
- rreturn = /\r/g,
- rtype = /^(?:button|input)$/i,
- rfocusable = /^(?:button|input|object|select|textarea)$/i,
- rclickable = /^a(?:rea)?$/i,
- rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- getSetAttribute = jQuery.support.getSetAttribute,
- nodeHook, boolHook, fixSpecified;
-
- jQuery.fn.extend({
- attr: function (name, value) {
- return jQuery.access(this, name, value, true, jQuery.attr);
- },
- removeAttr: function (name) {
- return this.each(function () {
- jQuery.removeAttr(this, name);
- });
- },
- prop: function (name, value) {
- return jQuery.access(this, name, value, true, jQuery.prop);
- },
- removeProp: function (name) {
- name = jQuery.propFix[ name ] || name;
- return this.each(function () {
- // try/catch handles cases where IE balks (such as removing a property on window)
- try {
- this[ name ] = undefined;
- delete this[ name ];
- } catch (e) {
- }
- });
- },
- addClass: function (value) {
- var classNames, i, l, elem,
- setClass, c, cl;
-
- if (jQuery.isFunction(value)) {
- return this.each(function (j) {
- jQuery(this).addClass(value.call(this, j, this.className));
- });
- }
-
- if (value && typeof value === "string") {
- classNames = value.split(rspace);
-
- for (i = 0, l = this.length; i < l; i++) {
- elem = this[ i ];
-
- if (elem.nodeType === 1) {
- if (!elem.className && classNames.length === 1) {
- elem.className = value;
-
- } else {
- setClass = " " + elem.className + " ";
-
- for (c = 0, cl = classNames.length; c < cl; c++) {
- if (!~setClass.indexOf(" " + classNames[ c ] + " ")) {
- setClass += classNames[ c ] + " ";
- }
- }
- elem.className = jQuery.trim(setClass);
- }
- }
- }
- }
-
- return this;
- },
- removeClass: function (value) {
- var classNames, i, l, elem, className, c, cl;
-
- if (jQuery.isFunction(value)) {
- return this.each(function (j) {
- jQuery(this).removeClass(value.call(this, j, this.className));
- });
- }
-
- if ((value && typeof value === "string") || value === undefined) {
- classNames = (value || "").split(rspace);
-
- for (i = 0, l = this.length; i < l; i++) {
- elem = this[ i ];
-
- if (elem.nodeType === 1 && elem.className) {
- if (value) {
- className = (" " + elem.className + " ").replace(rclass, " ");
- for (c = 0, cl = classNames.length; c < cl; c++) {
- className = className.replace(" " + classNames[ c ] + " ", " ");
- }
- elem.className = jQuery.trim(className);
-
- } else {
- elem.className = "";
- }
- }
- }
- }
-
- return this;
- },
- toggleClass: function (value, stateVal) {
- var type = typeof value,
- isBool = typeof stateVal === "boolean";
-
- if (jQuery.isFunction(value)) {
- return this.each(function (i) {
- jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
- });
- }
-
- return this.each(function () {
- if (type === "string") {
- // toggle individual class names
- var className,
- i = 0,
- self = jQuery(this),
- state = stateVal,
- classNames = value.split(rspace);
-
- while ((className = classNames[ i++ ])) {
- // check each className given, space seperated list
- state = isBool ? state : !self.hasClass(className);
- self[ state ? "addClass" : "removeClass" ](className);
- }
-
- } else if (type === "undefined" || type === "boolean") {
- if (this.className) {
- // store className if set
- jQuery._data(this, "__className__", this.className);
- }
-
- // toggle whole className
- this.className = this.className || value === false ? "" : jQuery._data(this, "__className__") || "";
- }
- });
- },
- hasClass: function (selector) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for (; i < l; i++) {
- if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) > -1) {
- return true;
- }
- }
-
- return false;
- },
- val: function (value) {
- var hooks, ret, isFunction,
- elem = this[0];
-
- if (!arguments.length) {
- if (elem) {
- hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
-
- if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
- return ret;
- }
-
- ret = elem.value;
-
- return typeof ret === "string" ?
- // handle most common string cases
- ret.replace(rreturn, "") :
- // handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
-
- return undefined;
- }
-
- isFunction = jQuery.isFunction(value);
-
- return this.each(function (i) {
- var self = jQuery(this), val;
-
- if (this.nodeType !== 1) {
- return;
- }
-
- if (isFunction) {
- val = value.call(this, i, self.val());
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if (val == null) {
- val = "";
- } else if (typeof val === "number") {
- val += "";
- } else if (jQuery.isArray(val)) {
- val = jQuery.map(val, function (value) {
- return value == null ? "" : value + "";
- });
- }
-
- hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
-
- // If set returns undefined, fall back to normal setting
- if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
- this.value = val;
- }
- });
- }
- });
-
- jQuery.extend({
- valHooks: {
- option: {
- get: function (elem) {
- // attributes.value is undefined in Blackberry 4.7 but
- // uses .value. See #6932
- var val = elem.attributes.value;
- return !val || val.specified ? elem.value : elem.text;
- }
- },
- select: {
- get: function (elem) {
- var value, i, max, option,
- index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type === "select-one";
-
- // Nothing was selected
- if (index < 0) {
- return null;
- }
-
- // Loop through all the selected options
- i = one ? index : 0;
- max = one ? index + 1 : options.length;
- for (; i < max; i++) {
- option = options[ i ];
-
- // Don't return options that are disabled or in a disabled optgroup
- if (option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
- (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) {
-
- // Get the specific value for the option
- value = jQuery(option).val();
-
- // We don't need an array for one selects
- if (one) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push(value);
- }
- }
-
- // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
- if (one && !values.length && options.length) {
- return jQuery(options[ index ]).val();
- }
-
- return values;
- },
- set: function (elem, value) {
- var values = jQuery.makeArray(value);
-
- jQuery(elem).find("option").each(function () {
- this.selected = jQuery.inArray(jQuery(this).val(), values) >= 0;
- });
-
- if (!values.length) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- },
- attrFn: {
- val: true,
- css: true,
- html: true,
- text: true,
- data: true,
- width: true,
- height: true,
- offset: true
- },
- attr: function (elem, name, value, pass) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set attributes on text, comment and attribute nodes
- if (!elem || nType === 3 || nType === 8 || nType === 2) {
- return undefined;
- }
-
- if (pass && name in jQuery.attrFn) {
- return jQuery(elem)[ name ](value);
- }
-
- // Fallback to prop when attributes are not supported
- if (!("getAttribute" in elem)) {
- return jQuery.prop(elem, name, value);
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
-
- // All attributes are lowercase
- // Grab necessary hook if one is defined
- if (notxml) {
- name = name.toLowerCase();
- hooks = jQuery.attrHooks[ name ] || (rboolean.test(name) ? boolHook : nodeHook);
- }
-
- if (value !== undefined) {
-
- if (value === null) {
- jQuery.removeAttr(elem, name);
- return undefined;
-
- } else if (hooks && "set" in hooks && notxml && (ret = hooks.set(elem, value, name)) !== undefined) {
- return ret;
-
- } else {
- elem.setAttribute(name, "" + value);
- return value;
- }
-
- } else if (hooks && "get" in hooks && notxml && (ret = hooks.get(elem, name)) !== null) {
- return ret;
-
- } else {
-
- ret = elem.getAttribute(name);
-
- // Non-existent attributes return null, we normalize to undefined
- return ret === null ?
- undefined :
- ret;
- }
- },
- removeAttr: function (elem, value) {
- var propName, attrNames, name, l,
- i = 0;
-
- if (elem.nodeType === 1) {
- attrNames = (value || "").split(rspace);
- l = attrNames.length;
-
- for (; i < l; i++) {
- name = attrNames[ i ].toLowerCase();
- propName = jQuery.propFix[ name ] || name;
-
- // See #9699 for explanation of this approach (setting first, then removal)
- jQuery.attr(elem, name, "");
- elem.removeAttribute(getSetAttribute ? name : propName);
-
- // Set corresponding property to false for boolean attributes
- if (rboolean.test(name) && propName in elem) {
- elem[ propName ] = false;
- }
- }
- }
- },
- attrHooks: {
- type: {
- set: function (elem, value) {
- // We can't allow the type property to be changed (since it causes problems in IE)
- if (rtype.test(elem.nodeName) && elem.parentNode) {
- jQuery.error("type property can't be changed");
- } else if (!jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input")) {
- // Setting the type on a radio button after the value resets the value in IE6-9
- // Reset value to it's default in case type is set after value
- // This is for element creation
- var val = elem.value;
- elem.setAttribute("type", value);
- if (val) {
- elem.value = val;
- }
- return value;
- }
- }
- },
- // Use the value property for back compat
- // Use the nodeHook for button elements in IE6/7 (#1954)
- value: {
- get: function (elem, name) {
- if (nodeHook && jQuery.nodeName(elem, "button")) {
- return nodeHook.get(elem, name);
- }
- return name in elem ?
- elem.value :
- null;
- },
- set: function (elem, value, name) {
- if (nodeHook && jQuery.nodeName(elem, "button")) {
- return nodeHook.set(elem, value, name);
- }
- // Does not return so that setAttribute is also used
- elem.value = value;
- }
- }
- },
- propFix: {
- tabindex: "tabIndex",
- readonly: "readOnly",
- "for": "htmlFor",
- "class": "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- },
- prop: function (elem, name, value) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set properties on text, comment and attribute nodes
- if (!elem || nType === 3 || nType === 8 || nType === 2) {
- return undefined;
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
-
- if (notxml) {
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if (value !== undefined) {
- if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
- return ret;
-
- } else {
- return (elem[ name ] = value);
- }
-
- } else {
- if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
- return ret;
-
- } else {
- return elem[ name ];
- }
- }
- },
- propHooks: {
- tabIndex: {
- get: function (elem) {
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- var attributeNode = elem.getAttributeNode("tabindex");
-
- return attributeNode && attributeNode.specified ?
- parseInt(attributeNode.value, 10) :
- rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ?
- 0 :
- undefined;
- }
- }
- }
- });
-
-// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
- jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
-
-// Hook for boolean attributes
- boolHook = {
- get: function (elem, name) {
- // Align boolean attributes with corresponding properties
- // Fall back to attribute presence where some booleans are not supported
- var attrNode,
- property = jQuery.prop(elem, name);
- return property === true || typeof property !== "boolean" && (attrNode = elem.getAttributeNode(name)) && attrNode.nodeValue !== false ?
- name.toLowerCase() :
- undefined;
- },
- set: function (elem, value, name) {
- var propName;
- if (value === false) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr(elem, name);
- } else {
- // value is true since we know at this point it's type boolean and not false
- // Set boolean attributes to the same name and set the DOM property
- propName = jQuery.propFix[ name ] || name;
- if (propName in elem) {
- // Only set the IDL specifically if it already exists on the element
- elem[ propName ] = true;
- }
-
- elem.setAttribute(name, name.toLowerCase());
- }
- return name;
- }
- };
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
- if (!getSetAttribute) {
-
- fixSpecified = {
- name: true,
- id: true
- };
-
- // Use this for any attribute in IE6/7
- // This fixes almost every IE6/7 issue
- nodeHook = jQuery.valHooks.button = {
- get: function (elem, name) {
- var ret;
- ret = elem.getAttributeNode(name);
- return ret && (fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified) ?
- ret.nodeValue :
- undefined;
- },
- set: function (elem, value, name) {
- // Set the existing or create a new attribute node
- var ret = elem.getAttributeNode(name);
- if (!ret) {
- ret = document.createAttribute(name);
- elem.setAttributeNode(ret);
- }
- return (ret.nodeValue = value + "");
- }
- };
-
- // Apply the nodeHook to tabindex
- jQuery.attrHooks.tabindex.set = nodeHook.set;
-
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
- // This is for removals
- jQuery.each(["width", "height"], function (i, name) {
- jQuery.attrHooks[ name ] = jQuery.extend(jQuery.attrHooks[ name ], {
- set: function (elem, value) {
- if (value === "") {
- elem.setAttribute(name, "auto");
- return value;
- }
- }
- });
- });
-
- // Set contenteditable to false on removals(#10429)
- // Setting to empty string throws an error as an invalid value
- jQuery.attrHooks.contenteditable = {
- get: nodeHook.get,
- set: function (elem, value, name) {
- if (value === "") {
- value = "false";
- }
- nodeHook.set(elem, value, name);
- }
- };
- }
-
-
-// Some attributes require a special call on IE
- if (!jQuery.support.hrefNormalized) {
- jQuery.each(["href", "src", "width", "height"], function (i, name) {
- jQuery.attrHooks[ name ] = jQuery.extend(jQuery.attrHooks[ name ], {
- get: function (elem) {
- var ret = elem.getAttribute(name, 2);
- return ret === null ? undefined : ret;
- }
- });
- });
- }
-
- if (!jQuery.support.style) {
- jQuery.attrHooks.style = {
- get: function (elem) {
- // Return undefined in the case of empty string
- // Normalize to lowercase since IE uppercases css property names
- return elem.style.cssText.toLowerCase() || undefined;
- },
- set: function (elem, value) {
- return (elem.style.cssText = "" + value);
- }
- };
- }
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
- if (!jQuery.support.optSelected) {
- jQuery.propHooks.selected = jQuery.extend(jQuery.propHooks.selected, {
- get: function (elem) {
- var parent = elem.parentNode;
-
- if (parent) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if (parent.parentNode) {
- parent.parentNode.selectedIndex;
- }
- }
- return null;
- }
- });
- }
-
-// IE6/7 call enctype encoding
- if (!jQuery.support.enctype) {
- jQuery.propFix.enctype = "encoding";
- }
-
-// Radios and checkboxes getter/setter
- if (!jQuery.support.checkOn) {
- jQuery.each(["radio", "checkbox"], function () {
- jQuery.valHooks[ this ] = {
- get: function (elem) {
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
- return elem.getAttribute("value") === null ? "on" : elem.value;
- }
- };
- });
- }
- jQuery.each(["radio", "checkbox"], function () {
- jQuery.valHooks[ this ] = jQuery.extend(jQuery.valHooks[ this ], {
- set: function (elem, value) {
- if (jQuery.isArray(value)) {
- return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0);
- }
- }
- });
- });
-
-
-
-
- var rnamespaces = /\.(.*)$/,
- rformElems = /^(?:textarea|input|select)$/i,
- rperiod = /\./g,
- rspaces = / /g,
- rescape = /[^\w\s.|`]/g,
- rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
- rhoverHack = /\bhover(\.\S+)?/,
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|contextmenu)|click/,
- rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
- quickParse = function (selector) {
- var quick = rquickIs.exec(selector);
- if (quick) {
- // 0 1 2 3
- // [ _, tag, id, class ]
- quick[1] = (quick[1] || "").toLowerCase();
- quick[3] = quick[3] && new RegExp("(?:^|\\s)" + quick[3] + "(?:\\s|$)");
- }
- return quick;
- },
- quickIs = function (elem, m) {
- return (
- (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
- (!m[2] || elem.id === m[2]) &&
- (!m[3] || m[3].test(elem.className))
- );
- },
- hoverHack = function (events) {
- return jQuery.event.special.hover ? events : events.replace(rhoverHack, "mouseenter$1 mouseleave$1");
- };
-
- /*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
- jQuery.event = {
- add: function (elem, types, handler, data, selector) {
-
- var elemData, eventHandle, events,
- t, tns, type, namespaces, handleObj,
- handleObjIn, quick, handlers, special;
-
- // Don't attach events to noData or text/comment nodes (allow plain objects tho)
- if (elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data(elem))) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if (handler.handler) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if (!handler.guid) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- events = elemData.events;
- if (!events) {
- elemData.events = events = {};
- }
- eventHandle = elemData.handle;
- if (!eventHandle) {
- elemData.handle = eventHandle = function (e) {
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
- jQuery.event.dispatch.apply(eventHandle.elem, arguments) :
- undefined;
- };
- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
- eventHandle.elem = elem;
- }
-
- // Handle multiple events separated by a space
- // jQuery(...).bind("mouseover mouseout", fn);
- types = hoverHack(types).split(" ");
- for (t = 0; t < types.length; t++) {
-
- tns = rtypenamespace.exec(types[t]) || [];
- type = tns[1];
- namespaces = (tns[2] || "").split(".").sort();
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = (selector ? special.delegateType : special.bindType) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend({
- type: type,
- origType: tns[1],
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- namespace: namespaces.join(".")
- }, handleObjIn);
-
- // Delegated event; pre-analyze selector so it's processed quickly on event dispatch
- if (selector) {
- handleObj.quick = quickParse(selector);
- if (!handleObj.quick && jQuery.expr.match.POS.test(selector)) {
- handleObj.isPositional = true;
- }
- }
-
- // Init the event handler queue if we're the first
- handlers = events[ type ];
- if (!handlers) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener/attachEvent if the special events handler returns false
- if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
- // Bind the global event handler to the element
- if (elem.addEventListener) {
- elem.addEventListener(type, eventHandle, false);
-
- } else if (elem.attachEvent) {
- elem.attachEvent("on" + type, eventHandle);
- }
- }
- }
-
- if (special.add) {
- special.add.call(elem, handleObj);
-
- if (!handleObj.handler.guid) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if (selector) {
- handlers.splice(handlers.delegateCount++, 0, handleObj);
- } else {
- handlers.push(handleObj);
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
- global: {},
- // Detach an event or set of events from an element
- remove: function (elem, types, handler, selector) {
-
- var elemData = jQuery.hasData(elem) && jQuery._data(elem),
- t, tns, type, namespaces, origCount,
- j, events, special, handle, eventType, handleObj;
-
- if (!elemData || !(events = elemData.events)) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = hoverHack(types || "").split(" ");
- for (t = 0; t < types.length; t++) {
- tns = rtypenamespace.exec(types[t]) || [];
- type = tns[1];
- namespaces = tns[2];
-
- // Unbind all events (on this namespace, if provided) for the element
- if (!type) {
- namespaces = namespaces ? "." + namespaces : "";
- for (j in events) {
- jQuery.event.remove(elem, j + namespaces, handler, selector);
- }
- return;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- eventType = events[ type ] || [];
- origCount = eventType.length;
- namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-
- // Only need to loop for special events or selective removal
- if (handler || namespaces || selector || special.remove) {
- for (j = 0; j < eventType.length; j++) {
- handleObj = eventType[ j ];
-
- if (!handler || handler.guid === handleObj.guid) {
- if (!namespaces || namespaces.test(handleObj.namespace)) {
- if (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector) {
- eventType.splice(j--, 1);
-
- if (handleObj.selector) {
- eventType.delegateCount--;
- }
- if (special.remove) {
- special.remove.call(elem, handleObj);
- }
- }
- }
- }
- }
- } else {
- // Removing all events
- eventType.length = 0;
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if (eventType.length === 0 && origCount !== eventType.length) {
- if (!special.teardown || special.teardown.call(elem, namespaces) === false) {
- jQuery.removeEvent(elem, type, elemData.handle);
- }
-
- delete events[ type ];
- }
- }
-
- // Remove the expando if it's no longer used
- if (jQuery.isEmptyObject(events)) {
- handle = elemData.handle;
- if (handle) {
- handle.elem = null;
- }
-
- // removeData also checks for emptiness and clears the expando if empty
- // so use it instead of delete
- jQuery.removeData(elem, ["events", "handle"], true);
- }
- },
- // Events that are safe to short-circuit if no handlers are attached.
- // Native DOM events should not be added, they may have inline handlers.
- customEvent: {
- "getData": true,
- "setData": true,
- "changeData": true
- },
- trigger: function (event, data, elem, onlyHandlers) {
- // Don't do events on text and comment nodes
- if (elem && (elem.nodeType === 3 || elem.nodeType === 8)) {
- return;
- }
-
- // Event object or event type
- var type = event.type || event,
- namespaces = [],
- cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
-
- if (type.indexOf("!") >= 0) {
- // Exclusive events trigger only for the exact event (no namespaces)
- type = type.slice(0, -1);
- exclusive = true;
- }
-
- if (type.indexOf(".") >= 0) {
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
-
- if ((!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ]) {
- // No jQuery handlers for this event type, and it can't have inline handlers
- return;
- }
-
- // Caller can pass in an Event, Object, or just an event type string
- event = typeof event === "object" ?
- // jQuery.Event object
- event[ jQuery.expando ] ? event :
- // Object literal
- new jQuery.Event(type, event) :
- // Just the event type (string)
- new jQuery.Event(type);
-
- event.type = type;
- event.isTrigger = true;
- event.exclusive = exclusive;
- event.namespace = namespaces.join(".");
- event.namespace_re = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
- ontype = type.indexOf(":") < 0 ? "on" + type : "";
-
- // triggerHandler() and global events don't bubble or run the default action
- if (onlyHandlers || !elem) {
- event.preventDefault();
- }
-
- // Handle a global trigger
- if (!elem) {
-
- // TODO: Stop taunting the data cache; remove global events and always attach to document
- cache = jQuery.cache;
- for (i in cache) {
- if (cache[ i ].events && cache[ i ].events[ type ]) {
- jQuery.event.trigger(event, data, cache[ i ].handle.elem, true);
- }
- }
- return;
- }
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if (!event.target) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data != null ? jQuery.makeArray(data) : [];
- data.unshift(event);
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if (special.trigger && special.trigger.apply(elem, data) === false) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- eventPath = [[elem, special.bindType || type]];
- if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
-
- bubbleType = special.delegateType || type;
- old = null;
- for (cur = elem.parentNode; cur; cur = cur.parentNode) {
- eventPath.push([cur, bubbleType]);
- old = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if (old && old === elem.ownerDocument) {
- eventPath.push([old.defaultView || old.parentWindow || window, bubbleType]);
- }
- }
-
- // Fire handlers on the event path
- for (i = 0; i < eventPath.length; i++) {
-
- cur = eventPath[i][0];
- event.type = eventPath[i][1];
-
- handle = (jQuery._data(cur, "events") || {})[ event.type ] && jQuery._data(cur, "handle");
- if (handle) {
- handle.apply(cur, data);
- }
- handle = ontype && cur[ ontype ];
- if (handle && jQuery.acceptData(cur)) {
- handle.apply(cur, data);
- }
-
- if (event.isPropagationStopped()) {
- break;
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if (!event.isDefaultPrevented()) {
-
- if ((!special._default || special._default.apply(elem.ownerDocument, data) === false) &&
- !(type === "click" && jQuery.nodeName(elem, "a")) && jQuery.acceptData(elem)) {
-
- // Call a native DOM method on the target with the same name name as the event.
- // Can't use an .isFunction() check here because IE6/7 fails that test.
- // Don't do default actions on window, that's where global variables be (#6170)
- // IE<9 dies on focus/blur to hidden element (#1486)
- if (ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow(elem)) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- old = elem[ ontype ];
-
- if (old) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- elem[ type ]();
- jQuery.event.triggered = undefined;
-
- if (old) {
- elem[ ontype ] = old;
- }
- }
- }
- }
-
- return event.result;
- },
- dispatch: function (event) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix(event || window.event);
-
- var handlers = ((jQuery._data(this, "events") || {})[ event.type ] || []),
- delegateCount = handlers.delegateCount,
- args = [].slice.call(arguments, 0),
- run_all = !event.exclusive && !event.namespace,
- specialHandle = (jQuery.event.special[ event.type ] || {}).handle,
- handlerQueue = [],
- i, j, cur, ret, selMatch, matched, matches, handleObj, sel, hit, related;
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[0] = event;
- event.delegateTarget = this;
-
- // Determine handlers that should run if there are delegated events
- // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
- if (delegateCount && !event.target.disabled && !(event.button && event.type === "click")) {
-
- for (cur = event.target; cur != this; cur = cur.parentNode || this) {
- selMatch = {};
- matches = [];
- for (i = 0; i < delegateCount; i++) {
- handleObj = handlers[ i ];
- sel = handleObj.selector;
- hit = selMatch[ sel ];
-
- if (handleObj.isPositional) {
- // Since .is() does not work for positionals; see http://jsfiddle.net/eJ4yd/3/
- hit = (hit || (selMatch[ sel ] = jQuery(sel))).index(cur) >= 0;
- } else if (hit === undefined) {
- hit = selMatch[ sel ] = (handleObj.quick ? quickIs(cur, handleObj.quick) : jQuery(cur).is(sel));
- }
- if (hit) {
- matches.push(handleObj);
- }
- }
- if (matches.length) {
- handlerQueue.push({elem: cur, matches: matches});
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- if (handlers.length > delegateCount) {
- handlerQueue.push({elem: this, matches: handlers.slice(delegateCount)});
- }
-
- // Run delegates first; they may want to stop propagation beneath us
- for (i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++) {
- matched = handlerQueue[ i ];
- event.currentTarget = matched.elem;
-
- for (j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++) {
- handleObj = matched.matches[ j ];
-
- // Triggered event must either 1) be non-exclusive and have no namespace, or
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
- if (run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test(handleObj.namespace)) {
-
- event.data = handleObj.data;
- event.handleObj = handleObj;
-
- ret = (specialHandle || handleObj.handler).apply(matched.elem, args);
-
- if (ret !== undefined) {
- event.result = ret;
- if (ret === false) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- return event.result;
- },
- // Includes some event props shared by KeyEvent and MouseEvent
- // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- fixHooks: {},
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function (event, original) {
-
- // Add which for key events
- if (event.which == null) {
- event.which = original.charCode != null ? original.charCode : original.keyCode;
- }
-
- return event;
- }
- },
- mouseHooks: {
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),
- filter: function (event, original) {
- var eventDoc, doc, body,
- button = original.button,
- fromElement = original.fromElement;
-
- // Calculate pageX/Y if missing and clientX/Y available
- if (event.pageX == null && original.clientX != null) {
- eventDoc = event.target.ownerDocument || document;
- doc = eventDoc.documentElement;
- body = eventDoc.body;
-
- event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
- event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
- }
-
- // Add relatedTarget, if necessary
- if (!event.relatedTarget && fromElement) {
- event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- // Note: button is not normalized, so don't use it
- if (!event.which && button !== undefined) {
- event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
- }
-
- return event;
- }
- },
- fix: function (event) {
- if (event[ jQuery.expando ]) {
- return event;
- }
-
- // Create a writable copy of the event object and normalize some properties
- var i, prop,
- originalEvent = event,
- fixHook = jQuery.event.fixHooks[ event.type ] || {},
- copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
-
- event = jQuery.Event(originalEvent);
-
- for (i = copy.length; i; ) {
- prop = copy[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
- if (!event.target) {
- event.target = originalEvent.srcElement || document;
- }
-
- // Target should not be a text node (#504, Safari)
- if (event.target.nodeType === 3) {
- event.target = event.target.parentNode;
- }
-
- // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
- if (event.metaKey === undefined) {
- event.metaKey = event.ctrlKey;
- }
-
- return fixHook.filter ? fixHook.filter(event, originalEvent) : event;
- },
- special: {
- ready: {
- // Make sure the ready event is setup
- setup: jQuery.bindReady
- },
- focus: {
- delegateType: "focusin",
- noBubble: true
- },
- blur: {
- delegateType: "focusout",
- noBubble: true
- },
- beforeunload: {
- setup: function (data, namespaces, eventHandle) {
- // We only want to do this special case on windows
- if (jQuery.isWindow(this)) {
- this.onbeforeunload = eventHandle;
- }
- },
- teardown: function (namespaces, eventHandle) {
- if (this.onbeforeunload === eventHandle) {
- this.onbeforeunload = null;
- }
- }
- }
- },
- simulate: function (type, elem, event, bubble) {
- // Piggyback on a donor event to simulate a different one.
- // Fake originalEvent to avoid donor's stopPropagation, but if the
- // simulated event prevents default then we do the same on the donor.
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- {type: type,
- isSimulated: true,
- originalEvent: {}
- }
- );
- if (bubble) {
- jQuery.event.trigger(e, null, elem);
- } else {
- jQuery.event.dispatch.call(elem, e);
- }
- if (e.isDefaultPrevented()) {
- event.preventDefault();
- }
- }
- };
-
-// Some plugins are using, but it's undocumented/deprecated and will be removed.
-// The 1.7 special event interface should provide all the hooks needed now.
- jQuery.event.handle = jQuery.event.dispatch;
-
- jQuery.removeEvent = document.removeEventListener ?
- function (elem, type, handle) {
- if (elem.removeEventListener) {
- elem.removeEventListener(type, handle, false);
- }
- } :
- function (elem, type, handle) {
- if (elem.detachEvent) {
- elem.detachEvent("on" + type, handle);
- }
- };
-
- jQuery.Event = function (src, props) {
- // Allow instantiation without the 'new' keyword
- if (!(this instanceof jQuery.Event)) {
- return new jQuery.Event(src, props);
- }
-
- // Event object
- if (src && src.type) {
- this.originalEvent = src;
- this.type = src.type;
-
- // Events bubbling up the document may have been marked as prevented
- // by a handler lower down the tree; reflect the correct value.
- this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
- src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
-
- // Event type
- } else {
- this.type = src;
- }
-
- // Put explicitly provided properties onto the event object
- if (props) {
- jQuery.extend(this, props);
- }
-
- // Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || jQuery.now();
-
- // Mark it as fixed
- this[ jQuery.expando ] = true;
- };
-
- function returnFalse() {
- return false;
- }
- function returnTrue() {
- return true;
- }
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
- jQuery.Event.prototype = {
- preventDefault: function () {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if (!e) {
- return;
- }
-
- // if preventDefault exists run it on the original event
- if (e.preventDefault) {
- e.preventDefault();
-
- // otherwise set the returnValue property of the original event to false (IE)
- } else {
- e.returnValue = false;
- }
- },
- stopPropagation: function () {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if (!e) {
- return;
- }
- // if stopPropagation exists run it on the original event
- if (e.stopPropagation) {
- e.stopPropagation();
- }
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation: function () {
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
- };
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
- jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- }, function (orig, fix) {
- jQuery.event.special[ orig ] = jQuery.event.special[ fix ] = {
- delegateType: fix,
- bindType: fix,
- handle: function (event) {
- var target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj,
- selector = handleObj.selector,
- oldType, ret;
-
- // For a real mouseover/out, always call the handler; for
- // mousenter/leave call the handler if related is outside the target.
- // NB: No relatedTarget if the mouse left/entered the browser window
- if (!related || handleObj.origType === event.type || (related !== target && !jQuery.contains(target, related))) {
- oldType = event.type;
- event.type = handleObj.origType;
- ret = handleObj.handler.apply(this, arguments);
- event.type = oldType;
- }
- return ret;
- }
- };
- });
-
-// IE submit delegation
- if (!jQuery.support.submitBubbles) {
-
- jQuery.event.special.submit = {
- setup: function () {
- // Only need this for delegated form submit events
- if (jQuery.nodeName(this, "form")) {
- return false;
- }
-
- // Lazy-add a submit handler when a descendant form may potentially be submitted
- jQuery.event.add(this, "click._submit keypress._submit", function (e) {
- // Node name check avoids a VML-related crash in IE (#9807)
- var elem = e.target,
- form = jQuery.nodeName(elem, "input") || jQuery.nodeName(elem, "button") ? elem.form : undefined;
- if (form && !form._submit_attached) {
- jQuery.event.add(form, "submit._submit", function (event) {
- // Form was submitted, bubble the event up the tree
- if (this.parentNode) {
- jQuery.event.simulate("submit", this.parentNode, event, true);
- }
- });
- form._submit_attached = true;
- }
- });
- // return undefined since we don't need an event listener
- },
- teardown: function () {
- // Only need this for delegated form submit events
- if (jQuery.nodeName(this, "form")) {
- return false;
- }
-
- // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
- jQuery.event.remove(this, "._submit");
- }
- };
- }
-
-// IE change delegation and checkbox/radio fix
- if (!jQuery.support.changeBubbles) {
-
- jQuery.event.special.change = {
- setup: function () {
-
- if (rformElems.test(this.nodeName)) {
- // IE doesn't fire change on a check/radio until blur; trigger it on click
- // after a propertychange. Eat the blur-change in special.change.handle.
- // This still fires onchange a second time for check/radio after blur.
- if (this.type === "checkbox" || this.type === "radio") {
- jQuery.event.add(this, "propertychange._change", function (event) {
- if (event.originalEvent.propertyName === "checked") {
- this._just_changed = true;
- }
- });
- jQuery.event.add(this, "click._change", function (event) {
- if (this._just_changed) {
- this._just_changed = false;
- jQuery.event.simulate("change", this, event, true);
- }
- });
- }
- return false;
- }
- // Delegated event; lazy-add a change handler on descendant inputs
- jQuery.event.add(this, "beforeactivate._change", function (e) {
- var elem = e.target;
-
- if (rformElems.test(elem.nodeName) && !elem._change_attached) {
- jQuery.event.add(elem, "change._change", function (event) {
- if (this.parentNode && !event.isSimulated) {
- jQuery.event.simulate("change", this.parentNode, event, true);
- }
- });
- elem._change_attached = true;
- }
- });
- },
- handle: function (event) {
- var elem = event.target;
-
- // Swallow native change events from checkbox/radio, we already triggered them above
- if (this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox")) {
- return event.handleObj.handler.apply(this, arguments);
- }
- },
- teardown: function () {
- jQuery.event.remove(this, "._change");
-
- return rformElems.test(this.nodeName);
- }
- };
- }
-
-// Create "bubbling" focus and blur events
- if (!jQuery.support.focusinBubbles) {
- jQuery.each({focus: "focusin", blur: "focusout"}, function (orig, fix) {
-
- // Attach a single capturing handler while someone wants focusin/focusout
- var attaches = 0,
- handler = function (event) {
- jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);
- };
-
- jQuery.event.special[ fix ] = {
- setup: function () {
- if (attaches++ === 0) {
- document.addEventListener(orig, handler, true);
- }
- },
- teardown: function () {
- if (--attaches === 0) {
- document.removeEventListener(orig, handler, true);
- }
- }
- };
- });
- }
-
- jQuery.fn.extend({
- on: function (types, selector, data, fn, /*INTERNAL*/ one) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if (typeof types === "object") {
- // ( types-Object, selector, data )
- if (typeof selector !== "string") {
- // ( types-Object, data )
- data = selector;
- selector = undefined;
- }
- for (type in types) {
- this.on(type, selector, data, types[ type ], one);
- }
- return this;
- }
-
- if (data == null && fn == null) {
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if (fn == null) {
- if (typeof selector === "string") {
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if (fn === false) {
- fn = returnFalse;
- } else if (!fn) {
- return this;
- }
-
- if (one === 1) {
- origFn = fn;
- fn = function (event) {
- // Can use an empty set, since event contains the info
- jQuery().off(event);
- return origFn.apply(this, arguments);
- };
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
- }
- return this.each(function () {
- jQuery.event.add(this, types, fn, data, selector);
- });
- },
- one: function (types, selector, data, fn) {
- return this.on.call(this, types, selector, data, fn, 1);
- },
- off: function (types, selector, fn) {
- if (types && types.preventDefault && types.handleObj) {
- // ( event ) dispatched jQuery.Event
- var handleObj = types.handleObj;
- jQuery(types.delegateTarget).off(
- handleObj.namespace ? handleObj.type + "." + handleObj.namespace : handleObj.type,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if (typeof types === "object") {
- // ( types-object [, selector] )
- for (var type in types) {
- this.off(type, selector, types[ type ]);
- }
- return this;
- }
- if (selector === false || typeof selector === "function") {
- // ( types [, fn] )
- fn = selector;
- selector = undefined;
- }
- if (fn === false) {
- fn = returnFalse;
- }
- return this.each(function () {
- jQuery.event.remove(this, types, fn, selector);
- });
- },
- bind: function (types, data, fn) {
- return this.on(types, null, data, fn);
- },
- unbind: function (types, fn) {
- return this.off(types, null, fn);
- },
- live: function (types, data, fn) {
- jQuery(this.context).on(types, this.selector, data, fn);
- return this;
- },
- die: function (types, fn) {
- jQuery(this.context).off(types, this.selector || "**", fn);
- return this;
- },
- delegate: function (selector, types, data, fn) {
- return this.on(types, selector, data, fn);
- },
- undelegate: function (selector, types, fn) {
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length == 1 ? this.off(selector, "**") : this.off(types, selector, fn);
- },
- trigger: function (type, data) {
- return this.each(function () {
- jQuery.event.trigger(type, data, this);
- });
- },
- triggerHandler: function (type, data) {
- if (this[0]) {
- return jQuery.event.trigger(type, data, this[0], true);
- }
- },
- toggle: function (fn) {
- // Save reference to arguments for access in closure
- var args = arguments,
- guid = fn.guid || jQuery.guid++,
- i = 0,
- toggler = function (event) {
- // Figure out which function to execute
- var lastToggle = (jQuery._data(this, "lastToggle" + fn.guid) || 0) % i;
- jQuery._data(this, "lastToggle" + fn.guid, lastToggle + 1);
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ lastToggle ].apply(this, arguments) || false;
- };
-
- // link all the functions, so any of them can unbind this click handler
- toggler.guid = guid;
- while (i < args.length) {
- args[ i++ ].guid = guid;
- }
-
- return this.click(toggler);
- },
- hover: function (fnOver, fnOut) {
- return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
- }
- });
-
- jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error contextmenu").split(" "), function (i, name) {
-
- // Handle event binding
- jQuery.fn[ name ] = function (data, fn) {
- if (fn == null) {
- fn = data;
- data = null;
- }
-
- return arguments.length > 0 ?
- this.bind(name, data, fn) :
- this.trigger(name);
- };
-
- if (jQuery.attrFn) {
- jQuery.attrFn[ name ] = true;
- }
-
- if (rkeyEvent.test(name)) {
- jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
- }
-
- if (rmouseEvent.test(name)) {
- jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
- }
- });
-
-
-
- /*!
- * Sizzle CSS Selector Engine
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
- (function () {
-
- var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
- expando = "sizcache" + (Math.random() + '').replace('.', ''),
- done = 0,
- toString = Object.prototype.toString,
- hasDuplicate = false,
- baseHasDuplicate = true,
- rBackslash = /\\/g,
- rReturn = /\r\n/g,
- rNonWord = /\W/;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-// Thus far that includes Google Chrome.
- [0, 0].sort(function () {
- baseHasDuplicate = false;
- return 0;
- });
-
- var Sizzle = function (selector, context, results, seed) {
- results = results || [];
- context = context || document;
-
- var origContext = context;
-
- if (context.nodeType !== 1 && context.nodeType !== 9) {
- return [];
- }
-
- if (!selector || typeof selector !== "string") {
- return results;
- }
-
- var m, set, checkSet, extra, ret, cur, pop, i,
- prune = true,
- contextXML = Sizzle.isXML(context),
- parts = [],
- soFar = selector;
-
- // Reset the position of the chunker regexp (start from head)
- do {
- chunker.exec("");
- m = chunker.exec(soFar);
-
- if (m) {
- soFar = m[3];
-
- parts.push(m[1]);
-
- if (m[2]) {
- extra = m[3];
- break;
- }
- }
- } while (m);
-
- if (parts.length > 1 && origPOS.exec(selector)) {
-
- if (parts.length === 2 && Expr.relative[ parts[0] ]) {
- set = posProcess(parts[0] + parts[1], context, seed);
-
- } else {
- set = Expr.relative[ parts[0] ] ?
- [context] :
- Sizzle(parts.shift(), context);
-
- while (parts.length) {
- selector = parts.shift();
-
- if (Expr.relative[ selector ]) {
- selector += parts.shift();
- }
-
- set = posProcess(selector, set, seed);
- }
- }
-
- } else {
- // Take a shortcut and set the context if the root selector is an ID
- // (but not if it'll be faster if the inner selector is an ID)
- if (!seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
- Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1])) {
-
- ret = Sizzle.find(parts.shift(), context, contextXML);
- context = ret.expr ?
- Sizzle.filter(ret.expr, ret.set)[0] :
- ret.set[0];
- }
-
- if (context) {
- ret = seed ?
- {expr: parts.pop(), set: makeArray(seed)} :
- Sizzle.find(parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML);
-
- set = ret.expr ?
- Sizzle.filter(ret.expr, ret.set) :
- ret.set;
-
- if (parts.length > 0) {
- checkSet = makeArray(set);
-
- } else {
- prune = false;
- }
-
- while (parts.length) {
- cur = parts.pop();
- pop = cur;
-
- if (!Expr.relative[ cur ]) {
- cur = "";
- } else {
- pop = parts.pop();
- }
-
- if (pop == null) {
- pop = context;
- }
-
- Expr.relative[ cur ](checkSet, pop, contextXML);
- }
-
- } else {
- checkSet = parts = [];
- }
- }
-
- if (!checkSet) {
- checkSet = set;
- }
-
- if (!checkSet) {
- Sizzle.error(cur || selector);
- }
-
- if (toString.call(checkSet) === "[object Array]") {
- if (!prune) {
- results.push.apply(results, checkSet);
-
- } else if (context && context.nodeType === 1) {
- for (i = 0; checkSet[i] != null; i++) {
- if (checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i]))) {
- results.push(set[i]);
- }
- }
-
- } else {
- for (i = 0; checkSet[i] != null; i++) {
- if (checkSet[i] && checkSet[i].nodeType === 1) {
- results.push(set[i]);
- }
- }
- }
-
- } else {
- makeArray(checkSet, results);
- }
-
- if (extra) {
- Sizzle(extra, origContext, results, seed);
- Sizzle.uniqueSort(results);
- }
-
- return results;
- };
-
- Sizzle.uniqueSort = function (results) {
- if (sortOrder) {
- hasDuplicate = baseHasDuplicate;
- results.sort(sortOrder);
-
- if (hasDuplicate) {
- for (var i = 1; i < results.length; i++) {
- if (results[i] === results[ i - 1 ]) {
- results.splice(i--, 1);
- }
- }
- }
- }
-
- return results;
- };
-
- Sizzle.matches = function (expr, set) {
- return Sizzle(expr, null, null, set);
- };
-
- Sizzle.matchesSelector = function (node, expr) {
- return Sizzle(expr, null, null, [node]).length > 0;
- };
-
- Sizzle.find = function (expr, context, isXML) {
- var set, i, len, match, type, left;
-
- if (!expr) {
- return [];
- }
-
- for (i = 0, len = Expr.order.length; i < len; i++) {
- type = Expr.order[i];
-
- if ((match = Expr.leftMatch[ type ].exec(expr))) {
- left = match[1];
- match.splice(1, 1);
-
- if (left.substr(left.length - 1) !== "\\") {
- match[1] = (match[1] || "").replace(rBackslash, "");
- set = Expr.find[ type ](match, context, isXML);
-
- if (set != null) {
- expr = expr.replace(Expr.match[ type ], "");
- break;
- }
- }
- }
- }
-
- if (!set) {
- set = typeof context.getElementsByTagName !== "undefined" ?
- context.getElementsByTagName("*") :
- [];
- }
-
- return {set: set, expr: expr};
- };
-
- Sizzle.filter = function (expr, set, inplace, not) {
- var match, anyFound,
- type, found, item, filter, left,
- i, pass,
- old = expr,
- result = [],
- curLoop = set,
- isXMLFilter = set && set[0] && Sizzle.isXML(set[0]);
-
- while (expr && set.length) {
- for (type in Expr.filter) {
- if ((match = Expr.leftMatch[ type ].exec(expr)) != null && match[2]) {
- filter = Expr.filter[ type ];
- left = match[1];
-
- anyFound = false;
-
- match.splice(1, 1);
-
- if (left.substr(left.length - 1) === "\\") {
- continue;
- }
-
- if (curLoop === result) {
- result = [];
- }
-
- if (Expr.preFilter[ type ]) {
- match = Expr.preFilter[ type ](match, curLoop, inplace, result, not, isXMLFilter);
-
- if (!match) {
- anyFound = found = true;
-
- } else if (match === true) {
- continue;
- }
- }
-
- if (match) {
- for (i = 0; (item = curLoop[i]) != null; i++) {
- if (item) {
- found = filter(item, match, i, curLoop);
- pass = not ^ found;
-
- if (inplace && found != null) {
- if (pass) {
- anyFound = true;
-
- } else {
- curLoop[i] = false;
- }
-
- } else if (pass) {
- result.push(item);
- anyFound = true;
- }
- }
- }
- }
-
- if (found !== undefined) {
- if (!inplace) {
- curLoop = result;
- }
-
- expr = expr.replace(Expr.match[ type ], "");
-
- if (!anyFound) {
- return [];
- }
-
- break;
- }
- }
- }
-
- // Improper expression
- if (expr === old) {
- if (anyFound == null) {
- Sizzle.error(expr);
-
- } else {
- break;
- }
- }
-
- old = expr;
- }
-
- return curLoop;
- };
-
- Sizzle.error = function (msg) {
- throw "Syntax error, unrecognized expression: " + msg;
- };
-
- /**
- * Utility function for retreiving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
- var getText = Sizzle.getText = function (elem) {
- var i, node,
- nodeType = elem.nodeType,
- ret = "";
-
- if (nodeType) {
- if (nodeType === 1) {
- // Use textContent || innerText for elements
- if (typeof elem.textContent === 'string') {
- return elem.textContent;
- } else if (typeof elem.innerText === 'string') {
- // Replace IE's carriage returns
- return elem.innerText.replace(rReturn, '');
- } else {
- // Traverse it's children
- for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
- ret += getText(elem);
- }
- }
- } else if (nodeType === 3 || nodeType === 4) {
- return elem.nodeValue;
- }
- } else {
-
- // If no nodeType, this is expected to be an array
- for (i = 0; (node = elem[i]); i++) {
- // Do not traverse comment nodes
- if (node.nodeType !== 8) {
- ret += getText(node);
- }
- }
- }
- return ret;
- };
-
- var Expr = Sizzle.selectors = {
- order: ["ID", "NAME", "TAG"],
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
- },
- leftMatch: {},
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
- attrHandle: {
- href: function (elem) {
- return elem.getAttribute("href");
- },
- type: function (elem) {
- return elem.getAttribute("type");
- }
- },
- relative: {
- "+": function (checkSet, part) {
- var isPartStr = typeof part === "string",
- isTag = isPartStr && !rNonWord.test(part),
- isPartStrNotTag = isPartStr && !isTag;
-
- if (isTag) {
- part = part.toLowerCase();
- }
-
- for (var i = 0, l = checkSet.length, elem; i < l; i++) {
- if ((elem = checkSet[i])) {
- while ((elem = elem.previousSibling) && elem.nodeType !== 1) {
- }
-
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
- elem || false :
- elem === part;
- }
- }
-
- if (isPartStrNotTag) {
- Sizzle.filter(part, checkSet, true);
- }
- },
- ">": function (checkSet, part) {
- var elem,
- isPartStr = typeof part === "string",
- i = 0,
- l = checkSet.length;
-
- if (isPartStr && !rNonWord.test(part)) {
- part = part.toLowerCase();
-
- for (; i < l; i++) {
- elem = checkSet[i];
-
- if (elem) {
- var parent = elem.parentNode;
- checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
- }
- }
-
- } else {
- for (; i < l; i++) {
- elem = checkSet[i];
-
- if (elem) {
- checkSet[i] = isPartStr ?
- elem.parentNode :
- elem.parentNode === part;
- }
- }
-
- if (isPartStr) {
- Sizzle.filter(part, checkSet, true);
- }
- }
- },
- "": function (checkSet, part, isXML) {
- var nodeCheck,
- doneName = done++,
- checkFn = dirCheck;
-
- if (typeof part === "string" && !rNonWord.test(part)) {
- part = part.toLowerCase();
- nodeCheck = part;
- checkFn = dirNodeCheck;
- }
-
- checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
- },
- "~": function (checkSet, part, isXML) {
- var nodeCheck,
- doneName = done++,
- checkFn = dirCheck;
-
- if (typeof part === "string" && !rNonWord.test(part)) {
- part = part.toLowerCase();
- nodeCheck = part;
- checkFn = dirNodeCheck;
- }
-
- checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
- }
- },
- find: {
- ID: function (match, context, isXML) {
- if (typeof context.getElementById !== "undefined" && !isXML) {
- var m = context.getElementById(match[1]);
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [m] : [];
- }
- },
- NAME: function (match, context) {
- if (typeof context.getElementsByName !== "undefined") {
- var ret = [],
- results = context.getElementsByName(match[1]);
-
- for (var i = 0, l = results.length; i < l; i++) {
- if (results[i].getAttribute("name") === match[1]) {
- ret.push(results[i]);
- }
- }
-
- return ret.length === 0 ? null : ret;
- }
- },
- TAG: function (match, context) {
- if (typeof context.getElementsByTagName !== "undefined") {
- return context.getElementsByTagName(match[1]);
- }
- }
- },
- preFilter: {
- CLASS: function (match, curLoop, inplace, result, not, isXML) {
- match = " " + match[1].replace(rBackslash, "") + " ";
-
- if (isXML) {
- return match;
- }
-
- for (var i = 0, elem; (elem = curLoop[i]) != null; i++) {
- if (elem) {
- if (not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0)) {
- if (!inplace) {
- result.push(elem);
- }
-
- } else if (inplace) {
- curLoop[i] = false;
- }
- }
- }
-
- return false;
- },
- ID: function (match) {
- return match[1].replace(rBackslash, "");
- },
- TAG: function (match, curLoop) {
- return match[1].replace(rBackslash, "").toLowerCase();
- },
- CHILD: function (match) {
- if (match[1] === "nth") {
- if (!match[2]) {
- Sizzle.error(match[0]);
- }
-
- match[2] = match[2].replace(/^\+|\s*/g, '');
-
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
- var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
- match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
- !/\D/.test(match[2]) && "0n+" + match[2] || match[2]);
-
- // calculate the numbers (first)n+(last) including if they are negative
- match[2] = (test[1] + (test[2] || 1)) - 0;
- match[3] = test[3] - 0;
- }
- else if (match[2]) {
- Sizzle.error(match[0]);
- }
-
- // TODO: Move to normal caching system
- match[0] = done++;
-
- return match;
- },
- ATTR: function (match, curLoop, inplace, result, not, isXML) {
- var name = match[1] = match[1].replace(rBackslash, "");
-
- if (!isXML && Expr.attrMap[name]) {
- match[1] = Expr.attrMap[name];
- }
-
- // Handle if an un-quoted value was used
- match[4] = (match[4] || match[5] || "").replace(rBackslash, "");
-
- if (match[2] === "~=") {
- match[4] = " " + match[4] + " ";
- }
-
- return match;
- },
- PSEUDO: function (match, curLoop, inplace, result, not) {
- if (match[1] === "not") {
- // If we're dealing with a complex expression, or a simple one
- if ((chunker.exec(match[3]) || "").length > 1 || /^\w/.test(match[3])) {
- match[3] = Sizzle(match[3], null, null, curLoop);
-
- } else {
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
- if (!inplace) {
- result.push.apply(result, ret);
- }
-
- return false;
- }
-
- } else if (Expr.match.POS.test(match[0]) || Expr.match.CHILD.test(match[0])) {
- return true;
- }
-
- return match;
- },
- POS: function (match) {
- match.unshift(true);
-
- return match;
- }
- },
- filters: {
- enabled: function (elem) {
- return elem.disabled === false && elem.type !== "hidden";
- },
- disabled: function (elem) {
- return elem.disabled === true;
- },
- checked: function (elem) {
- return elem.checked === true;
- },
- selected: function (elem) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if (elem.parentNode) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
- parent: function (elem) {
- return !!elem.firstChild;
- },
- empty: function (elem) {
- return !elem.firstChild;
- },
- has: function (elem, i, match) {
- return !!Sizzle(match[3], elem).length;
- },
- header: function (elem) {
- return (/h\d/i).test(elem.nodeName);
- },
- text: function (elem) {
- var attr = elem.getAttribute("type"), type = elem.type;
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
- // use getAttribute instead to test this case
- return elem.nodeName.toLowerCase() === "input" && "text" === type && (attr === type || attr === null);
- },
- radio: function (elem) {
- return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
- },
- checkbox: function (elem) {
- return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
- },
- file: function (elem) {
- return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
- },
- password: function (elem) {
- return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
- },
- submit: function (elem) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && "submit" === elem.type;
- },
- image: function (elem) {
- return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
- },
- reset: function (elem) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && "reset" === elem.type;
- },
- button: function (elem) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && "button" === elem.type || name === "button";
- },
- input: function (elem) {
- return (/input|select|textarea|button/i).test(elem.nodeName);
- },
- focus: function (elem) {
- return elem === elem.ownerDocument.activeElement;
- }
- },
- setFilters: {
- first: function (elem, i) {
- return i === 0;
- },
- last: function (elem, i, match, array) {
- return i === array.length - 1;
- },
- even: function (elem, i) {
- return i % 2 === 0;
- },
- odd: function (elem, i) {
- return i % 2 === 1;
- },
- lt: function (elem, i, match) {
- return i < match[3] - 0;
- },
- gt: function (elem, i, match) {
- return i > match[3] - 0;
- },
- nth: function (elem, i, match) {
- return match[3] - 0 === i;
- },
- eq: function (elem, i, match) {
- return match[3] - 0 === i;
- }
- },
- filter: {
- PSEUDO: function (elem, match, i, array) {
- var name = match[1],
- filter = Expr.filters[ name ];
-
- if (filter) {
- return filter(elem, i, match, array);
-
- } else if (name === "contains") {
- return (elem.textContent || elem.innerText || getText([elem]) || "").indexOf(match[3]) >= 0;
-
- } else if (name === "not") {
- var not = match[3];
-
- for (var j = 0, l = not.length; j < l; j++) {
- if (not[j] === elem) {
- return false;
- }
- }
-
- return true;
-
- } else {
- Sizzle.error(name);
- }
- },
- CHILD: function (elem, match) {
- var first, last,
- doneName, parent, cache,
- count, diff,
- type = match[1],
- node = elem;
-
- switch (type) {
- case "only":
- case "first":
- while ((node = node.previousSibling)) {
- if (node.nodeType === 1) {
- return false;
- }
- }
-
- if (type === "first") {
- return true;
- }
-
- node = elem;
-
- case "last":
- while ((node = node.nextSibling)) {
- if (node.nodeType === 1) {
- return false;
- }
- }
-
- return true;
-
- case "nth":
- first = match[2];
- last = match[3];
-
- if (first === 1 && last === 0) {
- return true;
- }
-
- doneName = match[0];
- parent = elem.parentNode;
-
- if (parent && (parent[ expando ] !== doneName || !elem.nodeIndex)) {
- count = 0;
-
- for (node = parent.firstChild; node; node = node.nextSibling) {
- if (node.nodeType === 1) {
- node.nodeIndex = ++count;
- }
- }
-
- parent[ expando ] = doneName;
- }
-
- diff = elem.nodeIndex - last;
-
- if (first === 0) {
- return diff === 0;
-
- } else {
- return (diff % first === 0 && diff / first >= 0);
- }
- }
- },
- ID: function (elem, match) {
- return elem.nodeType === 1 && elem.getAttribute("id") === match;
- },
- TAG: function (elem, match) {
- return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
- },
- CLASS: function (elem, match) {
- return (" " + (elem.className || elem.getAttribute("class")) + " ")
- .indexOf(match) > -1;
- },
- ATTR: function (elem, match) {
- var name = match[1],
- result = Sizzle.attr ?
- Sizzle.attr(elem, name) :
- Expr.attrHandle[ name ] ?
- Expr.attrHandle[ name ](elem) :
- elem[ name ] != null ?
- elem[ name ] :
- elem.getAttribute(name),
- value = result + "",
- type = match[2],
- check = match[4];
-
- return result == null ?
- type === "!=" :
- !type && Sizzle.attr ?
- result != null :
- type === "=" ?
- value === check :
- type === "*=" ?
- value.indexOf(check) >= 0 :
- type === "~=" ?
- (" " + value + " ").indexOf(check) >= 0 :
- !check ?
- value && result !== false :
- type === "!=" ?
- value !== check :
- type === "^=" ?
- value.indexOf(check) === 0 :
- type === "$=" ?
- value.substr(value.length - check.length) === check :
- type === "|=" ?
- value === check || value.substr(0, check.length + 1) === check + "-" :
- false;
- },
- POS: function (elem, match, i, array) {
- var name = match[2],
- filter = Expr.setFilters[ name ];
-
- if (filter) {
- return filter(elem, i, match, array);
- }
- }
- }
- };
-
- var origPOS = Expr.match.POS,
- fescape = function (all, num) {
- return "\\" + (num - 0 + 1);
- };
-
- for (var type in Expr.match) {
- Expr.match[ type ] = new RegExp(Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source));
- Expr.leftMatch[ type ] = new RegExp(/(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape));
- }
-
- var makeArray = function (array, results) {
- array = Array.prototype.slice.call(array, 0);
-
- if (results) {
- results.push.apply(results, array);
- return results;
- }
-
- return array;
- };
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-// Also verifies that the returned array holds DOM nodes
-// (which is not the case in the Blackberry browser)
- try {
- Array.prototype.slice.call(document.documentElement.childNodes, 0)[0].nodeType;
-
-// Provide a fallback method if it does not work
- } catch (e) {
- makeArray = function (array, results) {
- var i = 0,
- ret = results || [];
-
- if (toString.call(array) === "[object Array]") {
- Array.prototype.push.apply(ret, array);
-
- } else {
- if (typeof array.length === "number") {
- for (var l = array.length; i < l; i++) {
- ret.push(array[i]);
- }
-
- } else {
- for (; array[i]; i++) {
- ret.push(array[i]);
- }
- }
- }
-
- return ret;
- };
- }
-
- var sortOrder, siblingCheck;
-
- if (document.documentElement.compareDocumentPosition) {
- sortOrder = function (a, b) {
- if (a === b) {
- hasDuplicate = true;
- return 0;
- }
-
- if (!a.compareDocumentPosition || !b.compareDocumentPosition) {
- return a.compareDocumentPosition ? -1 : 1;
- }
-
- return a.compareDocumentPosition(b) & 4 ? -1 : 1;
- };
-
- } else {
- sortOrder = function (a, b) {
- // The nodes are identical, we can exit early
- if (a === b) {
- hasDuplicate = true;
- return 0;
-
- // Fallback to using sourceIndex (in IE) if it's available on both nodes
- } else if (a.sourceIndex && b.sourceIndex) {
- return a.sourceIndex - b.sourceIndex;
- }
-
- var al, bl,
- ap = [],
- bp = [],
- aup = a.parentNode,
- bup = b.parentNode,
- cur = aup;
-
- // If the nodes are siblings (or identical) we can do a quick check
- if (aup === bup) {
- return siblingCheck(a, b);
-
- // If no parents were found then the nodes are disconnected
- } else if (!aup) {
- return -1;
-
- } else if (!bup) {
- return 1;
- }
-
- // Otherwise they're somewhere else in the tree so we need
- // to build up a full list of the parentNodes for comparison
- while (cur) {
- ap.unshift(cur);
- cur = cur.parentNode;
- }
-
- cur = bup;
-
- while (cur) {
- bp.unshift(cur);
- cur = cur.parentNode;
- }
-
- al = ap.length;
- bl = bp.length;
-
- // Start walking down the tree looking for a discrepancy
- for (var i = 0; i < al && i < bl; i++) {
- if (ap[i] !== bp[i]) {
- return siblingCheck(ap[i], bp[i]);
- }
- }
-
- // We ended someplace up the tree so do a sibling check
- return i === al ?
- siblingCheck(a, bp[i], -1) :
- siblingCheck(ap[i], b, 1);
- };
-
- siblingCheck = function (a, b, ret) {
- if (a === b) {
- return ret;
- }
-
- var cur = a.nextSibling;
-
- while (cur) {
- if (cur === b) {
- return -1;
- }
-
- cur = cur.nextSibling;
- }
-
- return 1;
- };
- }
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
- (function () {
- // We're going to inject a fake input element with a specified name
- var form = document.createElement("div"),
- id = "script" + (new Date()).getTime(),
- root = document.documentElement;
-
- form.innerHTML = "";
-
- // Inject it into the root element, check its status, and remove it quickly
- root.insertBefore(form, root.firstChild);
-
- // The workaround has to do additional checks after a getElementById
- // Which slows things down for other browsers (hence the branching)
- if (document.getElementById(id)) {
- Expr.find.ID = function (match, context, isXML) {
- if (typeof context.getElementById !== "undefined" && !isXML) {
- var m = context.getElementById(match[1]);
-
- return m ?
- m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
- [m] :
- undefined :
- [];
- }
- };
-
- Expr.filter.ID = function (elem, match) {
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-
- return elem.nodeType === 1 && node && node.nodeValue === match;
- };
- }
-
- root.removeChild(form);
-
- // release memory in IE
- root = form = null;
- })();
-
- (function () {
- // Check to see if the browser returns only elements
- // when doing getElementsByTagName("*")
-
- // Create a fake element
- var div = document.createElement("div");
- div.appendChild(document.createComment(""));
-
- // Make sure no comments are found
- if (div.getElementsByTagName("*").length > 0) {
- Expr.find.TAG = function (match, context) {
- var results = context.getElementsByTagName(match[1]);
-
- // Filter out possible comments
- if (match[1] === "*") {
- var tmp = [];
-
- for (var i = 0; results[i]; i++) {
- if (results[i].nodeType === 1) {
- tmp.push(results[i]);
- }
- }
-
- results = tmp;
- }
-
- return results;
- };
- }
-
- // Check to see if an attribute returns normalized href attributes
- div.innerHTML = "";
-
- if (div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- div.firstChild.getAttribute("href") !== "#") {
-
- Expr.attrHandle.href = function (elem) {
- return elem.getAttribute("href", 2);
- };
- }
-
- // release memory in IE
- div = null;
- })();
-
- if (document.querySelectorAll) {
- (function () {
- var oldSizzle = Sizzle,
- div = document.createElement("div"),
- id = "__sizzle__";
-
- div.innerHTML = "";
-
- // Safari can't handle uppercase or unicode characters when
- // in quirks mode.
- if (div.querySelectorAll && div.querySelectorAll(".TEST").length === 0) {
- return;
- }
-
- Sizzle = function (query, context, extra, seed) {
- context = context || document;
-
- // Only use querySelectorAll on non-XML documents
- // (ID selectors don't work in non-HTML documents)
- if (!seed && !Sizzle.isXML(context)) {
- // See if we find a selector to speed up
- var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(query);
-
- if (match && (context.nodeType === 1 || context.nodeType === 9)) {
- // Speed-up: Sizzle("TAG")
- if (match[1]) {
- return makeArray(context.getElementsByTagName(query), extra);
-
- // Speed-up: Sizzle(".CLASS")
- } else if (match[2] && Expr.find.CLASS && context.getElementsByClassName) {
- return makeArray(context.getElementsByClassName(match[2]), extra);
- }
- }
-
- if (context.nodeType === 9) {
- // Speed-up: Sizzle("body")
- // The body element only exists once, optimize finding it
- if (query === "body" && context.body) {
- return makeArray([context.body], extra);
-
- // Speed-up: Sizzle("#ID")
- } else if (match && match[3]) {
- var elem = context.getElementById(match[3]);
-
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if (elem && elem.parentNode) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if (elem.id === match[3]) {
- return makeArray([elem], extra);
- }
-
- } else {
- return makeArray([], extra);
- }
- }
-
- try {
- return makeArray(context.querySelectorAll(query), extra);
- } catch (qsaError) {
- }
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- } else if (context.nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
- var oldContext = context,
- old = context.getAttribute("id"),
- nid = old || id,
- hasParent = context.parentNode,
- relativeHierarchySelector = /^\s*[+~]/.test(query);
-
- if (!old) {
- context.setAttribute("id", nid);
- } else {
- nid = nid.replace(/'/g, "\\$&");
- }
- if (relativeHierarchySelector && hasParent) {
- context = context.parentNode;
- }
-
- try {
- if (!relativeHierarchySelector || hasParent) {
- return makeArray(context.querySelectorAll("[id='" + nid + "'] " + query), extra);
- }
-
- } catch (pseudoError) {
- } finally {
- if (!old) {
- oldContext.removeAttribute("id");
- }
- }
- }
- }
-
- return oldSizzle(query, context, extra, seed);
- };
-
- for (var prop in oldSizzle) {
- Sizzle[ prop ] = oldSizzle[ prop ];
- }
-
- // release memory in IE
- div = null;
- })();
- }
-
- (function () {
- var html = document.documentElement,
- matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
-
- if (matches) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9 fails this)
- var disconnectedMatch = !matches.call(document.createElement("div"), "div"),
- pseudoWorks = false;
-
- try {
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call(document.documentElement, "[test!='']:sizzle");
-
- } catch (pseudoError) {
- pseudoWorks = true;
- }
-
- Sizzle.matchesSelector = function (node, expr) {
- // Make sure that attribute selectors are quoted
- expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
-
- if (!Sizzle.isXML(node)) {
- try {
- if (pseudoWorks || !Expr.match.PSEUDO.test(expr) && !/!=/.test(expr)) {
- var ret = matches.call(node, expr);
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if (ret || !disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9, so check for that
- node.document && node.document.nodeType !== 11) {
- return ret;
- }
- }
- } catch (e) {
- }
- }
-
- return Sizzle(expr, null, null, [node]).length > 0;
- };
- }
- })();
-
- (function () {
- var div = document.createElement("div");
-
- div.innerHTML = "";
-
- // Opera can't find a second classname (in 9.6)
- // Also, make sure that getElementsByClassName actually exists
- if (!div.getElementsByClassName || div.getElementsByClassName("e").length === 0) {
- return;
- }
-
- // Safari caches class attributes, doesn't catch changes (in 3.2)
- div.lastChild.className = "e";
-
- if (div.getElementsByClassName("e").length === 1) {
- return;
- }
-
- Expr.order.splice(1, 0, "CLASS");
- Expr.find.CLASS = function (match, context, isXML) {
- if (typeof context.getElementsByClassName !== "undefined" && !isXML) {
- return context.getElementsByClassName(match[1]);
- }
- };
-
- // release memory in IE
- div = null;
- })();
-
- function dirNodeCheck(dir, cur, doneName, checkSet, nodeCheck, isXML) {
- for (var i = 0, l = checkSet.length; i < l; i++) {
- var elem = checkSet[i];
-
- if (elem) {
- var match = false;
-
- elem = elem[dir];
-
- while (elem) {
- if (elem[ expando ] === doneName) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if (elem.nodeType === 1 && !isXML) {
- elem[ expando ] = doneName;
- elem.sizset = i;
- }
-
- if (elem.nodeName.toLowerCase() === cur) {
- match = elem;
- break;
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
- }
-
- function dirCheck(dir, cur, doneName, checkSet, nodeCheck, isXML) {
- for (var i = 0, l = checkSet.length; i < l; i++) {
- var elem = checkSet[i];
-
- if (elem) {
- var match = false;
-
- elem = elem[dir];
-
- while (elem) {
- if (elem[ expando ] === doneName) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if (elem.nodeType === 1) {
- if (!isXML) {
- elem[ expando ] = doneName;
- elem.sizset = i;
- }
-
- if (typeof cur !== "string") {
- if (elem === cur) {
- match = true;
- break;
- }
-
- } else if (Sizzle.filter(cur, [elem]).length > 0) {
- match = elem;
- break;
- }
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
- }
-
- if (document.documentElement.contains) {
- Sizzle.contains = function (a, b) {
- return a !== b && (a.contains ? a.contains(b) : true);
- };
-
- } else if (document.documentElement.compareDocumentPosition) {
- Sizzle.contains = function (a, b) {
- return !!(a.compareDocumentPosition(b) & 16);
- };
-
- } else {
- Sizzle.contains = function () {
- return false;
- };
- }
-
- Sizzle.isXML = function (elem) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
-
- return documentElement ? documentElement.nodeName !== "HTML" : false;
- };
-
- var posProcess = function (selector, context, seed) {
- var match,
- tmpSet = [],
- later = "",
- root = context.nodeType ? [context] : context;
-
- // Position selectors must be done after the filter
- // And so must :not(positional) so we move all PSEUDOs to the end
- while ((match = Expr.match.PSEUDO.exec(selector))) {
- later += match[0];
- selector = selector.replace(Expr.match.PSEUDO, "");
- }
-
- selector = Expr.relative[selector] ? selector + "*" : selector;
-
- for (var i = 0, l = root.length; i < l; i++) {
- Sizzle(selector, root[i], tmpSet, seed);
- }
-
- return Sizzle.filter(later, tmpSet);
- };
-
-// EXPOSE
-// Override sizzle attribute retrieval
- Sizzle.attr = jQuery.attr;
- Sizzle.selectors.attrMap = {};
- jQuery.find = Sizzle;
- jQuery.expr = Sizzle.selectors;
- jQuery.expr[":"] = jQuery.expr.filters;
- jQuery.unique = Sizzle.uniqueSort;
- jQuery.text = Sizzle.getText;
- jQuery.isXMLDoc = Sizzle.isXML;
- jQuery.contains = Sizzle.contains;
-
-
- })();
-
-
- var runtil = /Until$/,
- rparentsprev = /^(?:parents|prevUntil|prevAll)/,
- // Note: This RegExp should be improved, or likely pulled from Sizzle
- rmultiselector = /,/,
- isSimple = /^.[^:#\[\.,]*$/,
- slice = Array.prototype.slice,
- POS = jQuery.expr.match.POS,
- // methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
- jQuery.fn.extend({
- find: function (selector) {
- var self = this,
- i, l;
-
- if (typeof selector !== "string") {
- return jQuery(selector).filter(function () {
- for (i = 0, l = self.length; i < l; i++) {
- if (jQuery.contains(self[ i ], this)) {
- return true;
- }
- }
- });
- }
-
- var ret = this.pushStack("", "find", selector),
- length, n, r;
-
- for (i = 0, l = this.length; i < l; i++) {
- length = ret.length;
- jQuery.find(selector, this[i], ret);
-
- if (i > 0) {
- // Make sure that the results are unique
- for (n = length; n < ret.length; n++) {
- for (r = 0; r < length; r++) {
- if (ret[r] === ret[n]) {
- ret.splice(n--, 1);
- break;
- }
- }
- }
- }
- }
-
- return ret;
- },
- has: function (target) {
- var targets = jQuery(target);
- return this.filter(function () {
- for (var i = 0, l = targets.length; i < l; i++) {
- if (jQuery.contains(this, targets[i])) {
- return true;
- }
- }
- });
- },
- not: function (selector) {
- return this.pushStack(winnow(this, selector, false), "not", selector);
- },
- filter: function (selector) {
- return this.pushStack(winnow(this, selector, true), "filter", selector);
- },
- is: function (selector) {
- return !!selector && (
- typeof selector === "string" ?
- // If this is a positional selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- POS.test(selector) ?
- jQuery(selector, this.context).index(this[0]) >= 0 :
- jQuery.filter(selector, this).length > 0 :
- this.filter(selector).length > 0);
- },
- closest: function (selectors, context) {
- var ret = [], i, l, cur = this[0];
-
- // Array (deprecated as of jQuery 1.7)
- if (jQuery.isArray(selectors)) {
- var level = 1;
-
- while (cur && cur.ownerDocument && cur !== context) {
- for (i = 0; i < selectors.length; i++) {
-
- if (jQuery(cur).is(selectors[ i ])) {
- ret.push({selector: selectors[ i ], elem: cur, level: level});
- }
- }
-
- cur = cur.parentNode;
- level++;
- }
-
- return ret;
- }
-
- // String
- var pos = POS.test(selectors) || typeof selectors !== "string" ?
- jQuery(selectors, context || this.context) :
- 0;
-
- for (i = 0, l = this.length; i < l; i++) {
- cur = this[i];
-
- while (cur) {
- if (pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors)) {
- ret.push(cur);
- break;
-
- } else {
- cur = cur.parentNode;
- if (!cur || !cur.ownerDocument || cur === context || cur.nodeType === 11) {
- break;
- }
- }
- }
- }
-
- ret = ret.length > 1 ? jQuery.unique(ret) : ret;
-
- return this.pushStack(ret, "closest", selectors);
- },
- // Determine the position of an element within
- // the matched set of elements
- index: function (elem) {
-
- // No argument, return index in parent
- if (!elem) {
- return (this[0] && this[0].parentNode) ? this.prevAll().length : -1;
- }
-
- // index in selector
- if (typeof elem === "string") {
- return jQuery.inArray(this[0], jQuery(elem));
- }
-
- // Locate the position of the desired element
- return jQuery.inArray(
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[0] : elem, this);
- },
- add: function (selector, context) {
- var set = typeof selector === "string" ?
- jQuery(selector, context) :
- jQuery.makeArray(selector && selector.nodeType ? [selector] : selector),
- all = jQuery.merge(this.get(), set);
-
- return this.pushStack(isDisconnected(set[0]) || isDisconnected(all[0]) ?
- all :
- jQuery.unique(all));
- },
- andSelf: function () {
- return this.add(this.prevObject);
- }
- });
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
- function isDisconnected(node) {
- return !node || !node.parentNode || node.parentNode.nodeType === 11;
- }
-
- jQuery.each({
- parent: function (elem) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function (elem) {
- return jQuery.dir(elem, "parentNode");
- },
- parentsUntil: function (elem, i, until) {
- return jQuery.dir(elem, "parentNode", until);
- },
- next: function (elem) {
- return jQuery.nth(elem, 2, "nextSibling");
- },
- prev: function (elem) {
- return jQuery.nth(elem, 2, "previousSibling");
- },
- nextAll: function (elem) {
- return jQuery.dir(elem, "nextSibling");
- },
- prevAll: function (elem) {
- return jQuery.dir(elem, "previousSibling");
- },
- nextUntil: function (elem, i, until) {
- return jQuery.dir(elem, "nextSibling", until);
- },
- prevUntil: function (elem, i, until) {
- return jQuery.dir(elem, "previousSibling", until);
- },
- siblings: function (elem) {
- return jQuery.sibling(elem.parentNode.firstChild, elem);
- },
- children: function (elem) {
- return jQuery.sibling(elem.firstChild);
- },
- contents: function (elem) {
- return jQuery.nodeName(elem, "iframe") ?
- elem.contentDocument || elem.contentWindow.document :
- jQuery.makeArray(elem.childNodes);
- }
- }, function (name, fn) {
- jQuery.fn[ name ] = function (until, selector) {
- var ret = jQuery.map(this, fn, until),
- // The variable 'args' was introduced in
- // https://github.com/jquery/jquery/commit/52a0238
- // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
- // http://code.google.com/p/v8/issues/detail?id=1050
- args = slice.call(arguments);
-
- if (!runtil.test(name)) {
- selector = until;
- }
-
- if (selector && typeof selector === "string") {
- ret = jQuery.filter(selector, ret);
- }
-
- ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique(ret) : ret;
-
- if ((this.length > 1 || rmultiselector.test(selector)) && rparentsprev.test(name)) {
- ret = ret.reverse();
- }
-
- return this.pushStack(ret, name, args.join(","));
- };
- });
-
- jQuery.extend({
- filter: function (expr, elems, not) {
- if (not) {
- expr = ":not(" + expr + ")";
- }
-
- return elems.length === 1 ?
- jQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [] :
- jQuery.find.matches(expr, elems);
- },
- dir: function (elem, dir, until) {
- var matched = [],
- cur = elem[ dir ];
-
- while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery(cur).is(until))) {
- if (cur.nodeType === 1) {
- matched.push(cur);
- }
- cur = cur[dir];
- }
- return matched;
- },
- nth: function (cur, result, dir, elem) {
- result = result || 1;
- var num = 0;
-
- for (; cur; cur = cur[dir]) {
- if (cur.nodeType === 1 && ++num === result) {
- break;
- }
- }
-
- return cur;
- },
- sibling: function (n, elem) {
- var r = [];
-
- for (; n; n = n.nextSibling) {
- if (n.nodeType === 1 && n !== elem) {
- r.push(n);
- }
- }
-
- return r;
- }
- });
-
-// Implement the identical functionality for filter and not
- function winnow(elements, qualifier, keep) {
-
- // Can't pass null or undefined to indexOf in Firefox 4
- // Set to 0 to skip string check
- qualifier = qualifier || 0;
-
- if (jQuery.isFunction(qualifier)) {
- return jQuery.grep(elements, function (elem, i) {
- var retVal = !!qualifier.call(elem, i, elem);
- return retVal === keep;
- });
-
- } else if (qualifier.nodeType) {
- return jQuery.grep(elements, function (elem, i) {
- return (elem === qualifier) === keep;
- });
-
- } else if (typeof qualifier === "string") {
- var filtered = jQuery.grep(elements, function (elem) {
- return elem.nodeType === 1;
- });
-
- if (isSimple.test(qualifier)) {
- return jQuery.filter(qualifier, filtered, !keep);
- } else {
- qualifier = jQuery.filter(qualifier, filtered);
- }
- }
-
- return jQuery.grep(elements, function (elem, i) {
- return (jQuery.inArray(elem, qualifier) >= 0) === keep;
- });
- }
-
-
-
-
- function createSafeFragment(document) {
- var list = nodeNames.split(" "),
- safeFrag = document.createDocumentFragment();
-
- if (safeFrag.createElement) {
- while (list.length) {
- safeFrag.createElement(
- list.pop()
- );
- }
- }
- return safeFrag;
- }
-
- var nodeNames = "abbr article aside audio canvas datalist details figcaption figure footer " +
- "header hgroup mark meter nav output progress section summary time video",
- rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
- rleadingWhitespace = /^\s+/,
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
- rtagName = /<([\w:]+)/,
- rtbody = /", ""],
- legend: [1, ""],
- thead: [1, "", "
"],
- tr: [2, "", "
"],
- td: [3, "
"],
- col: [2, "", "
"],
- area: [1, ""],
- _default: [0, "", ""]
- },
- safeFragment = createSafeFragment(document);
-
- wrapMap.optgroup = wrapMap.option;
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
- wrapMap.th = wrapMap.td;
-
-// IE can't serialize and
-
+
+
diff --git a/nar-bundles/monitor-threshold-bundle/ui/src/main/webapp/js/jquery/jqgrid/css/ellipsis-xbl.xml b/nar-bundles/monitor-threshold-bundle/ui/src/main/webapp/js/jquery/jqgrid/css/ellipsis-xbl.xml
deleted file mode 100644
index ea0bdf8a00..0000000000
--- a/nar-bundles/monitor-threshold-bundle/ui/src/main/webapp/js/jquery/jqgrid/css/ellipsis-xbl.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-" + c + " "}, u = function(c, d, e){c = ''; d = F(d, e, ""); return'" + c + " "}, la = function(c, d, e, l){e = (parseInt(e, 10) - 1) * parseInt(l, 10) + 1 + d; c = F(c, d, ""); return'" + e + " "}, ca = function(c){var d, e = [], l = 0, n; for (n = 0; n < a.p.colModel.length; n++){d = a.p.colModel[n]; if (d.name !== "cb" && d.name !== "subgrid" && d.name !== "rn"){e[l] = c == "xml"?d.xmlmap || d.name:d.jsonmap || d.name; l++}}return e}, fa = function(c){var d = a.p.remapColumns; if (!d || !d.length)d = b.map(a.p.colModel, function(e, l){return l}); if (c)d = b.map(d, function(e){return e < c?null:e - c}); return d}, aa = function(c, d){a.p.deepempty?b("tbody:first tr", c).remove():b("tbody:first",
- c).empty(); if (d && a.p.scroll){b(">div:first", c).css({height:"auto"}).children("div:first").css({height:0, display:"none"}); c.scrollTop = 0}}, U = function(c, d){var e, l, n, o; if (typeof d === "function")return d(c); e = c[d]; if (e === undefined){if (typeof d === "string")n = d.split("."); try{if (o = n.length)for (e = c; e && o--; ){l = n.shift(); e = e[l]}} catch (p){}}return e}, ia = function(c, d, e, l, n){var o = new Date; a.p.reccount = 0; if (b.isXMLDoc(c)){if (a.p.treeANode === - 1 && !a.p.scroll){aa(d, false); e = 0} else e = e > 0?e:0; var p, w = 0, y, s, r = 0, v = 0,
- z = 0, D, N, L = [], P, G = {}, da = a.rows.length, E, W, B = [], S = 0, ga = a.p.altRows === true?" " + a.p.altclass:""; a.p.xmlReader.repeatitems || (L = ca("xml")); D = a.p.keyIndex === false?a.p.xmlReader.id:a.p.keyIndex; if (L.length > 0 && !isNaN(D)){if (a.p.remapColumns && a.p.remapColumns.length)D = b.inArray(D, a.p.remapColumns); D = L[D]}N = (D + "").indexOf("[") === - 1?L.length?function(X, V){return b(D, X).text() || V}:function(X, V){return b(a.p.xmlReader.cell, X).eq(D).text() || V}:function(X, V){return X.getAttribute(D.replace(/[\[\]]/g, "")) || V}; a.p.userData =
- {}; b(a.p.xmlReader.page, c).each(function(){a.p.page = this.textContent || this.text || 0}); b(a.p.xmlReader.total, c).each(function(){a.p.lastpage = this.textContent || this.text; if (a.p.lastpage === undefined)a.p.lastpage = 1}); b(a.p.xmlReader.records, c).each(function(){a.p.records = this.textContent || this.text || 0}); b(a.p.xmlReader.userdata, c).each(function(){a.p.userData[this.getAttribute("name")] = this.textContent || this.text}); c = b(a.p.xmlReader.root + " " + a.p.xmlReader.row, c); var ha = c.length, O = 0; if (c && ha){var ma = parseInt(a.p.rowNum,
- 10), wa = a.p.scroll?(parseInt(a.p.page, 10) - 1) * ma + 1:1; if (n)ma *= n + 1; for (n = b.isFunction(a.p.afterInsertRow); O < ha; ){E = c[O]; W = N(E, wa + O); p = e === 0?0:e + 1; p = (p + O) % 2 == 1?ga:""; B[S++] = ''; if (a.p.rownumbers === true){B[S++] = la(0, O, a.p.page, a.p.rowNum); z = 1}if (a.p.multiselect === true){B[S++] = u(W, z, O); r = 1}if (a.p.subGrid === true){B[S++] = b(a).jqGrid("addSubGridCell", r + z, O + e); v = 1}if (a.p.xmlReader.repeatitems){P || (P = fa(r + v + z)); var za = b(a.p.xmlReader.cell,
- E); b.each(P, function(X){var V = za[this]; if (!V)return false; y = V.textContent || V.text; G[a.p.colModel[X + r + v + z].name] = y; B[S++] = R(W, y, X + r + v + z, O + e, E)})} else for (p = 0; p < L.length; p++){y = b(L[p], E).text(); G[a.p.colModel[p + r + v + z].name] = y; B[S++] = R(W, y, p + r + v + z, O + e, E)}B[S++] = " "; if (a.p.gridview === false){if (a.p.treeGrid === true){p = a.p.treeANode >= - 1?a.p.treeANode:0; s = b(B.join(""))[0]; try{b(a).jqGrid("setTreeNode", G, s)} catch (Fa){}da === 0?b("tbody:first", d).append(s):b(a.rows[O + p + e]).after(s)} else b("tbody:first", d).append(B.join(""));
- if (a.p.subGrid === true)try{b(a).jqGrid("addSubGrid", a.rows[a.rows.length - 1], r + z)} catch (Ga){}n && a.p.afterInsertRow.call(a, W, G, E); B = []; S = 0}G = {}; w++; O++; if (w == ma)break}}a.p.gridview === true && b("tbody:first", d).append(B.join("")); a.p.totaltime = new Date - o; if (w > 0){a.grid.cols = a.rows[0].cells; if (a.p.records === 0)a.p.records = ha}B = null; if (!a.p.treeGrid && !a.p.scroll)a.grid.bDiv.scrollTop = 0; a.p.reccount = w; a.p.treeANode = - 1; a.p.userDataOnFooter && b(a).jqGrid("footerData", "set", a.p.userData, true); l || na(false, true)}},
- ra = function(c, d, e, l, n){var o = new Date; a.p.reccount = 0; if (c){if (a.p.treeANode === - 1 && !a.p.scroll){aa(d, false); e = 0} else e = e > 0?e:0; var p = 0, w, y, s, r = [], v, z = 0, D = 0, N = 0, L, P, G, da = {}, E, W = a.rows.length, B; s = []; E = 0; var S = a.p.altRows === true?" " + a.p.altclass:""; a.p.page = U(c, a.p.jsonReader.page) || 0; G = U(c, a.p.jsonReader.total); a.p.lastpage = G === undefined?1:G; a.p.records = U(c, a.p.jsonReader.records) || 0; a.p.userData = U(c, a.p.jsonReader.userdata) || {}; a.p.jsonReader.repeatitems || (v = r = ca("json")); G = a.p.keyIndex === false?a.p.jsonReader.id:
- a.p.keyIndex; if (r.length > 0 && !isNaN(G)){if (a.p.remapColumns && a.p.remapColumns.length)G = b.inArray(G, a.p.remapColumns); G = r[G]}if (P = U(c, a.p.jsonReader.root)){L = P.length; c = 0; var ga = parseInt(a.p.rowNum, 10), ha = a.p.scroll?(parseInt(a.p.page, 10) - 1) * ga + 1:1; if (n)ga *= n + 1; for (var O = b.isFunction(a.p.afterInsertRow); c < L; ){n = P[c]; B = U(n, G); if (B === undefined){B = ha + c; if (r.length === 0)if (a.p.jsonReader.cell)B = n[a.p.jsonReader.cell][G] || B}w = e === 0?0:e + 1; w = (w + c) % 2 == 1?S:""; s[E++] = ''; if (a.p.rownumbers === true){s[E++] = la(0, c, a.p.page, a.p.rowNum); N = 1}if (a.p.multiselect){s[E++] = u(B, N, c); z = 1}if (a.p.subGrid){s[E++] = b(a).jqGrid("addSubGridCell", z + N, c + e); D = 1}if (a.p.jsonReader.repeatitems){if (a.p.jsonReader.cell)n = U(n, a.p.jsonReader.cell); v || (v = fa(z + D + N))}for (y = 0; y < v.length; y++){w = U(n, v[y]); s[E++] = R(B, w, y + z + D + N, c + e, n); da[a.p.colModel[y + z + D + N].name] = w}s[E++] = " "; if (a.p.gridview === false){if (a.p.treeGrid === true){E = a.p.treeANode >= - 1?a.p.treeANode:0; s = b(s.join(""))[0];
- try{b(a).jqGrid("setTreeNode", da, s)} catch (ma){}W === 0?b("tbody:first", d).append(s):b(a.rows[c + E + e]).after(s)} else b("tbody:first", d).append(s.join("")); if (a.p.subGrid === true)try{b(a).jqGrid("addSubGrid", a.rows[a.rows.length - 1], z + N)} catch (wa){}O && a.p.afterInsertRow.call(a, B, da, n); s = []; E = 0}da = {}; p++; c++; if (p == ga)break}a.p.gridview === true && b("tbody:first", d).append(s.join("")); a.p.totaltime = new Date - o; if (p > 0){a.grid.cols = a.rows[0].cells; if (a.p.records === 0)a.p.records = L}}if (!a.p.treeGrid && !a.p.scroll)a.grid.bDiv.scrollTop =
- 0; a.p.reccount = p; a.p.treeANode = - 1; a.p.userDataOnFooter && b(a).jqGrid("footerData", "set", a.p.userData, true); l || na(false, true)}}, na = function(c, d){var e, l, n, o, p, w, y, s = ""; n = parseInt(a.p.page, 10) - 1; if (n < 0)n = 0; n *= parseInt(a.p.rowNum, 10); p = n + a.p.reccount; if (a.p.scroll){e = b("tbody:first > tr", a.grid.bDiv); n = p - e.length; if (l = e.outerHeight()){e = n * l; l = parseInt(a.p.records, 10) * l; b(">div:first", a.grid.bDiv).css({height:l}).children("div:first").css({height:e, display:e?"":"none"})}}s = a.p.pager?a.p.pager:""; s += a.p.toppager?
- s?"," + a.p.toppager:a.p.toppager:""; if (s){y = b.jgrid.formatter.integer || {}; if (a.p.loadonce){e = l = 1; a.p.lastpage = a.page = 1; b(".selbox", s).attr("disabled", true)} else{e = J(a.p.page); l = J(a.p.lastpage); b(".selbox", s).attr("disabled", false)}if (a.p.pginput === true){b(".ui-pg-input", s).val(a.p.page); b("#sp_1", s).html(b.fmatter?b.fmatter.util.NumberFormat(a.p.lastpage, y):a.p.lastpage)}if (a.p.viewrecords)if (a.p.reccount === 0)b(".ui-paging-info", s).html(a.p.emptyrecords); else{o = n + 1; w = a.p.records; if (b.fmatter){o = b.fmatter.util.NumberFormat(o,
- y); p = b.fmatter.util.NumberFormat(p, y); w = b.fmatter.util.NumberFormat(w, y)}b(".ui-paging-info", s).html(b.jgrid.format(a.p.recordtext, o, p, w))}if (a.p.pgbuttons === true){if (e <= 0)e = l = 0; if (e == 1 || e === 0){b("#first, #prev", a.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover"); a.p.toppager && b("#first_t, #prev_t", a.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")} else{b("#first, #prev", a.p.pager).removeClass("ui-state-disabled"); a.p.toppager && b("#first_t, #prev_t", a.p.toppager).removeClass("ui-state-disabled")}if (e ==
- l || e === 0){b("#next, #last", a.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover"); a.p.toppager && b("#next_t, #last_t", a.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")} else{b("#next, #last", a.p.pager).removeClass("ui-state-disabled"); a.p.toppager && b("#next_t, #last_t", a.p.toppager).removeClass("ui-state-disabled")}}}c === true && a.p.rownumbers === true && b("td.jqgrid-rownum", a.rows).each(function(r){b(this).html(n + 1 + r)}); d && a.p.jqgdnd && b(a).jqGrid("gridDnD", "updateDnD");
- b.isFunction(a.p.gridComplete) && a.p.gridComplete.call(a)}, Y = function(c){if (!a.grid.hDiv.loading){var d = a.p.scroll && c === false, e = {}, l, n = a.p.prmNames; if (a.p.page <= 0)a.p.page = 1; if (n.search !== null)e[n.search] = a.p.search; if (n.nd !== null)e[n.nd] = (new Date).getTime(); if (n.rows !== null)e[n.rows] = a.p.rowNum; if (n.page !== null)e[n.page] = a.p.page; if (n.sort !== null)e[n.sort] = a.p.sortname; if (n.order !== null)e[n.order] = a.p.sortorder; var o = a.p.loadComplete, p = b.isFunction(o); p || (o = null); var w = 0; c = c || 1; if (c > 1)if (n.npage !==
- null){e[n.npage] = c; w = c - 1; c = 1} else o = function(s){p && a.p.loadComplete.call(a, s); a.grid.hDiv.loading = false; a.p.page++; Y(c - 1)}; else n.npage !== null && delete a.p.postData[n.npage]; b.extend(a.p.postData, e); var y = !a.p.scroll?0:a.rows.length - 1; if (b.isFunction(a.p.datatype))a.p.datatype.call(a, a.p.postData, "load_" + a.p.id); else{b.isFunction(a.p.beforeRequest) && a.p.beforeRequest.call(a); l = a.p.datatype.toLowerCase(); switch (l){case "json":case "jsonp":case "xml":case "script":b.ajax(b.extend({url:a.p.url, type:a.p.mtype,
- dataType:l, data:b.isFunction(a.p.serializeGridData)?a.p.serializeGridData.call(a, a.p.postData):a.p.postData, success:function(s){l === "xml"?ia(s, a.grid.bDiv, y, c > 1, w):ra(s, a.grid.bDiv, y, c > 1, w); o && o.call(a, s); d && a.grid.populateVisible(); if (a.p.loadonce || a.p.treeGrid)a.p.datatype = "local"; ja()}, error:function(s, r, v){b.isFunction(a.p.loadError) && a.p.loadError.call(a, s, r, v); ja()}, beforeSend:function(s){oa(); b.isFunction(a.p.loadBeforeSend) && a.p.loadBeforeSend.call(a, s)}}, b.jgrid.ajaxOptions, a.p.ajaxGridOptions));
- break; case "xmlstring":oa(); e = b.jgrid.stringToDoc(a.p.datastr); p && a.p.loadComplete.call(a, e); ia(e, a.grid.bDiv); a.p.datatype = "local"; a.p.datastr = null; ja(); break; case "jsonstring":oa(); e = typeof a.p.datastr == "string"?b.jgrid.parse(a.p.datastr):a.p.datastr; p && a.p.loadComplete.call(a, e); ra(e, a.grid.bDiv); a.p.datatype = "local"; a.p.datastr = null; ja(); break; case "local":case "clientside":oa(); a.p.datatype = "local"; p && a.p.loadComplete.call(a, ""); Aa(); na(true, true); ja(); break}}}}, oa = function(){a.grid.hDiv.loading =
- true; if (!a.p.hiddengrid)switch (a.p.loadui){case "disable":break; case "enable":b("#load_" + a.p.id).show(); break; case "block":b("#lui_" + a.p.id).show(); b("#load_" + a.p.id).show(); break}}, ja = function(){a.grid.hDiv.loading = false; switch (a.p.loadui){case "disable":break; case "enable":b("#load_" + a.p.id).hide(); break; case "block":b("#lui_" + a.p.id).hide(); b("#load_" + a.p.id).hide(); break}}, Aa = function(){var c = /[\$,%]/g, d = [], e = 0, l, n, o, p = a.p.sortorder == "asc"?1: - 1, w = false, y; b.each(a.p.colModel, function(r){if (this.index ==
- a.p.sortname || this.name == a.p.sortname){if (a.p.lastsort == r)w = true; e = r; l = this.sorttype; return false}}); o = l == "float" || l == "number" || l == "currency"?function(r){r = parseFloat(r.replace(c, "")); return isNaN(r)?0:r}:l == "int" || l == "integer"?function(r){return J(r.replace(c, ""), 0)}:l == "date" || l == "datetime"?function(r){return Ba(a.p.colModel[e].datefmt || "Y-m-d", r).getTime()}:b.isFunction(l)?l:function(r){return b.trim(r.toUpperCase())}; y = a.p.colModel[e]; b.each(a.rows, function(r, v){try{n = b.unformat(b(v).children("td").eq(e),
- {rowId:v.id, colModel:y}, e, true)} catch (z){n = b(v).children("td").eq(e).text()}v.sortKey = o(n); d[r] = this}); if (a.p.treeGrid)b(a).jqGrid("SortTree", p); else{w?d.reverse():d.sort(function(r, v){if (r.sortKey < v.sortKey)return - p; if (r.sortKey > v.sortKey)return p; return 0}); if (d[0]){b("td", d[0]).each(function(r){b(this).css("width", g.headers[r].width + "px")}); a.grid.cols = d[0].cells}var s = ""; if (a.p.altRows)s = a.p.altclass; b.each(d, function(r, v){if (s)r % 2 == 1?b(v).addClass(s):b(v).removeClass(s); b("tbody", a.grid.bDiv).append(v);
- v.sortKey = null})}a.grid.bDiv.scrollTop = 0}, Ba = function(c, d){var e = {m:1, d:1, y:1970, h:0, i:0, s:0}, l, n, o; if (d = b.trim(d)){d = d.split(/[\\\/:_;.\t\T\s-]/); c = c.split(/[\\\/:_;.\t\T\s-]/); var p = b.jgrid.formatter.date.monthNames, w = b.jgrid.formatter.date.AmPm, y = function(s, r){if (s === 0){if (r == 12)r = 0} else if (r != 12)r += 12; return r}; l = 0; for (n = c.length; l < n; l++){if (c[l] == "M"){o = b.inArray(d[l], p); if (o !== - 1 && o < 12)d[l] = o + 1}if (c[l] == "F"){o = b.inArray(d[l], p); if (o !== - 1 && o > 11)d[l] = o + 1 - 12}if (c[l] == "a"){o = b.inArray(d[l], w); if (o !==
- - 1 && o < 2 && d[l] == w[o]){d[l] = o; e.h = y(d[l], e.h)}}if (c[l] == "A"){o = b.inArray(d[l], w); if (o !== - 1 && o > 1 && d[l] == w[o]){d[l] = o - 2; e.h = y(d[l], e.h)}}e[c[l].toLowerCase()] = parseInt(d[l], 10)}e.m = parseInt(e.m, 10) - 1; c = e.y; if (c >= 70 && c <= 99)e.y = 1900 + e.y; else if (c >= 0 && c <= 69)e.y = 2E3 + e.y}return new Date(e.y, e.m, e.d, e.h, e.i, e.s, 0)}; t = function(c, d){var e = "", l = "
"; a.p.viewrecords === true && b("td#" + c + "_" + a.p.recordpos, "#" + o).append(""); b("td#" + c + "_" + a.p.pagerpos, "#" + o).append(l); n = b(".ui-jqgrid").css("font-size") ||
- "11px"; b("body").append(""); l = b(l).clone().appendTo("#testpg").width(); b("#testpg").remove(); if (l > 0){if (e != "")l += 50; b("td#" + c + "_" + a.p.pagerpos, "#" + o).width(l)}a.p._nvtd = []; a.p._nvtd[0] = l?Math.floor((a.p.width - l) / 2):Math.floor(a.p.width / 3); a.p._nvtd[1] = 0; l = null; b(".ui-pg-selbox", "#" + o).bind("change", function(){a.p.page = Math.round(a.p.rowNum * (a.p.page - 1) / this.value - 0.5) + 1; a.p.rowNum = this.value;
- if (d)b(".ui-pg-selbox", a.p.pager).val(this.value); else a.p.toppager && b(".ui-pg-selbox", a.p.toppager).val(this.value); if (!s("records"))return false; Y(); return false}); if (a.p.pgbuttons === true){b(".ui-pg-button", "#" + o).hover(function(){if (b(this).hasClass("ui-state-disabled"))this.style.cursor = "default"; else{b(this).addClass("ui-state-hover"); this.style.cursor = "pointer"}}, function(){if (!b(this).hasClass("ui-state-disabled")){b(this).removeClass("ui-state-hover"); this.style.cursor = "default"}}); b("#first" +
- d + ", #prev" + d + ", #next" + d + ", #last" + d, "#" + c).click(function(){var r = J(a.p.page, 1), v = J(a.p.lastpage, 1), z = false, D = true, N = true, L = true, P = true; if (v === 0 || v === 1)P = L = N = D = false; else if (v > 1 && r >= 1)if (r === 1)N = D = false; else{if (!(r > 1 && r < v))if (r === v)P = L = false} else if (v > 1 && r === 0){P = L = false; r = v - 1}if (this.id === "first" + d && D){a.p.page = 1; z = true}if (this.id === "prev" + d && N){a.p.page = r - 1; z = true}if (this.id === "next" + d && L){a.p.page = r + 1; z = true}if (this.id === "last" + d && P){a.p.page = v; z = true}if (z){if (!s(this.id))return false; Y()}return false})}a.p.pginput ===
- true && b("input.ui-pg-input", "#" + o).keypress(function(r){if ((r.charCode?r.charCode:r.keyCode?r.keyCode:0) == 13){a.p.page = b(this).val() > 0?b(this).val():a.p.page; if (!s("user"))return false; Y(); return false}return this})}; var xa = function(c, d, e, l){if (a.p.colModel[d].sortable)if (!(a.p.savedRow.length > 0)){if (!e){if (a.p.lastsort == d)if (a.p.sortorder == "asc")a.p.sortorder = "desc"; else{if (a.p.sortorder == "desc")a.p.sortorder = "asc"} else a.p.sortorder = a.p.colModel[d].firstsortorder || "asc"; a.p.page = 1}if (l)if (a.p.lastsort ==
- d && a.p.sortorder == l && !e)return; else a.p.sortorder = l; e = b("thead:first", a.grid.hDiv).get(0); b("tr th:eq(" + a.p.lastsort + ") span.ui-grid-ico-sort", e).addClass("ui-state-disabled"); b("tr th:eq(" + a.p.lastsort + ")", e).attr("aria-selected", "false"); b("tr th:eq(" + d + ") span.ui-icon-" + a.p.sortorder, e).removeClass("ui-state-disabled"); b("tr th:eq(" + d + ")", e).attr("aria-selected", "true"); if (!a.p.viewsortcols[0])if (a.p.lastsort != d){b("tr th:eq(" + a.p.lastsort + ") span.s-ico", e).hide(); b("tr th:eq(" + d + ") span.s-ico",
- e).show()}c = c.substring(5); a.p.sortname = a.p.colModel[d].index || c; e = a.p.sortorder; if (b.isFunction(a.p.onSortCol))if (a.p.onSortCol.call(a, c, d, e) == "stop"){a.p.lastsort = d; return}if (a.p.datatype == "local")a.p.deselectAfterSort && b(a).jqGrid("resetSelection"); else{a.p.selrow = null; a.p.multiselect && b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv).attr("checked", false); a.p.selarrrow = []; a.p.savedRow = []; a.p.scroll && aa(a.grid.bDiv, true)}a.p.subGrid && a.p.datatype == "local" && b("td.sgexpanded", "#" + a.p.id).each(function(){b(this).trigger("click")});
- Y(); a.p.lastsort = d; if (a.p.sortname != c && d)a.p.lastsort = d}}, Ca = function(c){var d = c, e; for (e = c + 1; e < a.p.colModel.length; e++)if (a.p.colModel[e].hidden !== true){d = e; break}return d - c}, Da = function(c){var d, e = {}, l = C?0:a.p.cellLayout; for (d = e[0] = e[1] = e[2] = 0; d <= c; d++)if (a.p.colModel[d].hidden === false)e[0] += a.p.colModel[d].width + l; if (a.p.direction == "rtl")e[0] = a.p.width - e[0]; e[0] -= a.grid.bDiv.scrollLeft; if (b(a.grid.cDiv).is(":visible"))e[1] += b(a.grid.cDiv).height() + parseInt(b(a.grid.cDiv).css("padding-top"), 10) +
- parseInt(b(a.grid.cDiv).css("padding-bottom"), 10); if (a.p.toolbar[0] === true && (a.p.toolbar[1] == "top" || a.p.toolbar[1] == "both"))e[1] += b(a.grid.uDiv).height() + parseInt(b(a.grid.uDiv).css("border-top-width"), 10) + parseInt(b(a.grid.uDiv).css("border-bottom-width"), 10); if (a.p.toppager)e[1] += b(a.grid.topDiv).height() + parseInt(b(a.grid.topDiv).css("border-bottom-width"), 10); e[2] += b(a.grid.bDiv).height() + b(a.grid.hDiv).height(); return e}; this.p.id = this.id; if (b.inArray(a.p.multikey, ["shiftKey", "altKey", "ctrlKey"]) ==
- - 1)a.p.multikey = false; a.p.keyIndex = false; for (j = 0; j < a.p.colModel.length; j++)if (a.p.colModel[j].key === true){a.p.keyIndex = j; break}a.p.sortorder = a.p.sortorder.toLowerCase(); if (this.p.treeGrid === true)try{b(this).jqGrid("setTreeGrid")} catch (Ha){}if (this.p.subGrid)try{b(a).jqGrid("setSubGrid")} catch (Ia){}if (this.p.multiselect){this.p.colNames.unshift(""); this.p.colModel.unshift({name:"cb", width:C?a.p.multiselectWidth + a.p.cellLayout:
- a.p.multiselectWidth, sortable:false, resizable:false, hidedlg:true, search:false, align:"center", fixed:true})}if (this.p.rownumbers){this.p.colNames.unshift(""); this.p.colModel.unshift({name:"rn", width:a.p.rownumWidth, sortable:false, resizable:false, hidedlg:true, search:false, align:"center", fixed:true})}a.p.xmlReader = b.extend(true, {root:"rows", row:"row", page:"rows>page", total:"rows>total", records:"rows>records", repeatitems:true, cell:"cell", id:"[id]", userdata:"userdata", subgrid:{root:"rows", row:"row", repeatitems:true,
- cell:"cell"}}, a.p.xmlReader); a.p.jsonReader = b.extend(true, {root:"rows", page:"page", total:"total", records:"records", repeatitems:true, cell:"cell", id:"id", userdata:"userdata", subgrid:{root:"rows", repeatitems:true, cell:"cell"}}, a.p.jsonReader); if (a.p.scroll){a.p.pgbuttons = false; a.p.pginput = false; a.p.rowList = []}var H = "", n = "", o, p, w, y, s = function(r){var v; if (b.isFunction(a.p.onPaging))v =
- a.p.onPaging.call(a, r); a.p.selrow = null; if (a.p.multiselect){a.p.selarrrow = []; b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv).attr("checked", false)}a.p.savedRow = []; if (v == "stop")return false; return true}; c = c.substr(1); o = "pg_" + c; p = c + "_left"; w = c + "_center"; y = c + "_right"; b("#" + c).append(" "; n += " "}if (m == "rtl")l += n; if (a.p.pginput === true)e = "" + b.jgrid.format(a.p.pgtext || "", "",
- "") + " "; if (a.p.pgbuttons === true){p = ["first" + d, "prev" + d, "next" + d, "last" + d]; m == "rtl" && p.reverse(); l += ""; l += " "; l += e != ""?" " + e + " ":
- ""; l += " "; l += " "} else if (e != "")l += e; if (m == "ltr")l += n; l += " ", ya, ba, sa, ka, pa, I, A, ea; ba = ea = ""; if (a.p.shrinkToFit === true && a.p.forceFit === true)for (j = a.p.colModel.length - 1; j >= 0; j--)if (!a.p.colModel[j].hidden){a.p.colModel[j].resizable =
- false; break}if (a.p.viewsortcols[1] == "horizontal"){ea = " ui-i-asc"; ba = " ui-i-desc"}ya = x?"class='ui-th-div-ie'":""; ea = " "; b(this).append(H); b("thead tr:first th",
- this).hover(function(){b(this).addClass("ui-state-hover")}, function(){b(this).removeClass("ui-state-hover")}); if (this.p.multiselect){var ta = [], qa; b("#cb_" + b.jgrid.jqID(a.p.id), this).bind("click", function(){if (this.checked){b("[id^=jqg_]", a.rows).attr("checked", true); b(a.rows).each(function(c){if (!b(this).hasClass("subgrid")){b(this).addClass("ui-state-highlight").attr("aria-selected", "true"); a.p.selarrrow[c] = a.p.selrow = this.id}}); qa = true; ta = []} else{b("[id^=jqg_]", a.rows).attr("checked", false); b(a.rows).each(function(c){if (!b(this).hasClass("subgrid")){b(this).removeClass("ui-state-highlight").attr("aria-selected",
- "false"); ta[c] = this.id}}); a.p.selarrrow = []; a.p.selrow = null; qa = false}if (b.isFunction(a.p.onSelectAll))a.p.onSelectAll.call(a, qa?a.p.selarrrow:ta, qa)})}if (a.p.autowidth === true){H = b(K).innerWidth(); a.p.width = H > 0?H:"nw"}(function(){var c = 0, d = a.p.cellLayout, e = 0, l, n = a.p.scrollOffset, o, p = false, w, y = 0, s = 0, r = 0, v; if (C)d = 0; b.each(a.p.colModel, function(){if (typeof this.hidden === "undefined")this.hidden = false; if (this.hidden === false){c += J(this.width, 0); if (this.fixed){y += this.width; s += this.width + d} else e++; r++}});
- if (isNaN(a.p.width))a.p.width = g.width = c; else g.width = a.p.width; a.p.tblwidth = c; if (a.p.shrinkToFit === false && a.p.forceFit === true)a.p.forceFit = false; if (a.p.shrinkToFit === true && e > 0){w = g.width - d * e - s; if (!isNaN(a.p.height)){w -= n; p = true}c = 0; b.each(a.p.colModel, function(z){if (this.hidden === false && !this.fixed){this.width = o = Math.round(w * this.width / (a.p.tblwidth - y)); c += o; l = z}}); v = 0; if (p){if (g.width - s - (c + d * e) !== n)v = g.width - s - (c + d * e) - n} else if (!p && Math.abs(g.width - s - (c + d * e)) !== 1)v = g.width - s - (c + d * e); a.p.colModel[l].width +=
- v; a.p.tblwidth = c + v + y + r * d; if (a.p.tblwidth > a.p.width){a.p.colModel[l].width -= a.p.tblwidth - parseInt(a.p.width, 10); a.p.tblwidth = a.p.width}}})(); b(K).css("width", g.width + "px").append(" "; for (j = 0; j < this.p.colNames.length; j++){ba = a.p.headertitles?' title="' + b.jgrid.stripHtml(a.p.colNames[j]) +
- '"':""; H += ""; ba = a.p.colModel[j].index || a.p.colModel[j].name; H += " "}H += "
"; this.appendChild(document.createElement("tbody")); b(this).addClass("ui-jqgrid-btable"); q = b(""; q = b("tr:first", H); a.p.disableClick = false; b("th", q).each(function(c){sa = a.p.colModel[c].width; if (typeof a.p.colModel[c].resizable === "undefined")a.p.colModel[c].resizable = true; if (a.p.colModel[c].resizable){ka = document.createElement("span"); b(ka).html(" ").addClass("ui-jqgrid-resize ui-jqgrid-resize-" + m); b.browser.opera || b(ka).css("cursor", "col-resize"); b(this).addClass(a.p.resizeclass)} else ka = ""; b(this).css("width", sa + "px").prepend(ka); a.p.colModel[c].hidden && b(this).css("display", "none");
- g.headers[c] = {width:sa, el:this}; pa = a.p.colModel[c].sortable; if (typeof pa !== "boolean")pa = a.p.colModel[c].sortable = true; var d = a.p.colModel[c].name; d == "cb" || d == "subgrid" || d == "rn" || a.p.viewsortcols[2] && b("div", this).addClass("ui-jqgrid-sortable"); if (pa)if (a.p.viewsortcols[0]){b("div span.s-ico", this).show(); c == a.p.lastsort && b("div span.ui-icon-" + a.p.sortorder, this).removeClass("ui-state-disabled")} else if (c == a.p.lastsort){b("div span.s-ico", this).show(); b("div span.ui-icon-" + a.p.sortorder, this).removeClass("ui-state-disabled")}ua +=
- " "}).mousedown(function(c){if (b(c.target).closest("th>span.ui-jqgrid-resize").length == 1){var d = b.jgrid.getCellIndex(this); if (a.p.forceFit === true)a.p.nv = Ca(d); g.dragStart(d, c, Da(d)); return false}}).click(function(c){if (a.p.disableClick)return a.p.disableClick = false; var d = "th>div.ui-jqgrid-sortable", e, l; a.p.viewsortcols[2] || (d = "th>div>span>span.ui-grid-ico-sort"); c = b(c.target).closest(d); if (c.length == 1){d = b.jgrid.getCellIndex(this); if (!a.p.viewsortcols[2]){e =
- true; l = c.attr("sort")}xa(b("div", this)[0].id, d, e, l); return false}}); if (a.p.sortable && b.fn.sortable)try{b(a).jqGrid("sortableColumns", q)} catch (Ja){}ua += "").append(H); var T = a.p.caption && a.p.hiddengrid === true?true:false; H = b(""); g.hDiv = document.createElement("div"); b(g.hDiv).css({width:g.width + "px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(H); b(H).append(q); T && b(g.hDiv).hide(); if (a.p.pager){if (typeof a.p.pager == "string"){if (a.p.pager.substr(0, 1) != "#")a.p.pager = "#" + a.p.pager} else a.p.pager = "#" + b(a.p.pager).attr("id"); b(a.p.pager).css({width:g.width + "px"}).appendTo(K).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom"); T && b(a.p.pager).hide(); t(a.p.pager, "")}a.p.cellEdit ===
- false && a.p.hoverrows === true && b(a).bind("mouseover", function(c){A = b(c.target).closest("tr.jqgrow"); b(A).attr("class") !== "subgrid" && b(A).addClass("ui-state-hover"); return false}).bind("mouseout", function(c){A = b(c.target).closest("tr.jqgrow"); b(A).removeClass("ui-state-hover"); return false}); var Z, $; b(a).before(g.hDiv).click(function(c){I = c.target; var d = b(I).hasClass("cbox"); A = b(I, a.rows).closest("tr.jqgrow"); if (b(A).length === 0)return this; var e = true; if (b.isFunction(a.p.beforeSelectRow))e = a.p.beforeSelectRow.call(a,
- A[0].id, c); if (I.tagName == "A" || (I.tagName == "INPUT" || I.tagName == "TEXTAREA" || I.tagName == "OPTION" || I.tagName == "SELECT") && !d)return this; if (e === true){if (a.p.cellEdit === true)if (a.p.multiselect && d)b(a).jqGrid("setSelection", A[0].id, true); else{Z = A[0].rowIndex; $ = b.jgrid.getCellIndex(I); try{b(a).jqGrid("editCell", Z, $, true)} catch (l){}} else if (a.p.multikey)if (c[a.p.multikey])b(a).jqGrid("setSelection", A[0].id, true); else{if (a.p.multiselect && d){d = b("[id^=jqg_]", A).attr("checked"); b("[id^=jqg_]", A).attr("checked",
- !d)}} else{if (a.p.multiselect && a.p.multiboxonly)if (!d){b(a.p.selarrrow).each(function(n, o){n = a.rows.namedItem(o); b(n).removeClass("ui-state-highlight"); b("#jqg_" + b.jgrid.jqID(o), n).attr("checked", false)}); a.p.selarrrow = []; b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv).attr("checked", false)}b(a).jqGrid("setSelection", A[0].id, true)}if (b.isFunction(a.p.onCellSelect)){Z = A[0].id; $ = b.jgrid.getCellIndex(I); a.p.onCellSelect.call(a, Z, $, b(I).html(), c)}c.stopPropagation()} else return this}).bind("reloadGrid", function(c,
- d){if (a.p.treeGrid === true)a.p.datatype = a.p.treedatatype; d && d.current && a.grid.selectionPreserver(a); if (a.p.datatype == "local")b(a).jqGrid("resetSelection"); else if (!a.p.treeGrid){a.p.selrow = null; if (a.p.multiselect){a.p.selarrrow = []; b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv).attr("checked", false)}a.p.savedRow = []; a.p.scroll && aa(a.grid.bDiv, true)}if (d && d.page){c = d.page; if (c > a.p.lastpage)c = a.p.lastpage; if (c < 1)c = 1; a.p.page = c; a.grid.bDiv.scrollTop = a.grid.prevRowHeight?(c - 1) * a.grid.prevRowHeight * a.p.rowNum:
- 0}if (a.grid.prevRowHeight && a.p.scroll){delete a.p.lastpage; a.grid.populateVisible()} else a.grid.populate(); return false}); b.isFunction(this.p.ondblClickRow) && b(this).dblclick(function(c){I = c.target; A = b(I, a.rows).closest("tr.jqgrow"); if (b(A).length === 0)return false; Z = A[0].rowIndex; $ = b.jgrid.getCellIndex(I); a.p.ondblClickRow.call(a, b(A).attr("id"), Z, $, c); return false}); b.isFunction(this.p.onRightClickRow) && b(this).bind("contextmenu", function(c){I = c.target; A = b(I, a.rows).closest("tr.jqgrow"); if (b(A).length ===
- 0)return false; a.p.multiselect || b(a).jqGrid("setSelection", A[0].id, true); Z = A[0].rowIndex; $ = b.jgrid.getCellIndex(I); a.p.onRightClickRow.call(a, b(A).attr("id"), Z, $, c); return false}); g.bDiv = document.createElement("div"); b(g.bDiv).append(b('').append("").append(this)).addClass("ui-jqgrid-bdiv").css({height:a.p.height + (isNaN(a.p.height)?"":"px"), width:g.width + "px"}).scroll(g.scrollGrid); b("table:first", g.bDiv).css({width:a.p.tblwidth +
- "px"}); if (x){b("tbody", this).size() == 2 && b("tbody:first", this).remove(); a.p.multikey && b(g.bDiv).bind("selectstart", function(){return false})} else a.p.multikey && b(g.bDiv).bind("mousedown", function(){return false}); T && b(g.bDiv).hide(); g.cDiv = document.createElement("div"); var va = a.p.hidegrid === true?b("").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){va.addClass("ui-state-hover")}, function(){va.removeClass("ui-state-hover")}).append("").css(m ==
- "rtl"?"left":"right", "0px"):""; b(g.cDiv).append(va).append("" + a.p.caption + "").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix"); b(g.cDiv).insertBefore(g.hDiv); if (a.p.toolbar[0]){g.uDiv = document.createElement("div"); if (a.p.toolbar[1] == "top")b(g.uDiv).insertBefore(g.hDiv); else a.p.toolbar[1] == "bottom" && b(g.uDiv).insertAfter(g.hDiv); if (a.p.toolbar[1] == "both"){g.ubDiv = document.createElement("div"); b(g.uDiv).insertBefore(g.hDiv).addClass("ui-userdata ui-state-default").attr("id",
- "t_" + this.id); b(g.ubDiv).insertAfter(g.hDiv).addClass("ui-userdata ui-state-default").attr("id", "tb_" + this.id); T && b(g.ubDiv).hide()} else b(g.uDiv).width(g.width).addClass("ui-userdata ui-state-default").attr("id", "t_" + this.id); T && b(g.uDiv).hide()}if (a.p.toppager){a.p.toppager = a.p.id + "_toppager"; g.topDiv = b("")[0]; a.p.toppager = "#" + a.p.toppager; b(g.topDiv).insertBefore(g.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(g.width); t(a.p.toppager, "_t")}if (a.p.footerrow){g.sDiv =
- b("")[0]; H = b(""); b(g.sDiv).append(H).insertAfter(g.hDiv).width(g.width); b(H).append(ua); g.footers = b(".ui-jqgrid-ftable", g.sDiv)[0].rows[0].cells; if (a.p.rownumbers)g.footers[0].className = "ui-state-default jqgrid-rownum"; T && b(g.sDiv).hide()}if (a.p.caption){var Ea = a.p.datatype; if (a.p.hidegrid === true){b(".ui-jqgrid-titlebar-close", g.cDiv).click(function(c){var d = b.isFunction(a.p.onHeaderClick); if (a.p.gridstate ==
- "visible"){b(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv", "#gview_" + a.p.id).slideUp("fast"); a.p.pager && b(a.p.pager).slideUp("fast"); a.p.toppager && b(a.p.toppager).slideUp("fast"); if (a.p.toolbar[0] === true){a.p.toolbar[1] == "both" && b(g.ubDiv).slideUp("fast"); b(g.uDiv).slideUp("fast")}a.p.footerrow && b(".ui-jqgrid-sdiv", "#gbox_" + a.p.id).slideUp("fast"); b("span", this).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s"); a.p.gridstate = "hidden"; b("#gbox_" + a.p.id).hasClass("ui-resizable") &&
- b(".ui-resizable-handle", "#gbox_" + a.p.id).hide(); if (d)T || a.p.onHeaderClick.call(a, a.p.gridstate, c)} else if (a.p.gridstate == "hidden"){b(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv", "#gview_" + a.p.id).slideDown("fast"); a.p.pager && b(a.p.pager).slideDown("fast"); a.p.toppager && b(a.p.toppager).slideDown("fast"); if (a.p.toolbar[0] === true){a.p.toolbar[1] == "both" && b(g.ubDiv).slideDown("fast"); b(g.uDiv).slideDown("fast")}a.p.footerrow && b(".ui-jqgrid-sdiv", "#gbox_" + a.p.id).slideDown("fast"); b("span", this).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");
- if (T){a.p.datatype = Ea; Y(); T = false}a.p.gridstate = "visible"; b("#gbox_" + a.p.id).hasClass("ui-resizable") && b(".ui-resizable-handle", "#gbox_" + a.p.id).show(); d && a.p.onHeaderClick.call(a, a.p.gridstate, c)}return false}); if (T){a.p.datatype = "local"; b(".ui-jqgrid-titlebar-close", g.cDiv).trigger("click")}}} else b(g.cDiv).hide(); b(g.hDiv).after(g.bDiv).mousemove(function(c){if (g.resizing){g.dragMove(c); return false}}); b(".ui-jqgrid-labels", g.hDiv).bind("selectstart", function(){return false}); b(document).mouseup(function(){if (g.resizing){g.dragEnd();
- return false}return true}); this.updateColumns = function(){var c = this.rows[0], d = this; if (c){b("td", c).each(function(e){b(this).css("width", d.grid.headers[e].width + "px")}); this.grid.cols = c.cells}return this}; a.formatCol = F; a.sortData = xa; a.updatepager = na; a.formatter = function(c, d, e, l, n){return M(c, d, e, l, n)}; b.extend(g, {populate:Y, emptyRows:aa}); this.grid = g; a.addXmlData = function(c){ia(c, a.grid.bDiv)}; a.addJSONData = function(c){ra(c, a.grid.bDiv)}; Y(); a.p.hiddengrid = false; b(window).unload(function(){a = null})}}})};
- b.jgrid.extend({getGridParam:function(f){var k = this[0]; if (k.grid)return f?typeof k.p[f] != "undefined"?k.p[f]:null:k.p}, setGridParam:function(f){return this.each(function(){this.grid && typeof f === "object" && b.extend(true, this.p, f)})}, getDataIDs:function(){var f = [], k = 0, i; this.each(function(){if ((i = this.rows.length) && i > 0)for (; k < i; ){f[k] = this.rows[k].id; k++}}); return f}, setSelection:function(f, k){return this.each(function(){function i(a){var q = b(h.grid.bDiv)[0].clientHeight, t = b(h.grid.bDiv)[0].scrollTop,
- x = h.rows[a].offsetTop; a = h.rows[a].clientHeight; if (x + a >= q + t)b(h.grid.bDiv)[0].scrollTop = x - (q + t) + a + t; else if (x < q + t)if (x < t)b(h.grid.bDiv)[0].scrollTop = x}var h = this, g, j, m; if (f !== undefined){k = k === false?false:true; if (j = h.rows.namedItem(f + "")){if (h.p.scrollrows === true){g = h.rows.namedItem(f).rowIndex; g >= 0 && i(g)}if (h.p.multiselect){h.p.selrow = j.id; m = b.inArray(h.p.selrow, h.p.selarrrow); if (m === - 1){j.className !== "ui-subgrid" && b(j).addClass("ui-state-highlight").attr("aria-selected", "true"); g = true; b("#jqg_" + b.jgrid.jqID(h.p.selrow),
- h.rows[j.rowIndex]).attr("checked", g); h.p.selarrrow.push(h.p.selrow); h.p.onSelectRow && k && h.p.onSelectRow.call(h, h.p.selrow, g)} else{j.className !== "ui-subgrid" && b(j).removeClass("ui-state-highlight").attr("aria-selected", "false"); g = false; b("#jqg_" + b.jgrid.jqID(h.p.selrow), h.rows[j.rowIndex]).attr("checked", g); h.p.selarrrow.splice(m, 1); h.p.onSelectRow && k && h.p.onSelectRow.call(h, h.p.selrow, g); j = h.p.selarrrow[0]; h.p.selrow = j === undefined?null:j}} else if (j.className !== "ui-subgrid"){h.p.selrow && b(h.rows.namedItem(h.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected",
- "false"); h.p.selrow = j.id; b(j).addClass("ui-state-highlight").attr("aria-selected", "true"); h.p.onSelectRow && k && h.p.onSelectRow.call(h, h.p.selrow, true)}}}})}, resetSelection:function(){return this.each(function(){var f = this, k; if (f.p.multiselect){b(f.p.selarrrow).each(function(i, h){k = f.rows.namedItem(h); b(k).removeClass("ui-state-highlight").attr("aria-selected", "false"); b("#jqg_" + b.jgrid.jqID(h), k).attr("checked", false)}); b("#cb_" + b.jgrid.jqID(f.p.id), f.grid.hDiv).attr("checked", false); f.p.selarrrow =
- []} else if (f.p.selrow){b("tr#" + b.jgrid.jqID(f.p.selrow), f.grid.bDiv).removeClass("ui-state-highlight").attr("aria-selected", "false"); f.p.selrow = null}f.p.savedRow = []})}, getRowData:function(f){var k = {}, i, h = false, g, j = 0; this.each(function(){var m = this, a, q; if (typeof f == "undefined"){h = true; i = []; g = m.rows.length} else{q = m.rows.namedItem(f); if (!q)return k; g = 1}for (; j < g; ){if (h)q = m.rows[j]; b("td", q).each(function(t){a = m.p.colModel[t].name; if (a !== "cb" && a !== "subgrid")if (m.p.treeGrid === true && a == m.p.ExpandColumn)k[a] =
- b.jgrid.htmlDecode(b("span:first", this).html()); else try{k[a] = b.unformat(this, {rowId:q.id, colModel:m.p.colModel[t]}, t)} catch (x){k[a] = b.jgrid.htmlDecode(b(this).html())}}); j++; if (h){i.push(k); k = {}}}}); return i?i:k}, delRowData:function(f){var k = false, i, h, g; this.each(function(){var j = this; if (i = j.rows.namedItem(f)){g = i.rowIndex; b(i).remove(); j.p.records--; j.p.reccount--; j.updatepager(true, false); k = true; if (j.p.multiselect){h = b.inArray(f, j.p.selarrrow); h != - 1 && j.p.selarrrow.splice(h, 1)}if (f == j.p.selrow)j.p.selrow =
- null} else return false; g === 0 && k && j.updateColumns(); if (j.p.altRows === true && k){var m = j.p.altclass; b(j.rows).each(function(a){a % 2 == 1?b(this).addClass(m):b(this).removeClass(m)})}}); return k}, setRowData:function(f, k, i){var h, g = false, j; this.each(function(){var m = this, a, q, t = typeof i; if (!m.grid)return false; q = m.rows.namedItem(f); if (!q)return false; k && b(this.p.colModel).each(function(x){h = this.name; if (k[h] !== undefined){a = m.formatter(f, k[h], x, k, "edit"); j = this.title?{title:b.jgrid.stripHtml(a)}:{}; m.p.treeGrid ===
- true && h == m.p.ExpandColumn?b("td:eq(" + x + ") > span:first", q).html(a).attr(j):b("td:eq(" + x + ")", q).html(a).attr(j); g = true}}); if (t === "string")b(q).addClass(i); else t === "object" && b(q).css(i)}); return g}, addRowData:function(f, k, i, h){i || (i = "last"); var g = false, j, m, a, q, t, x, C, K, J = "", F, Q, M, R; if (k){if (b.isArray(k)){F = true; i = "last"; Q = f} else{k = [k]; F = false}this.each(function(){var u = this, la = k.length; t = u.p.rownumbers === true?1:0; a = u.p.multiselect === true?1:0; q = u.p.subGrid === true?1:0; if (!F)if (typeof f != "undefined")f +=
- ""; else{f = u.p.records + 1 + ""; if (u.p.keyIndex !== false){Q = u.p.colModel[u.p.keyIndex + a + q + t].name; if (typeof k[0][Q] != "undefined")f = k[0][Q]}}M = u.p.altclass; for (var ca = 0, fa = "", aa = b.isFunction(u.p.afterInsertRow)?true:false; ca < la; ){R = k[ca]; m = ""; if (F){try{f = R[Q]} catch (U){f = u.p.records + 1}fa = u.p.altRows === true?(u.rows.length - 1) % 2 === 0?M:"":""}if (t){J = u.formatCol(t, 1, ""); m += '
0 "}if (a){K = ''; J = u.formatCol(t, 1, ""); m += '" + K + " "}if (q)m += b(u).jqGrid("addSubGridCell", a + t, 1); for (C = a + q + t; C < this.p.colModel.length; C++){j = this.p.colModel[C].name; K = u.formatter(f, R[j], C, R, "add"); J = u.formatCol(C, 1, K); m += '" + K + " "}m = '' + m + " "; if (u.p.subGrid === true){m = b(m)[0]; b(u).jqGrid("addSubGrid",
- m, a + t)}if (u.rows.length === 0)b("table:first", u.grid.bDiv).append(m); else switch (i){case "last":b(u.rows[u.rows.length - 1]).after(m); break; case "first":b(u.rows[0]).before(m); break; case "after":if (x = u.rows.namedItem(h))b(u.rows[x.rowIndex + 1]).hasClass("ui-subgrid")?b(u.rows[x.rowIndex + 1]).after(m):b(x).after(m); break; case "before":if (x = u.rows.namedItem(h)){b(x).before(m); x = x.rowIndex}break}u.p.records++; u.p.reccount++; if (!u.grid.cols || !u.grid.cols.length)u.grid.cols = u.rows[0].cells; if (i === "first" || i ===
- "before" && x <= 1 || u.rows.length === 1)u.updateColumns(); aa && u.p.afterInsertRow.call(u, f, R, R); ca++}if (u.p.altRows === true && !F)if (i == "last")(u.rows.length - 1) % 2 == 1 && b(u.rows[u.rows.length - 1]).addClass(M); else b(u.rows).each(function(ia){ia % 2 == 1?b(this).addClass(M):b(this).removeClass(M)}); u.updatepager(true, true); g = true})}return g}, footerData:function(f, k, i){function h(q){for (var t in q)if (q.hasOwnProperty(t))return false; return true}var g, j = false, m = {}, a; if (typeof f == "undefined")f = "get"; if (typeof i != "boolean")i =
- true; f = f.toLowerCase(); this.each(function(){var q = this, t; if (!q.grid || !q.p.footerrow)return false; if (f == "set")if (h(k))return false; j = true; b(this.p.colModel).each(function(x){g = this.name; if (f == "set"){if (k[g] !== undefined){t = i?q.formatter("", k[g], x, k, "edit"):k[g]; a = this.title?{title:b.jgrid.stripHtml(t)}:{}; b("tr.footrow td:eq(" + x + ")", q.grid.sDiv).html(t).attr(a); j = true}} else if (f == "get")m[g] = b("tr.footrow td:eq(" + x + ")", q.grid.sDiv).html()})}); return f == "get"?m:j}, ShowHideCol:function(f, k){return this.each(function(){var i =
- this, h = false; if (i.grid){if (typeof f === "string")f = [f]; k = k != "none"?"":"none"; var g = k == ""?true:false; b(this.p.colModel).each(function(j){if (b.inArray(this.name, f) !== - 1 && this.hidden === g){b("tr", i.grid.hDiv).each(function(){b("th:eq(" + j + ")", this).css("display", k)}); b(i.rows).each(function(m){b("td:eq(" + j + ")", i.rows[m]).css("display", k)}); i.p.footerrow && b("td:eq(" + j + ")", i.grid.sDiv).css("display", k); if (k == "none")i.p.tblwidth -= this.width; else i.p.tblwidth += this.width; this.hidden = !g; h = true}}); if (h === true){b("table:first",
- i.grid.hDiv).width(i.p.tblwidth); b("table:first", i.grid.bDiv).width(i.p.tblwidth); i.grid.hDiv.scrollLeft = i.grid.bDiv.scrollLeft; if (i.p.footerrow){b("table:first", i.grid.sDiv).width(i.p.tblwidth); i.grid.sDiv.scrollLeft = i.grid.bDiv.scrollLeft}}}})}, hideCol:function(f){return this.each(function(){b(this).jqGrid("ShowHideCol", f, "none")})}, showCol:function(f){return this.each(function(){b(this).jqGrid("ShowHideCol", f, "")})}, remapColumns:function(f, k, i){function h(m){var a; a = m.length?b.makeArray(m):b.extend({},
- m); b.each(f, function(q){m[q] = a[this]})}function g(m, a){b(">tr" + (a || ""), m).each(function(){var q = this, t = b.makeArray(q.cells); b.each(f, function(){var x = t[this]; x && q.appendChild(x)})})}var j = this.get(0); h(j.p.colModel); h(j.p.colNames); h(j.grid.headers); g(b("thead:first", j.grid.hDiv), i && ":not(.ui-jqgrid-labels)"); k && g(b("tbody:first", j.grid.bDiv), ".jqgrow"); j.p.footerrow && g(b("tbody:first", j.grid.sDiv)); if (j.p.remapColumns)if (j.p.remapColumns.length)h(j.p.remapColumns); else j.p.remapColumns = b.makeArray(f);
- j.p.lastsort = b.inArray(j.p.lastsort, f); if (j.p.treeGrid)j.p.expColInd = b.inArray(j.p.expColInd, f)}, setGridWidth:function(f, k){return this.each(function(){var i = this, h, g = 0, j = i.p.cellLayout, m, a = 0, q = false, t = i.p.scrollOffset, x, C = 0, K = 0, J = 0, F; if (i.grid){if (typeof k != "boolean")k = i.p.shrinkToFit; if (!isNaN(f)){f = parseInt(f, 10); i.grid.width = i.p.width = f; b("#gbox_" + i.p.id).css("width", f + "px"); b("#gview_" + i.p.id).css("width", f + "px"); b(i.grid.bDiv).css("width", f + "px"); b(i.grid.hDiv).css("width", f + "px"); i.p.pager &&
- b(i.p.pager).css("width", f + "px"); i.p.toppager && b(i.p.toppager).css("width", f + "px"); if (i.p.toolbar[0] === true){b(i.grid.uDiv).css("width", f + "px"); i.p.toolbar[1] == "both" && b(i.grid.ubDiv).css("width", f + "px")}i.p.footerrow && b(i.grid.sDiv).css("width", f + "px"); if (k === false && i.p.forceFit === true)i.p.forceFit = false; if (k === true){if (b.browser.safari)j = 0; b.each(i.p.colModel, function(){if (this.hidden === false){g += parseInt(this.width, 10); if (this.fixed){K += this.width; C += this.width + j} else a++; J++}}); if (a !== 0){i.p.tblwidth =
- g; x = f - j * a - C; if (!isNaN(i.p.height))q = true; x -= t; g = 0; var Q = i.grid.cols.length > 0; b.each(i.p.colModel, function(M){if (this.hidden === false && !this.fixed){h = Math.round(x * this.width / (i.p.tblwidth - K)); if (!(h < 0)){this.width = h; g += h; i.grid.headers[M].width = h; i.grid.headers[M].el.style.width = h + "px"; if (i.p.footerrow)i.grid.footers[M].style.width = h + "px"; if (Q)i.grid.cols[M].style.width = h + "px"; m = M}}}); F = 0; if (q){if (f - C - (g + j * a) !== t)F = f - C - (g + j * a) - t} else if (Math.abs(f -
- C - (g + j * a)) !== 1)F = f - C - (g + j * a); i.p.colModel[m].width += F; i.p.tblwidth = g + F + K + j * J; if (i.p.tblwidth > f){q = i.p.tblwidth - parseInt(f, 10); i.p.tblwidth = f; h = i.p.colModel[m].width -= q} else h = i.p.colModel[m].width; i.grid.headers[m].width = h; i.grid.headers[m].el.style.width = h + "px"; if (Q)i.grid.cols[m].style.width = h + "px"; b("table:first", i.grid.bDiv).css("width", i.p.tblwidth + "px"); b("table:first", i.grid.hDiv).css("width", i.p.tblwidth + "px"); i.grid.hDiv.scrollLeft = i.grid.bDiv.scrollLeft; if (i.p.footerrow){i.grid.footers[m].style.width =
- h + "px"; b("table:first", i.grid.sDiv).css("width", i.p.tblwidth + "px")}}}}}})}, setGridHeight:function(f){return this.each(function(){var k = this; if (k.grid){b(k.grid.bDiv).css({height:f + (isNaN(f)?"":"px")}); k.p.height = f; k.p.scroll && k.grid.populateVisible()}})}, setCaption:function(f){return this.each(function(){this.p.caption = f; b("span.ui-jqgrid-title", this.grid.cDiv).html(f); b(this.grid.cDiv).show()})}, setLabel:function(f, k, i, h){return this.each(function(){var g = this, j = - 1; if (g.grid){if (isNaN(f))b(g.p.colModel).each(function(q){if (this.name ==
- f){j = q; return false}}); else j = parseInt(f, 10); if (j >= 0){var m = b("tr.ui-jqgrid-labels th:eq(" + j + ")", g.grid.hDiv); if (k){var a = b(".s-ico", m); b("[id^=jqgh_]", m).empty().html(k).append(a); g.p.colNames[j] = k}if (i)typeof i === "string"?b(m).addClass(i):b(m).css(i); typeof h === "object" && b(m).attr(h)}}})}, setCell:function(f, k, i, h, g, j){return this.each(function(){var m = this, a = - 1, q, t; if (m.grid){if (isNaN(k))b(m.p.colModel).each(function(C){if (this.name == k){a = C; return false}}); else a = parseInt(k, 10); if (a >= 0)if (q = m.rows.namedItem(f)){var x =
- b("td:eq(" + a + ")", q); if (i !== "" || j === true){q = m.formatter(f, i, a, q, "edit"); t = m.p.colModel[a].title?{title:b.jgrid.stripHtml(q)}:{}; m.p.treeGrid && b(".tree-wrap", b(x)).length > 0?b("span", b(x)).html(q).attr(t):b(x).html(q).attr(t)}if (typeof h === "string")b(x).addClass(h); else h && b(x).css(h); typeof g === "object" && b(x).attr(g)}}})}, getCell:function(f, k){var i = false; this.each(function(){var h = this, g = - 1; if (h.grid){if (isNaN(k))b(h.p.colModel).each(function(a){if (this.name === k){g = a; return false}}); else g = parseInt(k,
- 10); if (g >= 0){var j = h.rows.namedItem(f); if (j)try{i = b.unformat(b("td:eq(" + g + ")", j), {rowId:j.id, colModel:h.p.colModel[g]}, g)} catch (m){i = b.jgrid.htmlDecode(b("td:eq(" + g + ")", j).html())}}}}); return i}, getCol:function(f, k, i){var h = [], g, j = 0; k = typeof k != "boolean"?false:k; if (typeof i == "undefined")i = false; this.each(function(){var m = this, a = - 1; if (m.grid){if (isNaN(f))b(m.p.colModel).each(function(C){if (this.name === f){a = C; return false}}); else a = parseInt(f, 10); if (a >= 0){var q = m.rows.length, t = 0; if (q && q > 0){for (; t < q; ){try{g =
- b.unformat(b(m.rows[t].cells[a]), {rowId:m.rows[t].id, colModel:m.p.colModel[a]}, a)} catch (x){g = b.jgrid.htmlDecode(m.rows[t].cells[a].innerHTML)}if (i)j += parseFloat(g); else if (k)h.push({id:m.rows[t].id, value:g}); else h[t] = g; t++}if (i)switch (i.toLowerCase()){case "sum":h = j; break; case "avg":h = j / q; break; case "count":h = q; break}}}}}); return h}, clearGridData:function(f){return this.each(function(){var k = this; if (k.grid){if (typeof f != "boolean")f = false; b("tbody:first tr", k.grid.bDiv).remove(); k.p.footerrow && f &&
- b(".ui-jqgrid-ftable td", k.grid.sDiv).html(" "); k.p.selrow = null; k.p.selarrrow = []; k.p.savedRow = []; k.p.records = 0; k.p.page = "0"; k.p.lastpage = "0"; k.p.reccount = 0; k.updatepager(true, false)}})}, getInd:function(f, k){var i = false, h; this.each(function(){if (h = this.rows.namedItem(f))i = k === true?h:h.rowIndex}); return i}})})(jQuery);
- (function(c){function u(a, b, d, e, g){var h = b; if (c.fn.fmatter[a])h = c.fn.fmatter[a](b, d, e, g); return h}c.fmatter = {}; c.fn.fmatter = function(a, b, d, e, g){d = c.extend({}, c.jgrid.formatter, d); return u(a, b, d, e, g)}; c.fmatter.util = {NumberFormat:function(a, b){isNumber(a) || (a *= 1); if (isNumber(a)){var d = a < 0, e = a + "", g = b.decimalSeparator?b.decimalSeparator:"."; if (isNumber(b.decimalPlaces)){var h = b.decimalPlaces; e = Math.pow(10, h); e = Math.round(a * e) / e + ""; a = e.lastIndexOf("."); if (h > 0){if (a < 0){e += g; a = e.length - 1} else if (g !== ".")e =
- e.replace(".", g); for (; e.length - 1 - a < h; )e += "0"}}if (b.thousandsSeparator){h = b.thousandsSeparator; a = e.lastIndexOf(g); a = a > - 1?a:e.length; g = e.substring(a); for (var f = - 1, i = a; i > 0; i--){f++; if (f % 3 === 0 && i !== a && (!d || i > 1))g = h + g; g = e.charAt(i - 1) + g}e = g}e = b.prefix?b.prefix + e:e; return e = b.suffix?e + b.suffix:e} else return a}, DateFormat:function(a, b, d, e){var g = function(m, r){m = String(m); for (r = parseInt(r, 10) || 2; m.length < r; )m = "0" + m; return m}, h = {m:1, d:1, y:1970, h:0, i:0, s:0, u:0}, f = 0, i, k, j = ["i18n"]; j.i18n = {dayNames:e.dayNames,
- monthNames:e.monthNames}; if (a in e.masks)a = e.masks[a]; if (b.constructor === Date)f = b; else{b = b.split(/[\\\/:_;.\t\T\s-]/); a = a.split(/[\\\/:_;.\t\T\s-]/); i = 0; for (k = a.length; i < k; i++){if (a[i] == "M"){f = c.inArray(b[i], j.i18n.monthNames); if (f !== - 1 && f < 12)b[i] = f + 1}if (a[i] == "F"){f = c.inArray(b[i], j.i18n.monthNames); if (f !== - 1 && f > 11)b[i] = f + 1 - 12}h[a[i].toLowerCase()] = parseInt(b[i], 10)}h.m = parseInt(h.m, 10) - 1; f = h.y; if (f >= 70 && f <= 99)h.y = 1900 + h.y; else if (f >= 0 && f <= 69)h.y = 2E3 + h.y; f = new Date(h.y, h.m, h.d, h.h, h.i, h.s, h.u)}if (d in
- e.masks)d = e.masks[d]; else d || (d = "Y-m-d"); h = f.getHours(); a = f.getMinutes(); b = f.getDate(); i = f.getMonth() + 1; k = f.getTimezoneOffset(); var l = f.getSeconds(), o = f.getMilliseconds(), n = f.getDay(), p = f.getFullYear(), q = (n + 6) % 7 + 1, s = (new Date(p, i - 1, b) - new Date(p, 0, 1)) / 864E5, t = {d:g(b), D:j.i18n.dayNames[n], j:b, l:j.i18n.dayNames[n + 7], N:q, S:e.S(b), w:n, z:s, W:q < 5?Math.floor((s + q - 1) / 7) + 1:Math.floor((s + q - 1) / 7) || (((new Date(p - 1, 0, 1)).getDay() + 6) % 7 < 4?53:52), F:j.i18n.monthNames[i - 1 + 12], m:g(i), M:j.i18n.monthNames[i - 1], n:i, t:"?",
- L:"?", o:"?", Y:p, y:String(p).substring(2), a:h < 12?e.AmPm[0]:e.AmPm[1], A:h < 12?e.AmPm[2]:e.AmPm[3], B:"?", g:h % 12 || 12, G:h, h:g(h % 12 || 12), H:g(h), i:g(a), s:g(l), u:o, e:"?", I:"?", O:(k > 0?"-":"+") + g(Math.floor(Math.abs(k) / 60) * 100 + Math.abs(k) % 60, 4), P:"?", T:(String(f).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g) || [""]).pop().replace(/[^-+\dA-Z]/g, ""), Z:"?", c:"?", r:"?", U:Math.floor(f / 1E3)}; return d.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,
- function(m){return m in t?t[m]:m.substring(1)})}}; c.fn.fmatter.defaultFormat = function(a, b){return isValue(a) && a !== ""?a:b.defaultValue?b.defaultValue:" "}; c.fn.fmatter.email = function(a, b){return isEmpty(a)?c.fn.fmatter.defaultFormat(a, b):'' + a + ""}; c.fn.fmatter.checkbox = function(a, b){var d = c.extend({}, b.checkbox); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); b = d.disabled === true?"disabled":""; if (isEmpty(a) || isUndefined(a))a = c.fn.fmatter.defaultFormat(a,
- d); a += ""; a = a.toLowerCase(); return'"}; c.fn.fmatter.link = function(a, b){var d = {target:b.target}, e = ""; isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (d.target)e = "target=" + d.target; return isEmpty(a)?c.fn.fmatter.defaultFormat(a, b):"' + a + ""}; c.fn.fmatter.showlink = function(a, b){var d = {baseLinkUrl:b.baseLinkUrl, showAction:b.showAction,
- addParam:b.addParam || "", target:b.target, idName:b.idName}, e = ""; isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (d.target)e = "target=" + d.target; d = d.baseLinkUrl + d.showAction + "?" + d.idName + "=" + b.rowId + d.addParam; return isString(a)?"' + a + "":c.fn.fmatter.defaultFormat(a, b)}; c.fn.fmatter.integer = function(a, b){var d = c.extend({}, b.integer); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (isEmpty(a))return d.defaultValue;
- return c.fmatter.util.NumberFormat(a, d)}; c.fn.fmatter.number = function(a, b){var d = c.extend({}, b.number); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (isEmpty(a))return d.defaultValue; return c.fmatter.util.NumberFormat(a, d)}; c.fn.fmatter.currency = function(a, b){var d = c.extend({}, b.currency); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (isEmpty(a))return d.defaultValue; return c.fmatter.util.NumberFormat(a, d)}; c.fn.fmatter.date =
- function(a, b, d, e){d = c.extend({}, b.date); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); return!d.reformatAfterEdit && e == "edit"?c.fn.fmatter.defaultFormat(a, b):isEmpty(a)?c.fn.fmatter.defaultFormat(a, b):c.fmatter.util.DateFormat(d.srcformat, a, d.newformat, d)}; c.fn.fmatter.select = function(a, b){a += ""; var d = false, e = []; if (!isUndefined(b.colModel.editoptions))d = b.colModel.editoptions.value; if (d){var g = b.colModel.editoptions.multiple === true?true:false, h = [], f; if (g){h = a.split(",");
- h = c.map(h, function(l){return c.trim(l)})}if (isString(d))for (var i = d.split(";"), k = 0, j = 0; j < i.length; j++){f = i[j].split(":"); if (f.length > 2)f[1] = jQuery.map(f, function(l, o){if (o > 0)return l}).join(":"); if (g){if (jQuery.inArray(f[0], h) > - 1){e[k] = f[1]; k++}} else if (c.trim(f[0]) == c.trim(a)){e[0] = f[1]; break}} else if (isObject(d))if (g)e = jQuery.map(h, function(l){return d[l]}); else e[0] = d[a] || ""}a = e.join(", "); return a == ""?c.fn.fmatter.defaultFormat(a, b):a}; c.fn.fmatter.rowactions = function(a, b, d, e){switch (d){case "edit":d =
- function(){c("tr#" + a + " div.ui-inline-edit, tr#" + a + " div.ui-inline-del", "#" + b).show(); c("tr#" + a + " div.ui-inline-save, tr#" + a + " div.ui-inline-cancel", "#" + b).hide()}; c("#" + b).jqGrid("editRow", a, e, null, null, null, {oper:"edit"}, d, null, d); c("tr#" + a + " div.ui-inline-edit, tr#" + a + " div.ui-inline-del", "#" + b).hide(); c("tr#" + a + " div.ui-inline-save, tr#" + a + " div.ui-inline-cancel", "#" + b).show(); break; case "save":c("#" + b).jqGrid("saveRow", a, null, null); c("tr#" + a + " div.ui-inline-edit, tr#" + a + " div.ui-inline-del", "#" +
- b).show(); c("tr#" + a + " div.ui-inline-save, tr#" + a + " div.ui-inline-cancel", "#" + b).hide(); break; case "cancel":c("#" + b).jqGrid("restoreRow", a); c("tr#" + a + " div.ui-inline-edit, tr#" + a + " div.ui-inline-del", "#" + b).show(); c("tr#" + a + " div.ui-inline-save, tr#" + a + " div.ui-inline-cancel", "#" + b).hide(); break}}; c.fn.fmatter.actions = function(a, b){a = {keys:false, editbutton:true, delbutton:true}; isUndefined(b.colModel.formatoptions) || (a = c.extend(a, b.colModel.formatoptions)); var d = b.rowId, e = "", g; if (typeof d == "undefined" ||
- isEmpty(d))return""; if (a.editbutton){g = "onclick=$.fn.fmatter.rowactions('" + d + "','" + b.gid + "','edit'," + a.keys + ");"; e = e + ""); a(o).append(c); (function(){var f = document.createElement("tr"),
- e, m, i, k; b.p.formtype == "horizontal" && a(c).append(f); a.each(b.p.filterModel, function(p){i = document.createElement("td"); a(i).append(""); k = document.createElement("td"); var j = this; if (!this.stype)this.stype = "text"; switch (this.stype){case "select":if (this.surl)a(k).load(this.surl, function(){j.defval && a("select", this).val(j.defval); a("select", this).attr({name:j.index || j.name, id:"sg_" + j.name}); j.sopt && a("select", this).attr(j.sopt); b.p.gridToolbar === true && j.width &&
- a("select", this).width(j.width); b.p.autosearch === true && a("select", this).change(function(){h(); return false})}); else if (j.sopt.value){var r = j.sopt.value, u = document.createElement("select"); a(u).attr({name:j.index || j.name, id:"sg_" + j.name}).attr(j.sopt); var t; if (typeof r === "string"){p = r.split(";"); for (var v = 0; v < p.length; v++){r = p[v].split(":"); t = document.createElement("option"); t.value = r[0]; t.innerHTML = r[1]; if (r[1] == j.defval)t.selected = "selected"; u.appendChild(t)}} else if (typeof r === "object")for (v in r)if (r.hasOwnProperty(v)){p++;
- t = document.createElement("option"); t.value = v; t.innerHTML = r[v]; if (r[v] == j.defval)t.selected = "selected"; u.appendChild(t)}b.p.gridToolbar === true && j.width && a(u).width(j.width); a(k).append(u); b.p.autosearch === true && a(u).change(function(){h(); return false})}break; case "text":u = this.defval?this.defval:""; a(k).append(""); j.sopt && a("input", k).attr(j.sopt); if (b.p.gridToolbar === true && j.width)a.browser.msie?a("input", k).width(j.width -
- 4):a("input", k).width(j.width - 2); b.p.autosearch === true && a("input", k).keypress(function(w){if ((w.charCode?w.charCode:w.keyCode?w.keyCode:0) == 13){h(); return false}return this}); break}if (b.p.formtype == "horizontal"){b.p.gridToolbar === true && b.p.gridNames === false?a(f).append(k):a(f).append(i).append(k); a(f).append(k)} else{e = document.createElement("tr"); a(e).append(i).append(k); a(c).append(e)}}); k = document.createElement("td"); if (b.p.enableSearch === true){m = ""; a(k).append(m); a("input#sButton", k).click(function(){h(); return false})}if (b.p.enableClear === true){m = ""; a(k).append(m); a("input#cButton", k).click(function(){l(); return false})}if (b.p.enableClear === true || b.p.enableSearch === true)if (b.p.formtype == "horizontal")a(f).append(k); else{e = document.createElement("tr"); a(e).append("
").append(k); a(c).append(e)}})(); a(this).append(o);
- this.triggerSearch = h; this.clearSearch = l} else alert("Could not get grid colModel")} else alert("No target grid is set!")})}, filterToolbar:function(g){g = a.extend({autosearch:true, searchOnEnter:true, beforeSearch:null, afterSearch:null, beforeClear:null, afterClear:null, searchurl:"", stringResult:false, groupOp:"AND"}, g || {}); return this.each(function(){function d(h, l){var o = a(h); o[0] && jQuery.each(l, function(){this.data !== undefined?o.bind(this.type, this.data, this.fn):o.bind(this.type, this.fn)})}var b = this, n =
- function(){var h = {}, l = 0, o, c, f = {}; a.each(b.p.colModel, function(){c = this.index || this.name; var j = this.searchoptions && this.searchoptions.sopt?this.searchoptions.sopt[0]:"bw"; switch (this.stype){case "select":if (o = a("select[name=" + c + "]", b.grid.hDiv).val()){h[c] = o; f[c] = j; l++} else try{delete b.p.postData[c]} catch (r){}break; case "text":if (o = a("input[name=" + c + "]", b.grid.hDiv).val()){h[c] = o; f[c] = j; l++} else try{delete b.p.postData[c]} catch (u){}break}}); var e = l > 0?true:false; if (g.stringResult){var m = '{"groupOp":"' +
- g.groupOp + '","rules":[', i = 0; a.each(h, function(j, r){if (i > 0)m += ","; m += '{"field":"' + j + '",'; m += '"op":"' + f[j] + '",'; m += '"data":"' + r + '"}'; i++}); m += "]}"; a.extend(b.p.postData, {filters:m})} else a.extend(b.p.postData, h); var k; if (b.p.searchurl){k = b.p.url; a(b).jqGrid("setGridParam", {url:b.p.searchurl})}var p = false; if (a.isFunction(g.beforeSearch))p = g.beforeSearch.call(b); p || a(b).jqGrid("setGridParam", {search:e}).trigger("reloadGrid", [{page:1}]); k && a(b).jqGrid("setGridParam", {url:k}); a.isFunction(g.afterSearch) &&
- g.afterSearch()}, s = a(""), q; a.each(b.p.colModel, function(){var h = this, l, o, c, f; o = a(" "); l = a(""); this.hidden === true && a(o).css("display", "none"); this.search = this.search === false?false:true; if (typeof this.stype == "undefined")this.stype = "text"; c = a.extend({}, this.searchoptions || {}); if (this.search)switch (this.stype){case "select":if (f =
- this.surl || c.dataUrl)a.ajax(a.extend({url:f, dataType:"html", complete:function(p){if (c.buildSelect !== undefined)(p = c.buildSelect(p)) && a(l).append(p); else a(l).append(p.responseText); c.defaultValue && a("select", l).val(c.defaultValue); a("select", l).attr({name:h.index || h.name, id:"gs_" + h.name}); c.attr && a("select", l).attr(c.attr); a("select", l).css({width:"100%"}); c.dataInit !== undefined && c.dataInit(a("select", l)[0]); c.dataEvents !== undefined && d(a("select", l)[0], c.dataEvents); g.autosearch === true && a("select",
- l).change(function(){n(); return false}); p = null}}, a.jgrid.ajaxOptions, b.p.ajaxSelectOptions || {})); else{var e; if (h.searchoptions && h.searchoptions.value)e = h.searchoptions.value; else if (h.editoptions && h.editoptions.value)e = h.editoptions.value; if (e){f = document.createElement("select"); f.style.width = "100%"; a(f).attr({name:h.index || h.name, id:"gs_" + h.name}); var m, i; if (typeof e === "string"){e = e.split(";"); for (var k = 0; k < e.length; k++){m = e[k].split(":"); i = document.createElement("option"); i.value = m[0]; i.innerHTML =
- m[1]; f.appendChild(i)}} else if (typeof e === "object")for (m in e)if (e.hasOwnProperty(m)){i = document.createElement("option"); i.value = m; i.innerHTML = e[m]; f.appendChild(i)}c.defaultValue && a(f).val(c.defaultValue); c.attr && a(f).attr(c.attr); c.dataInit !== undefined && c.dataInit(f); c.dataEvents !== undefined && d(f, c.dataEvents); a(l).append(f); g.autosearch === true && a(f).change(function(){n(); return false})}}break; case "text":f = c.defaultValue?c.defaultValue:""; a(l).append(""); c.attr && a("input", l).attr(c.attr); c.dataInit !== undefined && c.dataInit(a("input", l)[0]); c.dataEvents !== undefined && d(a("input", l)[0], c.dataEvents); if (g.autosearch === true)g.searchOnEnter?a("input", l).keypress(function(p){if ((p.charCode?p.charCode:p.keyCode?p.keyCode:0) == 13){n(); return false}return this}):a("input", l).keydown(function(p){switch (p.which){case 9:case 16:case 37:case 38:case 39:case 40:case 27:break; default:q && clearTimeout(q); q = setTimeout(function(){n()},
- 500)}}); break}a(o).append(l); a(s).append(o)}); a("table thead", b.grid.hDiv).append(s); this.triggerToolbar = n; this.clearToolbar = function(h){var l = {}, o, c = 0, f; h = typeof h != "boolean"?true:h; a.each(b.p.colModel, function(){o = this.searchoptions && this.searchoptions.defaultValue?this.searchoptions.defaultValue:""; f = this.index || this.name; switch (this.stype){case "select":var j; a("select[name=" + f + "] option", b.grid.hDiv).each(function(t){if (t === 0)this.selected = true; if (a(this).text() == o){this.selected = true; j = a(this).val();
- return false}}); if (j){l[f] = j; c++} else try{delete b.p.postData[f]} catch (r){}break; case "text":a("input[name=" + f + "]", b.grid.hDiv).val(o); if (o){l[f] = o; c++} else try{delete b.p.postData[f]} catch (u){}break}}); var e = c > 0?true:false; if (g.stringResult){var m = '{"groupOp":"' + g.groupOp + '","rules":[', i = 0; a.each(l, function(j, r){if (i > 0)m += ","; m += '{"field":"' + j + '",'; m += '"op":"eq",'; m += '"data":"' + r + '"}'; i++}); m += "]}"; a.extend(b.p.postData, {filters:m})} else a.extend(b.p.postData, l); var k; if (b.p.searchurl){k = b.p.url;
- a(b).jqGrid("setGridParam", {url:b.p.searchurl})}var p = false; if (a.isFunction(g.beforeClear))p = g.beforeClear.call(b); p || h && a(b).jqGrid("setGridParam", {search:e}).trigger("reloadGrid", [{page:1}]); k && a(b).jqGrid("setGridParam", {url:k}); a.isFunction(g.afterClear) && g.afterClear()}; this.toggleToolbar = function(){var h = a("tr.ui-search-toolbar", b.grid.hDiv); h.css("display") == "none"?h.show():h.hide()}})}})})(jQuery);
- var showModal = function(a){a.w.show()}, closeModal = function(a){a.w.hide().attr("aria-hidden", "true"); a.o && a.o.remove()}, hideModal = function(a, b){b = jQuery.extend({jqm:true, gb:""}, b || {}); if (b.onClose){var c = b.onClose(a); if (typeof c == "boolean" && !c)return}if (jQuery.fn.jqm && b.jqm === true)jQuery(a).attr("aria-hidden", "true").jqmHide(); else{if (b.gb != "")try{jQuery(".jqgrid-overlay:first", b.gb).hide()} catch (e){}jQuery(a).hide().attr("aria-hidden", "true")}};
- function findPos(a){var b = 0, c = 0; if (a.offsetParent){do{b += a.offsetLeft; c += a.offsetTop}while (a = a.offsetParent)}return[b, c]}
-var createModal = function(a, b, c, e, f, h){var d = document.createElement("div"), g; g = jQuery(c.gbox).attr("dir") == "rtl"?true:false; d.className = "ui-widget ui-widget-content ui-corner-all ui-jqdialog"; d.id = a.themodal; var i = document.createElement("div"); i.className = "ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"; i.id = a.modalhead; jQuery(i).append("" + c.caption + ""); var j = jQuery("").hover(function(){j.addClass("ui-state-hover")},
- function(){j.removeClass("ui-state-hover")}).append(""); jQuery(i).append(j); if (g){d.dir = "rtl"; jQuery(".ui-jqdialog-title", i).css("float", "right"); jQuery(".ui-jqdialog-titlebar-close", i).css("left", "0.3em")} else{d.dir = "ltr"; jQuery(".ui-jqdialog-title", i).css("float", "left"); jQuery(".ui-jqdialog-titlebar-close", i).css("right", "0.3em")}var l = document.createElement("div"); jQuery(l).addClass("ui-jqdialog-content ui-widget-content").attr("id", a.modalcontent);
- jQuery(l).append(b); d.appendChild(l); jQuery(d).prepend(i); h === true?jQuery("body").append(d):jQuery(d).insertBefore(e); if (typeof c.jqModal === "undefined")c.jqModal = true; b = {}; if (jQuery.fn.jqm && c.jqModal === true){if (c.left === 0 && c.top === 0){e = []; e = findPos(f); c.left = e[0] + 4; c.top = e[1] + 4}b.top = c.top + "px"; b.left = c.left} else if (c.left !== 0 || c.top !== 0){b.left = c.left; b.top = c.top + "px"}jQuery("a.ui-jqdialog-titlebar-close", i).click(function(){var n = jQuery("#" + a.themodal).data("onClose") || c.onClose, k = jQuery("#" + a.themodal).data("gbox") ||
- c.gbox; hideModal("#" + a.themodal, {gb:k, jqm:c.jqModal, onClose:n}); return false}); if (c.width === 0 || !c.width)c.width = 300; if (c.height === 0 || !c.height)c.height = 200; if (!c.zIndex)c.zIndex = 950; f = 0; if (g && b.left && !h){f = jQuery(c.gbox).width() - (!isNaN(c.width)?parseInt(c.width, 10):0) - 8; b.left = parseInt(b.left, 10) + parseInt(f, 10)}if (b.left)b.left += "px"; jQuery(d).css(jQuery.extend({width:isNaN(c.width)?"auto":c.width + "px", height:isNaN(c.height)?"auto":c.height + "px", zIndex:c.zIndex, overflow:"hidden"}, b)).attr({tabIndex:"-1",
- role:"dialog", "aria-labelledby":a.modalhead, "aria-hidden":"true"}); if (typeof c.drag == "undefined")c.drag = true; if (typeof c.resize == "undefined")c.resize = true; if (c.drag){jQuery(i).css("cursor", "move"); if (jQuery.fn.jqDrag)jQuery(d).jqDrag(i); else try{jQuery(d).draggable({handle:jQuery("#" + i.id)})} catch (q){}}if (c.resize)if (jQuery.fn.jqResize){jQuery(d).append(""); jQuery("#" + a.themodal).jqResize(".jqResize",
- a.scrollelm?"#" + a.scrollelm:false)} else try{jQuery(d).resizable({handles:"se, sw", alsoResize:a.scrollelm?"#" + a.scrollelm:false})} catch (o){}c.closeOnEscape === true && jQuery(d).keydown(function(n){if (n.which == 27){n = jQuery("#" + a.themodal).data("onClose") || c.onClose; hideModal(this, {gb:c.gbox, jqm:c.jqModal, onClose:n})}})}, viewModal = function(a, b){b = jQuery.extend({toTop:true, overlay:10, modal:false, onShow:showModal, onHide:closeModal, gbox:"", jqm:true, jqM:true}, b || {}); if (jQuery.fn.jqm && b.jqm === true)b.jqM?jQuery(a).attr("aria-hidden",
- "false").jqm(b).jqmShow():jQuery(a).attr("aria-hidden", "false").jqmShow(); else{if (b.gbox != ""){jQuery(".jqgrid-overlay:first", b.gbox).show(); jQuery(a).data("gbox", b.gbox)}jQuery(a).show().attr("aria-hidden", "false"); try{jQuery(":input:visible", a)[0].focus()} catch (c){}}};
- function info_dialog(a, b, c, e){var f = {width:290, height:"auto", dataheight:"auto", drag:true, resize:false, caption:"" + a + "", left:250, top:170, zIndex:1E3, jqModal:true, modal:false, closeOnEscape:true, align:"center", buttonalign:"center", buttons:[]}; jQuery.extend(f, e || {}); var h = f.jqModal; if (jQuery.fn.jqm && !h)h = false; a = ""; if (f.buttons.length > 0)for (e = 0; e < f.buttons.length; e++){if (typeof f.buttons[e].id == "undefined")f.buttons[e].id = "info_button_" + e; a += "" +
- f.buttons[e].text + ""}e = isNaN(f.dataheight)?f.dataheight:f.dataheight + "px"; var d = " "; if (g != "_empty")G = a(n).jqGrid("getInd", g); a(n.p.colModel).each(function(U){E = this.name; P = (A = this.editrules && this.editrules.edithidden === true?false:this.hidden === true?true:false)?"style='display:none'":""; if (E !== "cb" && E !== "subgrid" && this.editable === true && E !== "rn"){if (G === false)x = ""; else if (E == n.p.ExpandColumn &&
- n.p.treeGrid === true)x = a("td:eq(" + U + ")", n.rows[G]).text(); else try{x = a.unformat(a("td:eq(" + U + ")", n.rows[G]), {rowId:g, colModel:this}, U)} catch (ca){x = a("td:eq(" + U + ")", n.rows[G]).html()}var W = a.extend({}, this.editoptions || {}, {id:E, name:E}), X = a.extend({}, {elmprefix:"", elmsuffix:"", rowabove:false, rowcontent:""}, this.formoptions || {}), ba = parseInt(X.rowpos, 10) || M + 1, da = parseInt((parseInt(X.colpos, 10) || 1) * 2, 10); if (g == "_empty" && W.defaultValue)x = a.isFunction(W.defaultValue)?W.defaultValue():W.defaultValue; if (!this.edittype)this.edittype =
- "text"; if (f.p.autoencode)x = a.jgrid.htmlDecode(x); C = createEl(this.edittype, W, x, false, a.extend({}, a.jgrid.ajaxOptions, n.p.ajaxSelectOptions || {})); if (x == "" && this.edittype == "checkbox")x = a(C).attr("offval"); if (x == "" && this.edittype == "select")x = a("option:eq(0)", C).text(); if (c.checkOnSubmit || c.checkOnUpdate)c._savedData[E] = x; a(C).addClass("FormElement"); B = a(v).find("tr[rowpos=" + ba + "]"); if (X.rowabove){W = a(" "); a(v).append(W); W[0].rp = ba}if (B.length ===
- 0){B = a("" + X.rowcontent + " ").addClass("FormData").attr("id", "tr_" + E); a(B).append(V); a(v).append(B); B[0].rp = ba}a("td:eq(" + (da - 2) + ")", B[0]).html(typeof X.label === "undefined"?n.p.colNames[U]:X.label); a("td:eq(" + (da - 1) + ")", B[0]).append(X.elmprefix).append(C).append(X.elmsuffix); T[M] = U; M++}}); if (M > 0){R = a(" "); R[0].rp = M + 999; a(v).append(R); if (c.checkOnSubmit || c.checkOnUpdate)c._savedData[n.p.id + "_id"] = g}return T}function h(g, n, v){var r, E = 0, A, B, M, x, P; if (c.checkOnSubmit || c.checkOnUpdate){c._savedData = {}; c._savedData[n.p.id + "_id"] = g}var C = n.p.colModel; if (g == "_empty"){a(C).each(function(){r = this.name; M = a.extend({}, this.editoptions || {}); B = a("#" + a.jgrid.jqID(r), "#" + v); if (B[0] != null){x = ""; if (M.defaultValue){x = a.isFunction(M.defaultValue)?M.defaultValue():M.defaultValue; if (B[0].type == "checkbox"){P =
- x.toLowerCase(); if (P.search(/(false|0|no|off|undefined)/i) < 0 && P !== ""){B[0].checked = true; B[0].defaultChecked = true; B[0].value = x} else B.attr({checked:"", defaultChecked:""})} else B.val(x)} else if (B[0].type == "checkbox"){B[0].checked = false; B[0].defaultChecked = false; x = a(B).attr("offval")} else if (B[0].type.substr(0, 6) == "select")B[0].selectedIndex = 0; else B.val(x); if (c.checkOnSubmit === true || c.checkOnUpdate)c._savedData[r] = x}}); a("#id_g", "#" + v).val(g)} else{var T = a(n).jqGrid("getInd", g, true); if (T){a("td", T).each(function(G){r =
- C[G].name; if (r !== "cb" && r !== "subgrid" && r !== "rn" && C[G].editable === true){if (r == n.p.ExpandColumn && n.p.treeGrid === true)A = a(this).text(); else try{A = a.unformat(this, {rowId:g, colModel:C[G]}, G)} catch (V){A = a(this).html()}if (f.p.autoencode)A = a.jgrid.htmlDecode(A); if (c.checkOnSubmit === true || c.checkOnUpdate)c._savedData[r] = A; r = a.jgrid.jqID(r); switch (C[G].edittype){case "password":case "text":case "button":case "image":a("#" + r, "#" + v).val(A); break; case "textarea":if (A == " " || A == " " || A.length == 1 && A.charCodeAt(0) ==
- 160)A = ""; a("#" + r, "#" + v).val(A); break; case "select":var R = A.split(","); R = a.map(R, function(ca){return a.trim(ca)}); a("#" + r + " option", "#" + v).each(function(){this.selected = !C[G].editoptions.multiple && (R[0] == a.trim(a(this).text()) || R[0] == a.trim(a(this).val()))?true:C[G].editoptions.multiple?a.inArray(a.trim(a(this).text()), R) > - 1 || a.inArray(a.trim(a(this).val()), R) > - 1?true:false:false}); break; case "checkbox":A += ""; if (C[G].editoptions && C[G].editoptions.value)if (C[G].editoptions.value.split(":")[0] == A){a("#" +
- r, "#" + v).attr("checked", true); a("#" + r, "#" + v).attr("defaultChecked", true)} else{a("#" + r, "#" + v).attr("checked", false); a("#" + r, "#" + v).attr("defaultChecked", "")} else{A = A.toLowerCase(); if (A.search(/(false|0|no|off|undefined)/i) < 0 && A !== ""){a("#" + r, "#" + v).attr("checked", true); a("#" + r, "#" + v).attr("defaultChecked", true)} else{a("#" + r, "#" + v).attr("checked", false); a("#" + r, "#" + v).attr("defaultChecked", "")}}break; case "custom":try{if (C[G].editoptions && a.isFunction(C[G].editoptions.custom_value))C[G].editoptions.custom_value(a("#" +
- r, "#" + v), "set", A); else throw"e1"; } catch (U){U == "e1"?info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.nodefined, jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap, U.message, jQuery.jgrid.edit.bClose)}break}E++}}); E > 0 && a("#id_g", "#" + j).val(g)}}}function p(){var g, n = [true, "", ""], v = {}, r = f.p.prmNames, E, A; if (a.isFunction(c.beforeCheckValues)){var B = c.beforeCheckValues(k, a("#" + e), k[f.p.id + "_id"] == "_empty"?r.addoper:r.editoper); if (B && typeof B === "object")k = B}for (var M in k)if (k.hasOwnProperty(M)){n =
- checkValues(k[M], M, f); if (n[0] === false)break}if (n[0]){if (a.isFunction(c.onclickSubmit))v = c.onclickSubmit(c, k) || {}; if (a.isFunction(c.beforeSubmit))n = c.beforeSubmit(k, a("#" + e))}if (n[0] && !c.processing){c.processing = true; a("#sData", "#" + j + "_2").addClass("ui-state-active"); A = r.oper; E = r.id; k[A] = a.trim(k[f.p.id + "_id"]) == "_empty"?r.addoper:r.editoper; if (k[A] != r.addoper)k[E] = k[f.p.id + "_id"]; else if (k[E] === undefined)k[E] = k[f.p.id + "_id"]; delete k[f.p.id + "_id"]; k = a.extend(k, c.editData, v); v = a.extend({url:c.url?
- c.url:a(f).jqGrid("getGridParam", "editurl"), type:c.mtype, data:a.isFunction(c.serializeEditData)?c.serializeEditData(k):k, complete:function(x, P){if (P != "success"){n[0] = false; n[1] = a.isFunction(c.errorTextFormat)?c.errorTextFormat(x):P + " Status: '" + x.statusText + "'. Error code: " + x.status} else if (a.isFunction(c.afterSubmit))n = c.afterSubmit(x, k); if (n[0] === false){a("#FormError>td", "#" + j).html(n[1]); a("#FormError", "#" + j).show()} else{a.each(f.p.colModel, function(){if (i[this.name] && this.formatter && this.formatter ==
- "select")try{delete i[this.name]} catch (G){}}); k = a.extend(k, i); f.p.autoencode && a.each(k, function(G, V){k[G] = a.jgrid.htmlDecode(V)}); if (k[A] == r.addoper){n[2] || (n[2] = parseInt(f.p.records, 10) + 1); k[E] = n[2]; if (c.closeAfterAdd){if (c.reloadAfterSubmit)a(f).trigger("reloadGrid"); else{a(f).jqGrid("addRowData", n[2], k, b.addedrow); a(f).jqGrid("setSelection", n[2])}hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose})} else if (c.clearAfterAdd){c.reloadAfterSubmit?a(f).trigger("reloadGrid"):a(f).jqGrid("addRowData",
- n[2], k, b.addedrow); h("_empty", f, e)} else c.reloadAfterSubmit?a(f).trigger("reloadGrid"):a(f).jqGrid("addRowData", n[2], k, b.addedrow)} else{if (c.reloadAfterSubmit){a(f).trigger("reloadGrid"); c.closeAfterEdit || setTimeout(function(){a(f).jqGrid("setSelection", k[E])}, 1E3)} else f.p.treeGrid === true?a(f).jqGrid("setTreeRow", k[E], k):a(f).jqGrid("setRowData", k[E], k); c.closeAfterEdit && hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose})}if (a.isFunction(c.afterComplete)){g = x; setTimeout(function(){c.afterComplete(g,
- k, a("#" + e)); g = null}, 500)}}c.processing = false; if (c.checkOnSubmit || c.checkOnUpdate){a("#" + e).data("disabled", false); if (c._savedData[f.p.id + "_id"] != "_empty")for (var C in c._savedData)if (k[C])c._savedData[C] = k[C]}a("#sData", "#" + j + "_2").removeClass("ui-state-active"); try{a(":input:visible", "#" + e)[0].focus()} catch (T){}}, error:function(x, P, C){a("#FormError>td", "#" + j).html(P + " : " + C); a("#FormError", "#" + j).show(); c.processing = false; a("#" + e).data("disabled", false); a("#sData", "#" + j + "_2").removeClass("ui-state-active")}},
- a.jgrid.ajaxOptions, c.ajaxEditOptions); if (!v.url && !c.useDataProxy)if (a.isFunction(f.p.dataProxy))c.useDataProxy = true; else{n[0] = false; n[1] += " " + a.jgrid.errors.nourl}if (n[0])c.useDataProxy?f.p.dataProxy.call(f, v, "set_" + f.p.id):a.ajax(v)}if (n[0] === false){a("#FormError>td", "#" + j).html(n[1]); a("#FormError", "#" + j).show()}}function H(g, n){var v = false, r; for (r in g)if (g[r] != n[r]){v = true; break}return v}var f = this; if (f.grid && d){var l = f.p.id, e = "FrmGrid_" + l, j = "TblGrid_" + l, m = {themodal:"editmod" + l, modalhead:"edithd" +
- l, modalcontent:"editcnt" + l, scrollelm:e}, u = a.isFunction(c.beforeShowForm)?c.beforeShowForm:false, Q = a.isFunction(c.afterShowForm)?c.afterShowForm:false, o = a.isFunction(c.beforeInitData)?c.beforeInitData:false, s = a.isFunction(c.onInitializeForm)?c.onInitializeForm:false, y = 1, J = 0, k, i, w, O; if (d == "new"){d = "_empty"; b.caption = b.addCaption} else b.caption = b.editCaption; b.recreateForm === true && a("#" + m.themodal).html() != null && a("#" + m.themodal).remove(); var S = true; if (b.checkOnUpdate && b.jqModal && !b.modal)S = false; if (a("#" +
- m.themodal).html() != null){a(".ui-jqdialog-title", "#" + m.modalhead).html(b.caption); a("#FormError", "#" + j).hide(); if (c.topinfo){a(".topinfo", "#" + j + "_2").html(c.topinfo); a(".tinfo", "#" + j + "_2").show()} else a(".tinfo", "#" + j + "_2").hide(); if (c.bottominfo){a(".bottominfo", "#" + j + "_2").html(c.bottominfo); a(".binfo", "#" + j + "_2").show()} else a(".binfo", "#" + j + "_2").hide(); o && o(a("#" + e)); h(d, f, e); d == "_empty" || !c.viewPagerButtons?a("#pData, #nData", "#" + j + "_2").hide():a("#pData, #nData", "#" + j + "_2").show(); if (c.processing ===
- true){c.processing = false; a("#sData", "#" + j + "_2").removeClass("ui-state-active")}if (a("#" + e).data("disabled") === true){a(".confirm", "#" + m.themodal).hide(); a("#" + e).data("disabled", false)}u && u(a("#" + e)); a("#" + m.themodal).data("onClose", c.onClose); viewModal("#" + m.themodal, {gbox:"#gbox_" + l, jqm:b.jqModal, jqM:false, closeoverlay:S, modal:b.modal}); S || a(".jqmOverlay").click(function(){if (!t())return false; hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false}); Q && Q(a("#" + e))} else{a(f.p.colModel).each(function(){var g =
- this.formoptions; y = Math.max(y, g?g.colpos || 0:0); J = Math.max(J, g?g.rowpos || 0:0)}); var I = isNaN(b.dataheight)?b.dataheight:b.dataheight + "px", K; I = a("").data("disabled", false); var L = a(" "); a(I).append(L); K = a(" "); K[0].rp = 0; a(L).append(K); K = a(" "); K[0].rp = 0; a(L).append(K); o && o(a("#" + e)); K = (o = f.p.direction == "rtl"?true:false)?"nData":"pData"; var N = o?"pData":"nData"; z(d, f, L, y); K = ""; N = "";
- var Z = "" + b.bSubmit + "", $ = "" + b.bCancel + ""; K = "
"; if (J > 0){var aa = []; a.each(a(L)[0].rows, function(g, n){aa[g] = n}); aa.sort(function(g, n){if (g.rp > n.rp)return 1; if (g.rp < n.rp)return - 1; return 0}); a.each(aa, function(g, n){a("tbody", L).append(n)})}b.gbox = "#gbox_" + l; var Y = false; if (b.closeOnEscape === true){b.closeOnEscape = false; Y = true}I = a("").append(I).append(K); createModal(m, I, b, "#gview_" + f.p.id, a("#gview_" + f.p.id)[0]); if (o){a("#pData, #nData", "#" + j + "_2").css("float", "right"); a(".EditButton", "#" + j +
- "_2").css("text-align", "left")}c.topinfo && a(".tinfo", "#" + j + "_2").show(); c.bottominfo && a(".binfo", "#" + j + "_2").show(); K = I = null; a("#" + m.themodal).keydown(function(g){var n = g.target; if (a("#" + e).data("disabled") === true)return false; if (c.savekey[0] === true && g.which == c.savekey[1])if (n.tagName != "TEXTAREA"){a("#sData", "#" + j + "_2").trigger("click"); return false}if (g.which === 27){if (!t())return false; Y && hideModal(this, {gb:b.gbox, jqm:b.jqModal, onClose:c.onClose}); return false}if (c.navkeys[0] === true){if (a("#id_g",
- "#" + j).val() == "_empty")return true; if (g.which == c.navkeys[1]){a("#pData", "#" + j + "_2").trigger("click"); return false}if (g.which == c.navkeys[2]){a("#nData", "#" + j + "_2").trigger("click"); return false}}}); if (b.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span", "#" + m.themodal).removeClass("jqmClose"); a("a.ui-jqdialog-titlebar-close", "#" + m.themodal).unbind("click").click(function(){if (!t())return false; hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false})}b.saveicon = a.extend([true,
- "left", "ui-icon-disk"], b.saveicon); b.closeicon = a.extend([true, "left", "ui-icon-close"], b.closeicon); if (b.saveicon[0] === true)a("#sData", "#" + j + "_2").addClass(b.saveicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); if (b.closeicon[0] === true)a("#cData", "#" + j + "_2").addClass(b.closeicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); if (c.checkOnSubmit || c.checkOnUpdate){Z =
- "" + b.bYes + ""; N = "" + b.bNo + ""; $ = "" + b.bExit + ""; I = b.zIndex || 999; I++; a(" ").insertAfter("#" + e); a("#sNew", "#" + m.themodal).click(function(){p(); a("#" + e).data("disabled", false); a(".confirm", "#" + m.themodal).hide(); return false}); a("#nNew", "#" + m.themodal).click(function(){a(".confirm", "#" +
- m.themodal).hide(); a("#" + e).data("disabled", false); setTimeout(function(){a(":input", "#" + e)[0].focus()}, 0); return false}); a("#cNew", "#" + m.themodal).click(function(){a(".confirm", "#" + m.themodal).hide(); a("#" + e).data("disabled", false); hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false})}s && s(a("#" + e)); d == "_empty" || !c.viewPagerButtons?a("#pData,#nData", "#" + j + "_2").hide():a("#pData,#nData", "#" + j + "_2").show(); u && u(a("#" + e)); a("#" + m.themodal).data("onClose", c.onClose);
- viewModal("#" + m.themodal, {gbox:"#gbox_" + l, jqm:b.jqModal, closeoverlay:S, modal:b.modal}); S || a(".jqmOverlay").click(function(){if (!t())return false; hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false}); Q && Q(a("#" + e)); a(".fm-button", "#" + m.themodal).hover(function(){a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); a("#sData", "#" + j + "_2").click(function(){k = {}; i = {}; a("#FormError", "#" + j).hide(); F(); if (k[f.p.id + "_id"] == "_empty")p(); else if (b.checkOnSubmit ===
- true){w = a.extend({}, k, i); if (O = H(w, c._savedData)){a("#" + e).data("disabled", true); a(".confirm", "#" + m.themodal).show()} else p()} else p(); return false}); a("#cData", "#" + j + "_2").click(function(){if (!t())return false; hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false}); a("#nData", "#" + j + "_2").click(function(){if (!t())return false; a("#FormError", "#" + j).hide(); var g = D(); g[0] = parseInt(g[0], 10); if (g[0] != - 1 && g[1][g[0] + 1]){a.isFunction(b.onclickPgButtons) && b.onclickPgButtons("next",
- a("#" + e), g[1][g[0]]); h(g[1][g[0] + 1], f, e); a(f).jqGrid("setSelection", g[1][g[0] + 1]); a.isFunction(b.afterclickPgButtons) && b.afterclickPgButtons("next", a("#" + e), g[1][g[0] + 1]); q(g[0] + 1, g[1].length - 1)}return false}); a("#pData", "#" + j + "_2").click(function(){if (!t())return false; a("#FormError", "#" + j).hide(); var g = D(); if (g[0] != - 1 && g[1][g[0] - 1]){a.isFunction(b.onclickPgButtons) && b.onclickPgButtons("prev", a("#" + e), g[1][g[0]]); h(g[1][g[0] - 1], f, e); a(f).jqGrid("setSelection", g[1][g[0] - 1]); a.isFunction(b.afterclickPgButtons) &&
- b.afterclickPgButtons("prev", a("#" + e), g[1][g[0] - 1]); q(g[0] - 1, g[1].length - 1)}return false})}u = D(); q(u[0], u[1].length - 1)}})}, viewGridRow:function(d, b){b = a.extend({top:0, left:0, width:0, height:"auto", dataheight:"auto", modal:false, drag:true, resize:true, jqModal:true, closeOnEscape:false, labelswidth:"30%", closeicon:[], navkeys:[false, 38, 40], onClose:null, beforeShowForm:null, viewPagerButtons:true}, a.jgrid.view, b || {}); return this.each(function(){function q(){if (b.closeOnEscape === true || b.navkeys[0] === true)setTimeout(function(){a(".ui-jqdialog-titlebar-close",
- "#" + l.modalhead).focus()}, 0)}function D(i, w){i === 0?a("#pData", "#" + f + "_2").addClass("ui-state-disabled"):a("#pData", "#" + f + "_2").removeClass("ui-state-disabled"); i == w?a("#nData", "#" + f + "_2").addClass("ui-state-disabled"):a("#nData", "#" + f + "_2").removeClass("ui-state-disabled")}function t(){var i = a(h).jqGrid("getDataIDs"), w = a("#id_g", "#" + f).val(); return[a.inArray(w, i), i]}function F(i, w, O, S){for (var I, K, L, N = 0, Z, $, aa = [], Y = false, g = " "; K += " "; K += "" + (o?N + K:K + N) + " " + Z + $ + " ", n = "", v = ["integer", "number", "currency"], r = 0, E = 0, A, B, M, x = 1; x <= S; x++)n += x == 1?g:" "; a(w.p.colModel).each(function(){K = this.editrules && this.editrules.edithidden === true?false:this.hidden === true?true:false; if (!K && this.align === "right")if (this.formatter && a.inArray(this.formatter, v) !== - 1)r =
- Math.max(r, parseInt(this.width, 10)); else E = Math.max(E, parseInt(this.width, 10))}); A = r !== 0?r:E !== 0?E:0; Y = a(w).jqGrid("getInd", i); a(w.p.colModel).each(function(P){I = this.name; B = false; $ = (K = this.editrules && this.editrules.edithidden === true?false:this.hidden === true?true:false)?"style='display:none'":""; M = typeof this.viewable != "boolean"?true:this.viewable; if (I !== "cb" && I !== "subgrid" && I !== "rn" && M){Z = Y === false?"":I == w.p.ExpandColumn && w.p.treeGrid === true?a("td:eq(" + P + ")", w.rows[Y]).text():a("td:eq(" + P + ")", w.rows[Y]).html();
- B = this.align === "right" && A !== 0?true:false; a.extend({}, this.editoptions || {}, {id:I, name:I}); var C = a.extend({}, {rowabove:false, rowcontent:""}, this.formoptions || {}), T = parseInt(C.rowpos, 10) || N + 1, G = parseInt((parseInt(C.colpos, 10) || 1) * 2, 10); if (C.rowabove){var V = a(" "); a(O).append(V); V[0].rp = T}L = a(O).find("tr[rowpos=" + T + "]"); if (L.length === 0){L = a("" + C.rowcontent + " ").addClass("FormData").attr("id", "trv_" + I); a(L).append(n); a(O).append(L);
- L[0].rp = T}a("td:eq(" + (G - 2) + ")", L[0]).html("" + (typeof C.label === "undefined"?w.p.colNames[P]:C.label) + ""); a("td:eq(" + (G - 1) + ")", L[0]).append("" + Z + "").attr("id", "v_" + I); B && a("td:eq(" + (G - 1) + ") span", L[0]).css({"text-align":"right", width:A + "px"}); aa[N] = P; N++}}); if (N > 0){i = a(" "); i[0].rp = N + 99; a(O).append(i)}return aa}
- function z(i, w){var O, S, I = 0, K, L; if (L = a(w).jqGrid("getInd", i, true)){a("td", L).each(function(N){O = w.p.colModel[N].name; S = w.p.colModel[N].editrules && w.p.colModel[N].editrules.edithidden === true?false:w.p.colModel[N].hidden === true?true:false; if (O !== "cb" && O !== "subgrid" && O !== "rn"){K = O == w.p.ExpandColumn && w.p.treeGrid === true?a(this).text():a(this).html(); a.extend({}, w.p.colModel[N].editoptions || {}); O = a.jgrid.jqID("v_" + O); a("#" + O + " span", "#" + f).html(K); S && a("#" + O, "#" + f).parents("tr:first").hide(); I++}}); I >
- 0 && a("#id_g", "#" + f).val(i)}}var h = this; if (h.grid && d){if (!b.imgpath)b.imgpath = h.p.imgpath; var p = h.p.id, H = "ViewGrid_" + p, f = "ViewTbl_" + p, l = {themodal:"viewmod" + p, modalhead:"viewhd" + p, modalcontent:"viewcnt" + p, scrollelm:H}, e = 1, j = 0; if (a("#" + l.themodal).html() != null){a(".ui-jqdialog-title", "#" + l.modalhead).html(b.caption); a("#FormError", "#" + f).hide(); z(d, h); a.isFunction(b.beforeShowForm) && b.beforeShowForm(a("#" + H)); viewModal("#" + l.themodal, {gbox:"#gbox_" + p, jqm:b.jqModal, jqM:false, modal:b.modal}); q()} else{a(h.p.colModel).each(function(){var i =
- this.formoptions; e = Math.max(e, i?i.colpos || 0:0); j = Math.max(j, i?i.rowpos || 0:0)}); var m = isNaN(b.dataheight)?b.dataheight:b.dataheight + "px", u = a(""), Q = a(" "); a(u).append(Q); F(d, h, Q, e); m = h.p.direction == "rtl"?true:false; var o = "", s = "", y = "" + b.bClose + ""; if (j > 0){var J = []; a.each(a(Q)[0].rows, function(i, w){J[i] = w}); J.sort(function(i, w){if (i.rp > w.rp)return 1;
- if (i.rp < w.rp)return - 1; return 0}); a.each(J, function(i, w){a("tbody", Q).append(w)})}b.gbox = "#gbox_" + p; var k = false; if (b.closeOnEscape === true){b.closeOnEscape = false; k = true}u = a("").append(u).append("
"); createModal(l, u, b, "#gview_" + h.p.id, a("#gview_" + h.p.id)[0]);
- if (m){a("#pData, #nData", "#" + f + "_2").css("float", "right"); a(".EditButton", "#" + f + "_2").css("text-align", "left")}b.viewPagerButtons || a("#pData, #nData", "#" + f + "_2").hide(); u = null; a("#" + l.themodal).keydown(function(i){if (i.which === 27){k && hideModal(this, {gb:b.gbox, jqm:b.jqModal, onClose:b.onClose}); return false}if (b.navkeys[0] === true){if (i.which === b.navkeys[1]){a("#pData", "#" + f + "_2").trigger("click"); return false}if (i.which === b.navkeys[2]){a("#nData", "#" + f + "_2").trigger("click"); return false}}}); b.closeicon =
- a.extend([true, "left", "ui-icon-close"], b.closeicon); if (b.closeicon[0] === true)a("#cData", "#" + f + "_2").addClass(b.closeicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); a.isFunction(b.beforeShowForm) && b.beforeShowForm(a("#" + H)); viewModal("#" + l.themodal, {gbox:"#gbox_" + p, jqm:b.jqModal, modal:b.modal}); a(".fm-button:not(.ui-state-disabled)", "#" + f + "_2").hover(function(){a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")});
- q(); a("#cData", "#" + f + "_2").click(function(){hideModal("#" + l.themodal, {gb:"#gbox_" + p, jqm:b.jqModal, onClose:b.onClose}); return false}); a("#nData", "#" + f + "_2").click(function(){a("#FormError", "#" + f).hide(); var i = t(); i[0] = parseInt(i[0], 10); if (i[0] != - 1 && i[1][i[0] + 1]){a.isFunction(b.onclickPgButtons) && b.onclickPgButtons("next", a("#" + H), i[1][i[0]]); z(i[1][i[0] + 1], h); a(h).jqGrid("setSelection", i[1][i[0] + 1]); a.isFunction(b.afterclickPgButtons) && b.afterclickPgButtons("next", a("#" + H), i[1][i[0] + 1]); D(i[0] + 1, i[1].length -
- 1)}q(); return false}); a("#pData", "#" + f + "_2").click(function(){a("#FormError", "#" + f).hide(); var i = t(); if (i[0] != - 1 && i[1][i[0] - 1]){a.isFunction(b.onclickPgButtons) && b.onclickPgButtons("prev", a("#" + H), i[1][i[0]]); z(i[1][i[0] - 1], h); a(h).jqGrid("setSelection", i[1][i[0] - 1]); a.isFunction(b.afterclickPgButtons) && b.afterclickPgButtons("prev", a("#" + H), i[1][i[0] - 1]); D(i[0] - 1, i[1].length - 1)}q(); return false})}m = t(); D(m[0], m[1].length - 1)}})}, delGridRow:function(d, b){c = b = a.extend({top:0, left:0, width:240, height:"auto",
- dataheight:"auto", modal:false, drag:true, resize:true, url:"", mtype:"POST", reloadAfterSubmit:true, beforeShowForm:null, afterShowForm:null, beforeSubmit:null, onclickSubmit:null, afterSubmit:null, jqModal:true, closeOnEscape:false, delData:{}, delicon:[], cancelicon:[], onClose:null, ajaxDelOptions:{}, processing:false, serializeDelData:null, useDataProxy:false}, a.jgrid.del, b || {}); return this.each(function(){var q = this; if (q.grid)if (d){var D = typeof b.beforeShowForm === "function"?true:false, t = typeof b.afterShowForm ===
- "function"?true:false, F = q.p.id, z = {}, h = "DelTbl_" + F, p, H, f, l, e = {themodal:"delmod" + F, modalhead:"delhd" + F, modalcontent:"delcnt" + F, scrollelm:h}; if (jQuery.isArray(d))d = d.join(); if (a("#" + e.themodal).html() != null){a("#DelData>td", "#" + h).text(d); a("#DelError", "#" + h).hide(); if (c.processing === true){c.processing = false; a("#dData", "#" + h).removeClass("ui-state-active")}D && b.beforeShowForm(a("#" + h)); viewModal("#" + e.themodal, {gbox:"#gbox_" + F, jqm:b.jqModal, jqM:false, modal:b.modal})} else{var j = isNaN(b.dataheight)?b.dataheight:
- b.dataheight + "px"; j = "" + (m?s + o:o + s) + " " + y + " "; j += "
"; j += " "; j += '' + b.msg + " "; j += "
"; b.gbox = "#gbox_" + F; createModal(e, j, b, "#gview_" + q.p.id, a("#gview_" + q.p.id)[0]); a(".fm-button",
- "#" + h + "_2").hover(function(){a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); b.delicon = a.extend([true, "left", "ui-icon-scissors"], b.delicon); b.cancelicon = a.extend([true, "left", "ui-icon-cancel"], b.cancelicon); if (b.delicon[0] === true)a("#dData", "#" + h + "_2").addClass(b.delicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); if (b.cancelicon[0] === true)a("#eData", "#" + h + "_2").addClass(b.cancelicon[1] ==
- "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); a("#dData", "#" + h + "_2").click(function(){var m = [true, ""]; z = {}; var u = a("#DelData>td", "#" + h).text(); if (typeof b.onclickSubmit === "function")z = b.onclickSubmit(c, u) || {}; if (typeof b.beforeSubmit === "function")m = b.beforeSubmit(u); if (m[0] && !c.processing){c.processing = true; a(this).addClass("ui-state-active"); f = q.p.prmNames; p = a.extend({}, c.delData, z); l = f.oper; p[l] = f.deloper; H = f.id; p[H] = u; var Q = a.extend({url:c.url?
- c.url:a(q).jqGrid("getGridParam", "editurl"), type:b.mtype, data:a.isFunction(b.serializeDelData)?b.serializeDelData(p):p, complete:function(o, s){if (s != "success"){m[0] = false; m[1] = a.isFunction(c.errorTextFormat)?c.errorTextFormat(o):s + " Status: '" + o.statusText + "'. Error code: " + o.status} else if (typeof c.afterSubmit === "function")m = c.afterSubmit(o, p); if (m[0] === false){a("#DelError>td", "#" + h).html(m[1]); a("#DelError", "#" + h).show()} else{if (c.reloadAfterSubmit)a(q).trigger("reloadGrid"); else{s = []; s = u.split(",");
- if (q.p.treeGrid === true)try{a(q).jqGrid("delTreeNode", s[0])} catch (y){} else for (var J = 0; J < s.length; J++)a(q).jqGrid("delRowData", s[J]); q.p.selrow = null; q.p.selarrrow = []}a.isFunction(c.afterComplete) && setTimeout(function(){c.afterComplete(o, u)}, 500)}c.processing = false; a("#dData", "#" + h + "_2").removeClass("ui-state-active"); m[0] && hideModal("#" + e.themodal, {gb:"#gbox_" + F, jqm:b.jqModal, onClose:c.onClose})}, error:function(o, s, y){a("#DelError>td", "#" + h).html(s + " : " + y); a("#DelError", "#" + h).show(); c.processing =
- false; a("#dData", "#" + h + "_2").removeClass("ui-state-active")}}, a.jgrid.ajaxOptions, b.ajaxDelOptions); if (!Q.url && !c.useDataProxy)if (a.isFunction(q.p.dataProxy))c.useDataProxy = true; else{m[0] = false; m[1] += " " + a.jgrid.errors.nourl}if (m[0])c.useDataProxy?q.p.dataProxy.call(q, Q, "del_" + q.p.id):a.ajax(Q)}if (m[0] === false){a("#DelError>td", "#" + h).html(m[1]); a("#DelError", "#" + h).show()}return false}); a("#eData", "#" + h + "_2").click(function(){hideModal("#" + e.themodal, {gb:"#gbox_" + F, jqm:b.jqModal, onClose:c.onClose});
- return false}); D && b.beforeShowForm(a("#" + h)); viewModal("#" + e.themodal, {gbox:"#gbox_" + F, jqm:b.jqModal, modal:b.modal})}t && b.afterShowForm(a("#" + h)); b.closeOnEscape === true && setTimeout(function(){a(".ui-jqdialog-titlebar-close", "#" + e.modalhead).focus()}, 0)}})}, navGrid:function(d, b, q, D, t, F, z){b = a.extend({edit:true, editicon:"ui-icon-pencil", add:true, addicon:"ui-icon-plus", del:true, delicon:"ui-icon-trash", search:true, searchicon:"ui-icon-search", refresh:true, refreshicon:"ui-icon-refresh", refreshstate:"firstpage",
- view:false, viewicon:"ui-icon-document", position:"left", closeOnEscape:true, beforeRefresh:null, afterRefresh:null, cloneToTop:false}, a.jgrid.nav, b || {}); return this.each(function(){var h = {themodal:"alertmod", modalhead:"alerthd", modalcontent:"alertcnt"}, p = this, H, f, l; if (!(!p.grid || typeof d != "string")){if (a("#" + h.themodal).html() === null){if (typeof window.innerWidth != "undefined"){H = window.innerWidth; f = window.innerHeight} else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth !=
- "undefined" && document.documentElement.clientWidth !== 0){H = document.documentElement.clientWidth; f = document.documentElement.clientHeight} else{H = 1024; f = 768}createModal(h, "" + ("" + b.bSubmit + "") + " " + ("" + b.bCancel + "") + "
"),
- j, m; if (f === 0){j = d; m = p.p.id; if (j == p.p.toppager){m += "_top"; H = 1}} else{j = p.p.toppager; m = p.p.id + "_top"}p.p.direction == "rtl" && a(e).attr("dir", "rtl").css("float", "right"); if (b.add){D = D || {}; l = a(""); a(l).append(" "); q = q || {}; a(l).append(" "); z = z || {}; a(l).append(" ");
- t = t || {}; a(l).append(" "); if (b.search){l = a(" "); F = F || {}; a(l).append(" "); a(l).append(" "); b.buttonicon.toString().toUpperCase() == "NONE"?a(t).addClass("ui-pg-button ui-corner-all").append(" " + b.sepcontent + " "; a("tr", q).append(D)}}})}, GridToForm:function(d, b){return this.each(function(){var q = this; if (q.grid){var D = a(q).jqGrid("getRowData", d); if (D)for (var t in D)a("[name=" + t + "]", b).is("input:radio") || a("[name=" + t + "]", b).is("input:checkbox")?a("[name=" + t + "]", b).each(function(){a(this).val() == D[t]?a(this).attr("checked", "checked"):a(this).attr("checked",
- "")}):a("[name=" + t + "]", b).val(D[t])}})}, FormToGrid:function(d, b, q, D){return this.each(function(){var t = this; if (t.grid){q || (q = "set"); D || (D = "first"); var F = a(b).serializeArray(), z = {}; a.each(F, function(h, p){z[p.name] = p.value}); if (q == "add")a(t).jqGrid("addRowData", d, z, D); else q == "set" && a(t).jqGrid("setRowData", d, z)}})}})})(jQuery);
- jQuery.fn.searchFilter = function(k, H){function I(e, l, v){this.$ = e; this.add = function(a){a == null?e.find(".ui-add-last").click():e.find(".sf:eq(" + a + ") .ui-add").click(); return this}; this.del = function(a){a == null?e.find(".sf:last .ui-del").click():e.find(".sf:eq(" + a + ") .ui-del").click(); return this}; this.search = function(){e.find(".ui-search").click(); return this}; this.reset = function(){e.find(".ui-reset").click(); return this}; this.close = function(){e.find(".ui-closer").click(); return this}; if (l != null){function C(){jQuery(this).toggleClass("ui-state-hover");
- return false}function D(a){jQuery(this).toggleClass("ui-state-active", a.type == "mousedown"); return false}function m(a, b){return""}function w(a, b, d){return""}function E(a, b){a = e.find("tr.sf td.data " + a); a[0] != null && b(a)}function F(a, b){var d = e.find("tr.sf td.data " + a); d[0] != null && jQuery.each(b, function(){this.data != null?d.bind(this.type, this.data, this.fn):d.bind(this.type, this.fn)})}var f = jQuery.extend({},
- jQuery.fn.searchFilter.defaults, v), n = - 1, r = ""; jQuery.each(f.groupOps, function(){r += m(this.op, this.text)}); r = ""; e.html("").addClass("ui-searchFilter").append("
");
- var x = e.find("tr.sf"), G = x.find("td.fields"), y = x.find("td.ops"), o = x.find("td.data"), s = ""; jQuery.each(f.operators, function(){s += m(this.op, this.text)}); s = w("default", s, true); y.append(s); o.append(""); var t = "", z = false, p = false; jQuery.each(l, function(a){t += m(this.itemval, this.text); if (this.ops != null){z = true; var b = ""; jQuery.each(this.ops, function(){b += m(this.op, this.text)}); b = w("field" + a, b, true); y.append(b)}if (this.dataUrl != null){if (a > n)n = a; p = true;
- var d = this.dataEvents, c = this.dataInit, g = this.buildSelect; jQuery.ajax(jQuery.extend({url:this.dataUrl, complete:function(h){h = g != null?jQuery("").append(g(h)):jQuery("").append(h.responseText); h.find("select").addClass("field" + a).hide(); o.append(h.html()); c && E(".field" + a, c); d && F(".field" + a, d); a == n && e.find("tr.sf td.fields select[name='field']").change()}}, f.ajaxSelectOptions))} else if (this.dataValues != null){p = true; var i = ""; jQuery.each(this.dataValues, function(){i += m(this.value, this.text)});
- i = w("field" + a, i, true); o.append(i)} else if (this.dataEvents != null || this.dataInit != null){p = true; i = ""; o.append(i)}this.dataInit != null && a != n && E(".field" + a, this.dataInit); this.dataEvents != null && a != n && F(".field" + a, this.dataEvents)}); t = ""; G.append(t); l = G.find("select[name='field']"); z?l.change(function(a){var b = a.target.selectedIndex; a = jQuery(a.target).parents("tr.sf").find("td.ops"); a.find("select").removeAttr("name").hide(); b = a.find(".field" +
- b); if (b[0] == null)b = a.find(".default"); b.attr("name", "op").show()}):y.find(".default").attr("name", "op").show(); p?l.change(function(a){var b = a.target.selectedIndex; a = jQuery(a.target).parents("tr.sf").find("td.data"); a.find("select,input").removeClass("vdata").hide(); b = a.find(".field" + b); if (b[0] == null)b = a.find(".default"); b.show().addClass("vdata")}):o.find(".default").show().addClass("vdata"); if (z || p)l.change(); e.find(".ui-state-default").hover(C, C).mousedown(D).mouseup(D); e.find(".ui-closer").click(function(){f.onClose(jQuery(e.selector));
- return false}); e.find(".ui-del").click(function(a){a = jQuery(a.target).parents(".sf"); if (a.siblings(".sf").length > 0){f.datepickerFix === true && jQuery.fn.datepicker !== undefined && a.find(".hasDatepicker").datepicker("destroy"); a.remove()} else{a.find("select[name='field']")[0].selectedIndex = 0; a.find("select[name='op']")[0].selectedIndex = 0; a.find(".data input").val(""); a.find(".data select").each(function(){this.selectedIndex = 0}); a.find("select[name='field']").change()}return false}); e.find(".ui-add").click(function(a){a =
- jQuery(a.target).parents(".sf"); var b = a.clone(true).insertAfter(a); b.find(".ui-state-default").removeClass("ui-state-hover ui-state-active"); if (f.clone){b.find("select[name='field']")[0].selectedIndex = a.find("select[name='field']")[0].selectedIndex; if (b.find("select[name='op']")[0] != null)b.find("select[name='op']").focus()[0].selectedIndex = a.find("select[name='op']")[0].selectedIndex; var d = b.find("select.vdata"); if (d[0] != null)d[0].selectedIndex = a.find("select.vdata")[0].selectedIndex} else{b.find(".data input").val("");
- b.find("select[name='field']").focus()}f.datepickerFix === true && jQuery.fn.datepicker !== undefined && a.find(".hasDatepicker").each(function(){var c = jQuery.data(this, "datepicker").settings; b.find("#" + this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(c)}); b.find("select[name='field']").change(); return false}); e.find(".ui-search").click(function(){var a = jQuery(e.selector), b, d = a.find("select[name='groupOp'] :selected").val(); b = f.stringResult?'{"groupOp":"' + d + '","rules":[':{groupOp:d,
- rules:[]}; a.find(".sf").each(function(c){var g = jQuery(this).find("select[name='field'] :selected").val(), i = jQuery(this).find("select[name='op'] :selected").val(), h = jQuery(this).find("input.vdata,select.vdata :selected").val(); h += ""; h = h.replace(/\\/g, "\\\\").replace(/\"/g, '\\"'); if (f.stringResult){if (c > 0)b += ","; b += '{"field":"' + g + '",'; b += '"op":"' + i + '",'; b += '"data":"' + h + '"}'} else b.rules.push({field:g, op:i, data:h})}); if (f.stringResult)b += "]}"; f.onSearch(b); return false}); e.find(".ui-reset").click(function(){var a =
- jQuery(e.selector); a.find(".ui-del").click(); a.find("select[name='groupOp']")[0].selectedIndex = 0; f.onReset(); return false}); e.find(".ui-add-last").click(function(){var a = jQuery(e.selector + " .sf:last"), b = a.clone(true).insertAfter(a); b.find(".ui-state-default").removeClass("ui-state-hover ui-state-active"); b.find(".data input").val(""); b.find("select[name='field']").focus(); f.datepickerFix === true && jQuery.fn.datepicker !== undefined && a.find(".hasDatepicker").each(function(){var d = jQuery.data(this, "datepicker").settings;
- b.find("#" + this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(d)}); b.find("select[name='field']").change(); return false}); this.setGroupOp = function(a){selDOMobj = this.$.find("select[name='groupOp']")[0]; var b = {}, d = selDOMobj.options.length, c; for (c = 0; c < d; c++)b[selDOMobj.options[c].value] = c; selDOMobj.selectedIndex = b[a]; $(selDOMobj).change()}; this.setFilter = function(a){var b = a.sfref; a = a.filter; var d = [], c, g, i, h, j = {}; selDOMobj = b.find("select[name='field']")[0]; c = 0; for (i = selDOMobj.options.length; c <
- i; c++){j[selDOMobj.options[c].value] = {index:c, ops:{}}; d.push(selDOMobj.options[c].value)}c = 0; for (i = d.length; c < i; c++){if (selDOMobj = b.find(".ops > select[class='field" + c + "']")[0]){g = 0; for (h = selDOMobj.options.length; g < h; g++)j[d[c]].ops[selDOMobj.options[g].value] = g}if (selDOMobj = b.find(".data > select[class='field" + c + "']")[0]){j[d[c]].data = {}; g = 0; for (h = selDOMobj.options.length; g < h; g++)j[d[c]].data[selDOMobj.options[g].value] = g}}var u, q, A, B; d = a.field; if (j[d])u = j[d].index; if (u != null){q = j[d].ops[a.op]; if (q ===
- undefined){c = 0; for (i = v.operators.length; c < i; c++)if (v.operators[c].op == a.op){q = c; break}}A = a.data; B = j[d].data == null? - 1:j[d].data[A]}if (u != null && q != null && B != null){b.find("select[name='field']")[0].selectedIndex = u; b.find("select[name='field']").change(); b.find("select[name='op']")[0].selectedIndex = q; b.find("input.vdata").val(A); if (b = b.find("select.vdata")[0])b.selectedIndex = B; return true} else return false}}}return new I(this, k, H)}; jQuery.fn.searchFilter.version = "1.2.9";
- jQuery.fn.searchFilter.defaults = {clone:true, datepickerFix:true, onReset:function(k){alert("Reset Clicked. Data Returned: " + k)}, onSearch:function(k){alert("Search Clicked. Data Returned: " + k)}, onClose:function(k){k.hide()}, groupOps:[{op:"AND", text:"all"}, {op:"OR", text:"any"}], operators:[{op:"eq", text:"is equal to"}, {op:"ne", text:"is not equal to"}, {op:"lt", text:"is less than"}, {op:"le", text:"is less or equal to"}, {op:"gt", text:"is greater than"}, {op:"ge", text:"is greater or equal to"}, {op:"in", text:"is in"},
- {op:"ni", text:"is not in"}, {op:"bw", text:"begins with"}, {op:"bn", text:"does not begin with"}, {op:"ew", text:"ends with"}, {op:"en", text:"does not end with"}, {op:"cn", text:"contains"}, {op:"nc", text:"does not contain"}], matchText:"match", rulesText:"rules", resetText:"Reset", searchText:"Search", stringResult:true, windowTitle:"Search Rules", ajaxSelectOptions:{}};
- (function(a){a.jgrid.extend({editRow:function(d, t, i, n, o, u, s, c, f){return this.each(function(){var b = this, k, l, r = 0, p = null, q = {}, h, g; if (b.grid){h = a(b).jqGrid("getInd", d, true); if (h !== false)if ((a(h).attr("editable") || "0") == "0" && !a(h).hasClass("not-editable-row")){g = b.p.colModel; a("td", h).each(function(j){k = g[j].name; var v = b.p.treeGrid === true && k == b.p.ExpandColumn; if (v)l = a("span:first", this).html(); else try{l = a.unformat(this, {rowId:d, colModel:g[j]}, j)} catch (m){l = a(this).html()}if (k != "cb" && k != "subgrid" && k !=
- "rn"){if (b.p.autoencode)l = a.jgrid.htmlDecode(l); q[k] = l; if (g[j].editable === true){if (p === null)p = j; v?a("span:first", this).html(""):a(this).html(""); var e = a.extend({}, g[j].editoptions || {}, {id:d + "_" + k, name:k}); if (!g[j].edittype)g[j].edittype = "text"; e = createEl(g[j].edittype, e, l, true, a.extend({}, a.jgrid.ajaxOptions, b.p.ajaxSelectOptions || {})); a(e).addClass("editable"); v?a("span:first", this).append(e):a(this).append(e); g[j].edittype == "select" && g[j].editoptions.multiple === true && a.browser.msie && a(e).width(a(e).width());
- r++}}}); if (r > 0){q.id = d; b.p.savedRow.push(q); a(h).attr("editable", "1"); a("td:eq(" + p + ") input", h).focus(); t === true && a(h).bind("keydown", function(j){j.keyCode === 27 && a(b).jqGrid("restoreRow", d, f); if (j.keyCode === 13){if (j.target.tagName == "TEXTAREA")return true; a(b).jqGrid("saveRow", d, n, o, u, s, c, f); return false}j.stopPropagation()}); a.isFunction(i) && i(d)}}}})}, saveRow:function(d, t, i, n, o, u, s){return this.each(function(){var c = this, f, b = {}, k = {}, l, r, p, q; if (c.grid){q = a(c).jqGrid("getInd", d, true); if (q !== false){l =
- a(q).attr("editable"); i = i?i:c.p.editurl; if (l === "1"){var h; a("td", q).each(function(m){h = c.p.colModel[m]; f = h.name; if (f != "cb" && f != "subgrid" && h.editable === true && f != "rn"){switch (h.edittype){case "checkbox":var e = ["Yes", "No"]; if (h.editoptions)e = h.editoptions.value.split(":"); b[f] = a("input", this).attr("checked")?e[0]:e[1]; break; case "text":case "password":case "textarea":case "button":b[f] = a("input, textarea", this).val(); break; case "select":if (h.editoptions.multiple){e = a("select", this); var x = []; b[f] = a(e).val();
- b[f] = b[f]?b[f].join(","):""; a("select > option:selected", this).each(function(y, z){x[y] = a(z).text()}); k[f] = x.join(",")} else{b[f] = a("select>option:selected", this).val(); k[f] = a("select>option:selected", this).text()}if (h.formatter && h.formatter == "select")k = {}; break; case "custom":try{if (h.editoptions && a.isFunction(h.editoptions.custom_value)){b[f] = h.editoptions.custom_value(a(".customelement", this), "get"); if (b[f] === undefined)throw"e2"; } else throw"e1"; } catch (w){w == "e1" && info_dialog(jQuery.jgrid.errors.errcap,
- "function 'custom_value' " + a.jgrid.edit.msg.nodefined, jQuery.jgrid.edit.bClose); w == "e2"?info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.novalue, jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap, w.message, jQuery.jgrid.edit.bClose)}break}p = checkValues(b[f], m, c); if (p[0] === false){p[1] = b[f] + " " + p[1]; return false}if (c.p.autoencode)b[f] = a.jgrid.htmlEncode(b[f])}}); if (p[0] === false)try{var g = findPos(a("#" + d)[0]); info_dialog(a.jgrid.errors.errcap, p[1], a.jgrid.edit.bClose,
- {left:g[0], top:g[1]})} catch (j){alert(p[1])} else{if (b){var v; g = c.p.prmNames; v = g.oper; l = g.id; b[v] = g.editoper; b[l] = d; if (typeof c.p.inlineData == "undefined")c.p.inlineData = {}; if (typeof n == "undefined")n = {}; b = a.extend({}, b, c.p.inlineData, n)}if (i == "clientArray"){b = a.extend({}, b, k); c.p.autoencode && a.each(b, function(m, e){b[m] = a.jgrid.htmlDecode(e)}); l = a(c).jqGrid("setRowData", d, b); a(q).attr("editable", "0"); for (g = 0; g < c.p.savedRow.length; g++)if (c.p.savedRow[g].id == d){r = g; break}r >= 0 && c.p.savedRow.splice(r, 1);
- a.isFunction(o) && o(d, l)} else{a("#lui_" + c.p.id).show(); a.ajax(a.extend({url:i, data:a.isFunction(c.p.serializeRowData)?c.p.serializeRowData(b):b, type:"POST", complete:function(m, e){a("#lui_" + c.p.id).hide(); if (e === "success")if ((a.isFunction(t)?t(m):true) === true){c.p.autoencode && a.each(b, function(x, w){b[x] = a.jgrid.htmlDecode(w)}); b = a.extend({}, b, k); a(c).jqGrid("setRowData", d, b); a(q).attr("editable", "0"); for (e = 0; e < c.p.savedRow.length; e++)if (c.p.savedRow[e].id == d){r = e; break}r >= 0 && c.p.savedRow.splice(r, 1);
- a.isFunction(o) && o(d, m)} else a(c).jqGrid("restoreRow", d, s)}, error:function(m, e){a("#lui_" + c.p.id).hide(); a.isFunction(u)?u(d, m, e):alert("Error Row: " + d + " Result: " + m.status + ":" + m.statusText + " Status: " + e)}}, a.jgrid.ajaxOptions, c.p.ajaxRowOptions || {}))}a(q).unbind("keydown")}}}}})}, restoreRow:function(d, t){return this.each(function(){var i = this, n, o, u = {}; if (i.grid){o = a(i).jqGrid("getInd", d, true); if (o !== false){for (var s = 0; s < i.p.savedRow.length; s++)if (i.p.savedRow[s].id == d){n = s; break}if (n >= 0){if (a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker",
- "#" + o.id).datepicker("hide")} catch (c){}a.each(i.p.colModel, function(){if (this.editable === true && this.name in i.p.savedRow[n])u[this.name] = i.p.savedRow[n][this.name]}); a(i).jqGrid("setRowData", d, u); a(o).attr("editable", "0").unbind("keydown"); i.p.savedRow.splice(n, 1)}a.isFunction(t) && t(d)}}})}})})(jQuery);
- (function(b){b.jgrid.extend({editCell:function(d, e, a){return this.each(function(){var c = this, h, f, g; if (!(!c.grid || c.p.cellEdit !== true)){e = parseInt(e, 10); c.p.selrow = c.rows[d].id; c.p.knv || b(c).jqGrid("GridNav"); if (c.p.savedRow.length > 0){if (a === true)if (d == c.p.iRow && e == c.p.iCol)return; b(c).jqGrid("saveCell", c.p.savedRow[0].id, c.p.savedRow[0].ic)} else window.setTimeout(function(){b("#" + c.p.knv).attr("tabindex", "-1").focus()}, 0); h = c.p.colModel[e].name; if (!(h == "subgrid" || h == "cb" || h == "rn")){g = b("td:eq(" + e +
- ")", c.rows[d]); if (c.p.colModel[e].editable === true && a === true && !g.hasClass("not-editable-cell")){if (parseInt(c.p.iCol, 10) >= 0 && parseInt(c.p.iRow, 10) >= 0){b("td:eq(" + c.p.iCol + ")", c.rows[c.p.iRow]).removeClass("edit-cell ui-state-highlight"); b(c.rows[c.p.iRow]).removeClass("selected-row ui-state-hover")}b(g).addClass("edit-cell ui-state-highlight"); b(c.rows[d]).addClass("selected-row ui-state-hover"); try{f = b.unformat(g, {rowId:c.rows[d].id, colModel:c.p.colModel[e]}, e)} catch (k){f = b(g).html()}if (c.p.autoencode)f =
- b.jgrid.htmlDecode(f); if (!c.p.colModel[e].edittype)c.p.colModel[e].edittype = "text"; c.p.savedRow.push({id:d, ic:e, name:h, v:f}); if (b.isFunction(c.p.formatCell)){var j = c.p.formatCell(c.rows[d].id, h, f, d, e); if (j !== undefined)f = j}j = b.extend({}, c.p.colModel[e].editoptions || {}, {id:d + "_" + h, name:h}); var i = createEl(c.p.colModel[e].edittype, j, f, true, b.extend({}, b.jgrid.ajaxOptions, c.p.ajaxSelectOptions || {})); b.isFunction(c.p.beforeEditCell) && c.p.beforeEditCell(c.rows[d].id, h, f, d, e); b(g).html("").append(i).attr("tabindex",
- "0"); window.setTimeout(function(){b(i).focus()}, 0); b("input, select, textarea", g).bind("keydown", function(l){if (l.keyCode === 27)if (b("input.hasDatepicker", g).length > 0)b(".ui-datepicker").is(":hidden")?b(c).jqGrid("restoreCell", d, e):b("input.hasDatepicker", g).datepicker("hide"); else b(c).jqGrid("restoreCell", d, e); l.keyCode === 13 && b(c).jqGrid("saveCell", d, e); if (l.keyCode == 9)if (c.grid.hDiv.loading)return false; else l.shiftKey?b(c).jqGrid("prevCell", d, e):b(c).jqGrid("nextCell", d, e); l.stopPropagation()});
- b.isFunction(c.p.afterEditCell) && c.p.afterEditCell(c.rows[d].id, h, f, d, e)} else{if (parseInt(c.p.iCol, 10) >= 0 && parseInt(c.p.iRow, 10) >= 0){b("td:eq(" + c.p.iCol + ")", c.rows[c.p.iRow]).removeClass("edit-cell ui-state-highlight"); b(c.rows[c.p.iRow]).removeClass("selected-row ui-state-hover")}g.addClass("edit-cell ui-state-highlight"); b(c.rows[d]).addClass("selected-row ui-state-hover"); if (b.isFunction(c.p.onSelectCell)){f = g.html().replace(/\ \;/ig, ""); c.p.onSelectCell(c.rows[d].id, h, f, d, e)}}c.p.iCol = e; c.p.iRow =
- d}}})}, saveCell:function(d, e){return this.each(function(){var a = this, c; if (!(!a.grid || a.p.cellEdit !== true)){c = a.p.savedRow.length >= 1?0:null; if (c !== null){var h = b("td:eq(" + e + ")", a.rows[d]), f, g, k = a.p.colModel[e], j = k.name, i = b.jgrid.jqID(j); switch (k.edittype){case "select":if (k.editoptions.multiple){i = b("#" + d + "_" + i, a.rows[d]); var l = []; if (f = b(i).val())f.join(","); else f = ""; b("option:selected", i).each(function(m, p){l[m] = b(p).text()}); g = l.join(",")} else{f = b("#" + d + "_" + i + ">option:selected", a.rows[d]).val();
- g = b("#" + d + "_" + i + ">option:selected", a.rows[d]).text()}if (k.formatter)g = f; break; case "checkbox":var n = ["Yes", "No"]; if (k.editoptions)n = k.editoptions.value.split(":"); g = f = b("#" + d + "_" + i, a.rows[d]).attr("checked")?n[0]:n[1]; break; case "password":case "text":case "textarea":case "button":g = f = b("#" + d + "_" + i, a.rows[d]).val(); break; case "custom":try{if (k.editoptions && b.isFunction(k.editoptions.custom_value)){f = k.editoptions.custom_value(b(".customelement", h), "get"); if (f === undefined)throw"e2"; else g = f} else throw"e1";
- } catch (q){q == "e1" && info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + b.jgrid.edit.msg.nodefined, jQuery.jgrid.edit.bClose); q == "e2"?info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + b.jgrid.edit.msg.novalue, jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap, q.message, jQuery.jgrid.edit.bClose)}break}if (g != a.p.savedRow[c].v){if (b.isFunction(a.p.beforeSaveCell))if (c = a.p.beforeSaveCell(a.rows[d].id, j, f, d, e))f = c; var r = checkValues(f, e, a); if (r[0] === true){c = {};
- if (b.isFunction(a.p.beforeSubmitCell))(c = a.p.beforeSubmitCell(a.rows[d].id, j, f, d, e)) || (c = {}); b("input.hasDatepicker", h).length > 0 && b("input.hasDatepicker", h).datepicker("hide"); if (a.p.cellsubmit == "remote")if (a.p.cellurl){var o = {}; if (a.p.autoencode)f = b.jgrid.htmlEncode(f); o[j] = f; n = a.p.prmNames; k = n.id; i = n.oper; o[k] = a.rows[d].id; o[i] = n.editoper; o = b.extend(c, o); b("#lui_" + a.p.id).show(); a.grid.hDiv.loading = true; b.ajax(b.extend({url:a.p.cellurl, data:b.isFunction(a.p.serializeCellData)?a.p.serializeCellData(o):
- o, type:"POST", complete:function(m, p){b("#lui_" + a.p.id).hide(); a.grid.hDiv.loading = false; if (p == "success")if (b.isFunction(a.p.afterSubmitCell)){m = a.p.afterSubmitCell(m, o.id, j, f, d, e); if (m[0] === true){b(h).empty(); b(a).jqGrid("setCell", a.rows[d].id, e, g, false, false, true); b(h).addClass("dirty-cell"); b(a.rows[d]).addClass("edited"); b.isFunction(a.p.afterSaveCell) && a.p.afterSaveCell(a.rows[d].id, j, f, d, e); a.p.savedRow.splice(0, 1)} else{info_dialog(b.jgrid.errors.errcap, m[1], b.jgrid.edit.bClose); b(a).jqGrid("restoreCell",
- d, e)}} else{b(h).empty(); b(a).jqGrid("setCell", a.rows[d].id, e, g, false, false, true); b(h).addClass("dirty-cell"); b(a.rows[d]).addClass("edited"); b.isFunction(a.p.afterSaveCell) && a.p.afterSaveCell(a.rows[d].id, j, f, d, e); a.p.savedRow.splice(0, 1)}}, error:function(m, p){b("#lui_" + a.p.id).hide(); a.grid.hDiv.loading = false; b.isFunction(a.p.errorCell)?a.p.errorCell(m, p):info_dialog(b.jgrid.errors.errcap, m.status + " : " + m.statusText + "" +
- f.resetText + "" + f.searchText + "" + f.matchText + " " + r + " " + f.rulesText + "
" + p, b.jgrid.edit.bClose); b(a).jqGrid("restoreCell", d, e)}}, b.jgrid.ajaxOptions,
- a.p.ajaxCellOptions || {}))} else try{info_dialog(b.jgrid.errors.errcap, b.jgrid.errors.nourl, b.jgrid.edit.bClose); b(a).jqGrid("restoreCell", d, e)} catch (s){}if (a.p.cellsubmit == "clientArray"){b(h).empty(); b(a).jqGrid("setCell", a.rows[d].id, e, g, false, false, true); b(h).addClass("dirty-cell"); b(a.rows[d]).addClass("edited"); b.isFunction(a.p.afterSaveCell) && a.p.afterSaveCell(a.rows[d].id, j, f, d, e); a.p.savedRow.splice(0, 1)}} else try{window.setTimeout(function(){info_dialog(b.jgrid.errors.errcap, f + " " + r[1], b.jgrid.edit.bClose)},
- 100); b(a).jqGrid("restoreCell", d, e)} catch (t){}} else b(a).jqGrid("restoreCell", d, e)}b.browser.opera?b("#" + a.p.knv).attr("tabindex", "-1").focus():window.setTimeout(function(){b("#" + a.p.knv).attr("tabindex", "-1").focus()}, 0)}})}, restoreCell:function(d, e){return this.each(function(){var a = this, c; if (!(!a.grid || a.p.cellEdit !== true)){c = a.p.savedRow.length >= 1?0:null; if (c !== null){var h = b("td:eq(" + e + ")", a.rows[d]); if (b.isFunction(b.fn.datepicker))try{b("input.hasDatepicker", h).datepicker("hide")} catch (f){}b(h).empty().attr("tabindex",
- "-1"); b(a).jqGrid("setCell", a.rows[d].id, e, a.p.savedRow[c].v, false, false, true); a.p.savedRow.splice(0, 1)}window.setTimeout(function(){b("#" + a.p.knv).attr("tabindex", "-1").focus()}, 0)}})}, nextCell:function(d, e){return this.each(function(){var a = this, c = false; if (!(!a.grid || a.p.cellEdit !== true)){for (var h = e + 1; h < a.p.colModel.length; h++)if (a.p.colModel[h].editable === true){c = h; break}if (c !== false)b(a).jqGrid("editCell", d, c, true); else a.p.savedRow.length > 0 && b(a).jqGrid("saveCell", d, e)}})}, prevCell:function(d,
- e){return this.each(function(){var a = this, c = false; if (!(!a.grid || a.p.cellEdit !== true)){for (var h = e - 1; h >= 0; h--)if (a.p.colModel[h].editable === true){c = h; break}if (c !== false)b(a).jqGrid("editCell", d, c, true); else a.p.savedRow.length > 0 && b(a).jqGrid("saveCell", d, e)}})}, GridNav:function(){return this.each(function(){function d(g, k, j){if (j.substr(0, 1) == "v"){var i = b(a.grid.bDiv)[0].clientHeight, l = b(a.grid.bDiv)[0].scrollTop, n = a.rows[g].offsetTop + a.rows[g].clientHeight, q = a.rows[g].offsetTop; if (j == "vd")if (n >= i)b(a.grid.bDiv)[0].scrollTop =
- b(a.grid.bDiv)[0].scrollTop + a.rows[g].clientHeight; if (j == "vu")if (q < l)b(a.grid.bDiv)[0].scrollTop = b(a.grid.bDiv)[0].scrollTop - a.rows[g].clientHeight}if (j == "h"){j = b(a.grid.bDiv)[0].clientWidth; i = b(a.grid.bDiv)[0].scrollLeft; l = a.rows[g].cells[k].offsetLeft; if (a.rows[g].cells[k].offsetLeft + a.rows[g].cells[k].clientWidth >= j + parseInt(i, 10))b(a.grid.bDiv)[0].scrollLeft = b(a.grid.bDiv)[0].scrollLeft + a.rows[g].cells[k].clientWidth; else if (l < i)b(a.grid.bDiv)[0].scrollLeft = b(a.grid.bDiv)[0].scrollLeft - a.rows[g].cells[k].clientWidth}}
- function e(g, k){var j, i; if (k == "lft"){j = g + 1; for (i = g; i >= 0; i--)if (a.p.colModel[i].hidden !== true){j = i; break}}if (k == "rgt"){j = g - 1; for (i = g; i < a.p.colModel.length; i++)if (a.p.colModel[i].hidden !== true){j = i; break}}return j}var a = this; if (!(!a.grid || a.p.cellEdit !== true)){a.p.knv = a.p.id + "_kn"; var c = b(""), h, f; b(c).insertBefore(a.grid.cDiv);
- b("#" + a.p.knv).focus().keydown(function(g){f = g.keyCode; if (a.p.direction == "rtl")if (f == 37)f = 39; else if (f == 39)f = 37; switch (f){case 38:if (a.p.iRow - 1 >= 0){d(a.p.iRow - 1, a.p.iCol, "vu"); b(a).jqGrid("editCell", a.p.iRow - 1, a.p.iCol, false)}break; case 40:if (a.p.iRow + 1 <= a.rows.length - 1){d(a.p.iRow + 1, a.p.iCol, "vd"); b(a).jqGrid("editCell", a.p.iRow + 1, a.p.iCol, false)}break; case 37:if (a.p.iCol - 1 >= 0){h = e(a.p.iCol - 1, "lft"); d(a.p.iRow, h, "h"); b(a).jqGrid("editCell", a.p.iRow, h, false)}break; case 39:if (a.p.iCol + 1 <= a.p.colModel.length -
- 1){h = e(a.p.iCol + 1, "rgt"); d(a.p.iRow, h, "h"); b(a).jqGrid("editCell", a.p.iRow, h, false)}break; case 13:parseInt(a.p.iCol, 10) >= 0 && parseInt(a.p.iRow, 10) >= 0 && b(a).jqGrid("editCell", a.p.iRow, a.p.iCol, true); break}return false})}})}, getChangedCells:function(d){var e = []; d || (d = "all"); this.each(function(){var a = this, c; !a.grid || a.p.cellEdit !== true || b(a.rows).each(function(h){var f = {}; if (b(this).hasClass("edited")){b("td", this).each(function(g){c = a.p.colModel[g].name; if (c !== "cb" && c !== "subgrid")if (d == "dirty"){if (b(this).hasClass("dirty-cell"))try{f[c] =
- b.unformat(this, {rowId:a.rows[h].id, colModel:a.p.colModel[g]}, g)} catch (k){f[c] = b.jgrid.htmlDecode(b(this).html())}} else try{f[c] = b.unformat(this, {rowId:a.rows[h].id, colModel:a.p.colModel[g]}, g)} catch (j){f[c] = b.jgrid.htmlDecode(b(this).html())}}); f.id = this.id; e.push(f)}})}); return e}})})(jQuery);
- (function(b){b.fn.jqm = function(a){var f = {overlay:50, closeoverlay:true, overlayClass:"jqmOverlay", closeClass:"jqmClose", trigger:".jqModal", ajax:e, ajaxText:"", target:e, modal:e, toTop:e, onShow:e, onHide:e, onLoad:e}; return this.each(function(){if (this._jqm)return i[this._jqm].c = b.extend({}, i[this._jqm].c, a); l++; this._jqm = l; i[l] = {c:b.extend(f, b.jqm.params, a), a:e, w:b(this).addClass("jqmID" + l), s:l}; f.trigger && b(this).jqmAddTrigger(f.trigger)})}; b.fn.jqmAddClose = function(a){return o(this, a, "jqmHide")}; b.fn.jqmAddTrigger =
- function(a){return o(this, a, "jqmShow")}; b.fn.jqmShow = function(a){return this.each(function(){b.jqm.open(this._jqm, a)})}; b.fn.jqmHide = function(a){return this.each(function(){b.jqm.close(this._jqm, a)})}; b.jqm = {hash:{}, open:function(a, f){var c = i[a], d = c.c, h = "." + d.closeClass, g = parseInt(c.w.css("z-index")); g = g > 0?g:3E3; var j = b("").css({height:"100%", width:"100%", position:"fixed", left:0, top:0, "z-index":g - 1, opacity:d.overlay / 100}); if (c.a)return e; c.t = f; c.a = true; c.w.css("z-index", g); if (d.modal){k[0] ||
- setTimeout(function(){p("bind")}, 1); k.push(a)} else if (d.overlay > 0)d.closeoverlay && c.w.jqmAddClose(j); else j = e; c.o = j?j.addClass(d.overlayClass).prependTo("body"):e; if (q){b("html,body").css({height:"100%", width:"100%"}); if (j){j = j.css({position:"absolute"})[0]; for (var m in{Top:1, Left:1})j.style.setExpression(m.toLowerCase(), "(_=(document.documentElement.scroll" + m + " || document.body.scroll" + m + "))+'px'")}}if (d.ajax){a = d.target || c.w; g = d.ajax; a = typeof a == "string"?b(a, c.w):b(a); g = g.substr(0, 1) == "@"?b(f).attr(g.substring(1)):
- g; a.html(d.ajaxText).load(g, function(){d.onLoad && d.onLoad.call(this, c); h && c.w.jqmAddClose(b(h, c.w)); r(c)})} else h && c.w.jqmAddClose(b(h, c.w)); d.toTop && c.o && c.w.before('').insertAfter(c.o); d.onShow?d.onShow(c):c.w.show(); r(c); return e}, close:function(a){a = i[a]; if (!a.a)return e; a.a = e; if (k[0]){k.pop(); k[0] || p("unbind")}a.c.toTop && a.o && b("#jqmP" + a.w[0]._jqm).after(a.w).remove(); if (a.c.onHide)a.c.onHide(a); else{a.w.hide(); a.o && a.o.remove()}return e}, params:{}}; var l =
- 0, i = b.jqm.hash, k = [], q = b.browser.msie && b.browser.version == "6.0", e = false, r = function(a){var f = b('').css({opacity:0}); if (q)if (a.o)a.o.html('').prepend(f); else b("iframe.jqm", a.w)[0] || a.w.prepend(f); s(a)}, s = function(a){try{b(":input:visible", a.w)[0].focus()} catch (f){}}, p = function(a){b(document)[a]("keypress", n)[a]("keydown", n)[a]("mousedown", n)}, n = function(a){var f = i[k[k.length - 1]]; (a = !b(a.target).parents(".jqmID" +
- f.s)[0]) && s(f); return!a}, o = function(a, f, c){return a.each(function(){var d = this._jqm; b(f).each(function(){if (!this[c]){this[c] = []; b(this).click(function(){for (var h in{jqmShow:1, jqmHide:1})for (var g in this[h])i[this[h][g]] && i[this[h][g]].w[h](this); return e})}this[c].push(d)})})}})(jQuery);
- (function(b){b.fn.jqDrag = function(a){return l(this, a, "d")}; b.fn.jqResize = function(a, e){return l(this, a, "r", e)}; b.jqDnR = {dnr:{}, e:0, drag:function(a){if (c.k == "d")d.css({left:c.X + a.pageX - c.pX, top:c.Y + a.pageY - c.pY}); else{d.css({width:Math.max(a.pageX - c.pX + c.W, 0), height:Math.max(a.pageY - c.pY + c.H, 0)}); M1 && f.css({width:Math.max(a.pageX - M1.pX + M1.W, 0), height:Math.max(a.pageY - M1.pY + M1.H, 0)})}return false}, stop:function(){b(document).unbind("mousemove", i.drag).unbind("mouseup", i.stop)}}; var i = b.jqDnR, c = i.dnr,
- d = i.e, f, l = function(a, e, n, m){return a.each(function(){e = e?b(e, a):a; e.bind("mousedown", {e:a, k:n}, function(g){var j = g.data, h = {}; d = j.e; f = m?b(m):false; if (d.css("position") != "relative")try{d.position(h)} catch (o){}c = {X:h.left || k("left") || 0, Y:h.top || k("top") || 0, W:k("width") || d[0].scrollWidth || 0, H:k("height") || d[0].scrollHeight || 0, pX:g.pageX, pY:g.pageY, k:j.k}; M1 = f && j.k != "d"?{X:h.left || f1("left") || 0, Y:h.top || f1("top") || 0, W:f[0].offsetWidth || f1("width") || 0, H:f[0].offsetHeight || f1("height") || 0, pX:g.pageX, pY:g.pageY,
- k:j.k}:false; b(document).mousemove(b.jqDnR.drag).mouseup(b.jqDnR.stop); return false})})}, k = function(a){return parseInt(d.css(a)) || false}; f1 = function(a){return parseInt(f.css(a)) || false}})(jQuery);
- (function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var e = this; e.p.colNames.unshift(""); e.p.colModel.unshift({name:"subgrid", width:a.browser.safari?e.p.subGridWidth + e.p.cellLayout:e.p.subGridWidth, sortable:false, resizable:false, hidedlg:true, search:false, fixed:true}); e = e.p.subGridModel; if (e[0]){e[0].align = a.extend([], e[0].align || []); for (var c = 0; c < e[0].name.length; c++)e[0].align[c] = e[0].align[c] || "left"}})}, addSubGridCell:function(e, c){var b = "", n, k; this.each(function(){b =
- this.formatCol(e, c); n = this.p.gridview; k = this.p.id}); return n === false?'":' "}, addSubGrid:function(e, c){return this.each(function(){var b = this; if (b.grid){var n, k, p, t, s, u, o; a("td:eq(" + c + ")", e).click(function(){if (a(this).hasClass("sgcollapsed")){p = b.p.id; n = a(this).parent();
- t = c >= 1?" ":""; k = a(n).attr("id"); o = true; if (a.isFunction(b.p.subGridBeforeExpand))o = b.p.subGridBeforeExpand(p + "_" + k, k); if (o === false)return false; s = 0; a.each(b.p.colModel, function(){if (this.hidden === true || this.name == "rn" || this.name == "cb")s++}); u = "" + t + " "); a.isFunction(b.p.subGridRowExpanded)?b.p.subGridRowExpanded(p + "_" + k, k):x(n); a(this).html("").removeClass("sgcollapsed").addClass("sgexpanded")} else if (a(this).hasClass("sgexpanded")){o = true; if (a.isFunction(b.p.subGridRowColapsed)){n = a(this).parent(); k = a(n).attr("id"); o = b.p.subGridRowColapsed(p + "_" + k, k)}if (o === false)return false; a(this).parent().next().remove(".ui-subgrid");
- a(this).html("").removeClass("sgexpanded").addClass("sgcollapsed")}return false}); var x = function(g){var j, f, d, h; j = a(g).attr("id"); f = {nd_:(new Date).getTime()}; f[b.p.prmNames.subgridid] = j; if (!b.p.subGridModel[0])return false; if (b.p.subGridModel[0].params)for (h = 0; h < b.p.subGridModel[0].params.length; h++)for (d = 0; d < b.p.colModel.length; d++)if (b.p.colModel[d].name == b.p.subGridModel[0].params[h])f[b.p.colModel[d].name] = a("td:eq(" +
- d + ")", g).text().replace(/\ \;/ig, ""); if (!b.grid.hDiv.loading){b.grid.hDiv.loading = true; a("#load_" + b.p.id).show(); if (!b.p.subgridtype)b.p.subgridtype = b.p.datatype; if (a.isFunction(b.p.subgridtype))b.p.subgridtype(f); else b.p.subgridtype = b.p.subgridtype.toLowerCase(); switch (b.p.subgridtype){case "xml":case "json":a.ajax(a.extend({type:b.p.mtype, url:b.p.subGridUrl, dataType:b.p.subgridtype, data:a.isFunction(b.p.serializeSubGridData)?b.p.serializeSubGridData(f):f, complete:function(i){b.p.subgridtype ==
- "xml"?v(i.responseXML, j):w(a.jgrid.parse(i.responseText), j)}}, a.jgrid.ajaxOptions, b.p.ajaxSubgridOptions || {})); break}}return false}, r = function(g, j, f){j = a("").html(j); a(g).append(j)}, v = function(g, j){var f, d, h, i = a(" "), l = a("
"); for (d = 0; d < b.p.subGridModel[0].name.length; d++){f = a(" "); a(f).html(b.p.subGridModel[0].name[d]);
- a(f).width(b.p.subGridModel[0].width[d]); a(l).append(f)}a(i).append(l); if (g){h = b.p.xmlReader.subgrid; a(h.root + " " + h.row, g).each(function(){l = a(" "); if (h.repeatitems === true)a(h.cell, this).each(function(q){r(l, a(this).text() || " ", q)}); else{var m = b.p.subGridModel[0].mapping || b.p.subGridModel[0].name; if (m)for (d = 0; d < m.length; d++)r(l, a(m[d], this).text() || " ", d)}a(i).append(l)})}g = a("table:first", b.grid.bDiv).attr("id") + "_"; a("#" + g + j).append(i); b.grid.hDiv.loading =
- false; a("#load_" + b.p.id).hide(); return false}, w = function(g, j){var f, d, h, i, l = a(" "), m = a("
"); for (d = 0; d < b.p.subGridModel[0].name.length; d++){f = a(" "); a(f).html(b.p.subGridModel[0].name[d]); a(f).width(b.p.subGridModel[0].width[d]); a(m).append(f)}a(l).append(m); if (g){f = b.p.jsonReader.subgrid; g = g[f.root]; if (typeof g !== "undefined")for (d = 0; d <
- g.length; d++){h = g[d]; m = a(" "); if (f.repeatitems === true){if (f.cell)h = h[f.cell]; for (i = 0; i < h.length; i++)r(m, h[i] || " ", i)} else{var q = b.p.subGridModel[0].mapping || b.p.subGridModel[0].name; if (q.length)for (i = 0; i < q.length; i++)r(m, h[q[i]] || " ", i)}a(l).append(m)}}d = a("table:first", b.grid.bDiv).attr("id") + "_"; a("#" + d + j).append(l); b.grid.hDiv.loading = false; a("#load_" + b.p.id).hide(); return false}; b.subGridXml = function(g, j){v(g, j)}; b.subGridJson = function(g,
- j){w(g, j)}}})}, expandSubGridRow:function(e){return this.each(function(){var c = this; if (c.grid || e)if (c.p.subGrid === true)if (c = a(this).jqGrid("getInd", e, true))(c = a("td.sgcollapsed", c)[0]) && a(c).trigger("click")})}, collapseSubGridRow:function(e){return this.each(function(){var c = this; if (c.grid || e)if (c.p.subGrid === true)if (c = a(this).jqGrid("getInd", e, true))(c = a("td.sgexpanded", c)[0]) && a(c).trigger("click")})}, toggleSubGridRow:function(e){return this.each(function(){var c = this; if (c.grid || e)if (c.p.subGrid ===
- true)if (c = a(this).jqGrid("getInd", e, true)){var b = a("td.sgcollapsed", c)[0]; if (b)a(b).trigger("click"); else(b = a("td.sgexpanded", c)[0]) && a(b).trigger("click")}})}})})(jQuery);
- (function(d){d.jgrid.extend({setTreeNode:function(a, c){return this.each(function(){var b = this; if (b.grid && b.p.treeGrid){var e = b.p.expColInd, f = b.p.treeReader.expanded_field, j = b.p.treeReader.leaf_field, k = b.p.treeReader.level_field; c.level = a[k]; if (b.p.treeGridModel == "nested"){c.lft = a[b.p.treeReader.left_field]; c.rgt = a[b.p.treeReader.right_field]; a[j] || (a[j] = parseInt(c.rgt, 10) === parseInt(c.lft, 10) + 1?"true":"false")} else c.parent_id = a[b.p.treeReader.parent_id_field]; var g = parseInt(c.level, 10), i; if (b.p.tree_root_level ===
- 0){i = g + 1; g = g} else{i = g; g = g - 1}i = " "; for (i = 0; i < this.p.colNames.length; i++)c.p.colModel[i].hidedlg || (g += "
"); g += "
"; a.gbox = "#gbox_" + e; createModal(f, g, a, "#gview_" + c.p.id, b("#gview_" + c.p.id)[0]); if (a.saveicon[0] == true)b("#dData", "#" + d + "_2").addClass(a.saveicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); if (a.closeicon[0] == true)b("#eData", "#" + d + "_2").addClass(a.closeicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); a.updateAfterCheck?
- b(":input", "#" + d).click(function(){var h = this.id.substr(4); if (h){this.checked?b(c).jqGrid("showCol", h):b(c).jqGrid("hideCol", h); a.ShrinkToFit === true && b(c).jqGrid("setGridWidth", c.grid.width - 0.0010, true)}return this}):b("#dData", "#" + d + "_2").click(function(){for (i = 0; i < c.p.colModel.length; i++)if (!c.p.colModel[i].hidedlg){var h = c.p.colModel[i].name.replace(".", "\\."); if (b("#col_" + h, "#" + d).attr("checked")){b(c).jqGrid("showCol", c.p.colModel[i].name); b("#col_" + h, "#" + d).attr("defaultChecked", true)} else{b(c).jqGrid("hideCol",
- c.p.colModel[i].name); b("#col_" + h, "#" + d).attr("defaultChecked", "")}}a.ShrinkToFit === true && b(c).jqGrid("setGridWidth", c.grid.width - 0.0010, true); a.closeAfterSubmit && hideModal("#" + f.themodal, {gb:"#gbox_" + e, jqm:a.jqModal, onClose:a.onClose}); l && a.afterSubmitForm(b("#" + d)); return false}); b("#eData", "#" + d + "_2").click(function(){hideModal("#" + f.themodal, {gb:"#gbox_" + e, jqm:a.jqModal, onClose:a.onClose}); return false}); b("#dData, #eData", "#" + d + "_2").hover(function(){b(this).addClass("ui-state-hover")}, function(){b(this).removeClass("ui-state-hover")});
- j && a.beforeShowForm(b("#" + d)); viewModal("#" + f.themodal, {gbox:"#gbox_" + e, jqm:a.jqModal, jqM:true, modal:a.modal})}k && a.afterShowForm(b("#" + d))}})}})})(jQuery);
- (function(c){c.jgrid.extend({getPostData:function(){var a = this[0]; if (a.grid)return a.p.postData}, setPostData:function(a){var b = this[0]; if (b.grid)if (typeof a === "object")b.p.postData = a; else alert("Error: cannot add a non-object postData value. postData unchanged.")}, appendPostData:function(a){var b = this[0]; if (b.grid)typeof a === "object"?c.extend(b.p.postData, a):alert("Error: cannot append a non-object postData value. postData unchanged.")}, setPostDataItem:function(a, b){var d = this[0]; if (d.grid)d.p.postData[a] =
- b}, getPostDataItem:function(a){var b = this[0]; if (b.grid)return b.p.postData[a]}, removePostDataItem:function(a){var b = this[0]; b.grid && delete b.p.postData[a]}, getUserData:function(){var a = this[0]; if (a.grid)return a.p.userData}, getUserDataItem:function(a){var b = this[0]; if (b.grid)return b.p.userData[a]}})})(jQuery);
- function tableToGrid(o, p){jQuery(o).each(function(){if (!this.grid){jQuery(this).width("99%"); var a = jQuery(this).width(), f = jQuery("input[type=checkbox]:first", jQuery(this)), l = jQuery("input[type=radio]:first", jQuery(this)), b = f.length > 0, q = !b && l.length > 0, m = b || q; f = f.attr("name") || l.attr("name"); var c = [], g = []; jQuery("th", jQuery(this)).each(function(){if (c.length === 0 && m){c.push({name:"__selection__", index:"__selection__", width:0, hidden:true}); g.push("__selection__")} else{c.push({name:jQuery(this).attr("id") ||
- jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"), index:jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"), width:jQuery(this).width() || 150}); g.push(jQuery(this).html())}}); var e = [], h = [], i = []; jQuery("tbody > tr", jQuery(this)).each(function(){var j = {}, d = 0; jQuery("td", jQuery(this)).each(function(){if (d === 0 && m){var k = jQuery("input", jQuery(this)), n = k.attr("value"); h.push(n || e.length); k.attr("checked") && i.push(n); j[c[d].name] =
- k.attr("value")} else j[c[d].name] = jQuery(this).html(); d++}); d > 0 && e.push(j)}); jQuery(this).empty(); jQuery(this).addClass("scroll"); jQuery(this).jqGrid($.extend({datatype:"local", width:a, colNames:g, colModel:c, multiselect:b}, p || {})); for (a = 0; a < e.length; a++){b = null; if (h.length > 0)if ((b = h[a]) && b.replace)b = encodeURIComponent(b).replace(/[.\-%]/g, "_"); if (b === null)b = a + 1; jQuery(this).jqGrid("addRowData", b, e[a])}for (a = 0; a < i.length; a++)jQuery(this).jqGrid("setSelection", i[a])}})};
- (function(a){if (a.browser.msie && a.browser.version == 8)a.expr[":"].hidden = function(b){return b.offsetWidth === 0 || b.offsetHeight === 0 || b.style.display == "none"}; a.jgrid._multiselect = false; if (a.ui)if (a.ui.multiselect){if (a.ui.multiselect.prototype._setSelected){var q = a.ui.multiselect.prototype._setSelected; a.ui.multiselect.prototype._setSelected = function(b, i){b = q.call(this, b, i); if (i && this.selectedList){var c = this.element; this.selectedList.find("li").each(function(){a(this).data("optionLink") && a(this).data("optionLink").remove().appendTo(c)})}return b}}if (a.ui.multiselect.prototype.destroy)a.ui.multiselect.prototype.destroy =
- function(){this.element.show(); this.container.remove(); a.Widget === undefined?a.widget.prototype.destroy.apply(this, arguments):a.Widget.prototype.destroy.apply(this, arguments)}; a.jgrid._multiselect = true}a.jgrid.extend({sortableColumns:function(b){return this.each(function(){function i(){c.p.disableClick = true}var c = this, g = {tolerance:"pointer", axis:"x", scrollSensitivity:"1", items:">th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)", placeholder:{element:function(e){return a(document.createElement(e[0].nodeName)).addClass(e[0].className +
- " ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]}, update:function(e, h){h.height(e.currentItem.innerHeight() - parseInt(e.currentItem.css("paddingTop") || 0, 10) - parseInt(e.currentItem.css("paddingBottom") || 0, 10)); h.width(e.currentItem.innerWidth() - parseInt(e.currentItem.css("paddingLeft") || 0, 10) - parseInt(e.currentItem.css("paddingRight") || 0, 10))}}, update:function(e, h){e = a(h.item).parent(); e = a(">th", e); var j = {}; a.each(c.p.colModel, function(m){j[this.name] = m}); var l = [];
- e.each(function(){var m = a(">div", this).get(0).id.replace(/^jqgh_/, ""); m in j && l.push(j[m])}); a(c).jqGrid("remapColumns", l, true, true); a.isFunction(c.p.sortable.update) && c.p.sortable.update(l); setTimeout(function(){c.p.disableClick = false}, 50)}}; if (c.p.sortable.options)a.extend(g, c.p.sortable.options); else if (a.isFunction(c.p.sortable))c.p.sortable = {update:c.p.sortable}; if (g.start){var d = g.start; g.start = function(e, h){i(); d.call(this, e, h)}} else g.start = i; if (c.p.sortable.exclude)g.items += ":not(" + c.p.sortable.exclude +
- ")"; b.sortable(g).data("sortable").floating = true})}, columnChooser:function(b){function i(f, k, p){if (k >= 0){var o = f.slice(), r = o.splice(k, Math.max(f.length - k, k)); if (k > f.length)k = f.length; o[k] = p; return o.concat(r)}}function c(f, k){if (f)if (typeof f == "string")a.fn[f] && a.fn[f].apply(k, a.makeArray(arguments).slice(2)); else a.isFunction(f) && f.apply(k, a.makeArray(arguments).slice(2))}var g = this; if (!a("#colchooser_" + g[0].p.id).length){var d = a('" + (!a.updateAfterCheck?"" + a.bSubmit + "":"") + " " + ("" +
- a.bCancel + "") + " "); if (typeof b == "string" && b ==
- "updateDnD" && c.p.jqgdnd === true)i(); else{b = a.extend({drag:function(d){return a.extend({start:function(e, h){if (c.p.subGrid){var j = a(h.helper).attr("id"); try{a(c).jqGrid("collapseSubGridRow", j)} catch (l){}}for (j = 0; j < a.data(c, "dnd").connectWith.length; j++)a(a.data(c, "dnd").connectWith[j]).jqGrid("getGridParam", "reccount") == "0" && a(a.data(c, "dnd").connectWith[j]).jqGrid("addRowData", "jqg_empty_row", {}); h.helper.addClass("ui-state-highlight"); a("td", h.helper).each(function(m){this.style.width = c.grid.headers[m].width +
- "px"}); d.onstart && a.isFunction(d.onstart) && d.onstart.call(a(c), e, h)}, stop:function(e, h){if (h.helper.dropped){var j = a(h.helper).attr("id"); a(c).jqGrid("delRowData", j)}for (j = 0; j < a.data(c, "dnd").connectWith.length; j++)a(a.data(c, "dnd").connectWith[j]).jqGrid("delRowData", "jqg_empty_row"); d.onstop && a.isFunction(d.onstop) && d.onstop.call(a(c), e, h)}}, d.drag_opts || {})}, drop:function(d){return a.extend({accept:function(e){var h = a(e).closest("table.ui-jqgrid-btable"); if (a.data(h[0], "dnd") !== undefined){e = a.data(h[0],
- "dnd").connectWith; return a.inArray("#" + this.id, e) != - 1?true:false}return e}, drop:function(e, h){var j = a(h.draggable).attr("id"); j = a("#" + c.id).jqGrid("getRowData", j); if (!d.dropbyname){var l = 0, m = {}, n, f = a("#" + this.id).jqGrid("getGridParam", "colModel"); try{for (var k in j){if (j.hasOwnProperty(k) && f[l]){n = f[l].name; m[n] = j[k]}l++}j = m} catch (p){}}h.helper.dropped = true; if (d.beforedrop && a.isFunction(d.beforedrop)){n = d.beforedrop.call(this, e, h, j, a("#" + c.id), a(this)); if (typeof n != "undefined" && n !== null && typeof n ==
- "object")j = n}if (h.helper.dropped){var o; if (d.autoid)if (a.isFunction(d.autoid))o = d.autoid.call(this, j); else{o = Math.ceil(Math.random() * 1E3); o = d.autoidprefix + o}a("#" + this.id).jqGrid("addRowData", o, j, d.droppos)}d.ondrop && a.isFunction(d.ondrop) && d.ondrop.call(this, e, h, j)}}, d.drop_opts || {})}, onstart:null, onstop:null, beforedrop:null, ondrop:null, drop_opts:{activeClass:"ui-state-active", hoverClass:"ui-state-hover"}, drag_opts:{revert:"invalid", helper:"clone", cursor:"move", appendTo:"#jqgrid_dnd", zIndex:5E3},
- dropbyname:false, droppos:"first", autoid:true, autoidprefix:"dnd_"}, b || {}); if (b.connectWith){b.connectWith = b.connectWith.split(","); b.connectWith = a.map(b.connectWith, function(d){return a.trim(d)}); a.data(c, "dnd", b); c.p.reccount != "0" && !c.p.jqgdnd && i(); c.p.jqgdnd = true; for (var g = 0; g < b.connectWith.length; g++)a(b.connectWith[g]).droppable(a.isFunction(b.drop)?b.drop.call(a(c), b):b.drop)}}}})}, gridResize:function(b){return this.each(function(){var i = this; if (i.grid && a.fn.resizable){b = a.extend({}, b || {}); if (b.alsoResize){b._alsoResize_ =
- b.alsoResize; delete b.alsoResize} else b._alsoResize_ = false; if (b.stop && a.isFunction(b.stop)){b._stop_ = b.stop; delete b.stop} else b._stop_ = false; b.stop = function(c, g){a(i).jqGrid("setGridParam", {height:a("#gview_" + i.p.id + " .ui-jqgrid-bdiv").height()}); a(i).jqGrid("setGridWidth", g.size.width, b.shrinkToFit); b._stop_ && b._stop_.call(i, c, g)}; b.alsoResize = b._alsoResize_?eval("(" + ("{'#gview_" + i.p.id + " .ui-jqgrid-bdiv':true,'" + b._alsoResize_ + "':true}") + ")"):a(".ui-jqgrid-bdiv", "#gview_" + i.p.id); delete b._alsoResize_;
- a("#gbox_" + i.p.id).resizable(b)}})}})})(jQuery);
+* jqGrid 4.6.0 - jQuery Grid
+* Copyright (c) 2008, Tony Tomov, tony@trirand.com
+* Dual licensed under the MIT or GPL licenses
+* http://www.opensource.org/licenses/mit-license.php
+* http://www.gnu.org/licenses/gpl-2.0.html
+* Date:2014-02-20
+* Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; grid.filter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; jqDnR.js; grid.subgrid.js; grid.grouping.js; grid.treegrid.js; grid.pivot.js; grid.import.js; JsonXml.js; grid.tbltogrid.js; grid.jqueryui.js;
+*/
+(function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{version:"4.6.0",htmlDecode:function(b){return b&&(" "===b||" "===b||1===b.length&&160===b.charCodeAt(0))?"":b?String(b).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&"):b},htmlEncode:function(b){return b?String(b).replace(/&/g,"&").replace(/\"/g,""").replace(//g,">"):b},format:function(e){var f=b.makeArray(arguments).slice(1);null==e&&(e="");return e.replace(/\{(\d+)\}/g,
+function(b,d){return f[d]})},msie:"Microsoft Internet Explorer"===navigator.appName,msiever:function(){var b=-1;null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(b=parseFloat(RegExp.$1));return b},getCellIndex:function(e){e=b(e);if(e.is("tr"))return-1;e=(e.is("td")||e.is("th")?e:e.closest("td,th"))[0];return b.jgrid.msie?b.inArray(e,e.parentNode.cells):e.cellIndex},stripHtml:function(b){b=String(b);var f=/<("[^"]*"|'[^']*'|[^'">])*>/gi;return b?(b=b.replace(f,""))&&" "!==b&&" "!==
+b?b.replace(/\"/g,"'"):"":b},stripPref:function(e,f){var c=b.type(e);if("string"===c||"number"===c)e=String(e),f=""!==e?String(f).replace(String(e),""):f;return f},parse:function(e){"while(1);"===e.substr(0,9)&&(e=e.substr(9));"/*"===e.substr(0,2)&&(e=e.substr(2,e.length-4));e||(e="{}");return!0===b.jgrid.useJSON&&"object"===typeof JSON&&"function"===typeof JSON.parse?JSON.parse(e):eval("("+e+")")},parseDate:function(e,f,c,d){var a=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,l="string"===
+typeof f?f.match(a):null,a=function(a,b){a=String(a);for(b=parseInt(b,10)||2;a.lengthl&&(f[k]=l+1,g.m=f[k])),"F"===e[k]&&(l=b.inArray(f[k],d.monthNames,12),-1!==l&&11
"+e+" "},M=function(a,b,c,d){c=(parseInt(c,10)-1)*parseInt(d,10)+1+b;return'"+c+" "},ea=function(b){var c,d=[],e=0,f;for(f=0;f");a.p.grouping&&(y.push(s),a.p.groupingView._locgr||J.call(n,v,I),s=[]);if(l||!0===a.p.treeGrid)v._id_=b.jgrid.stripPref(a.p.idPrefix,H),a.p.data.push(v),a.p._index[v._id_]=a.p.data.length-1;!1===a.p.gridview&&(b("tbody:first",d).append(s.join("")),n.triggerHandler("jqGridAfterInsertRow",[H,v,w]),g&&a.p.afterInsertRow.call(a,H,v,w),
+s=[]);v={};R++;I++;if(R===D)break}}!0===a.p.gridview&&(A=-1",k="",l,m,n,p,q=function(c){var e;b.isFunction(a.p.onPaging)&&(e=a.p.onPaging.call(a,c));if("stop"===e)return!1;a.p.selrow=null;a.p.multiselect&&(a.p.selarrrow=[],ha(!1));a.p.savedRow=[];return!0};c=c.substr(1);
+e+="_"+c;l="pg_"+c;m=c+"_left";n=c+"_center";p=c+"_right";b("#"+b.jgrid.jqID(c)).append(" ";!0===a.p.viewrecords&&b("td#"+c+"_"+a.p.recordpos,"#"+l).append("");b("td#"+c+"_"+a.p.pagerpos,"#"+l).append(g);k=b(".ui-jqgrid").css("font-size")||
+"11px";b(document.body).append("");g=b(g).clone().appendTo("#testpg").width();b("#testpg").remove();0"+b.jgrid.format(a.p.pgtext||"","","")+" ");!0===a.p.pgbuttons?
+(m=["first"+e,"prev"+e,"next"+e,"last"+e],"rtl"===f&&m.reverse(),g+="",g+=" ",g=g+(""!==d?" "+d+" ":
+"")+(" "),g+=" "):""!==d&&(g+=d);"ltr"===f&&(g+=k);g+=" ",ta,F,ja,fa,ka,y,t,ba,ua=ba="",ga=[],va=[];F=[];if(!0===a.p.shrinkToFit&&!0===a.p.forceFit)for(g=a.p.colModel.length-1;0<=g;g--)if(!a.p.colModel[g].hidden){a.p.colModel[g].resizable=
+!1;break}"horizontal"===a.p.viewsortcols[1]&&(ba=" ui-i-asc",ua=" ui-i-desc");ta=n?"class='ui-th-div-ie'":"";ba=" ";ba=null;b(this).append(D);b("thead tr:first th",this).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});if(this.p.multiselect){var la=[],ca;b("#cb_"+b.jgrid.jqID(a.p.id),this).bind("click",function(){a.p.selarrrow=
+[];var c=!0===a.p.frozenColumns?a.p.id+"_frozen":"";this.checked?(b(a.rows).each(function(d){0 ");if(a.p.multiSort)for(ga=a.p.sortname.split(","),g=0;g
");da+="";k=document.createElement("tbody");this.appendChild(k);b(this).addClass("ui-jqgrid-btable").append(da);var da=null,k=b("");var k=b("tr:first",D),da=" ";a.p.disableClick=!1;b("th",k).each(function(d){ja=a.p.colModel[d].width;void 0===a.p.colModel[d].resizable&&(a.p.colModel[d].resizable=
+!0);a.p.colModel[d].resizable?(fa=document.createElement("span"),b(fa).html(" ").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+f).css("cursor","col-resize"),b(this).addClass(a.p.resizeclass)):fa="";b(this).css("width",ja+"px").prepend(fa);fa=null;var e="";a.p.colModel[d].hidden&&(b(this).css("display","none"),e="display:none;");da+=" ";c.headers[d]={width:ja,el:this};ka=a.p.colModel[d].sortable;"boolean"!==typeof ka&&(ka=a.p.colModel[d].sortable=
+!0);e=a.p.colModel[d].name;"cb"!==e&&"subgrid"!==e&&"rn"!==e&&a.p.viewsortcols[2]&&b(">div",this).addClass("ui-jqgrid-sortable");ka&&(a.p.multiSort?a.p.viewsortcols[0]?(b("div span.s-ico",this).show(),a.p.colModel[d].lso&&b("div span.ui-icon-"+a.p.colModel[d].lso,this).removeClass("ui-state-disabled")):a.p.colModel[d].lso&&(b("div span.s-ico",this).show(),b("div span.ui-icon-"+a.p.colModel[d].lso,this).removeClass("ui-state-disabled")):a.p.viewsortcols[0]?(b("div span.s-ico",this).show(),d===a.p.lastsort&&
+b("div span.ui-icon-"+a.p.sortorder,this).removeClass("ui-state-disabled")):d===a.p.lastsort&&(b("div span.s-ico",this).show(),b("div span.ui-icon-"+a.p.sortorder,this).removeClass("ui-state-disabled")));a.p.footerrow&&(V+=" ")}).mousedown(function(d){if(1===b(d.target).closest("th>span.ui-jqgrid-resize").length){var e=sa(this);if(!0===a.p.forceFit){var g=a.p,f=e,h;for(h=e+1;h").append(D),J=a.p.caption&&!0===a.p.hiddengrid?!0:!1;g=b("");D=null;c.hDiv=document.createElement("div");b(c.hDiv).css({width:c.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(g);b(g).append(k);k=null;J&&b(c.hDiv).hide();a.p.pager&&("string"===typeof a.p.pager?"#"!==a.p.pager.substr(0,1)&&(a.p.pager="#"+a.p.pager):a.p.pager="#"+b(a.p.pager).attr("id"),b(a.p.pager).css({width:c.width+"px"}).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom").appendTo(m),J&&b(a.p.pager).hide(),qa(a.p.pager,""));!1===
+a.p.cellEdit&&!0===a.p.hoverrows&&b(a).bind("mouseover",function(a){t=b(a.target).closest("tr.jqgrow");"ui-subgrid"!==b(t).attr("class")&&b(t).addClass("ui-state-hover")}).bind("mouseout",function(a){t=b(a.target).closest("tr.jqgrow");b(t).removeClass("ui-state-hover")});var B,N,ma;b(a).before(c.hDiv).click(function(c){y=c.target;t=b(y,a.rows).closest("tr.jqgrow");if(0===b(t).length||-1
"+p+" ");k&&(g[g.length]=b(this).jqGrid("addSubGridCell",h+n,1));for(r=h+k+n;r
");f+="";a("body").append(f);a("#sopt_menu").addClass("ui-menu ui-widget ui-widget-content ui-corner-all");a("#sopt_menu > li > a").hover(function(){a(this).addClass("ui-state-hover")},
+function(){a(this).removeClass("ui-state-hover")}).click(function(f){f=a(this).attr("value");var g=a(this).attr("oper");a(c).triggerHandler("jqGridToolbarSelectOper",[f,g,e]);a("#sopt_menu").hide();a(e).text(g).attr("soper",f);!0===b.autosearch&&(g=a(e).parent().next().children()[0],(a(g).val()||"nu"===f||"nn"===f)&&d())})},k=a("'+b.operands[b.odata[q].oper]+" "+b.odata[q].text+" "),e;a.each(c.p.colModel,function(h){var f=this,g,m;m="";var x="=",q,p=a(" "),l=a(""),n=a("
");!0===this.hidden&&a(p).css("display","none");this.search=!1===this.search?!1:!0;void 0===this.stype&&(this.stype="text");g=a.extend({},this.searchoptions||{});if(this.search){if(b.searchOperators){m=g.sopt?g.sopt[0]:
+"select"===f.stype?"eq":b.defaultSearch;for(q=0;q
";h=a.jgrid.jqID(h);a("#"+h).jqFilter({columns:x,filter:b.loadDefaults?r:null,showQuery:b.showQuery,errorcheck:b.errorcheck,sopt:b.sopt,
+groupButton:b.multipleGroup,ruleButtons:b.multipleSearch,afterRedraw:b.afterRedraw,ops:b.odata,operands:b.operands,ajaxSelectOptions:e.p.ajaxSelectOptions,groupOps:b.groupOps,onChange:function(){this.p.showQuery&&a(".query",this).html(this.toUserFriendlyString());a.isFunction(b.afterChange)&&b.afterChange.call(e,a("#"+h),b)},direction:e.p.direction,id:e.p.id});f.append(k);q&&b.tmplFilters&&b.tmplFilters.length&&a(".ui-template",f).bind("change",function(){var c=a(this).val();"default"===c?a("#"+h).jqFilter("addFilter",
+r):a("#"+h).jqFilter("addFilter",b.tmplFilters[parseInt(c,10)]);return!1});!0===b.multipleGroup&&(b.multipleSearch=!0);a(e).triggerHandler("jqGridFilterInitialize",[a("#"+h)]);a.isFunction(b.onInitializeSearch)&&b.onInitializeSearch.call(e,a("#"+h));b.gbox="#gbox_"+h;b.layer?a.jgrid.createModal(s,f,b,"#gview_"+a.jgrid.jqID(e.p.id),a("#gbox_"+a.jgrid.jqID(e.p.id))[0],"#"+a.jgrid.jqID(b.layer),{position:"relative"}):a.jgrid.createModal(s,f,b,"#gview_"+a.jgrid.jqID(e.p.id),a("#gbox_"+a.jgrid.jqID(e.p.id))[0]);
+(b.searchOnEnter||b.closeOnEscape)&&a("#"+a.jgrid.jqID(s.themodal)).keydown(function(c){var d=a(c.target);if(b.searchOnEnter&&13===c.which&&!(d.hasClass("add-group")||d.hasClass("add-rule")||d.hasClass("delete-group")||d.hasClass("delete-rule")||d.hasClass("fm-button")&&d.is("[id$=_query]")))return a("#"+h+"_search").click(),!1;if(b.closeOnEscape&&27===c.which)return a("#"+a.jgrid.jqID(s.modalhead)).find(".ui-jqdialog-titlebar-close").click(),!1});g&&a("#"+h+"_query").bind("click",function(){a(".queryresult",
+f).toggle();return!1});void 0===b.stringResult&&(b.stringResult=b.multipleSearch);a("#"+h+"_search").bind("click",function(){var c=a("#"+h),d={},n,g;c.find(".input-elm:focus").change();g=c.jqFilter("filterData");if(b.errorcheck&&(c[0].hideError(),b.showQuery||c.jqFilter("toSQLString"),c[0].p.error))return c[0].showError(),!1;if(b.stringResult){try{n=xmlJsonClass.toJson(g,"","",!1)}catch(f){try{n=JSON.stringify(g)}catch(k){}}"string"===typeof n&&(d[b.sFilter]=n,a.each([b.sField,b.sValue,b.sOper],function(){d[this]=
+""}))}else b.multipleSearch?(d[b.sFilter]=g,a.each([b.sField,b.sValue,b.sOper],function(){d[this]=""})):(d[b.sField]=g.rules[0].field,d[b.sValue]=g.rules[0].data,d[b.sOper]=g.rules[0].op,d[b.sFilter]="");e.p.search=!0;a.extend(e.p.postData,d);t=a(e).triggerHandler("jqGridFilterSearch");void 0===t&&(t=!0);t&&a.isFunction(b.onSearch)&&(t=b.onSearch.call(e,e.p.filters));!1!==t&&a(e).trigger("reloadGrid",[{page:1}]);b.closeAfterSearch&&a.jgrid.hideModal("#"+a.jgrid.jqID(s.themodal),{gb:"#gbox_"+a.jgrid.jqID(e.p.id),
+jqm:b.jqModal,onClose:b.onClose});return!1});a("#"+h+"_reset").bind("click",function(){var c={},d=a("#"+h);e.p.search=!1;e.p.resetsearch=!0;!1===b.multipleSearch?c[b.sField]=c[b.sValue]=c[b.sOper]="":c[b.sFilter]="";d[0].resetFilter();q&&a(".ui-template",f).val("default");a.extend(e.p.postData,c);t=a(e).triggerHandler("jqGridFilterReset");void 0===t&&(t=!0);t&&a.isFunction(b.onReset)&&(t=b.onReset.call(e));!1!==t&&a(e).trigger("reloadGrid",[{page:1}]);b.closeAfterReset&&a.jgrid.hideModal("#"+a.jgrid.jqID(s.themodal),
+{gb:"#gbox_"+a.jgrid.jqID(e.p.id),jqm:b.jqModal,onClose:b.onClose});return!1});c(a("#"+h));a(".fm-button:not(.ui-state-disabled)",f).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},editGridRow:function(z,c){c=a.extend(!0,{top:0,left:0,width:300,datawidth:"auto",height:"auto",dataheight:"auto",modal:!1,overlay:30,drag:!0,resize:!0,url:null,mtype:"POST",clearAfterAdd:!0,closeAfterEdit:!1,reloadAfterSubmit:!0,onInitializeForm:null,beforeInitData:null,
+beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:!1,jqModal:!0,closeOnEscape:!1,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],closeicon:[],savekey:[!1,13],navkeys:[!1,38,40],checkOnSubmit:!1,checkOnUpdate:!1,_savedData:{},processing:!1,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:!0,overlayClass:"ui-widget-overlay"},a.jgrid.edit,
+c||{});b[a(this)[0].p.id]=c;return this.each(function(){function e(){a(p+" > tbody > tr > td > .FormElement").each(function(){var b=a(".customelement",this);if(b.length){var c=a(b[0]).attr("name");a.each(d.p.colModel,function(){if(this.name===c&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{if(l[c]=this.editoptions.custom_value.call(d,a("#"+a.jgrid.jqID(c),p),"get"),void 0===l[c])throw"e1";}catch(b){"e1"===b?a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+
+a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose):a.jgrid.info_dialog(a.jgrid.errors.errcap,b.message,a.jgrid.edit.bClose)}return!0}})}else{switch(a(this).get(0).type){case "checkbox":a(this).is(":checked")?l[this.name]=a(this).val():(b=a(this).attr("offval"),l[this.name]=b);break;case "select-one":l[this.name]=a("option:selected",this).val();break;case "select-multiple":l[this.name]=a(this).val();l[this.name]=l[this.name]?l[this.name].join(","):"";a("option:selected",this).each(function(b,c){a(c).text()});
+break;case "password":case "text":case "textarea":case "button":l[this.name]=a(this).val()}d.p.autoencode&&(l[this.name]=a.jgrid.htmlEncode(l[this.name]))}});return!0}function h(c,e,n,f){var k,l,p,h=0,q,m,r,C=[],u=!1,z="",t;for(t=1;t<=f;t++)z+=""+v+m+" "+g+d+" ";"_empty"!==c&&(u=a(e).jqGrid("getInd",c));a(e.p.colModel).each(function(t){k=this.name;m=(l=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1)?"style='display:none'":"";
+if("cb"!==k&&"subgrid"!==k&&!0===this.editable&&"rn"!==k){if(!1===u)q="";else if(k===e.p.ExpandColumn&&!0===e.p.treeGrid)q=a("td[role='gridcell']:eq("+t+")",e.rows[u]).text();else{try{q=a.unformat.call(e,a("td[role='gridcell']:eq("+t+")",e.rows[u]),{rowId:c,colModel:this},t)}catch(w){q=this.edittype&&"textarea"===this.edittype?a("td[role='gridcell']:eq("+t+")",e.rows[u]).text():a("td[role='gridcell']:eq("+t+")",e.rows[u]).html()}if(!q||" "===q||" "===q||1===q.length&&160===q.charCodeAt(0))q=
+""}var s=a.extend({},this.editoptions||{},{id:k,name:k}),y=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:!1,rowcontent:""},this.formoptions||{}),v=parseInt(y.rowpos,10)||h+1,A=parseInt(2*(parseInt(y.colpos,10)||1),10);"_empty"===c&&s.defaultValue&&(q=a.isFunction(s.defaultValue)?s.defaultValue.call(d):s.defaultValue);this.edittype||(this.edittype="text");d.p.autoencode&&(q=a.jgrid.htmlDecode(q));r=a.jgrid.createEl.call(d,this.edittype,s,q,!1,a.extend({},a.jgrid.ajaxOptions,e.p.ajaxSelectOptions||
+{}));if(b[d.p.id].checkOnSubmit||b[d.p.id].checkOnUpdate)b[d.p.id]._savedData[k]=q;a(r).addClass("FormElement");-1"+y.rowcontent+" ");a(n).append(x);x[0].rp=v}0===p.length&&(p=a("").addClass("FormData").attr("id","tr_"+k),a(p).append(z),a(n).append(p),
+p[0].rp=v);a("td:eq("+(A-2)+")",p[0]).html(void 0===y.label?e.p.colNames[t]:y.label);a("td:eq("+(A-1)+")",p[0]).append(y.elmprefix).append(r).append(y.elmsuffix);"custom"===this.edittype&&a.isFunction(s.custom_value)&&s.custom_value.call(d,a("#"+k,"#"+g),"set",q);a.jgrid.bindEv.call(d,r,s);C[h]=t;h++}});0