|
|
/* This file results from the fusion of the following files : jquery-1.7.min.js, jquery-ui-1.8.16.custom.min.js, jquery.dropkick-1.0.0.js, jquery.event.drag-2.2.js, jquery.json-2.3.min.js, slick.core.js, slick.editors.js, slick.formatters.js, slick.grid.js, slick.enhancementpager.js, sha1-min.js, index.js, */ |
|
|
|
|
|
|
|
|
/*! jQuery v1.7 jquery.com | jquery.org/license */ |
|
|
(function(a,b){function cA(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cx(a){if(!cm[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cn||(cn=c.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),b.appendChild(cn);if(!co||!cn.createElement)co=(cn.contentWindow||cn.contentDocument).document,co.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),co.close();d=co.createElement(a),co.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cn)}cm[a]=e}return cm[a]}function cw(a,b){var c={};f.each(cs.concat.apply([],cs.slice(0,b)),function(){c[this]=a});return c}function cv(){ct=b}function cu(){setTimeout(cv,0);return ct=f.now()}function cl(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ck(){try{return new a.XMLHttpRequest}catch(b){}}function ce(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cd(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function cc(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bG.test(a)?d(a,e):cc(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)cc(a+"["+e+"]",b[e],c,d);else d(a,b)}function cb(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function ca(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bV,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=ca(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=ca(a,c,d,e,"*",g));return l}function b_(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bR),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bE(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bz:bA;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bB(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function br(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bi,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bq(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bp(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bp)}function bp(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bo(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bn(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bm(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bl(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function X(a){var b=Y.split(" "),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(){return!0}function M(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.add(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;B.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return a!=null&&m.test(a)&&!isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:H?function(a){return a==null?"":H.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?F.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(I)return I.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=G.call(arguments,2),g=function(){return a.apply(c,f.concat(G.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){c.removeEventListener("DOMContentLoaded",C,!1),e.ready()}:c.attachEvent&&(C=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",C),e.ready())}),typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return e});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){return i.done.apply(i,arguments).fail.apply(i,arguments)},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/><nav></nav>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!a.getElementsByTagName("nav").length,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",enctype:!!c.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.lastChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-999px",top:"-999px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;f(function(){var a,b,d,e,g,h,i=1,j="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",l="visibility:hidden;border:0;",n="style='"+j+"border:5px solid #000;padding:0;'",p="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>";m=c.getElementsByTagName("body")[0];!m||(a=c.createElement("div"),a.style.cssText=l+"width:0;height:0;position:static;top:0;margin-top:"+i+"px",m.insertBefore(a,m.firstChild),o=c.createElement("div"),o.style.cssText=j+l,o.innerHTML=p,a.appendChild(o),b=o.firstChild,d=b.firstChild,g=b.nextSibling.firstChild.firstChild,h={doesNotAddBorder:d.offsetTop!==5,doesAddBorderForTableAndCells:g.offsetTop===5},d.style.position="fixed",d.style.top="20px",h.fixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",b.style.overflow="hidden",b.style.position="relative",h.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,h.doesNotIncludeMarginInBodyOffset=m.offsetTop!==i,m.removeChild(a),o=a=null,f.extend(k,h))}),o.innerHTML="",n.removeChild(o),o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[f.expando]:a[f.expando]&&f.expando,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[f.expando]=n=++f.uuid:n=f.expando),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[f.expando]:f.expando;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)?b=b:b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" "));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];if(!arguments.length){if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}return b}e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!a||j===3||j===8||j===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g},removeAttr:function(a,b){var c,d,e,g,h=0;if(a.nodeType===1){d=(b||"").split(p),g=d.length;for(;h<g;h++)e=d[h].toLowerCase(),c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1)}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},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(a,c,d){var e,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return b;h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/\.(.*)$/,A=/^(?:textarea|input|select)$/i,B=/\./g,C=/ /g,D=/[^\w\s.|`]/g,E=/^([^\.]*)?(?:\.(.+))?$/,F=/\bhover(\.\S+)?/,G=/^key/,H=/^(?:mouse|contextmenu)|click/,I=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,J=function(a){var b=I.exec(a);b&& |
|
|
(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},K=function(a,b){return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||a.id===b[2])&&(!b[3]||b[3].test(a.className))},L=function(a){return f.event.special.hover?a:a.replace(F,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=L(c).split(" ");for(k=0;k<c.length;k++){l=E.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,namespace:n.join(".")},p),g&&(o.quick=J(g),!o.quick&&f.expr.match.POS.test(g)&&(o.isPositional=!0)),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d){var e=f.hasData(a)&&f._data(a),g,h,i,j,k,l,m,n,o,p,q;if(!!e&&!!(m=e.events)){b=L(b||"").split(" ");for(g=0;g<b.length;g++){h=E.exec(b[g])||[],i=h[1],j=h[2];if(!i){j=j?"."+j:"";for(l in m)f.event.remove(a,l+j,c,d);return}n=f.event.special[i]||{},i=(d?n.delegateType:n.bindType)||i,p=m[i]||[],k=p.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;if(c||j||d||n.remove)for(l=0;l<p.length;l++){q=p[l];if(!c||c.guid===q.guid)if(!j||j.test(q.namespace))if(!d||d===q.selector||d==="**"&&q.selector)p.splice(l--,1),q.selector&&p.delegateCount--,n.remove&&n.remove.call(a,q)}else p.length=0;p.length===0&&k!==p.length&&((!n.teardown||n.teardown.call(a,j)===!1)&&f.removeEvent(a,i,e.handle),delete m[i])}f.isEmptyObject(m)&&(o=e.handle,o&&(o.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"",(g||!e)&&c.preventDefault();if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,n=null;for(m=e.parentNode;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length;l++){m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d);if(c.isPropagationStopped())break}c.type=h,c.isDefaultPrevented()||(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=(f.event.special[c.type]||{}).handle,j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click"))for(m=c.target;m!=this;m=m.parentNode||this){o={},q=[];for(k=0;k<e;k++)r=d[k],s=r.selector,t=o[s],r.isPositional?t=(t||(o[s]=f(s))).index(m)>=0:t===b&&(t=o[s]=r.quick?K(m,r.quick):f(m).is(s)),t&&q.push(r);q.length&&j.push({elem:m,matches:q})}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){p=j[k],c.currentTarget=p.elem;for(l=0;l<p.matches.length&&!c.isImmediatePropagationStopped();l++){r=p.matches[l];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=(i||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},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(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},focus:{delegateType:"focusin",noBubble:!0},blur:{delegateType:"focusout",noBubble:!0},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?N:M):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=N;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=N;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=N,this.stopPropagation()},isDefaultPrevented:M,isPropagationStopped:M,isImmediatePropagationStopped:M},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]=f.event.special[b]={delegateType:b,bindType:b,handle:function(a){var b=this,c=a.relatedTarget,d=a.handleObj,e=d.selector,g,h;if(!c||d.origType===a.type||c!==b&&!f.contains(b,c))g=a.type,a.type=d.origType,h=d.handler.apply(this,arguments),a.type=g;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(A.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;A.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return A.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=M;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=M);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.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(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),G.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),H.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw"Syntax error, unrecognized expression: "+a};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.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(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?T.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",Z=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,_=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ba=/<([\w:]+)/,bb=/<tbody/i,bc=/<|&#?\w+;/,bd=/<(?:script|style)/i,be=/<(?:script|object|embed|option|style)/i,bf=new RegExp("<(?:"+Y.replace(" ","|")+")","i"),bg=/checked\s*(?:[^=]|=\s*.checked.)/i,bh=/\/(java|ecma)script/i,bi=/^\s*<!(?:\[CDATA\[|\-\-)/,bj={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bk=X(c);bj.optgroup=bj.option,bj.tbody=bj.tfoot=bj.colgroup=bj.caption=bj.thead,bj.th=bj.td,f.support.htmlSerialize||(bj._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after" |
|
|
,arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Z,""):null;if(typeof a=="string"&&!bd.test(a)&&(f.support.leadingWhitespace||!$.test(a))&&!bj[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(_,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bg.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bl(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,br)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!be.test(j)&&(f.support.checkClone||!bg.test(j))&&!f.support.unknownElems&&bf.test(j)&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bn(a,d),e=bo(a),g=bo(d);for(h=0;e[h];++h)g[h]&&bn(e[h],g[h])}if(b){bm(a,d);if(c){e=bo(a),g=bo(d);for(h=0;e[h];++h)bm(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bc.test(k))k=b.createTextNode(k);else{k=k.replace(_,"<$1></$2>");var l=(ba.exec(k)||["",""])[1].toLowerCase(),m=bj[l]||bj._default,n=m[0],o=b.createElement("div");b===c?bk.appendChild(o):X(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=bb.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&$.test(k)&&o.insertBefore(b.createTextNode($.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bq(k[i]);else bq(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bh.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bs=/alpha\([^)]*\)/i,bt=/opacity=([^)]*)/,bu=/([A-Z]|^ms)/g,bv=/^-?\d+(?:px)?$/i,bw=/^-?\d/,bx=/^([\-+])=([\-+.\de]+)/,by={position:"absolute",visibility:"hidden",display:"block"},bz=["Left","Right"],bA=["Top","Bottom"],bB,bC,bD;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bB(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bx.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bB)return bB(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bE(a,b,d);f.swap(a,by,function(){e=bE(a,b,d)});return e}},set:function(a,b){if(!bv.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bt.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bs,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bs.test(g)?g.replace(bs,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bB(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bC=function(a,c){var d,e,g;c=c.replace(bu,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bD=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bv.test(f)&&bw.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bB=bC||bD,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bF=/%20/g,bG=/\[\]$/,bH=/\r?\n/g,bI=/#.*$/,bJ=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bK=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bL=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bM=/^(?:GET|HEAD)$/,bN=/^\/\//,bO=/\?/,bP=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bQ=/^(?:select|textarea)/i,bR=/\s+/,bS=/([?&])_=[^&]*/,bT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bU=f.fn.load,bV={},bW={},bX,bY,bZ=["*/"]+["*"];try{bX=e.href}catch(b$){bX=c.createElement("a"),bX.href="",bX=bX.href}bY=bT.exec(bX.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bU)return bU.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bP,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bQ.test(this.nodeName)||bK.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bH,"\r\n")}}):{name:b.name,value:c.replace(bH,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?cb(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),cb(a,b);return a},ajaxSettings:{url:bX,isLocal:bL.test(bY[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bZ},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b_(bV),ajaxTransport:b_(bW),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cd(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=ce(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bJ.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bI,"").replace(bN,bY[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bR),d.crossDomain==null&&(r=bT.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bY[1]&&r[2]==bY[2]&&(r[3]||(r[1]==="http:"?80:443))==(bY[3]||(bY[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),ca(bV,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bM.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bO.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bS,"$1_="+x);d.url=y+(y===d.url?(bO.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bZ+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=ca(bW,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)cc(g,a[g],c,e);return d.join("&").replace(bF,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cf=f.now(),cg=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cf++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cg.test(b.url)||e&&cg.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cg,l),b.url===j&&(e&&(k=k.replace(cg,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ch=a.ActiveXObject?function(){for(var a in cj)cj[a](0,1)}:!1,ci=0,cj;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ck()||cl()}:ck,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ch&&delete cj[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++ci,ch&&(cj||(cj={},f(a).unload(ch)),cj[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cm={},cn,co,cp=/^(?:toggle|show|hide)$/,cq=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cr,cs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ct;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cw("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cx(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cw("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cw("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cx(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cp.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=cq.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cw("show",1),slideUp:cw("hide",1),slideToggle:cw("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=ct||cu(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cr&&(cr=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=ct||cu(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cr),cr=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now))}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cy=/^t(?:able|d|h)$/i,cz=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cA(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cy.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cz.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cz.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cA(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cA(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);/*! |
|
|
* jQuery UI 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI |
|
|
*/ |
|
|
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16", |
|
|
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d= |
|
|
this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this, |
|
|
"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart": |
|
|
"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight, |
|
|
outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a, |
|
|
"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&& |
|
|
a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&& |
|
|
c.ui.isOverAxis(b,e,i)}})}})(jQuery); |
|
|
;/*! |
|
|
* jQuery UI Widget 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Widget |
|
|
*/ |
|
|
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]= |
|
|
function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)): |
|
|
d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options= |
|
|
b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+ |
|
|
"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled", |
|
|
c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); |
|
|
;/*! |
|
|
* jQuery UI Mouse 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Mouse |
|
|
* |
|
|
* Depends: |
|
|
* jquery.ui.widget.js |
|
|
*/ |
|
|
(function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+ |
|
|
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted= |
|
|
this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&& |
|
|
!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= |
|
|
false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Position 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Position |
|
|
*/ |
|
|
(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, |
|
|
left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= |
|
|
k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= |
|
|
m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= |
|
|
d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= |
|
|
a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), |
|
|
g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Draggable 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Draggables |
|
|
* |
|
|
* Depends: |
|
|
* jquery.ui.core.js |
|
|
* jquery.ui.mouse.js |
|
|
* jquery.ui.widget.js |
|
|
*/ |
|
|
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== |
|
|
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= |
|
|
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options; |
|
|
this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); |
|
|
this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, |
|
|
_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= |
|
|
false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, |
|
|
10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| |
|
|
!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& |
|
|
a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= |
|
|
this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), |
|
|
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), |
|
|
10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, |
|
|
(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= |
|
|
"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), |
|
|
10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ |
|
|
this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& |
|
|
!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.left<g[0])e=g[0]+this.offset.click.left; |
|
|
if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/ |
|
|
b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version< |
|
|
526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b, |
|
|
c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.16"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert}); |
|
|
h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval= |
|
|
false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true); |
|
|
this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top; |
|
|
c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&& |
|
|
this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity= |
|
|
a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!= |
|
|
"x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left< |
|
|
c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()- |
|
|
c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this, |
|
|
width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.width,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e&&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&& |
|
|
o<m+e){if(f.snapMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=Math.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left}var t= |
|
|
p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&& |
|
|
(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"), |
|
|
10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Droppable 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Droppables |
|
|
* |
|
|
* Depends: |
|
|
* jquery.ui.core.js |
|
|
* jquery.ui.widget.js |
|
|
* jquery.ui.mouse.js |
|
|
* jquery.ui.draggable.js |
|
|
*/ |
|
|
(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this); |
|
|
a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&& |
|
|
this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass); |
|
|
this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g= |
|
|
d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop", |
|
|
a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.16"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height; |
|
|
switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>= |
|
|
i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!= |
|
|
"none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem|| |
|
|
a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parents(":not(body,html)").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance); |
|
|
if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parents(":not(body,html)").unbind("scroll.droppable"); |
|
|
a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Resizable 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Resizables |
|
|
* |
|
|
* Depends: |
|
|
* jquery.ui.core.js |
|
|
* jquery.ui.mouse.js |
|
|
* jquery.ui.widget.js |
|
|
*/ |
|
|
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element, |
|
|
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), |
|
|
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= |
|
|
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", |
|
|
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== |
|
|
String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); |
|
|
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); |
|
|
var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= |
|
|
false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); |
|
|
this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= |
|
|
{width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; |
|
|
if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false}, |
|
|
_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f, |
|
|
{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight: |
|
|
Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(c<a.maxWidth)a.maxWidth=c;if(f<a.maxHeight)a.maxHeight=f}this._vBoundaries=a},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width= |
|
|
b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(k(b.height))b.width=b.height*this.aspectRatio;else if(k(b.width))b.height=b.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this._vBoundaries,c=this.axis,d=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=k(b.width)&&a.minWidth&& |
|
|
a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left= |
|
|
null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)|| |
|
|
0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ |
|
|
a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+ |
|
|
c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]); |
|
|
b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(), |
|
|
10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top- |
|
|
f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType? |
|
|
e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a= |
|
|
e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing, |
|
|
step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= |
|
|
e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset; |
|
|
var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left: |
|
|
a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top- |
|
|
d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition, |
|
|
f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, |
|
|
display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b= |
|
|
e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height= |
|
|
d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Selectable 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Selectables |
|
|
* |
|
|
* Depends: |
|
|
* jquery.ui.core.js |
|
|
* jquery.ui.mouse.js |
|
|
* jquery.ui.widget.js |
|
|
*/ |
|
|
(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), |
|
|
selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, |
|
|
c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", |
|
|
c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= |
|
|
this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting"); |
|
|
a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&& |
|
|
!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d= |
|
|
e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.16"})})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Sortable 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Sortables |
|
|
* |
|
|
* Depends: |
|
|
* jquery.ui.core.js |
|
|
* jquery.ui.mouse.js |
|
|
* jquery.ui.widget.js |
|
|
*/ |
|
|
(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); |
|
|
this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== |
|
|
"disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& |
|
|
!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, |
|
|
left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; |
|
|
this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= |
|
|
document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); |
|
|
return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top< |
|
|
b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()- |
|
|
b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this, |
|
|
a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], |
|
|
e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); |
|
|
c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): |
|
|
this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, |
|
|
dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, |
|
|
toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers|| |
|
|
this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection(); |
|
|
var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)}, |
|
|
_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); |
|
|
if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), |
|
|
this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element), |
|
|
this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&& |
|
|
this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= |
|
|
this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= |
|
|
d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| |
|
|
0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", |
|
|
a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- |
|
|
f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b= |
|
|
this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width== |
|
|
""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top= |
|
|
this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a= |
|
|
{top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"), |
|
|
10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"? |
|
|
document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), |
|
|
10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b= |
|
|
this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&& |
|
|
this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset(); |
|
|
var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- |
|
|
this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g- |
|
|
this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0], |
|
|
this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]= |
|
|
"";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove", |
|
|
f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, |
|
|
this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", |
|
|
a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()}, |
|
|
_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.16"})})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Slider 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Slider |
|
|
* |
|
|
* Depends: |
|
|
* jquery.ui.core.js |
|
|
* jquery.ui.mouse.js |
|
|
* jquery.ui.widget.js |
|
|
*/ |
|
|
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+ |
|
|
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>"); |
|
|
this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", |
|
|
g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length? |
|
|
(h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i- |
|
|
m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); |
|
|
return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false; |
|
|
this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= |
|
|
this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= |
|
|
this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b); |
|
|
c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c<f))c=f;if(c!==this.values(b)){f=this.values();f[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:f});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c}); |
|
|
a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value= |
|
|
this._trimAlignValue(a);this._refreshValue();this._change(null,0)}else return this._value()},values:function(a,b){var c,f,e;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a): |
|
|
this.value();else return this._values()},_setOption:function(a,b){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation(); |
|
|
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a]; |
|
|
return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= |
|
|
this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e- |
|
|
g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"}, |
|
|
b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Datepicker 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Datepicker |
|
|
* |
|
|
* Depends: |
|
|
* jquery.ui.core.js |
|
|
*/ |
|
|
(function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass= |
|
|
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su", |
|
|
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10", |
|
|
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout", |
|
|
function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); |
|
|
b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv}, |
|
|
setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g, |
|
|
"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", |
|
|
function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c== |
|
|
"focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker(): |
|
|
d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a, |
|
|
b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+= |
|
|
1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ |
|
|
2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b= |
|
|
d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e= |
|
|
a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a, |
|
|
"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f== |
|
|
a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"? |
|
|
d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e); |
|
|
this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl"); |
|
|
b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"onSelect")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b])}else d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target, |
|
|
a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c= |
|
|
a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b, |
|
|
"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode); |
|
|
return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input", |
|
|
a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value= |
|
|
"";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b); |
|
|
c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing= |
|
|
true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}); |
|
|
a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&& |
|
|
!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(), |
|
|
h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b= |
|
|
this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b); |
|
|
this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, |
|
|
_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): |
|
|
0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"? |
|
|
"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a); |
|
|
this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField"); |
|
|
if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"? |
|
|
b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a.length&&a.charAt(A+1)==p)&&A++;return p},m=function(p){var D= |
|
|
o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s= |
|
|
function(){if(b.charAt(q)!=a.charAt(A))throw"Unexpected literal at position "+q;q++},q=0,A=0;A<a.length;A++)if(k)if(a.charAt(A)=="'"&&!o("'"))k=false;else s();else switch(a.charAt(A)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+ |
|
|
1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd", |
|
|
COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames: |
|
|
null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()- |
|
|
(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f= |
|
|
0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a); |
|
|
var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date; |
|
|
i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g= |
|
|
Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()> |
|
|
12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& |
|
|
a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? |
|
|
new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a)); |
|
|
n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m, |
|
|
g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&& |
|
|
a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+ |
|
|
B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O= |
|
|
"";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&& |
|
|
x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, |
|
|
z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()== |
|
|
P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?" ":L?'<span class="ui-state-default">'+ |
|
|
r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>': |
|
|
"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&& |
|
|
(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b, |
|
|
e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+ |
|
|
(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input? |
|
|
a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c, |
|
|
e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, |
|
|
"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; |
|
|
if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a== |
|
|
"string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/ |
|
|
*/ |
|
|
jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], |
|
|
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, |
|
|
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= |
|
|
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", |
|
|
"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, |
|
|
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, |
|
|
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, |
|
|
d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; |
|
|
f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, |
|
|
[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b= |
|
|
0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}), |
|
|
d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement; |
|
|
if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)}); |
|
|
return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this, |
|
|
arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/ |
|
|
2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b, |
|
|
d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c, |
|
|
a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b, |
|
|
d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g= |
|
|
0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158; |
|
|
if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c, |
|
|
a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Blind 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Blind |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a, |
|
|
g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Bounce 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Bounce |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/ |
|
|
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a); |
|
|
b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Clip 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Clip |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position, |
|
|
c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Drop 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Drop |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e== |
|
|
"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Explode 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Explode |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f= |
|
|
0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ |
|
|
e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Fade 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Fade |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Fold 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Fold |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], |
|
|
10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Highlight 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Highlight |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& |
|
|
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Pulsate 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Pulsate |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration, |
|
|
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Scale 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Scale |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a, |
|
|
b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity= |
|
|
1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"], |
|
|
p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}}; |
|
|
if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a); |
|
|
a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from); |
|
|
child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a, |
|
|
n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Shake 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Shake |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]= |
|
|
(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Slide 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Slide |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e); |
|
|
var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); |
|
|
;/* |
|
|
* jQuery UI Effects Transfer 1.8.16 |
|
|
* |
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
|
|
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
|
* http://jquery.org/license |
|
|
* |
|
|
* http://docs.jquery.com/UI/Effects/Transfer |
|
|
* |
|
|
* Depends: |
|
|
* jquery.effects.core.js |
|
|
*/ |
|
|
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); |
|
|
b.dequeue()})})}})(jQuery); |
|
|
;/** |
|
|
* DropKick |
|
|
* |
|
|
* Highly customizable <select> lists |
|
|
* https://github.com/JamieLottering/DropKick |
|
|
* |
|
|
* © 2011 Jamie Lottering <http://github.com/JamieLottering> |
|
|
* <http://twitter.com/JamieLottering> |
|
|
* |
|
|
*/ |
|
|
(function ($, window, document) { |
|
|
|
|
|
var ie6 = false; |
|
|
|
|
|
// Help prevent flashes of unstyled content |
|
|
if ($.browser.msie && $.browser.version.substr(0, 1) < 7) { |
|
|
ie6 = true; |
|
|
} else { |
|
|
document.documentElement.className = document.documentElement.className + ' dk_fouc'; |
|
|
} |
|
|
|
|
|
var |
|
|
// Public methods exposed to $.fn.dropkick() |
|
|
methods = {}, |
|
|
|
|
|
// Cache every <select> element that gets dropkicked |
|
|
lists = [], |
|
|
|
|
|
// Convenience keys for keyboard navigation |
|
|
keyMap = { |
|
|
'left' : 37, |
|
|
'up' : 38, |
|
|
'right' : 39, |
|
|
'down' : 40, |
|
|
'enter' : 13 |
|
|
}, |
|
|
|
|
|
// HTML template for the dropdowns |
|
|
dropdownTemplate = [ |
|
|
'<div class="dk_container" id="dk_container_{{ id }}" tabindex="{{ tabindex }}">', |
|
|
'<a class="dk_toggle">', |
|
|
'<span class="dk_label">{{ label }}</span>', |
|
|
'</a>', |
|
|
'<div class="dk_options">', |
|
|
'<ul class="dk_options_inner">', |
|
|
'</ul>', |
|
|
'</div>', |
|
|
'</div>' |
|
|
].join(''), |
|
|
|
|
|
// HTML template for dropdown options |
|
|
optionTemplate = '<li class="{{ current }}"><a data-dk-dropdown-value="{{ value }}">{{ text }}</a></li>', |
|
|
|
|
|
// Some nice default values |
|
|
defaults = { |
|
|
startSpeed : 1000, // I recommend a high value here, I feel it makes the changes less noticeable to the user |
|
|
theme : false, |
|
|
change : false |
|
|
}, |
|
|
|
|
|
// Make sure we only bind keydown on the document once |
|
|
keysBound = false |
|
|
; |
|
|
|
|
|
// Called by using $('foo').dropkick(); |
|
|
methods.init = function (settings) { |
|
|
settings = $.extend({}, defaults, settings); |
|
|
|
|
|
return this.each(function () { |
|
|
var |
|
|
// The current <select> element |
|
|
$select = $(this), |
|
|
|
|
|
// Store a reference to the originally selected <option> element |
|
|
$original = $select.find(':selected').first(), |
|
|
|
|
|
// Save all of the <option> elements |
|
|
$options = $select.find('option'), |
|
|
|
|
|
// We store lots of great stuff using jQuery data |
|
|
data = $select.data('dropkick') || {}, |
|
|
|
|
|
// This gets applied to the 'dk_container' element |
|
|
id = $select.attr('id') || $select.attr('name'), |
|
|
|
|
|
// This gets updated to be equal to the longest <option> element |
|
|
width = settings.width || $select.outerWidth(), |
|
|
|
|
|
// Check if we have a tabindex set or not |
|
|
tabindex = $select.attr('tabindex') ? $select.attr('tabindex') : '', |
|
|
|
|
|
// The completed dk_container element |
|
|
$dk = false, |
|
|
|
|
|
theme |
|
|
; |
|
|
|
|
|
// Dont do anything if we've already setup dropkick on this element |
|
|
if (data.id) { |
|
|
return $select; |
|
|
} else { |
|
|
data.settings = settings; |
|
|
data.tabindex = tabindex; |
|
|
data.id = id; |
|
|
data.$original = $original; |
|
|
data.$select = $select; |
|
|
data.value = _notBlank($select.val()) || _notBlank($original.attr('value')); |
|
|
data.label = $original.text(); |
|
|
data.options = $options; |
|
|
} |
|
|
|
|
|
// Build the dropdown HTML |
|
|
$dk = _build(dropdownTemplate, data); |
|
|
|
|
|
// Make the dropdown fixed width if desired |
|
|
$dk.find('.dk_toggle').css({ |
|
|
'width' : width + 'px' |
|
|
}); |
|
|
|
|
|
// Hide the <select> list and place our new one in front of it |
|
|
$select.before($dk); |
|
|
|
|
|
// Update the reference to $dk |
|
|
$dk = $('#dk_container_' + id).fadeIn(settings.startSpeed); |
|
|
|
|
|
// Save the current theme |
|
|
theme = settings.theme ? settings.theme : 'default'; |
|
|
$dk.addClass('dk_theme_' + theme); |
|
|
data.theme = theme; |
|
|
|
|
|
// Save the updated $dk reference into our data object |
|
|
data.$dk = $dk; |
|
|
|
|
|
// Save the dropkick data onto the <select> element |
|
|
$select.data('dropkick', data); |
|
|
|
|
|
// Do the same for the dropdown, but add a few helpers |
|
|
$dk.data('dropkick', data); |
|
|
|
|
|
lists[lists.length] = $select; |
|
|
|
|
|
// Focus events |
|
|
$dk.bind('focus.dropkick', function (e) { |
|
|
$dk.addClass('dk_focus'); |
|
|
}).bind('blur.dropkick', function (e) { |
|
|
$dk.removeClass('dk_open dk_focus'); |
|
|
}); |
|
|
|
|
|
setTimeout(function () { |
|
|
$select.hide(); |
|
|
}, 0); |
|
|
}); |
|
|
}; |
|
|
|
|
|
// Allows dynamic theme changes |
|
|
methods.theme = function (newTheme) { |
|
|
var |
|
|
$select = $(this), |
|
|
list = $select.data('dropkick'), |
|
|
$dk = list.$dk, |
|
|
oldtheme = 'dk_theme_' + list.theme |
|
|
; |
|
|
|
|
|
$dk.removeClass(oldtheme).addClass('dk_theme_' + newTheme); |
|
|
|
|
|
list.theme = newTheme; |
|
|
}; |
|
|
|
|
|
// Reset all <selects and dropdowns in our lists array |
|
|
methods.reset = function () { |
|
|
for (var i = 0, l = lists.length; i < l; i++) { |
|
|
var |
|
|
listData = lists[i].data('dropkick'), |
|
|
$dk = listData.$dk, |
|
|
$current = $dk.find('li').first() |
|
|
; |
|
|
|
|
|
$dk.find('.dk_label').text(listData.label); |
|
|
$dk.find('.dk_options_inner').animate({ scrollTop: 0 }, 0); |
|
|
|
|
|
_setCurrent($current, $dk); |
|
|
_updateFields($current, $dk, true); |
|
|
} |
|
|
}; |
|
|
|
|
|
// Expose the plugin |
|
|
$.fn.dropkick = function (method) { |
|
|
if (!ie6) { |
|
|
if (methods[method]) { |
|
|
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); |
|
|
} else if (typeof method === 'object' || ! method) { |
|
|
return methods.init.apply(this, arguments); |
|
|
} |
|
|
} |
|
|
}; |
|
|
|
|
|
// private |
|
|
function _handleKeyBoardNav(e, $dk) { |
|
|
var |
|
|
code = e.keyCode, |
|
|
data = $dk.data('dropkick'), |
|
|
options = $dk.find('.dk_options'), |
|
|
open = $dk.hasClass('dk_open'), |
|
|
current = $dk.find('.dk_option_current'), |
|
|
first = options.find('li').first(), |
|
|
last = options.find('li').last(), |
|
|
next, |
|
|
prev |
|
|
; |
|
|
|
|
|
switch (code) { |
|
|
case keyMap.enter: |
|
|
if (open) { |
|
|
_updateFields(current.find('a'), $dk); |
|
|
_closeDropdown($dk); |
|
|
} else { |
|
|
_openDropdown($dk); |
|
|
} |
|
|
e.preventDefault(); |
|
|
break; |
|
|
|
|
|
case keyMap.up: |
|
|
prev = current.prev('li'); |
|
|
if (open) { |
|
|
if (prev.length) { |
|
|
_setCurrent(prev, $dk); |
|
|
} else { |
|
|
_setCurrent(last, $dk); |
|
|
} |
|
|
} else { |
|
|
_openDropdown($dk); |
|
|
} |
|
|
e.preventDefault(); |
|
|
break; |
|
|
|
|
|
case keyMap.down: |
|
|
if (open) { |
|
|
next = current.next('li').first(); |
|
|
if (next.length) { |
|
|
_setCurrent(next, $dk); |
|
|
} else { |
|
|
_setCurrent(first, $dk); |
|
|
} |
|
|
} else { |
|
|
_openDropdown($dk); |
|
|
} |
|
|
e.preventDefault(); |
|
|
break; |
|
|
|
|
|
default: |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
// Update the <select> value, and the dropdown label |
|
|
function _updateFields(option, $dk, reset) { |
|
|
var value, label, data; |
|
|
|
|
|
value = option.attr('data-dk-dropdown-value'); |
|
|
label = option.text(); |
|
|
data = $dk.data('dropkick'); |
|
|
|
|
|
$select = data.$select; |
|
|
$select.val(value); |
|
|
|
|
|
$dk.find('.dk_label').text(label); |
|
|
|
|
|
reset = reset || false; |
|
|
|
|
|
if (data.settings.change && !reset) { |
|
|
data.settings.change.call($select, value, label); |
|
|
} |
|
|
} |
|
|
|
|
|
// Set the currently selected option |
|
|
function _setCurrent($current, $dk) { |
|
|
$dk.find('.dk_option_current').removeClass('dk_option_current'); |
|
|
$current.addClass('dk_option_current'); |
|
|
|
|
|
_setScrollPos($dk, $current); |
|
|
} |
|
|
|
|
|
function _setScrollPos($dk, anchor) { |
|
|
var height = anchor.prevAll('li').outerHeight() * anchor.prevAll('li').length; |
|
|
$dk.find('.dk_options_inner').animate({ scrollTop: height + 'px' }, 0); |
|
|
} |
|
|
|
|
|
// Close a dropdown |
|
|
function _closeDropdown($dk) { |
|
|
$dk.removeClass('dk_open'); |
|
|
} |
|
|
|
|
|
// Open a dropdown |
|
|
function _openDropdown($dk) { |
|
|
var data = $dk.data('dropkick'); |
|
|
$dk.find('.dk_options').css({ top : $dk.find('.dk_toggle').outerHeight() - 1 }); |
|
|
$dk.toggleClass('dk_open'); |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
* Turn the dropdownTemplate into a jQuery object and fill in the variables. |
|
|
*/ |
|
|
function _build (tpl, view) { |
|
|
var |
|
|
// Template for the dropdown |
|
|
template = tpl, |
|
|
// Holder of the dropdowns options |
|
|
options = [], |
|
|
$dk |
|
|
; |
|
|
|
|
|
template = template.replace('{{ id }}', view.id); |
|
|
template = template.replace('{{ label }}', view.label); |
|
|
template = template.replace('{{ tabindex }}', view.tabindex); |
|
|
|
|
|
if (view.options && view.options.length) { |
|
|
for (var i = 0, l = view.options.length; i < l; i++) { |
|
|
var |
|
|
$option = $(view.options[i]), |
|
|
current = 'dk_option_current', |
|
|
oTemplate = optionTemplate |
|
|
; |
|
|
|
|
|
oTemplate = oTemplate.replace('{{ value }}', $option.val()); |
|
|
oTemplate = oTemplate.replace('{{ current }}', (_notBlank($option.val()) === view.value) ? current : ''); |
|
|
oTemplate = oTemplate.replace('{{ text }}', $option.text()); |
|
|
|
|
|
options[options.length] = oTemplate; |
|
|
} |
|
|
} |
|
|
|
|
|
$dk = $(template); |
|
|
$dk.find('.dk_options_inner').html(options.join('')); |
|
|
|
|
|
return $dk; |
|
|
} |
|
|
|
|
|
function _notBlank(text) { |
|
|
return ($.trim(text).length > 0) ? text : false; |
|
|
} |
|
|
|
|
|
$(function () { |
|
|
|
|
|
// Handle click events on the dropdown toggler |
|
|
$('.dk_toggle').live('click', function (e) { |
|
|
var $dk = $(this).parents('.dk_container').first(); |
|
|
|
|
|
_openDropdown($dk); |
|
|
|
|
|
if ("ontouchstart" in window) { |
|
|
$dk.addClass('dk_touch'); |
|
|
$dk.find('.dk_options_inner').addClass('scrollable vertical'); |
|
|
} |
|
|
|
|
|
e.preventDefault(); |
|
|
return false; |
|
|
}); |
|
|
|
|
|
// Handle click events on individual dropdown options |
|
|
$('.dk_options a').live(($.browser.msie ? 'mousedown' : 'click'), function (e) { |
|
|
var |
|
|
$option = $(this), |
|
|
$dk = $option.parents('.dk_container').first(), |
|
|
data = $dk.data('dropkick') |
|
|
; |
|
|
|
|
|
_closeDropdown($dk); |
|
|
_updateFields($option, $dk); |
|
|
_setCurrent($option.parent(), $dk); |
|
|
|
|
|
e.preventDefault(); |
|
|
return false; |
|
|
}); |
|
|
|
|
|
// Setup keyboard nav |
|
|
$(document).bind('keydown.dk_nav', function (e) { |
|
|
var |
|
|
// Look for an open dropdown... |
|
|
$open = $('.dk_container.dk_open'), |
|
|
|
|
|
// Look for a focused dropdown |
|
|
$focused = $('.dk_container.dk_focus'), |
|
|
|
|
|
// Will be either $open, $focused, or null |
|
|
$dk = null |
|
|
; |
|
|
|
|
|
// If we have an open dropdown, key events should get sent to that one |
|
|
if ($open.length) { |
|
|
$dk = $open; |
|
|
} else if ($focused.length && !$open.length) { |
|
|
// But if we have no open dropdowns, use the focused dropdown instead |
|
|
$dk = $focused; |
|
|
} |
|
|
|
|
|
if ($dk) { |
|
|
_handleKeyBoardNav(e, $dk); |
|
|
} |
|
|
}); |
|
|
}); |
|
|
})(jQuery, window, document);/*! |
|
|
* jquery.event.drag - v 2.2 |
|
|
* Copyright (c) 2010 Three Dub Media - http://threedubmedia.com |
|
|
* Open Source MIT License - http://threedubmedia.com/code/license |
|
|
*/ |
|
|
// Created: 2008-06-04 |
|
|
// Updated: 2012-05-21 |
|
|
// REQUIRES: jquery 1.7.x |
|
|
|
|
|
;(function( $ ){ |
|
|
|
|
|
// add the jquery instance method |
|
|
$.fn.drag = function( str, arg, opts ){ |
|
|
// figure out the event type |
|
|
var type = typeof str == "string" ? str : "", |
|
|
// figure out the event handler... |
|
|
fn = $.isFunction( str ) ? str : $.isFunction( arg ) ? arg : null; |
|
|
// fix the event type |
|
|
if ( type.indexOf("drag") !== 0 ) |
|
|
type = "drag"+ type; |
|
|
// were options passed |
|
|
opts = ( str == fn ? arg : opts ) || {}; |
|
|
// trigger or bind event handler |
|
|
return fn ? this.bind( type, opts, fn ) : this.trigger( type ); |
|
|
}; |
|
|
|
|
|
// local refs (increase compression) |
|
|
var $event = $.event, |
|
|
$special = $event.special, |
|
|
// configure the drag special event |
|
|
drag = $special.drag = { |
|
|
|
|
|
// these are the default settings |
|
|
defaults: { |
|
|
which: 1, // mouse button pressed to start drag sequence |
|
|
distance: 0, // distance dragged before dragstart |
|
|
not: ':input', // selector to suppress dragging on target elements |
|
|
handle: null, // selector to match handle target elements |
|
|
relative: false, // true to use "position", false to use "offset" |
|
|
drop: true, // false to suppress drop events, true or selector to allow |
|
|
click: false // false to suppress click events after dragend (no proxy) |
|
|
}, |
|
|
|
|
|
// the key name for stored drag data |
|
|
datakey: "dragdata", |
|
|
|
|
|
// prevent bubbling for better performance |
|
|
noBubble: true, |
|
|
|
|
|
// count bound related events |
|
|
add: function( obj ){ |
|
|
// read the interaction data |
|
|
var data = $.data( this, drag.datakey ), |
|
|
// read any passed options |
|
|
opts = obj.data || {}; |
|
|
// count another realted event |
|
|
data.related += 1; |
|
|
// extend data options bound with this event |
|
|
// don't iterate "opts" in case it is a node |
|
|
$.each( drag.defaults, function( key, def ){ |
|
|
if ( opts[ key ] !== undefined ) |
|
|
data[ key ] = opts[ key ]; |
|
|
}); |
|
|
}, |
|
|
|
|
|
// forget unbound related events |
|
|
remove: function(){ |
|
|
$.data( this, drag.datakey ).related -= 1; |
|
|
}, |
|
|
|
|
|
// configure interaction, capture settings |
|
|
setup: function(){ |
|
|
// check for related events |
|
|
if ( $.data( this, drag.datakey ) ) |
|
|
return; |
|
|
// initialize the drag data with copied defaults |
|
|
var data = $.extend({ related:0 }, drag.defaults ); |
|
|
// store the interaction data |
|
|
$.data( this, drag.datakey, data ); |
|
|
// bind the mousedown event, which starts drag interactions |
|
|
$event.add( this, "touchstart mousedown", drag.init, data ); |
|
|
// prevent image dragging in IE... |
|
|
if ( this.attachEvent ) |
|
|
this.attachEvent("ondragstart", drag.dontstart ); |
|
|
}, |
|
|
|
|
|
// destroy configured interaction |
|
|
teardown: function(){ |
|
|
var data = $.data( this, drag.datakey ) || {}; |
|
|
// check for related events |
|
|
if ( data.related ) |
|
|
return; |
|
|
// remove the stored data |
|
|
$.removeData( this, drag.datakey ); |
|
|
// remove the mousedown event |
|
|
$event.remove( this, "touchstart mousedown", drag.init ); |
|
|
// enable text selection |
|
|
drag.textselect( true ); |
|
|
// un-prevent image dragging in IE... |
|
|
if ( this.detachEvent ) |
|
|
this.detachEvent("ondragstart", drag.dontstart ); |
|
|
}, |
|
|
|
|
|
// initialize the interaction |
|
|
init: function( event ){ |
|
|
// sorry, only one touch at a time |
|
|
if ( drag.touched ) |
|
|
return; |
|
|
// the drag/drop interaction data |
|
|
var dd = event.data, results; |
|
|
// check the which directive |
|
|
if ( event.which != 0 && dd.which > 0 && event.which != dd.which ) |
|
|
return; |
|
|
// check for suppressed selector |
|
|
if ( $( event.target ).is( dd.not ) ) |
|
|
return; |
|
|
// check for handle selector |
|
|
if ( dd.handle && !$( event.target ).closest( dd.handle, event.currentTarget ).length ) |
|
|
return; |
|
|
|
|
|
drag.touched = event.type == 'touchstart' ? this : null; |
|
|
dd.propagates = 1; |
|
|
dd.mousedown = this; |
|
|
dd.interactions = [ drag.interaction( this, dd ) ]; |
|
|
dd.target = event.target; |
|
|
dd.pageX = event.pageX; |
|
|
dd.pageY = event.pageY; |
|
|
dd.dragging = null; |
|
|
// handle draginit event... |
|
|
results = drag.hijack( event, "draginit", dd ); |
|
|
// early cancel |
|
|
if ( !dd.propagates ) |
|
|
return; |
|
|
// flatten the result set |
|
|
results = drag.flatten( results ); |
|
|
// insert new interaction elements |
|
|
if ( results && results.length ){ |
|
|
dd.interactions = []; |
|
|
$.each( results, function(){ |
|
|
dd.interactions.push( drag.interaction( this, dd ) ); |
|
|
}); |
|
|
} |
|
|
// remember how many interactions are propagating |
|
|
dd.propagates = dd.interactions.length; |
|
|
// locate and init the drop targets |
|
|
if ( dd.drop !== false && $special.drop ) |
|
|
$special.drop.handler( event, dd ); |
|
|
// disable text selection |
|
|
drag.textselect( false ); |
|
|
// bind additional events... |
|
|
if ( drag.touched ) |
|
|
$event.add( drag.touched, "touchmove touchend", drag.handler, dd ); |
|
|
else |
|
|
$event.add( document, "mousemove mouseup", drag.handler, dd ); |
|
|
// helps prevent text selection or scrolling |
|
|
if ( !drag.touched || dd.live ) |
|
|
return false; |
|
|
}, |
|
|
|
|
|
// returns an interaction object |
|
|
interaction: function( elem, dd ){ |
|
|
var offset = $( elem )[ dd.relative ? "position" : "offset" ]() || { top:0, left:0 }; |
|
|
return { |
|
|
drag: elem, |
|
|
callback: new drag.callback(), |
|
|
droppable: [], |
|
|
offset: offset |
|
|
}; |
|
|
}, |
|
|
|
|
|
// handle drag-releatd DOM events |
|
|
handler: function( event ){ |
|
|
// read the data before hijacking anything |
|
|
var dd = event.data; |
|
|
// handle various events |
|
|
switch ( event.type ){ |
|
|
// mousemove, check distance, start dragging |
|
|
case !dd.dragging && 'touchmove': |
|
|
event.preventDefault(); |
|
|
case !dd.dragging && 'mousemove': |
|
|
// drag tolerance, x≤ + y≤ = distance≤ |
|
|
if ( Math.pow( event.pageX-dd.pageX, 2 ) + Math.pow( event.pageY-dd.pageY, 2 ) < Math.pow( dd.distance, 2 ) ) |
|
|
break; // distance tolerance not reached |
|
|
event.target = dd.target; // force target from "mousedown" event (fix distance issue) |
|
|
drag.hijack( event, "dragstart", dd ); // trigger "dragstart" |
|
|
if ( dd.propagates ) // "dragstart" not rejected |
|
|
dd.dragging = true; // activate interaction |
|
|
// mousemove, dragging |
|
|
case 'touchmove': |
|
|
event.preventDefault(); |
|
|
case 'mousemove': |
|
|
if ( dd.dragging ){ |
|
|
// trigger "drag" |
|
|
drag.hijack( event, "drag", dd ); |
|
|
if ( dd.propagates ){ |
|
|
// manage drop events |
|
|
if ( dd.drop !== false && $special.drop ) |
|
|
$special.drop.handler( event, dd ); // "dropstart", "dropend" |
|
|
break; // "drag" not rejected, stop |
|
|
} |
|
|
event.type = "mouseup"; // helps "drop" handler behave |
|
|
} |
|
|
// mouseup, stop dragging |
|
|
case 'touchend': |
|
|
case 'mouseup': |
|
|
default: |
|
|
if ( drag.touched ) |
|
|
$event.remove( drag.touched, "touchmove touchend", drag.handler ); // remove touch events |
|
|
else |
|
|
$event.remove( document, "mousemove mouseup", drag.handler ); // remove page events |
|
|
if ( dd.dragging ){ |
|
|
if ( dd.drop !== false && $special.drop ) |
|
|
$special.drop.handler( event, dd ); // "drop" |
|
|
drag.hijack( event, "dragend", dd ); // trigger "dragend" |
|
|
} |
|
|
drag.textselect( true ); // enable text selection |
|
|
// if suppressing click events... |
|
|
if ( dd.click === false && dd.dragging ) |
|
|
$.data( dd.mousedown, "suppress.click", new Date().getTime() + 5 ); |
|
|
dd.dragging = drag.touched = false; // deactivate element |
|
|
break; |
|
|
} |
|
|
}, |
|
|
|
|
|
// re-use event object for custom events |
|
|
hijack: function( event, type, dd, x, elem ){ |
|
|
// not configured |
|
|
if ( !dd ) |
|
|
return; |
|
|
// remember the original event and type |
|
|
var orig = { event:event.originalEvent, type:event.type }, |
|
|
// is the event drag related or drog related? |
|
|
mode = type.indexOf("drop") ? "drag" : "drop", |
|
|
// iteration vars |
|
|
result, i = x || 0, ia, $elems, callback, |
|
|
len = !isNaN( x ) ? x : dd.interactions.length; |
|
|
// modify the event type |
|
|
event.type = type; |
|
|
// remove the original event |
|
|
event.originalEvent = null; |
|
|
// initialize the results |
|
|
dd.results = []; |
|
|
// handle each interacted element |
|
|
do if ( ia = dd.interactions[ i ] ){ |
|
|
// validate the interaction |
|
|
if ( type !== "dragend" && ia.cancelled ) |
|
|
continue; |
|
|
// set the dragdrop properties on the event object |
|
|
callback = drag.properties( event, dd, ia ); |
|
|
// prepare for more results |
|
|
ia.results = []; |
|
|
// handle each element |
|
|
$( elem || ia[ mode ] || dd.droppable ).each(function( p, subject ){ |
|
|
// identify drag or drop targets individually |
|
|
callback.target = subject; |
|
|
// force propagtion of the custom event |
|
|
event.isPropagationStopped = function(){ return false; }; |
|
|
// handle the event |
|
|
result = subject ? $event.dispatch.call( subject, event, callback ) : null; |
|
|
// stop the drag interaction for this element |
|
|
if ( result === false ){ |
|
|
if ( mode == "drag" ){ |
|
|
ia.cancelled = true; |
|
|
dd.propagates -= 1; |
|
|
} |
|
|
if ( type == "drop" ){ |
|
|
ia[ mode ][p] = null; |
|
|
} |
|
|
} |
|
|
// assign any dropinit elements |
|
|
else if ( type == "dropinit" ) |
|
|
ia.droppable.push( drag.element( result ) || subject ); |
|
|
// accept a returned proxy element |
|
|
if ( type == "dragstart" ) |
|
|
ia.proxy = $( drag.element( result ) || ia.drag )[0]; |
|
|
// remember this result |
|
|
ia.results.push( result ); |
|
|
// forget the event result, for recycling |
|
|
delete event.result; |
|
|
// break on cancelled handler |
|
|
if ( type !== "dropinit" ) |
|
|
return result; |
|
|
}); |
|
|
// flatten the results |
|
|
dd.results[ i ] = drag.flatten( ia.results ); |
|
|
// accept a set of valid drop targets |
|
|
if ( type == "dropinit" ) |
|
|
ia.droppable = drag.flatten( ia.droppable ); |
|
|
// locate drop targets |
|
|
if ( type == "dragstart" && !ia.cancelled ) |
|
|
callback.update(); |
|
|
} |
|
|
while ( ++i < len ) |
|
|
// restore the original event & type |
|
|
event.type = orig.type; |
|
|
event.originalEvent = orig.event; |
|
|
// return all handler results |
|
|
return drag.flatten( dd.results ); |
|
|
}, |
|
|
|
|
|
// extend the callback object with drag/drop properties... |
|
|
properties: function( event, dd, ia ){ |
|
|
var obj = ia.callback; |
|
|
// elements |
|
|
obj.drag = ia.drag; |
|
|
obj.proxy = ia.proxy || ia.drag; |
|
|
// starting mouse position |
|
|
obj.startX = dd.pageX; |
|
|
obj.startY = dd.pageY; |
|
|
// current distance dragged |
|
|
obj.deltaX = event.pageX - dd.pageX; |
|
|
obj.deltaY = event.pageY - dd.pageY; |
|
|
// original element position |
|
|
obj.originalX = ia.offset.left; |
|
|
obj.originalY = ia.offset.top; |
|
|
// adjusted element position |
|
|
obj.offsetX = obj.originalX + obj.deltaX; |
|
|
obj.offsetY = obj.originalY + obj.deltaY; |
|
|
// assign the drop targets information |
|
|
obj.drop = drag.flatten( ( ia.drop || [] ).slice() ); |
|
|
obj.available = drag.flatten( ( ia.droppable || [] ).slice() ); |
|
|
return obj; |
|
|
}, |
|
|
|
|
|
// determine is the argument is an element or jquery instance |
|
|
element: function( arg ){ |
|
|
if ( arg && ( arg.jquery || arg.nodeType == 1 ) ) |
|
|
return arg; |
|
|
}, |
|
|
|
|
|
// flatten nested jquery objects and arrays into a single dimension array |
|
|
flatten: function( arr ){ |
|
|
return $.map( arr, function( member ){ |
|
|
return member && member.jquery ? $.makeArray( member ) : |
|
|
member && member.length ? drag.flatten( member ) : member; |
|
|
}); |
|
|
}, |
|
|
|
|
|
// toggles text selection attributes ON (true) or OFF (false) |
|
|
textselect: function( bool ){ |
|
|
$( document )[ bool ? "unbind" : "bind" ]("selectstart", drag.dontstart ) |
|
|
.css("MozUserSelect", bool ? "" : "none" ); |
|
|
// .attr("unselectable", bool ? "off" : "on" ) |
|
|
document.unselectable = bool ? "off" : "on"; |
|
|
}, |
|
|
|
|
|
// suppress "selectstart" and "ondragstart" events |
|
|
dontstart: function(){ |
|
|
return false; |
|
|
}, |
|
|
|
|
|
// a callback instance contructor |
|
|
callback: function(){} |
|
|
|
|
|
}; |
|
|
|
|
|
// callback methods |
|
|
drag.callback.prototype = { |
|
|
update: function(){ |
|
|
if ( $special.drop && this.available.length ) |
|
|
$.each( this.available, function( i ){ |
|
|
$special.drop.locate( this, i ); |
|
|
}); |
|
|
} |
|
|
}; |
|
|
|
|
|
// patch $.event.$dispatch to allow suppressing clicks |
|
|
var $dispatch = $event.dispatch; |
|
|
$event.dispatch = function( event ){ |
|
|
if ( $.data( this, "suppress."+ event.type ) - new Date().getTime() > 0 ){ |
|
|
$.removeData( this, "suppress."+ event.type ); |
|
|
return; |
|
|
} |
|
|
return $dispatch.apply( this, arguments ); |
|
|
}; |
|
|
|
|
|
// event fix hooks for touch events... |
|
|
var touchHooks = |
|
|
$event.fixHooks.touchstart = |
|
|
$event.fixHooks.touchmove = |
|
|
$event.fixHooks.touchend = |
|
|
$event.fixHooks.touchcancel = { |
|
|
props: "clientX clientY pageX pageY screenX screenY".split( " " ), |
|
|
filter: function( event, orig ) { |
|
|
if ( orig ){ |
|
|
var touched = ( orig.touches && orig.touches[0] ) |
|
|
|| ( orig.changedTouches && orig.changedTouches[0] ) |
|
|
|| null; |
|
|
// iOS webkit: touchstart, touchmove, touchend |
|
|
if ( touched ) |
|
|
$.each( touchHooks.props, function( i, prop ){ |
|
|
event[ prop ] = touched[ prop ]; |
|
|
}); |
|
|
} |
|
|
return event; |
|
|
} |
|
|
}; |
|
|
|
|
|
// share the same special event configuration with related events... |
|
|
$special.draginit = $special.dragstart = $special.dragend = drag; |
|
|
|
|
|
})( jQuery ); |
|
|
(function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';} |
|
|
var type=typeof o;if(type==='undefined'){return undefined;} |
|
|
if(type==='number'||type==='boolean'){return''+o;} |
|
|
if(type==='string'){return $.quoteString(o);} |
|
|
if(type==='object'){if(typeof o.toJSON==='function'){return $.toJSON(o.toJSON());} |
|
|
if(o.constructor===Date){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month='0'+month;} |
|
|
if(day<10){day='0'+day;} |
|
|
if(hours<10){hours='0'+hours;} |
|
|
if(minutes<10){minutes='0'+minutes;} |
|
|
if(seconds<10){seconds='0'+seconds;} |
|
|
if(milli<100){milli='0'+milli;} |
|
|
if(milli<10){milli='0'+milli;} |
|
|
return'"'+year+'-'+month+'-'+day+'T'+ |
|
|
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';} |
|
|
if(o.constructor===Array){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i])||'null');} |
|
|
return'['+ret.join(',')+']';} |
|
|
var name,val,pairs=[];for(var k in o){type=typeof k;if(type==='number'){name='"'+k+'"';}else if(type==='string'){name=$.quoteString(k);}else{continue;} |
|
|
type=typeof o[k];if(type==='function'||type==='undefined'){continue;} |
|
|
val=$.toJSON(o[k]);pairs.push(name+':'+val);} |
|
|
return'{'+pairs.join(',')+'}';}};$.evalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){return eval('('+src+')');};$.secureEvalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){var filtered=src.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered)){return eval('('+src+')');}else{throw new SyntaxError('Error parsing JSON, source is not valid.');}};$.quoteString=function(string){if(string.match(escapeable)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;} |
|
|
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';} |
|
|
return'"'+string+'"';};})(jQuery);/*** |
|
|
* Contains core SlickGrid classes. |
|
|
* @module Core |
|
|
* @namespace Slick |
|
|
*/ |
|
|
|
|
|
(function ($) { |
|
|
// register namespace |
|
|
$.extend(true, window, { |
|
|
"Slick": { |
|
|
"Event": Event, |
|
|
"EventData": EventData, |
|
|
"EventHandler": EventHandler, |
|
|
"Range": Range, |
|
|
"NonDataRow": NonDataItem, |
|
|
"Group": Group, |
|
|
"GroupTotals": GroupTotals, |
|
|
"EditorLock": EditorLock, |
|
|
|
|
|
/*** |
|
|
* A global singleton editor lock. |
|
|
* @class GlobalEditorLock |
|
|
* @static |
|
|
* @constructor |
|
|
*/ |
|
|
"GlobalEditorLock": new EditorLock() |
|
|
} |
|
|
}); |
|
|
|
|
|
/*** |
|
|
* An event object for passing data to event handlers and letting them control propagation. |
|
|
* <p>This is pretty much identical to how W3C and jQuery implement events.</p> |
|
|
* @class EventData |
|
|
* @constructor |
|
|
*/ |
|
|
function EventData() { |
|
|
var isPropagationStopped = false; |
|
|
var isImmediatePropagationStopped = false; |
|
|
|
|
|
/*** |
|
|
* Stops event from propagating up the DOM tree. |
|
|
* @method stopPropagation |
|
|
*/ |
|
|
this.stopPropagation = function () { |
|
|
isPropagationStopped = true; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Returns whether stopPropagation was called on this event object. |
|
|
* @method isPropagationStopped |
|
|
* @return {Boolean} |
|
|
*/ |
|
|
this.isPropagationStopped = function () { |
|
|
return isPropagationStopped; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Prevents the rest of the handlers from being executed. |
|
|
* @method stopImmediatePropagation |
|
|
*/ |
|
|
this.stopImmediatePropagation = function () { |
|
|
isImmediatePropagationStopped = true; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Returns whether stopImmediatePropagation was called on this event object.\ |
|
|
* @method isImmediatePropagationStopped |
|
|
* @return {Boolean} |
|
|
*/ |
|
|
this.isImmediatePropagationStopped = function () { |
|
|
return isImmediatePropagationStopped; |
|
|
} |
|
|
} |
|
|
|
|
|
/*** |
|
|
* A simple publisher-subscriber implementation. |
|
|
* @class Event |
|
|
* @constructor |
|
|
*/ |
|
|
function Event() { |
|
|
var handlers = []; |
|
|
|
|
|
/*** |
|
|
* Adds an event handler to be called when the event is fired. |
|
|
* <p>Event handler will receive two arguments - an <code>EventData</code> and the <code>data</code> |
|
|
* object the event was fired with.<p> |
|
|
* @method subscribe |
|
|
* @param fn {Function} Event handler. |
|
|
*/ |
|
|
this.subscribe = function (fn) { |
|
|
handlers.push(fn); |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Removes an event handler added with <code>subscribe(fn)</code>. |
|
|
* @method unsubscribe |
|
|
* @param fn {Function} Event handler to be removed. |
|
|
*/ |
|
|
this.unsubscribe = function (fn) { |
|
|
for (var i = handlers.length - 1; i >= 0; i--) { |
|
|
if (handlers[i] === fn) { |
|
|
handlers.splice(i, 1); |
|
|
} |
|
|
} |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Fires an event notifying all subscribers. |
|
|
* @method notify |
|
|
* @param args {Object} Additional data object to be passed to all handlers. |
|
|
* @param e {EventData} |
|
|
* Optional. |
|
|
* An <code>EventData</code> object to be passed to all handlers. |
|
|
* For DOM events, an existing W3C/jQuery event object can be passed in. |
|
|
* @param scope {Object} |
|
|
* Optional. |
|
|
* The scope ("this") within which the handler will be executed. |
|
|
* If not specified, the scope will be set to the <code>Event</code> instance. |
|
|
*/ |
|
|
this.notify = function (args, e, scope) { |
|
|
e = e || new EventData(); |
|
|
scope = scope || this; |
|
|
|
|
|
var returnValue; |
|
|
for (var i = 0; i < handlers.length && !(e.isPropagationStopped() || e.isImmediatePropagationStopped()); i++) { |
|
|
returnValue = handlers[i].call(scope, e, args); |
|
|
} |
|
|
|
|
|
return returnValue; |
|
|
}; |
|
|
} |
|
|
|
|
|
function EventHandler() { |
|
|
var handlers = []; |
|
|
|
|
|
this.subscribe = function (event, handler) { |
|
|
handlers.push({ |
|
|
event: event, |
|
|
handler: handler |
|
|
}); |
|
|
event.subscribe(handler); |
|
|
|
|
|
return this; // allow chaining |
|
|
}; |
|
|
|
|
|
this.unsubscribe = function (event, handler) { |
|
|
var i = handlers.length; |
|
|
while (i--) { |
|
|
if (handlers[i].event === event && |
|
|
handlers[i].handler === handler) { |
|
|
handlers.splice(i, 1); |
|
|
event.unsubscribe(handler); |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
return this; // allow chaining |
|
|
}; |
|
|
|
|
|
this.unsubscribeAll = function () { |
|
|
var i = handlers.length; |
|
|
while (i--) { |
|
|
handlers[i].event.unsubscribe(handlers[i].handler); |
|
|
} |
|
|
handlers = []; |
|
|
|
|
|
return this; // allow chaining |
|
|
} |
|
|
} |
|
|
|
|
|
/*** |
|
|
* A structure containing a range of cells. |
|
|
* @class Range |
|
|
* @constructor |
|
|
* @param fromRow {Integer} Starting row. |
|
|
* @param fromCell {Integer} Starting cell. |
|
|
* @param toRow {Integer} Optional. Ending row. Defaults to <code>fromRow</code>. |
|
|
* @param toCell {Integer} Optional. Ending cell. Defaults to <code>fromCell</code>. |
|
|
*/ |
|
|
function Range(fromRow, fromCell, toRow, toCell) { |
|
|
if (toRow === undefined && toCell === undefined) { |
|
|
toRow = fromRow; |
|
|
toCell = fromCell; |
|
|
} |
|
|
|
|
|
/*** |
|
|
* @property fromRow |
|
|
* @type {Integer} |
|
|
*/ |
|
|
this.fromRow = Math.min(fromRow, toRow); |
|
|
|
|
|
/*** |
|
|
* @property fromCell |
|
|
* @type {Integer} |
|
|
*/ |
|
|
this.fromCell = Math.min(fromCell, toCell); |
|
|
|
|
|
/*** |
|
|
* @property toRow |
|
|
* @type {Integer} |
|
|
*/ |
|
|
this.toRow = Math.max(fromRow, toRow); |
|
|
|
|
|
/*** |
|
|
* @property toCell |
|
|
* @type {Integer} |
|
|
*/ |
|
|
this.toCell = Math.max(fromCell, toCell); |
|
|
|
|
|
/*** |
|
|
* Returns whether a range represents a single row. |
|
|
* @method isSingleRow |
|
|
* @return {Boolean} |
|
|
*/ |
|
|
this.isSingleRow = function () { |
|
|
return this.fromRow == this.toRow; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Returns whether a range represents a single cell. |
|
|
* @method isSingleCell |
|
|
* @return {Boolean} |
|
|
*/ |
|
|
this.isSingleCell = function () { |
|
|
return this.fromRow == this.toRow && this.fromCell == this.toCell; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Returns whether a range contains a given cell. |
|
|
* @method contains |
|
|
* @param row {Integer} |
|
|
* @param cell {Integer} |
|
|
* @return {Boolean} |
|
|
*/ |
|
|
this.contains = function (row, cell) { |
|
|
return row >= this.fromRow && row <= this.toRow && |
|
|
cell >= this.fromCell && cell <= this.toCell; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Returns a readable representation of a range. |
|
|
* @method toString |
|
|
* @return {String} |
|
|
*/ |
|
|
this.toString = function () { |
|
|
if (this.isSingleCell()) { |
|
|
return "(" + this.fromRow + ":" + this.fromCell + ")"; |
|
|
} |
|
|
else { |
|
|
return "(" + this.fromRow + ":" + this.fromCell + " - " + this.toRow + ":" + this.toCell + ")"; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*** |
|
|
* A base class that all special / non-data rows (like Group and GroupTotals) derive from. |
|
|
* @class NonDataItem |
|
|
* @constructor |
|
|
*/ |
|
|
function NonDataItem() { |
|
|
this.__nonDataRow = true; |
|
|
} |
|
|
|
|
|
|
|
|
/*** |
|
|
* Information about a group of rows. |
|
|
* @class Group |
|
|
* @extends Slick.NonDataItem |
|
|
* @constructor |
|
|
*/ |
|
|
function Group() { |
|
|
this.__group = true; |
|
|
|
|
|
/** |
|
|
* Grouping level, starting with 0. |
|
|
* @property level |
|
|
* @type {Number} |
|
|
*/ |
|
|
this.level = 0; |
|
|
|
|
|
/*** |
|
|
* Number of rows in the group. |
|
|
* @property count |
|
|
* @type {Integer} |
|
|
*/ |
|
|
this.count = 0; |
|
|
|
|
|
/*** |
|
|
* Grouping value. |
|
|
* @property value |
|
|
* @type {Object} |
|
|
*/ |
|
|
this.value = null; |
|
|
|
|
|
/*** |
|
|
* Formatted display value of the group. |
|
|
* @property title |
|
|
* @type {String} |
|
|
*/ |
|
|
this.title = null; |
|
|
|
|
|
/*** |
|
|
* Whether a group is collapsed. |
|
|
* @property collapsed |
|
|
* @type {Boolean} |
|
|
*/ |
|
|
this.collapsed = false; |
|
|
|
|
|
/*** |
|
|
* GroupTotals, if any. |
|
|
* @property totals |
|
|
* @type {GroupTotals} |
|
|
*/ |
|
|
this.totals = null; |
|
|
|
|
|
/** |
|
|
* Rows that are part of the group. |
|
|
* @property rows |
|
|
* @type {Array} |
|
|
*/ |
|
|
this.rows = []; |
|
|
|
|
|
/** |
|
|
* Sub-groups that are part of the group. |
|
|
* @property groups |
|
|
* @type {Array} |
|
|
*/ |
|
|
this.groups = null; |
|
|
|
|
|
/** |
|
|
* A unique key used to identify the group. This key can be used in calls to DataView |
|
|
* collapseGroup() or expandGroup(). |
|
|
* @property groupingKey |
|
|
* @type {Object} |
|
|
*/ |
|
|
this.groupingKey = null; |
|
|
} |
|
|
|
|
|
Group.prototype = new NonDataItem(); |
|
|
|
|
|
/*** |
|
|
* Compares two Group instances. |
|
|
* @method equals |
|
|
* @return {Boolean} |
|
|
* @param group {Group} Group instance to compare to. |
|
|
*/ |
|
|
Group.prototype.equals = function (group) { |
|
|
return this.value === group.value && |
|
|
this.count === group.count && |
|
|
this.collapsed === group.collapsed && |
|
|
this.title === group.title; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Information about group totals. |
|
|
* An instance of GroupTotals will be created for each totals row and passed to the aggregators |
|
|
* so that they can store arbitrary data in it. That data can later be accessed by group totals |
|
|
* formatters during the display. |
|
|
* @class GroupTotals |
|
|
* @extends Slick.NonDataItem |
|
|
* @constructor |
|
|
*/ |
|
|
function GroupTotals() { |
|
|
this.__groupTotals = true; |
|
|
|
|
|
/*** |
|
|
* Parent Group. |
|
|
* @param group |
|
|
* @type {Group} |
|
|
*/ |
|
|
this.group = null; |
|
|
|
|
|
/*** |
|
|
* Whether the totals have been fully initialized / calculated. |
|
|
* Will be set to false for lazy-calculated group totals. |
|
|
* @param initialized |
|
|
* @type {Boolean} |
|
|
*/ |
|
|
this.initialized = false; |
|
|
} |
|
|
|
|
|
GroupTotals.prototype = new NonDataItem(); |
|
|
|
|
|
/*** |
|
|
* A locking helper to track the active edit controller and ensure that only a single controller |
|
|
* can be active at a time. This prevents a whole class of state and validation synchronization |
|
|
* issues. An edit controller (such as SlickGrid) can query if an active edit is in progress |
|
|
* and attempt a commit or cancel before proceeding. |
|
|
* @class EditorLock |
|
|
* @constructor |
|
|
*/ |
|
|
function EditorLock() { |
|
|
var activeEditController = null; |
|
|
|
|
|
/*** |
|
|
* Returns true if a specified edit controller is active (has the edit lock). |
|
|
* If the parameter is not specified, returns true if any edit controller is active. |
|
|
* @method isActive |
|
|
* @param editController {EditController} |
|
|
* @return {Boolean} |
|
|
*/ |
|
|
this.isActive = function (editController) { |
|
|
return (editController ? activeEditController === editController : activeEditController !== null); |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Sets the specified edit controller as the active edit controller (acquire edit lock). |
|
|
* If another edit controller is already active, and exception will be thrown. |
|
|
* @method activate |
|
|
* @param editController {EditController} edit controller acquiring the lock |
|
|
*/ |
|
|
this.activate = function (editController) { |
|
|
if (editController === activeEditController) { // already activated? |
|
|
return; |
|
|
} |
|
|
if (activeEditController !== null) { |
|
|
throw "SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController"; |
|
|
} |
|
|
if (!editController.commitCurrentEdit) { |
|
|
throw "SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()"; |
|
|
} |
|
|
if (!editController.cancelCurrentEdit) { |
|
|
throw "SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()"; |
|
|
} |
|
|
activeEditController = editController; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Unsets the specified edit controller as the active edit controller (release edit lock). |
|
|
* If the specified edit controller is not the active one, an exception will be thrown. |
|
|
* @method deactivate |
|
|
* @param editController {EditController} edit controller releasing the lock |
|
|
*/ |
|
|
this.deactivate = function (editController) { |
|
|
if (activeEditController !== editController) { |
|
|
throw "SlickGrid.EditorLock.deactivate: specified editController is not the currently active one"; |
|
|
} |
|
|
activeEditController = null; |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit |
|
|
* controller and returns whether the commit attempt was successful (commit may fail due to validation |
|
|
* errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded |
|
|
* and false otherwise. If no edit controller is active, returns true. |
|
|
* @method commitCurrentEdit |
|
|
* @return {Boolean} |
|
|
*/ |
|
|
this.commitCurrentEdit = function () { |
|
|
return (activeEditController ? activeEditController.commitCurrentEdit() : true); |
|
|
}; |
|
|
|
|
|
/*** |
|
|
* Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit |
|
|
* controller and returns whether the edit was successfully cancelled. If no edit controller is |
|
|
* active, returns true. |
|
|
* @method cancelCurrentEdit |
|
|
* @return {Boolean} |
|
|
*/ |
|
|
this.cancelCurrentEdit = function cancelCurrentEdit() { |
|
|
return (activeEditController ? activeEditController.cancelCurrentEdit() : true); |
|
|
}; |
|
|
} |
|
|
})(jQuery); |
|
|
|
|
|
|
|
|
/*** |
|
|
* Contains basic SlickGrid editors. |
|
|
* @module Editors |
|
|
* @namespace Slick |
|
|
*/ |
|
|
|
|
|
(function ($) { |
|
|
// register namespace |
|
|
$.extend(true, window, { |
|
|
"Slick": { |
|
|
"Editors": { |
|
|
"Text": TextEditor, |
|
|
"Integer": IntegerEditor, |
|
|
"Date": DateEditor, |
|
|
"YesNoSelect": YesNoSelectEditor, |
|
|
"Checkbox": CheckboxEditor, |
|
|
"PercentComplete": PercentCompleteEditor, |
|
|
"LongText": LongTextEditor |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
function TextEditor(args) { |
|
|
var $input; |
|
|
var defaultValue; |
|
|
var scope = this; |
|
|
|
|
|
this.init = function () { |
|
|
$input = $("<INPUT type=text class='editor-text' />") |
|
|
.appendTo(args.container) |
|
|
.bind("keydown.nav", function (e) { |
|
|
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { |
|
|
e.stopImmediatePropagation(); |
|
|
} |
|
|
}) |
|
|
.focus() |
|
|
.select(); |
|
|
}; |
|
|
|
|
|
this.destroy = function () { |
|
|
$input.remove(); |
|
|
}; |
|
|
|
|
|
this.focus = function () { |
|
|
$input.focus(); |
|
|
}; |
|
|
|
|
|
this.getValue = function () { |
|
|
return $input.val(); |
|
|
}; |
|
|
|
|
|
this.setValue = function (val) { |
|
|
$input.val(val); |
|
|
}; |
|
|
|
|
|
this.loadValue = function (item) { |
|
|
defaultValue = item[args.column.field] || ""; |
|
|
$input.val(defaultValue); |
|
|
$input[0].defaultValue = defaultValue; |
|
|
$input.select(); |
|
|
}; |
|
|
|
|
|
this.serializeValue = function () { |
|
|
return $input.val(); |
|
|
}; |
|
|
|
|
|
this.applyValue = function (item, state) { |
|
|
item[args.column.field] = state; |
|
|
}; |
|
|
|
|
|
this.isValueChanged = function () { |
|
|
return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); |
|
|
}; |
|
|
|
|
|
this.validate = function () { |
|
|
if (args.column.validator) { |
|
|
var validationResults = args.column.validator($input.val()); |
|
|
if (!validationResults.valid) { |
|
|
return validationResults; |
|
|
} |
|
|
} |
|
|
|
|
|
return { |
|
|
valid: true, |
|
|
msg: null |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.init(); |
|
|
} |
|
|
|
|
|
function IntegerEditor(args) { |
|
|
var $input; |
|
|
var defaultValue; |
|
|
var scope = this; |
|
|
|
|
|
this.init = function () { |
|
|
$input = $("<INPUT type=text class='editor-text' />"); |
|
|
|
|
|
$input.bind("keydown.nav", function (e) { |
|
|
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { |
|
|
e.stopImmediatePropagation(); |
|
|
} |
|
|
}); |
|
|
|
|
|
$input.appendTo(args.container); |
|
|
$input.focus().select(); |
|
|
}; |
|
|
|
|
|
this.destroy = function () { |
|
|
$input.remove(); |
|
|
}; |
|
|
|
|
|
this.focus = function () { |
|
|
$input.focus(); |
|
|
}; |
|
|
|
|
|
this.loadValue = function (item) { |
|
|
defaultValue = item[args.column.field]; |
|
|
$input.val(defaultValue); |
|
|
$input[0].defaultValue = defaultValue; |
|
|
$input.select(); |
|
|
}; |
|
|
|
|
|
this.serializeValue = function () { |
|
|
return parseInt($input.val(), 10) || 0; |
|
|
}; |
|
|
|
|
|
this.applyValue = function (item, state) { |
|
|
item[args.column.field] = state; |
|
|
}; |
|
|
|
|
|
this.isValueChanged = function () { |
|
|
return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); |
|
|
}; |
|
|
|
|
|
this.validate = function () { |
|
|
if (isNaN($input.val())) { |
|
|
return { |
|
|
valid: false, |
|
|
msg: "Please enter a valid integer" |
|
|
}; |
|
|
} |
|
|
|
|
|
return { |
|
|
valid: true, |
|
|
msg: null |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.init(); |
|
|
} |
|
|
|
|
|
function DateEditor(args) { |
|
|
var $input; |
|
|
var defaultValue; |
|
|
var scope = this; |
|
|
var calendarOpen = false; |
|
|
|
|
|
this.init = function () { |
|
|
$input = $("<INPUT type=text class='editor-text' />"); |
|
|
$input.appendTo(args.container); |
|
|
$input.focus().select(); |
|
|
$input.datepicker({ |
|
|
showOn: "button", |
|
|
buttonImageOnly: true, |
|
|
buttonImage: "../images/calendar.gif", |
|
|
beforeShow: function () { |
|
|
calendarOpen = true |
|
|
}, |
|
|
onClose: function () { |
|
|
calendarOpen = false |
|
|
}, |
|
|
dateFormat: "dd/mm/yy" |
|
|
}); |
|
|
$input.width($input.width() - 18); |
|
|
}; |
|
|
|
|
|
this.destroy = function () { |
|
|
$.datepicker.dpDiv.stop(true, true); |
|
|
$input.datepicker("hide"); |
|
|
$input.datepicker("destroy"); |
|
|
$input.remove(); |
|
|
}; |
|
|
|
|
|
this.show = function () { |
|
|
if (calendarOpen) { |
|
|
$.datepicker.dpDiv.stop(true, true).show(); |
|
|
} |
|
|
}; |
|
|
|
|
|
this.hide = function () { |
|
|
if (calendarOpen) { |
|
|
$.datepicker.dpDiv.stop(true, true).hide(); |
|
|
} |
|
|
}; |
|
|
|
|
|
this.position = function (position) { |
|
|
if (!calendarOpen) { |
|
|
return; |
|
|
} |
|
|
$.datepicker.dpDiv |
|
|
.css("top", position.top + 30) |
|
|
.css("left", position.left); |
|
|
}; |
|
|
|
|
|
this.focus = function () { |
|
|
$input.focus(); |
|
|
}; |
|
|
|
|
|
this.loadValue = function (item) { |
|
|
defaultValue = item[args.column.field]; |
|
|
$input.val(defaultValue); |
|
|
$input[0].defaultValue = defaultValue; |
|
|
$input.select(); |
|
|
}; |
|
|
|
|
|
this.serializeValue = function () { |
|
|
return $input.val(); |
|
|
}; |
|
|
|
|
|
this.applyValue = function (item, state) { |
|
|
item[args.column.field] = state; |
|
|
}; |
|
|
|
|
|
this.isValueChanged = function () { |
|
|
return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); |
|
|
}; |
|
|
|
|
|
this.validate = function () { |
|
|
return { |
|
|
valid: true, |
|
|
msg: null |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.init(); |
|
|
} |
|
|
|
|
|
function YesNoSelectEditor(args) { |
|
|
var $select; |
|
|
var defaultValue; |
|
|
var scope = this; |
|
|
|
|
|
this.init = function () { |
|
|
$select = $("<SELECT tabIndex='0' class='editor-yesno'><OPTION value='yes'>Yes</OPTION><OPTION value='no'>No</OPTION></SELECT>"); |
|
|
$select.appendTo(args.container); |
|
|
$select.focus(); |
|
|
}; |
|
|
|
|
|
this.destroy = function () { |
|
|
$select.remove(); |
|
|
}; |
|
|
|
|
|
this.focus = function () { |
|
|
$select.focus(); |
|
|
}; |
|
|
|
|
|
this.loadValue = function (item) { |
|
|
$select.val((defaultValue = item[args.column.field]) ? "yes" : "no"); |
|
|
$select.select(); |
|
|
}; |
|
|
|
|
|
this.serializeValue = function () { |
|
|
return ($select.val() == "yes"); |
|
|
}; |
|
|
|
|
|
this.applyValue = function (item, state) { |
|
|
item[args.column.field] = state; |
|
|
}; |
|
|
|
|
|
this.isValueChanged = function () { |
|
|
return ($select.val() != defaultValue); |
|
|
}; |
|
|
|
|
|
this.validate = function () { |
|
|
return { |
|
|
valid: true, |
|
|
msg: null |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.init(); |
|
|
} |
|
|
|
|
|
function CheckboxEditor(args) { |
|
|
var $select; |
|
|
var defaultValue; |
|
|
var scope = this; |
|
|
|
|
|
this.init = function () { |
|
|
$select = $("<INPUT type=checkbox value='true' class='editor-checkbox' hideFocus>"); |
|
|
$select.appendTo(args.container); |
|
|
$select.focus(); |
|
|
}; |
|
|
|
|
|
this.destroy = function () { |
|
|
$select.remove(); |
|
|
}; |
|
|
|
|
|
this.focus = function () { |
|
|
$select.focus(); |
|
|
}; |
|
|
|
|
|
this.loadValue = function (item) { |
|
|
defaultValue = !!item[args.column.field]; |
|
|
if (defaultValue) { |
|
|
$select.prop('checked', true); |
|
|
} else { |
|
|
$select.prop('checked', false); |
|
|
} |
|
|
}; |
|
|
|
|
|
this.serializeValue = function () { |
|
|
return $select.prop('checked'); |
|
|
}; |
|
|
|
|
|
this.applyValue = function (item, state) { |
|
|
item[args.column.field] = state; |
|
|
}; |
|
|
|
|
|
this.isValueChanged = function () { |
|
|
return (this.serializeValue() !== defaultValue); |
|
|
}; |
|
|
|
|
|
this.validate = function () { |
|
|
return { |
|
|
valid: true, |
|
|
msg: null |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.init(); |
|
|
} |
|
|
|
|
|
function PercentCompleteEditor(args) { |
|
|
var $input, $picker; |
|
|
var defaultValue; |
|
|
var scope = this; |
|
|
|
|
|
this.init = function () { |
|
|
$input = $("<INPUT type=text class='editor-percentcomplete' />"); |
|
|
$input.width($(args.container).innerWidth() - 25); |
|
|
$input.appendTo(args.container); |
|
|
|
|
|
$picker = $("<div class='editor-percentcomplete-picker' />").appendTo(args.container); |
|
|
$picker.append("<div class='editor-percentcomplete-helper'><div class='editor-percentcomplete-wrapper'><div class='editor-percentcomplete-slider' /><div class='editor-percentcomplete-buttons' /></div></div>"); |
|
|
|
|
|
$picker.find(".editor-percentcomplete-buttons").append("<button val=0>Not started</button><br/><button val=50>In Progress</button><br/><button val=100>Complete</button>"); |
|
|
|
|
|
$input.focus().select(); |
|
|
|
|
|
$picker.find(".editor-percentcomplete-slider").slider({ |
|
|
orientation: "vertical", |
|
|
range: "min", |
|
|
value: defaultValue, |
|
|
slide: function (event, ui) { |
|
|
$input.val(ui.value) |
|
|
} |
|
|
}); |
|
|
|
|
|
$picker.find(".editor-percentcomplete-buttons button").bind("click", function (e) { |
|
|
$input.val($(this).attr("val")); |
|
|
$picker.find(".editor-percentcomplete-slider").slider("value", $(this).attr("val")); |
|
|
}) |
|
|
}; |
|
|
|
|
|
this.destroy = function () { |
|
|
$input.remove(); |
|
|
$picker.remove(); |
|
|
}; |
|
|
|
|
|
this.focus = function () { |
|
|
$input.focus(); |
|
|
}; |
|
|
|
|
|
this.loadValue = function (item) { |
|
|
$input.val(defaultValue = item[args.column.field]); |
|
|
$input.select(); |
|
|
}; |
|
|
|
|
|
this.serializeValue = function () { |
|
|
return parseInt($input.val(), 10) || 0; |
|
|
}; |
|
|
|
|
|
this.applyValue = function (item, state) { |
|
|
item[args.column.field] = state; |
|
|
}; |
|
|
|
|
|
this.isValueChanged = function () { |
|
|
return (!($input.val() == "" && defaultValue == null)) && ((parseInt($input.val(), 10) || 0) != defaultValue); |
|
|
}; |
|
|
|
|
|
this.validate = function () { |
|
|
if (isNaN(parseInt($input.val(), 10))) { |
|
|
return { |
|
|
valid: false, |
|
|
msg: "Please enter a valid positive number" |
|
|
}; |
|
|
} |
|
|
|
|
|
return { |
|
|
valid: true, |
|
|
msg: null |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.init(); |
|
|
} |
|
|
|
|
|
/* |
|
|
* An example of a "detached" editor. |
|
|
* The UI is added onto document BODY and .position(), .show() and .hide() are implemented. |
|
|
* KeyDown events are also handled to provide handling for Tab, Shift-Tab, Esc and Ctrl-Enter. |
|
|
*/ |
|
|
function LongTextEditor(args) { |
|
|
var $input, $wrapper; |
|
|
var defaultValue; |
|
|
var scope = this; |
|
|
|
|
|
this.init = function () { |
|
|
var $container = $("body"); |
|
|
|
|
|
$wrapper = $("<DIV style='z-index:10000;position:absolute;background:white;padding:5px;border:3px solid gray; -moz-border-radius:10px; border-radius:10px;'/>") |
|
|
.appendTo($container); |
|
|
|
|
|
$input = $("<TEXTAREA hidefocus rows=5 style='backround:white;width:250px;height:80px;border:0;outline:0'>") |
|
|
.appendTo($wrapper); |
|
|
|
|
|
$("<DIV style='text-align:right'><BUTTON>Save</BUTTON><BUTTON>Cancel</BUTTON></DIV>") |
|
|
.appendTo($wrapper); |
|
|
|
|
|
$wrapper.find("button:first").bind("click", this.save); |
|
|
$wrapper.find("button:last").bind("click", this.cancel); |
|
|
$input.bind("keydown", this.handleKeyDown); |
|
|
|
|
|
scope.position(args.position); |
|
|
$input.focus().select(); |
|
|
}; |
|
|
|
|
|
this.handleKeyDown = function (e) { |
|
|
if (e.which == $.ui.keyCode.ENTER && e.ctrlKey) { |
|
|
scope.save(); |
|
|
} else if (e.which == $.ui.keyCode.ESCAPE) { |
|
|
e.preventDefault(); |
|
|
scope.cancel(); |
|
|
} else if (e.which == $.ui.keyCode.TAB && e.shiftKey) { |
|
|
e.preventDefault(); |
|
|
args.grid.navigatePrev(); |
|
|
} else if (e.which == $.ui.keyCode.TAB) { |
|
|
e.preventDefault(); |
|
|
args.grid.navigateNext(); |
|
|
} |
|
|
}; |
|
|
|
|
|
this.save = function () { |
|
|
args.commitChanges(); |
|
|
}; |
|
|
|
|
|
this.cancel = function () { |
|
|
$input.val(defaultValue); |
|
|
args.cancelChanges(); |
|
|
}; |
|
|
|
|
|
this.hide = function () { |
|
|
$wrapper.hide(); |
|
|
}; |
|
|
|
|
|
this.show = function () { |
|
|
$wrapper.show(); |
|
|
}; |
|
|
|
|
|
this.position = function (position) { |
|
|
$wrapper |
|
|
.css("top", position.top - 5) |
|
|
.css("left", position.left - 5) |
|
|
}; |
|
|
|
|
|
this.destroy = function () { |
|
|
$wrapper.remove(); |
|
|
}; |
|
|
|
|
|
this.focus = function () { |
|
|
$input.focus(); |
|
|
}; |
|
|
|
|
|
this.loadValue = function (item) { |
|
|
$input.val(defaultValue = item[args.column.field]); |
|
|
$input.select(); |
|
|
}; |
|
|
|
|
|
this.serializeValue = function () { |
|
|
return $input.val(); |
|
|
}; |
|
|
|
|
|
this.applyValue = function (item, state) { |
|
|
item[args.column.field] = state; |
|
|
}; |
|
|
|
|
|
this.isValueChanged = function () { |
|
|
return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); |
|
|
}; |
|
|
|
|
|
this.validate = function () { |
|
|
return { |
|
|
valid: true, |
|
|
msg: null |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.init(); |
|
|
} |
|
|
})(jQuery); |
|
|
/*** |
|
|
* Contains basic SlickGrid formatters. |
|
|
* |
|
|
* NOTE: These are merely examples. You will most likely need to implement something more |
|
|
* robust/extensible/localizable/etc. for your use! |
|
|
* |
|
|
* @module Formatters |
|
|
* @namespace Slick |
|
|
*/ |
|
|
|
|
|
(function ($) { |
|
|
// register namespace |
|
|
$.extend(true, window, { |
|
|
"Slick": { |
|
|
"Formatters": { |
|
|
"PercentComplete": PercentCompleteFormatter, |
|
|
"PercentCompleteBar": PercentCompleteBarFormatter, |
|
|
"YesNo": YesNoFormatter, |
|
|
"Checkmark": CheckmarkFormatter |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
function PercentCompleteFormatter(row, cell, value, columnDef, dataContext) { |
|
|
if (value == null || value === "") { |
|
|
return "-"; |
|
|
} else if (value < 50) { |
|
|
return "<span style='color:red;font-weight:bold;'>" + value + "%</span>"; |
|
|
} else { |
|
|
return "<span style='color:green'>" + value + "%</span>"; |
|
|
} |
|
|
} |
|
|
|
|
|
function PercentCompleteBarFormatter(row, cell, value, columnDef, dataContext) { |
|
|
if (value == null || value === "") { |
|
|
return ""; |
|
|
} |
|
|
|
|
|
var color; |
|
|
|
|
|
if (value < 30) { |
|
|
color = "red"; |
|
|
} else if (value < 70) { |
|
|
color = "silver"; |
|
|
} else { |
|
|
color = "green"; |
|
|
} |
|
|
|
|
|
return "<span class='percent-complete-bar' style='background:" + color + ";width:" + value + "%'></span>"; |
|
|
} |
|
|
|
|
|
function YesNoFormatter(row, cell, value, columnDef, dataContext) { |
|
|
return value ? "Yes" : "No"; |
|
|
} |
|
|
|
|
|
function CheckmarkFormatter(row, cell, value, columnDef, dataContext) { |
|
|
return value ? "<img src='../images/tick.png'>" : ""; |
|
|
} |
|
|
})(jQuery); |
|
|
/** |
|
|
* @license |
|
|
* (c) 2009-2013 Michael Leibman |
|
|
* michael{dot}leibman{at}gmail{dot}com |
|
|
* http://github.com/mleibman/slickgrid |
|
|
* |
|
|
* Distributed under MIT license. |
|
|
* All rights reserved. |
|
|
* |
|
|
* SlickGrid v2.2 |
|
|
* |
|
|
* NOTES: |
|
|
* Cell/row DOM manipulations are done directly bypassing jQuery's DOM manipulation methods. |
|
|
* This increases the speed dramatically, but can only be done safely because there are no event handlers |
|
|
* or data associated with any cell/row DOM nodes. Cell editors must make sure they implement .destroy() |
|
|
* and do proper cleanup. |
|
|
*/ |
|
|
|
|
|
// make sure required JavaScript modules are loaded |
|
|
if (typeof jQuery === "undefined") { |
|
|
throw "SlickGrid requires jquery module to be loaded"; |
|
|
} |
|
|
if (!jQuery.fn.drag) { |
|
|
throw "SlickGrid requires jquery.event.drag module to be loaded"; |
|
|
} |
|
|
if (typeof Slick === "undefined") { |
|
|
throw "slick.core.js not loaded"; |
|
|
} |
|
|
|
|
|
|
|
|
(function ($) { |
|
|
// Slick.Grid |
|
|
$.extend(true, window, { |
|
|
Slick: { |
|
|
Grid: SlickGrid |
|
|
} |
|
|
}); |
|
|
|
|
|
// shared across all grids on the page |
|
|
var scrollbarDimensions; |
|
|
var maxSupportedCssHeight; // browser's breaking point |
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// SlickGrid class implementation (available as Slick.Grid) |
|
|
|
|
|
/** |
|
|
* Creates a new instance of the grid. |
|
|
* @class SlickGrid |
|
|
* @constructor |
|
|
* @param {Node} container Container node to create the grid in. |
|
|
* @param {Array,Object} data An array of objects for databinding. |
|
|
* @param {Array} columns An array of column definitions. |
|
|
* @param {Object} options Grid options. |
|
|
**/ |
|
|
function SlickGrid(container, data, columns, options) { |
|
|
// settings |
|
|
var defaults = { |
|
|
explicitInitialization: false, |
|
|
rowHeight: 25, |
|
|
defaultColumnWidth: 80, |
|
|
enableAddRow: false, |
|
|
leaveSpaceForNewRows: false, |
|
|
editable: false, |
|
|
autoEdit: true, |
|
|
enableCellNavigation: true, |
|
|
enableColumnReorder: true, |
|
|
asyncEditorLoading: false, |
|
|
asyncEditorLoadDelay: 100, |
|
|
forceFitColumns: false, |
|
|
enableAsyncPostRender: false, |
|
|
asyncPostRenderDelay: 50, |
|
|
autoHeight: false, |
|
|
editorLock: Slick.GlobalEditorLock, |
|
|
showHeaderRow: false, |
|
|
headerRowHeight: 25, |
|
|
showTopPanel: false, |
|
|
topPanelHeight: 25, |
|
|
formatterFactory: null, |
|
|
editorFactory: null, |
|
|
cellFlashingCssClass: "flashing", |
|
|
selectedCellCssClass: "selected", |
|
|
multiSelect: true, |
|
|
enableTextSelectionOnCells: false, |
|
|
dataItemColumnValueExtractor: null, |
|
|
fullWidthRows: false, |
|
|
multiColumnSort: false, |
|
|
defaultFormatter: defaultFormatter, |
|
|
forceSyncScrolling: false, |
|
|
addNewRowCssClass: "new-row" |
|
|
}; |
|
|
|
|
|
var columnDefaults = { |
|
|
name: "", |
|
|
resizable: true, |
|
|
sortable: false, |
|
|
minWidth: 30, |
|
|
rerenderOnResize: false, |
|
|
headerCssClass: null, |
|
|
defaultSortAsc: true, |
|
|
focusable: true, |
|
|
selectable: true |
|
|
}; |
|
|
|
|
|
// scroller |
|
|
var th; // virtual height |
|
|
var h; // real scrollable height |
|
|
var ph; // page height |
|
|
var n; // number of pages |
|
|
var cj; // "jumpiness" coefficient |
|
|
|
|
|
var page = 0; // current page |
|
|
var offset = 0; // current page offset |
|
|
var vScrollDir = 1; |
|
|
|
|
|
// private |
|
|
var initialized = false; |
|
|
var $container; |
|
|
var uid = "slickgrid_" + Math.round(1000000 * Math.random()); |
|
|
var self = this; |
|
|
var $focusSink, $focusSink2; |
|
|
var $headerScroller; |
|
|
var $headers; |
|
|
var $headerRow, $headerRowScroller, $headerRowSpacer; |
|
|
var $topPanelScroller; |
|
|
var $topPanel; |
|
|
var $viewport; |
|
|
var $canvas; |
|
|
var $style; |
|
|
var $boundAncestors; |
|
|
var stylesheet, columnCssRulesL, columnCssRulesR; |
|
|
var viewportH, viewportW; |
|
|
var canvasWidth; |
|
|
var viewportHasHScroll, viewportHasVScroll; |
|
|
var headerColumnWidthDiff = 0, headerColumnHeightDiff = 0, // border+padding |
|
|
cellWidthDiff = 0, cellHeightDiff = 0; |
|
|
var absoluteColumnMinWidth; |
|
|
|
|
|
var tabbingDirection = 1; |
|
|
var activePosX; |
|
|
var activeRow, activeCell; |
|
|
var activeCellNode = null; |
|
|
var currentEditor = null; |
|
|
var serializedEditorValue; |
|
|
var editController; |
|
|
|
|
|
var rowsCache = {}; |
|
|
var renderedRows = 0; |
|
|
var numVisibleRows; |
|
|
var prevScrollTop = 0; |
|
|
var scrollTop = 0; |
|
|
var lastRenderedScrollTop = 0; |
|
|
var lastRenderedScrollLeft = 0; |
|
|
var prevScrollLeft = 0; |
|
|
var scrollLeft = 0; |
|
|
|
|
|
var selectionModel; |
|
|
var selectedRows = []; |
|
|
|
|
|
var plugins = []; |
|
|
var cellCssClasses = {}; |
|
|
|
|
|
var columnsById = {}; |
|
|
var sortColumns = []; |
|
|
var columnPosLeft = []; |
|
|
var columnPosRight = []; |
|
|
|
|
|
|
|
|
// async call handles |
|
|
var h_editorLoader = null; |
|
|
var h_render = null; |
|
|
var h_postrender = null; |
|
|
var postProcessedRows = {}; |
|
|
var postProcessToRow = null; |
|
|
var postProcessFromRow = null; |
|
|
|
|
|
// perf counters |
|
|
var counter_rows_rendered = 0; |
|
|
var counter_rows_removed = 0; |
|
|
|
|
|
// These two variables work around a bug with inertial scrolling in Webkit/Blink on Mac. |
|
|
// See http://crbug.com/312427. |
|
|
var rowNodeFromLastMouseWheelEvent; // this node must not be deleted while inertial scrolling |
|
|
var zombieRowNodeFromLastMouseWheelEvent; // node that was hidden instead of getting deleted |
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// Initialization |
|
|
|
|
|
function init() { |
|
|
$container = $(container); |
|
|
if ($container.length < 1) { |
|
|
throw new Error("SlickGrid requires a valid container, " + container + " does not exist in the DOM."); |
|
|
} |
|
|
|
|
|
// calculate these only once and share between grid instances |
|
|
maxSupportedCssHeight = maxSupportedCssHeight || getMaxSupportedCssHeight(); |
|
|
scrollbarDimensions = scrollbarDimensions || measureScrollbar(); |
|
|
|
|
|
options = $.extend({}, defaults, options); |
|
|
validateAndEnforceOptions(); |
|
|
columnDefaults.width = options.defaultColumnWidth; |
|
|
|
|
|
columnsById = {}; |
|
|
for (var i = 0; i < columns.length; i++) { |
|
|
var m = columns[i] = $.extend({}, columnDefaults, columns[i]); |
|
|
columnsById[m.id] = i; |
|
|
if (m.minWidth && m.width < m.minWidth) { |
|
|
m.width = m.minWidth; |
|
|
} |
|
|
if (m.maxWidth && m.width > m.maxWidth) { |
|
|
m.width = m.maxWidth; |
|
|
} |
|
|
} |
|
|
|
|
|
// validate loaded JavaScript modules against requested options |
|
|
if (options.enableColumnReorder && !$.fn.sortable) { |
|
|
throw new Error("SlickGrid's 'enableColumnReorder = true' option requires jquery-ui.sortable module to be loaded"); |
|
|
} |
|
|
|
|
|
editController = { |
|
|
"commitCurrentEdit": commitCurrentEdit, |
|
|
"cancelCurrentEdit": cancelCurrentEdit |
|
|
}; |
|
|
|
|
|
$container |
|
|
.empty() |
|
|
.css("overflow", "hidden") |
|
|
.css("outline", 0) |
|
|
.addClass(uid) |
|
|
.addClass("ui-widget"); |
|
|
|
|
|
// set up a positioning container if needed |
|
|
if (!/relative|absolute|fixed/.test($container.css("position"))) { |
|
|
$container.css("position", "relative"); |
|
|
} |
|
|
|
|
|
$focusSink = $("<div tabIndex='0' hideFocus style='position:fixed;width:0;height:0;top:0;left:0;outline:0;'></div>").appendTo($container); |
|
|
|
|
|
$headerScroller = $("<div class='slick-header ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($container); |
|
|
$headers = $("<div class='slick-header-columns' style='left:-1000px' />").appendTo($headerScroller); |
|
|
$headers.width(getHeadersWidth()); |
|
|
|
|
|
$headerRowScroller = $("<div class='slick-headerrow ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($container); |
|
|
$headerRow = $("<div class='slick-headerrow-columns' />").appendTo($headerRowScroller); |
|
|
$headerRowSpacer = $("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>") |
|
|
.css("width", getCanvasWidth() + scrollbarDimensions.width + "px") |
|
|
.appendTo($headerRowScroller); |
|
|
|
|
|
$topPanelScroller = $("<div class='slick-top-panel-scroller ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($container); |
|
|
$topPanel = $("<div class='slick-top-panel' style='width:10000px' />").appendTo($topPanelScroller); |
|
|
|
|
|
if (!options.showTopPanel) { |
|
|
$topPanelScroller.hide(); |
|
|
} |
|
|
|
|
|
if (!options.showHeaderRow) { |
|
|
$headerRowScroller.hide(); |
|
|
} |
|
|
|
|
|
$viewport = $("<div class='slick-viewport' style='width:100%;overflow:auto;outline:0;position:relative;;'>").appendTo($container); |
|
|
$viewport.css("overflow-y", options.autoHeight ? "hidden" : "auto"); |
|
|
|
|
|
$canvas = $("<div class='grid-canvas' />").appendTo($viewport); |
|
|
|
|
|
$focusSink2 = $focusSink.clone().appendTo($container); |
|
|
|
|
|
if (!options.explicitInitialization) { |
|
|
finishInitialization(); |
|
|
} |
|
|
} |
|
|
|
|
|
function finishInitialization() { |
|
|
if (!initialized) { |
|
|
initialized = true; |
|
|
|
|
|
viewportW = parseFloat($.css($container[0], "width", true)); |
|
|
|
|
|
// header columns and cells may have different padding/border skewing width calculations (box-sizing, hello?) |
|
|
// calculate the diff so we can set consistent sizes |
|
|
measureCellPaddingAndBorder(); |
|
|
|
|
|
// for usability reasons, all text selection in SlickGrid is disabled |
|
|
// with the exception of input and textarea elements (selection must |
|
|
// be enabled there so that editors work as expected); note that |
|
|
// selection in grid cells (grid body) is already unavailable in |
|
|
// all browsers except IE |
|
|
disableSelection($headers); // disable all text selection in header (including input and textarea) |
|
|
|
|
|
if (!options.enableTextSelectionOnCells) { |
|
|
// disable text selection in grid cells except in input and textarea elements |
|
|
// (this is IE-specific, because selectstart event will only fire in IE) |
|
|
$viewport.bind("selectstart.ui", function (event) { |
|
|
return $(event.target).is("input,textarea"); |
|
|
}); |
|
|
} |
|
|
|
|
|
updateColumnCaches(); |
|
|
createColumnHeaders(); |
|
|
setupColumnSort(); |
|
|
createCssRules(); |
|
|
resizeCanvas(); |
|
|
bindAncestorScrollEvents(); |
|
|
|
|
|
$container |
|
|
.bind("resize.slickgrid", resizeCanvas); |
|
|
$viewport |
|
|
//.bind("click", handleClick) |
|
|
.bind("scroll", handleScroll); |
|
|
$headerScroller |
|
|
.bind("contextmenu", handleHeaderContextMenu) |
|
|
.bind("click", handleHeaderClick) |
|
|
.delegate(".slick-header-column", "mouseenter", handleHeaderMouseEnter) |
|
|
.delegate(".slick-header-column", "mouseleave", handleHeaderMouseLeave); |
|
|
$headerRowScroller |
|
|
.bind("scroll", handleHeaderRowScroll); |
|
|
$focusSink.add($focusSink2) |
|
|
.bind("keydown", handleKeyDown); |
|
|
$canvas |
|
|
.bind("keydown", handleKeyDown) |
|
|
.bind("click", handleClick) |
|
|
.bind("dblclick", handleDblClick) |
|
|
.bind("contextmenu", handleContextMenu) |
|
|
.bind("draginit", handleDragInit) |
|
|
.bind("dragstart", {distance: 3}, handleDragStart) |
|
|
.bind("drag", handleDrag) |
|
|
.bind("dragend", handleDragEnd) |
|
|
.delegate(".slick-cell", "mouseenter", handleMouseEnter) |
|
|
.delegate(".slick-cell", "mouseleave", handleMouseLeave); |
|
|
|
|
|
// Work around http://crbug.com/312427. |
|
|
if (navigator.userAgent.toLowerCase().match(/webkit/) && |
|
|
navigator.userAgent.toLowerCase().match(/macintosh/)) { |
|
|
$canvas.bind("mousewheel", handleMouseWheel); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function registerPlugin(plugin) { |
|
|
plugins.unshift(plugin); |
|
|
plugin.init(self); |
|
|
} |
|
|
|
|
|
function unregisterPlugin(plugin) { |
|
|
for (var i = plugins.length; i >= 0; i--) { |
|
|
if (plugins[i] === plugin) { |
|
|
if (plugins[i].destroy) { |
|
|
plugins[i].destroy(); |
|
|
} |
|
|
plugins.splice(i, 1); |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function setSelectionModel(model) { |
|
|
if (selectionModel) { |
|
|
selectionModel.onSelectedRangesChanged.unsubscribe(handleSelectedRangesChanged); |
|
|
if (selectionModel.destroy) { |
|
|
selectionModel.destroy(); |
|
|
} |
|
|
} |
|
|
|
|
|
selectionModel = model; |
|
|
if (selectionModel) { |
|
|
selectionModel.init(self); |
|
|
selectionModel.onSelectedRangesChanged.subscribe(handleSelectedRangesChanged); |
|
|
} |
|
|
} |
|
|
|
|
|
function getSelectionModel() { |
|
|
return selectionModel; |
|
|
} |
|
|
|
|
|
function getCanvasNode() { |
|
|
return $canvas[0]; |
|
|
} |
|
|
|
|
|
function measureScrollbar() { |
|
|
var $c = $("<div style='position:absolute; top:-10000px; left:-10000px; width:100px; height:100px; overflow:scroll;'></div>").appendTo("body"); |
|
|
var dim = { |
|
|
width: $c.width() - $c[0].clientWidth, |
|
|
height: $c.height() - $c[0].clientHeight |
|
|
}; |
|
|
$c.remove(); |
|
|
return dim; |
|
|
} |
|
|
|
|
|
function getHeadersWidth() { |
|
|
var headersWidth = 0; |
|
|
for (var i = 0, ii = columns.length; i < ii; i++) { |
|
|
var width = columns[i].width; |
|
|
headersWidth += width; |
|
|
} |
|
|
headersWidth += scrollbarDimensions.width; |
|
|
return Math.max(headersWidth, viewportW) + 1000; |
|
|
} |
|
|
|
|
|
function getCanvasWidth() { |
|
|
var availableWidth = viewportHasVScroll ? viewportW - scrollbarDimensions.width : viewportW; |
|
|
var rowWidth = 0; |
|
|
var i = columns.length; |
|
|
while (i--) { |
|
|
rowWidth += columns[i].width; |
|
|
} |
|
|
return options.fullWidthRows ? Math.max(rowWidth, availableWidth) : rowWidth; |
|
|
} |
|
|
|
|
|
function updateCanvasWidth(forceColumnWidthsUpdate) { |
|
|
var oldCanvasWidth = canvasWidth; |
|
|
canvasWidth = getCanvasWidth(); |
|
|
|
|
|
if (canvasWidth != oldCanvasWidth) { |
|
|
$canvas.width(canvasWidth); |
|
|
$headerRow.width(canvasWidth); |
|
|
$headers.width(getHeadersWidth()); |
|
|
viewportHasHScroll = (canvasWidth > viewportW - scrollbarDimensions.width); |
|
|
} |
|
|
|
|
|
$headerRowSpacer.width(canvasWidth + (viewportHasVScroll ? scrollbarDimensions.width : 0)); |
|
|
|
|
|
if (canvasWidth != oldCanvasWidth || forceColumnWidthsUpdate) { |
|
|
applyColumnWidths(); |
|
|
} |
|
|
} |
|
|
|
|
|
function disableSelection($target) { |
|
|
if ($target && $target.jquery) { |
|
|
$target |
|
|
.attr("unselectable", "on") |
|
|
.css("MozUserSelect", "none") |
|
|
.bind("selectstart.ui", function () { |
|
|
return false; |
|
|
}); // from jquery:ui.core.js 1.7.2 |
|
|
} |
|
|
} |
|
|
|
|
|
function getMaxSupportedCssHeight() { |
|
|
var supportedHeight = 1000000; |
|
|
// FF reports the height back but still renders blank after ~6M px |
|
|
var testUpTo = navigator.userAgent.toLowerCase().match(/firefox/) ? 6000000 : 1000000000; |
|
|
var div = $("<div style='display:none' />").appendTo(document.body); |
|
|
|
|
|
while (true) { |
|
|
var test = supportedHeight * 2; |
|
|
div.css("height", test); |
|
|
if (test > testUpTo || div.height() !== test) { |
|
|
break; |
|
|
} else { |
|
|
supportedHeight = test; |
|
|
} |
|
|
} |
|
|
|
|
|
div.remove(); |
|
|
return supportedHeight; |
|
|
} |
|
|
|
|
|
// TODO: this is static. need to handle page mutation. |
|
|
function bindAncestorScrollEvents() { |
|
|
var elem = $canvas[0]; |
|
|
while ((elem = elem.parentNode) != document.body && elem != null) { |
|
|
// bind to scroll containers only |
|
|
if (elem == $viewport[0] || elem.scrollWidth != elem.clientWidth || elem.scrollHeight != elem.clientHeight) { |
|
|
var $elem = $(elem); |
|
|
if (!$boundAncestors) { |
|
|
$boundAncestors = $elem; |
|
|
} else { |
|
|
$boundAncestors = $boundAncestors.add($elem); |
|
|
} |
|
|
$elem.bind("scroll." + uid, handleActiveCellPositionChange); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function unbindAncestorScrollEvents() { |
|
|
if (!$boundAncestors) { |
|
|
return; |
|
|
} |
|
|
$boundAncestors.unbind("scroll." + uid); |
|
|
$boundAncestors = null; |
|
|
} |
|
|
|
|
|
function updateColumnHeader(columnId, title, toolTip) { |
|
|
if (!initialized) { return; } |
|
|
var idx = getColumnIndex(columnId); |
|
|
if (idx == null) { |
|
|
return; |
|
|
} |
|
|
|
|
|
var columnDef = columns[idx]; |
|
|
var $header = $headers.children().eq(idx); |
|
|
if ($header) { |
|
|
if (title !== undefined) { |
|
|
columns[idx].name = title; |
|
|
} |
|
|
if (toolTip !== undefined) { |
|
|
columns[idx].toolTip = toolTip; |
|
|
} |
|
|
|
|
|
trigger(self.onBeforeHeaderCellDestroy, { |
|
|
"node": $header[0], |
|
|
"column": columnDef |
|
|
}); |
|
|
|
|
|
$header |
|
|
.attr("title", toolTip || "") |
|
|
.children().eq(0).html(title); |
|
|
|
|
|
trigger(self.onHeaderCellRendered, { |
|
|
"node": $header[0], |
|
|
"column": columnDef |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
function getHeaderRow() { |
|
|
return $headerRow[0]; |
|
|
} |
|
|
|
|
|
function getHeaderRowColumn(columnId) { |
|
|
var idx = getColumnIndex(columnId); |
|
|
var $header = $headerRow.children().eq(idx); |
|
|
return $header && $header[0]; |
|
|
} |
|
|
|
|
|
function createColumnHeaders() { |
|
|
function onMouseEnter() { |
|
|
$(this).addClass("ui-state-hover"); |
|
|
} |
|
|
|
|
|
function onMouseLeave() { |
|
|
$(this).removeClass("ui-state-hover"); |
|
|
} |
|
|
|
|
|
$headers.find(".slick-header-column") |
|
|
.each(function() { |
|
|
var columnDef = $(this).data("column"); |
|
|
if (columnDef) { |
|
|
trigger(self.onBeforeHeaderCellDestroy, { |
|
|
"node": this, |
|
|
"column": columnDef |
|
|
}); |
|
|
} |
|
|
}); |
|
|
$headers.empty(); |
|
|
$headers.width(getHeadersWidth()); |
|
|
|
|
|
$headerRow.find(".slick-headerrow-column") |
|
|
.each(function() { |
|
|
var columnDef = $(this).data("column"); |
|
|
if (columnDef) { |
|
|
trigger(self.onBeforeHeaderRowCellDestroy, { |
|
|
"node": this, |
|
|
"column": columnDef |
|
|
}); |
|
|
} |
|
|
}); |
|
|
$headerRow.empty(); |
|
|
|
|
|
for (var i = 0; i < columns.length; i++) { |
|
|
var m = columns[i]; |
|
|
|
|
|
var header = $("<div class='ui-state-default slick-header-column' />") |
|
|
.html("<span class='slick-column-name'>" + m.name + "</span>") |
|
|
.width(m.width - headerColumnWidthDiff) |
|
|
.attr("id", "" + uid + m.id) |
|
|
.attr("title", m.toolTip || "") |
|
|
.data("column", m) |
|
|
.addClass(m.headerCssClass || "") |
|
|
.appendTo($headers); |
|
|
|
|
|
if (options.enableColumnReorder || m.sortable) { |
|
|
header |
|
|
.on('mouseenter', onMouseEnter) |
|
|
.on('mouseleave', onMouseLeave); |
|
|
} |
|
|
|
|
|
if (m.sortable) { |
|
|
header.addClass("slick-header-sortable"); |
|
|
header.append("<span class='slick-sort-indicator' />"); |
|
|
} |
|
|
|
|
|
trigger(self.onHeaderCellRendered, { |
|
|
"node": header[0], |
|
|
"column": m |
|
|
}); |
|
|
|
|
|
if (options.showHeaderRow) { |
|
|
var headerRowCell = $("<div class='ui-state-default slick-headerrow-column l" + i + " r" + i + "'></div>") |
|
|
.data("column", m) |
|
|
.appendTo($headerRow); |
|
|
|
|
|
trigger(self.onHeaderRowCellRendered, { |
|
|
"node": headerRowCell[0], |
|
|
"column": m |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
setSortColumns(sortColumns); |
|
|
setupColumnResize(); |
|
|
if (options.enableColumnReorder) { |
|
|
setupColumnReorder(); |
|
|
} |
|
|
} |
|
|
|
|
|
function setupColumnSort() { |
|
|
$headers.click(function (e) { |
|
|
// temporary workaround for a bug in jQuery 1.7.1 (http://bugs.jquery.com/ticket/11328) |
|
|
e.metaKey = e.metaKey || e.ctrlKey; |
|
|
|
|
|
if ($(e.target).hasClass("slick-resizable-handle")) { |
|
|
return; |
|
|
} |
|
|
|
|
|
var $col = $(e.target).closest(".slick-header-column"); |
|
|
if (!$col.length) { |
|
|
return; |
|
|
} |
|
|
|
|
|
var column = $col.data("column"); |
|
|
if (column.sortable) { |
|
|
if (!getEditorLock().commitCurrentEdit()) { |
|
|
return; |
|
|
} |
|
|
|
|
|
var sortOpts = null; |
|
|
var i = 0; |
|
|
for (; i < sortColumns.length; i++) { |
|
|
if (sortColumns[i].columnId == column.id) { |
|
|
sortOpts = sortColumns[i]; |
|
|
sortOpts.sortAsc = !sortOpts.sortAsc; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
if (e.metaKey && options.multiColumnSort) { |
|
|
if (sortOpts) { |
|
|
sortColumns.splice(i, 1); |
|
|
} |
|
|
} |
|
|
else { |
|
|
if ((!e.shiftKey && !e.metaKey) || !options.multiColumnSort) { |
|
|
sortColumns = []; |
|
|
} |
|
|
|
|
|
if (!sortOpts) { |
|
|
sortOpts = { columnId: column.id, sortAsc: column.defaultSortAsc }; |
|
|
sortColumns.push(sortOpts); |
|
|
} else if (sortColumns.length == 0) { |
|
|
sortColumns.push(sortOpts); |
|
|
} |
|
|
} |
|
|
|
|
|
setSortColumns(sortColumns); |
|
|
|
|
|
if (!options.multiColumnSort) { |
|
|
trigger(self.onSort, { |
|
|
multiColumnSort: false, |
|
|
sortCol: column, |
|
|
sortAsc: sortOpts.sortAsc}, e); |
|
|
} else { |
|
|
trigger(self.onSort, { |
|
|
multiColumnSort: true, |
|
|
sortCols: $.map(sortColumns, function(col) { |
|
|
return {sortCol: columns[getColumnIndex(col.columnId)], sortAsc: col.sortAsc }; |
|
|
})}, e); |
|
|
} |
|
|
} |
|
|
}); |
|
|
} |
|
|
|
|
|
function setupColumnReorder() { |
|
|
$headers.filter(":ui-sortable").sortable("destroy"); |
|
|
$headers.sortable({ |
|
|
containment: "parent", |
|
|
distance: 3, |
|
|
axis: "x", |
|
|
cursor: "default", |
|
|
tolerance: "intersection", |
|
|
helper: "clone", |
|
|
placeholder: "slick-sortable-placeholder ui-state-default slick-header-column", |
|
|
start: function (e, ui) { |
|
|
ui.placeholder.width(ui.helper.outerWidth() - headerColumnWidthDiff); |
|
|
$(ui.helper).addClass("slick-header-column-active"); |
|
|
}, |
|
|
beforeStop: function (e, ui) { |
|
|
$(ui.helper).removeClass("slick-header-column-active"); |
|
|
}, |
|
|
stop: function (e) { |
|
|
if (!getEditorLock().commitCurrentEdit()) { |
|
|
$(this).sortable("cancel"); |
|
|
return; |
|
|
} |
|
|
|
|
|
var reorderedIds = $headers.sortable("toArray"); |
|
|
var reorderedColumns = []; |
|
|
for (var i = 0; i < reorderedIds.length; i++) { |
|
|
reorderedColumns.push(columns[getColumnIndex(reorderedIds[i].replace(uid, ""))]); |
|
|
} |
|
|
setColumns(reorderedColumns); |
|
|
|
|
|
trigger(self.onColumnsReordered, {}); |
|
|
e.stopPropagation(); |
|
|
setupColumnResize(); |
|
|
} |
|
|
}); |
|
|
} |
|
|
|
|
|
function setupColumnResize() { |
|
|
var $col, j, c, pageX, columnElements, minPageX, maxPageX, firstResizable, lastResizable; |
|
|
columnElements = $headers.children(); |
|
|
columnElements.find(".slick-resizable-handle").remove(); |
|
|
columnElements.each(function (i, e) { |
|
|
if (columns[i].resizable) { |
|
|
if (firstResizable === undefined) { |
|
|
firstResizable = i; |
|
|
} |
|
|
lastResizable = i; |
|
|
} |
|
|
}); |
|
|
if (firstResizable === undefined) { |
|
|
return; |
|
|
} |
|
|
columnElements.each(function (i, e) { |
|
|
if (i < firstResizable || (options.forceFitColumns && i >= lastResizable)) { |
|
|
return; |
|
|
} |
|
|
$col = $(e); |
|
|
$("<div class='slick-resizable-handle' />") |
|
|
.appendTo(e) |
|
|
.bind("dragstart", function (e, dd) { |
|
|
if (!getEditorLock().commitCurrentEdit()) { |
|
|
return false; |
|
|
} |
|
|
pageX = e.pageX; |
|
|
$(this).parent().addClass("slick-header-column-active"); |
|
|
var shrinkLeewayOnRight = null, stretchLeewayOnRight = null; |
|
|
// lock each column's width option to current width |
|
|
columnElements.each(function (i, e) { |
|
|
columns[i].previousWidth = $(e).outerWidth(); |
|
|
}); |
|
|
if (options.forceFitColumns) { |
|
|
shrinkLeewayOnRight = 0; |
|
|
stretchLeewayOnRight = 0; |
|
|
// colums on right affect maxPageX/minPageX |
|
|
for (j = i + 1; j < columnElements.length; j++) { |
|
|
c = columns[j]; |
|
|
if (c.resizable) { |
|
|
if (stretchLeewayOnRight !== null) { |
|
|
if (c.maxWidth) { |
|
|
stretchLeewayOnRight += c.maxWidth - c.previousWidth; |
|
|
} else { |
|
|
stretchLeewayOnRight = null; |
|
|
} |
|
|
} |
|
|
shrinkLeewayOnRight += c.previousWidth - Math.max(c.minWidth || 0, absoluteColumnMinWidth); |
|
|
} |
|
|
} |
|
|
} |
|
|
var shrinkLeewayOnLeft = 0, stretchLeewayOnLeft = 0; |
|
|
for (j = 0; j <= i; j++) { |
|
|
// columns on left only affect minPageX |
|
|
c = columns[j]; |
|
|
if (c.resizable) { |
|
|
if (stretchLeewayOnLeft !== null) { |
|
|
if (c.maxWidth) { |
|
|
stretchLeewayOnLeft += c.maxWidth - c.previousWidth; |
|
|
} else { |
|
|
stretchLeewayOnLeft = null; |
|
|
} |
|
|
} |
|
|
shrinkLeewayOnLeft += c.previousWidth - Math.max(c.minWidth || 0, absoluteColumnMinWidth); |
|
|
} |
|
|
} |
|
|
if (shrinkLeewayOnRight === null) { |
|
|
shrinkLeewayOnRight = 100000; |
|
|
} |
|
|
if (shrinkLeewayOnLeft === null) { |
|
|
shrinkLeewayOnLeft = 100000; |
|
|
} |
|
|
if (stretchLeewayOnRight === null) { |
|
|
stretchLeewayOnRight = 100000; |
|
|
} |
|
|
if (stretchLeewayOnLeft === null) { |
|
|
stretchLeewayOnLeft = 100000; |
|
|
} |
|
|
maxPageX = pageX + Math.min(shrinkLeewayOnRight, stretchLeewayOnLeft); |
|
|
minPageX = pageX - Math.min(shrinkLeewayOnLeft, stretchLeewayOnRight); |
|
|
}) |
|
|
.bind("drag", function (e, dd) { |
|
|
var actualMinWidth, d = Math.min(maxPageX, Math.max(minPageX, e.pageX)) - pageX, x; |
|
|
if (d < 0) { // shrink column |
|
|
x = d; |
|
|
for (j = i; j >= 0; j--) { |
|
|
c = columns[j]; |
|
|
if (c.resizable) { |
|
|
actualMinWidth = Math.max(c.minWidth || 0, absoluteColumnMinWidth); |
|
|
if (x && c.previousWidth + x < actualMinWidth) { |
|
|
x += c.previousWidth - actualMinWidth; |
|
|
c.width = actualMinWidth; |
|
|
} else { |
|
|
c.width = c.previousWidth + x; |
|
|
x = 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (options.forceFitColumns) { |
|
|
x = -d; |
|
|
for (j = i + 1; j < columnElements.length; j++) { |
|
|
c = columns[j]; |
|
|
if (c.resizable) { |
|
|
if (x && c.maxWidth && (c.maxWidth - c.previousWidth < x)) { |
|
|
x -= c.maxWidth - c.previousWidth; |
|
|
c.width = c.maxWidth; |
|
|
} else { |
|
|
c.width = c.previousWidth + x; |
|
|
x = 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { // stretch column |
|
|
x = d; |
|
|
for (j = i; j >= 0; j--) { |
|
|
c = columns[j]; |
|
|
if (c.resizable) { |
|
|
if (x && c.maxWidth && (c.maxWidth - c.previousWidth < x)) { |
|
|
x -= c.maxWidth - c.previousWidth; |
|
|
c.width = c.maxWidth; |
|
|
} else { |
|
|
c.width = c.previousWidth + x; |
|
|
x = 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (options.forceFitColumns) { |
|
|
x = -d; |
|
|
for (j = i + 1; j < columnElements.length; j++) { |
|
|
c = columns[j]; |
|
|
if (c.resizable) { |
|
|
actualMinWidth = Math.max(c.minWidth || 0, absoluteColumnMinWidth); |
|
|
if (x && c.previousWidth + x < actualMinWidth) { |
|
|
x += c.previousWidth - actualMinWidth; |
|
|
c.width = actualMinWidth; |
|
|
} else { |
|
|
c.width = c.previousWidth + x; |
|
|
x = 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
applyColumnHeaderWidths(); |
|
|
if (options.syncColumnCellResize) { |
|
|
applyColumnWidths(); |
|
|
} |
|
|
}) |
|
|
.bind("dragend", function (e, dd) { |
|
|
var newWidth; |
|
|
$(this).parent().removeClass("slick-header-column-active"); |
|
|
for (j = 0; j < columnElements.length; j++) { |
|
|
c = columns[j]; |
|
|
newWidth = $(columnElements[j]).outerWidth(); |
|
|
|
|
|
if (c.previousWidth !== newWidth && c.rerenderOnResize) { |
|
|
invalidateAllRows(); |
|
|
} |
|
|
} |
|
|
updateCanvasWidth(true); |
|
|
render(); |
|
|
trigger(self.onColumnsResized, {}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
function getVBoxDelta($el) { |
|
|
var p = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"]; |
|
|
var delta = 0; |
|
|
$.each(p, function (n, val) { |
|
|
delta += parseFloat($el.css(val)) || 0; |
|
|
}); |
|
|
return delta; |
|
|
} |
|
|
|
|
|
function measureCellPaddingAndBorder() { |
|
|
var el; |
|
|
var h = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"]; |
|
|
var v = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"]; |
|
|
|
|
|
el = $("<div class='ui-state-default slick-header-column' style='visibility:hidden'>-</div>").appendTo($headers); |
|
|
headerColumnWidthDiff = headerColumnHeightDiff = 0; |
|
|
if (el.css("box-sizing") != "border-box" && el.css("-moz-box-sizing") != "border-box" && el.css("-webkit-box-sizing") != "border-box") { |
|
|
$.each(h, function (n, val) { |
|
|
headerColumnWidthDiff += parseFloat(el.css(val)) || 0; |
|
|
}); |
|
|
$.each(v, function (n, val) { |
|
|
headerColumnHeightDiff += parseFloat(el.css(val)) || 0; |
|
|
}); |
|
|
} |
|
|
el.remove(); |
|
|
|
|
|
var r = $("<div class='slick-row' />").appendTo($canvas); |
|
|
el = $("<div class='slick-cell' id='' style='visibility:hidden'>-</div>").appendTo(r); |
|
|
cellWidthDiff = cellHeightDiff = 0; |
|
|
if (el.css("box-sizing") != "border-box" && el.css("-moz-box-sizing") != "border-box" && el.css("-webkit-box-sizing") != "border-box") { |
|
|
$.each(h, function (n, val) { |
|
|
cellWidthDiff += parseFloat(el.css(val)) || 0; |
|
|
}); |
|
|
$.each(v, function (n, val) { |
|
|
cellHeightDiff += parseFloat(el.css(val)) || 0; |
|
|
}); |
|
|
} |
|
|
r.remove(); |
|
|
|
|
|
absoluteColumnMinWidth = Math.max(headerColumnWidthDiff, cellWidthDiff); |
|
|
} |
|
|
|
|
|
function createCssRules() { |
|
|
$style = $("<style type='text/css' rel='stylesheet' />").appendTo($("head")); |
|
|
var rowHeight = (options.rowHeight - cellHeightDiff); |
|
|
var rules = [ |
|
|
"." + uid + " .slick-header-column { left: 1000px; }", |
|
|
"." + uid + " .slick-top-panel { height:" + options.topPanelHeight + "px; }", |
|
|
"." + uid + " .slick-headerrow-columns { height:" + options.headerRowHeight + "px; }", |
|
|
"." + uid + " .slick-cell { height:" + rowHeight + "px; }", |
|
|
"." + uid + " .slick-row { height:" + options.rowHeight + "px; }" |
|
|
]; |
|
|
|
|
|
for (var i = 0; i < columns.length; i++) { |
|
|
rules.push("." + uid + " .l" + i + " { }"); |
|
|
rules.push("." + uid + " .r" + i + " { }"); |
|
|
} |
|
|
|
|
|
if ($style[0].styleSheet) { // IE |
|
|
$style[0].styleSheet.cssText = rules.join(" "); |
|
|
} else { |
|
|
$style[0].appendChild(document.createTextNode(rules.join(" "))); |
|
|
} |
|
|
} |
|
|
|
|
|
function getColumnCssRules(idx) { |
|
|
if (!stylesheet) { |
|
|
var sheets = document.styleSheets; |
|
|
for (var i = 0; i < sheets.length; i++) { |
|
|
if ((sheets[i].ownerNode || sheets[i].owningElement) == $style[0]) { |
|
|
stylesheet = sheets[i]; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
if (!stylesheet) { |
|
|
throw new Error("Cannot find stylesheet."); |
|
|
} |
|
|
|
|
|
// find and cache column CSS rules |
|
|
columnCssRulesL = []; |
|
|
columnCssRulesR = []; |
|
|
var cssRules = (stylesheet.cssRules || stylesheet.rules); |
|
|
var matches, columnIdx; |
|
|
for (var i = 0; i < cssRules.length; i++) { |
|
|
var selector = cssRules[i].selectorText; |
|
|
if (matches = /\.l\d+/.exec(selector)) { |
|
|
columnIdx = parseInt(matches[0].substr(2, matches[0].length - 2), 10); |
|
|
columnCssRulesL[columnIdx] = cssRules[i]; |
|
|
} else if (matches = /\.r\d+/.exec(selector)) { |
|
|
columnIdx = parseInt(matches[0].substr(2, matches[0].length - 2), 10); |
|
|
columnCssRulesR[columnIdx] = cssRules[i]; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
return { |
|
|
"left": columnCssRulesL[idx], |
|
|
"right": columnCssRulesR[idx] |
|
|
}; |
|
|
} |
|
|
|
|
|
function removeCssRules() { |
|
|
$style.remove(); |
|
|
stylesheet = null; |
|
|
} |
|
|
|
|
|
function destroy() { |
|
|
getEditorLock().cancelCurrentEdit(); |
|
|
|
|
|
trigger(self.onBeforeDestroy, {}); |
|
|
|
|
|
var i = plugins.length; |
|
|
while(i--) { |
|
|
unregisterPlugin(plugins[i]); |
|
|
} |
|
|
|
|
|
if (options.enableColumnReorder) { |
|
|
$headers.filter(":ui-sortable").sortable("destroy"); |
|
|
} |
|
|
|
|
|
unbindAncestorScrollEvents(); |
|
|
$container.unbind(".slickgrid"); |
|
|
removeCssRules(); |
|
|
|
|
|
$canvas.unbind("draginit dragstart dragend drag"); |
|
|
$container.empty().removeClass(uid); |
|
|
} |
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// General |
|
|
|
|
|
function trigger(evt, args, e) { |
|
|
e = e || new Slick.EventData(); |
|
|
args = args || {}; |
|
|
args.grid = self; |
|
|
return evt.notify(args, e, self); |
|
|
} |
|
|
|
|
|
function getEditorLock() { |
|
|
return options.editorLock; |
|
|
} |
|
|
|
|
|
function getEditController() { |
|
|
return editController; |
|
|
} |
|
|
|
|
|
function getColumnIndex(id) { |
|
|
return columnsById[id]; |
|
|
} |
|
|
|
|
|
function autosizeColumns() { |
|
|
var i, c, |
|
|
widths = [], |
|
|
shrinkLeeway = 0, |
|
|
total = 0, |
|
|
prevTotal, |
|
|
availWidth = viewportHasVScroll ? viewportW - scrollbarDimensions.width : viewportW; |
|
|
|
|
|
for (i = 0; i < columns.length; i++) { |
|
|
c = columns[i]; |
|
|
widths.push(c.width); |
|
|
total += c.width; |
|
|
if (c.resizable) { |
|
|
shrinkLeeway += c.width - Math.max(c.minWidth, absoluteColumnMinWidth); |
|
|
} |
|
|
} |
|
|
|
|
|
// shrink |
|
|
prevTotal = total; |
|
|
while (total > availWidth && shrinkLeeway) { |
|
|
var shrinkProportion = (total - availWidth) / shrinkLeeway; |
|
|
for (i = 0; i < columns.length && total > availWidth; i++) { |
|
|
c = columns[i]; |
|
|
var width = widths[i]; |
|
|
if (!c.resizable || width <= c.minWidth || width <= absoluteColumnMinWidth) { |
|
|
continue; |
|
|
} |
|
|
var absMinWidth = Math.max(c.minWidth, absoluteColumnMinWidth); |
|
|
var shrinkSize = Math.floor(shrinkProportion * (width - absMinWidth)) || 1; |
|
|
shrinkSize = Math.min(shrinkSize, width - absMinWidth); |
|
|
total -= shrinkSize; |
|
|
shrinkLeeway -= shrinkSize; |
|
|
widths[i] -= shrinkSize; |
|
|
} |
|
|
if (prevTotal <= total) { // avoid infinite loop |
|
|
break; |
|
|
} |
|
|
prevTotal = total; |
|
|
} |
|
|
|
|
|
// grow |
|
|
prevTotal = total; |
|
|
while (total < availWidth) { |
|
|
var growProportion = availWidth / total; |
|
|
for (i = 0; i < columns.length && total < availWidth; i++) { |
|
|
c = columns[i]; |
|
|
var currentWidth = widths[i]; |
|
|
var growSize; |
|
|
|
|
|
if (!c.resizable || c.maxWidth <= currentWidth) { |
|
|
growSize = 0; |
|
|
} else { |
|
|
growSize = Math.min(Math.floor(growProportion * currentWidth) - currentWidth, (c.maxWidth - currentWidth) || 1000000) || 1; |
|
|
} |
|
|
total += growSize; |
|
|
widths[i] += growSize; |
|
|
} |
|
|
if (prevTotal >= total) { // avoid infinite loop |
|
|
break; |
|
|
} |
|
|
prevTotal = total; |
|
|
} |
|
|
|
|
|
var reRender = false; |
|
|
for (i = 0; i < columns.length; i++) { |
|
|
if (columns[i].rerenderOnResize && columns[i].width != widths[i]) { |
|
|
reRender = true; |
|
|
} |
|
|
columns[i].width = widths[i]; |
|
|
} |
|
|
|
|
|
applyColumnHeaderWidths(); |
|
|
updateCanvasWidth(true); |
|
|
if (reRender) { |
|
|
invalidateAllRows(); |
|
|
render(); |
|
|
} |
|
|
} |
|
|
|
|
|
function applyColumnHeaderWidths() { |
|
|
if (!initialized) { return; } |
|
|
var h; |
|
|
for (var i = 0, headers = $headers.children(), ii = headers.length; i < ii; i++) { |
|
|
h = $(headers[i]); |
|
|
if (h.width() !== columns[i].width - headerColumnWidthDiff) { |
|
|
h.width(columns[i].width - headerColumnWidthDiff); |
|
|
} |
|
|
} |
|
|
|
|
|
updateColumnCaches(); |
|
|
} |
|
|
|
|
|
function applyColumnWidths() { |
|
|
var x = 0, w, rule; |
|
|
for (var i = 0; i < columns.length; i++) { |
|
|
w = columns[i].width; |
|
|
|
|
|
rule = getColumnCssRules(i); |
|
|
rule.left.style.left = x + "px"; |
|
|
rule.right.style.right = (canvasWidth - x - w) + "px"; |
|
|
|
|
|
x += columns[i].width; |
|
|
} |
|
|
} |
|
|
|
|
|
function setSortColumn(columnId, ascending) { |
|
|
setSortColumns([{ columnId: columnId, sortAsc: ascending}]); |
|
|
} |
|
|
|
|
|
function setSortColumns(cols) { |
|
|
sortColumns = cols; |
|
|
|
|
|
var headerColumnEls = $headers.children(); |
|
|
headerColumnEls |
|
|
.removeClass("slick-header-column-sorted") |
|
|
.find(".slick-sort-indicator") |
|
|
.removeClass("slick-sort-indicator-asc slick-sort-indicator-desc"); |
|
|
|
|
|
$.each(sortColumns, function(i, col) { |
|
|
if (col.sortAsc == null) { |
|
|
col.sortAsc = true; |
|
|
} |
|
|
var columnIndex = getColumnIndex(col.columnId); |
|
|
if (columnIndex != null) { |
|
|
headerColumnEls.eq(columnIndex) |
|
|
.addClass("slick-header-column-sorted") |
|
|
.find(".slick-sort-indicator") |
|
|
.addClass(col.sortAsc ? "slick-sort-indicator-asc" : "slick-sort-indicator-desc"); |
|
|
} |
|
|
}); |
|
|
} |
|
|
|
|
|
function getSortColumns() { |
|
|
return sortColumns; |
|
|
} |
|
|
|
|
|
function handleSelectedRangesChanged(e, ranges) { |
|
|
selectedRows = []; |
|
|
var hash = {}; |
|
|
for (var i = 0; i < ranges.length; i++) { |
|
|
for (var j = ranges[i].fromRow; j <= ranges[i].toRow; j++) { |
|
|
if (!hash[j]) { // prevent duplicates |
|
|
selectedRows.push(j); |
|
|
hash[j] = {}; |
|
|
} |
|
|
for (var k = ranges[i].fromCell; k <= ranges[i].toCell; k++) { |
|
|
if (canCellBeSelected(j, k)) { |
|
|
hash[j][columns[k].id] = options.selectedCellCssClass; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
setCellCssStyles(options.selectedCellCssClass, hash); |
|
|
|
|
|
trigger(self.onSelectedRowsChanged, {rows: getSelectedRows()}, e); |
|
|
} |
|
|
|
|
|
function getColumns() { |
|
|
return columns; |
|
|
} |
|
|
|
|
|
function updateColumnCaches() { |
|
|
// Pre-calculate cell boundaries. |
|
|
columnPosLeft = []; |
|
|
columnPosRight = []; |
|
|
var x = 0; |
|
|
for (var i = 0, ii = columns.length; i < ii; i++) { |
|
|
columnPosLeft[i] = x; |
|
|
columnPosRight[i] = x + columns[i].width; |
|
|
x += columns[i].width; |
|
|
} |
|
|
} |
|
|
|
|
|
function setColumns(columnDefinitions) { |
|
|
columns = columnDefinitions; |
|
|
|
|
|
columnsById = {}; |
|
|
for (var i = 0; i < columns.length; i++) { |
|
|
var m = columns[i] = $.extend({}, columnDefaults, columns[i]); |
|
|
columnsById[m.id] = i; |
|
|
if (m.minWidth && m.width < m.minWidth) { |
|
|
m.width = m.minWidth; |
|
|
} |
|
|
if (m.maxWidth && m.width > m.maxWidth) { |
|
|
m.width = m.maxWidth; |
|
|
} |
|
|
} |
|
|
|
|
|
updateColumnCaches(); |
|
|
|
|
|
if (initialized) { |
|
|
invalidateAllRows(); |
|
|
createColumnHeaders(); |
|
|
removeCssRules(); |
|
|
createCssRules(); |
|
|
resizeCanvas(); |
|
|
applyColumnWidths(); |
|
|
handleScroll(); |
|
|
} |
|
|
} |
|
|
|
|
|
function getOptions() { |
|
|
return options; |
|
|
} |
|
|
|
|
|
function setOptions(args) { |
|
|
if (!getEditorLock().commitCurrentEdit()) { |
|
|
return; |
|
|
} |
|
|
|
|
|
makeActiveCellNormal(); |
|
|
|
|
|
if (options.enableAddRow !== args.enableAddRow) { |
|
|
invalidateRow(getDataLength()); |
|
|
} |
|
|
|
|
|
options = $.extend(options, args); |
|
|
validateAndEnforceOptions(); |
|
|
|
|
|
$viewport.css("overflow-y", options.autoHeight ? "hidden" : "auto"); |
|
|
render(); |
|
|
} |
|
|
|
|
|
function validateAndEnforceOptions() { |
|
|
if (options.autoHeight) { |
|
|
options.leaveSpaceForNewRows = false; |
|
|
} |
|
|
} |
|
|
|
|
|
function setData(newData, scrollToTop) { |
|
|
data = newData; |
|
|
invalidateAllRows(); |
|
|
updateRowCount(); |
|
|
if (scrollToTop) { |
|
|
scrollTo(0); |
|
|
} |
|
|
} |
|
|
|
|
|
function getData() { |
|
|
return data; |
|
|
} |
|
|
|
|
|
function getDataLength() { |
|
|
if (data.getLength) { |
|
|
return data.getLength(); |
|
|
} else { |
|
|
return data.length; |
|
|
} |
|
|
} |
|
|
|
|
|
function getDataLengthIncludingAddNew() { |
|
|
return getDataLength() + (options.enableAddRow ? 1 : 0); |
|
|
} |
|
|
|
|
|
function getDataItem(i) { |
|
|
if (data.getItem) { |
|
|
return data.getItem(i); |
|
|
} else { |
|
|
return data[i]; |
|
|
} |
|
|
} |
|
|
|
|
|
function getTopPanel() { |
|
|
return $topPanel[0]; |
|
|
} |
|
|
|
|
|
function setTopPanelVisibility(visible) { |
|
|
if (options.showTopPanel != visible) { |
|
|
options.showTopPanel = visible; |
|
|
if (visible) { |
|
|
$topPanelScroller.slideDown("fast", resizeCanvas); |
|
|
} else { |
|
|
$topPanelScroller.slideUp("fast", resizeCanvas); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function setHeaderRowVisibility(visible) { |
|
|
if (options.showHeaderRow != visible) { |
|
|
options.showHeaderRow = visible; |
|
|
if (visible) { |
|
|
$headerRowScroller.slideDown("fast", resizeCanvas); |
|
|
} else { |
|
|
$headerRowScroller.slideUp("fast", resizeCanvas); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function getContainerNode() { |
|
|
return $container.get(0); |
|
|
} |
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// Rendering / Scrolling |
|
|
|
|
|
function getRowTop(row) { |
|
|
return options.rowHeight * row - offset; |
|
|
} |
|
|
|
|
|
function getRowFromPosition(y) { |
|
|
return Math.floor((y + offset) / options.rowHeight); |
|
|
} |
|
|
|
|
|
function scrollTo(y) { |
|
|
y = Math.max(y, 0); |
|
|
y = Math.min(y, th - viewportH + (viewportHasHScroll ? scrollbarDimensions.height : 0)); |
|
|
|
|
|
var oldOffset = offset; |
|
|
|
|
|
page = Math.min(n - 1, Math.floor(y / ph)); |
|
|
offset = Math.round(page * cj); |
|
|
var newScrollTop = y - offset; |
|
|
|
|
|
if (offset != oldOffset) { |
|
|
var range = getVisibleRange(newScrollTop); |
|
|
cleanupRows(range); |
|
|
updateRowPositions(); |
|
|
} |
|
|
|
|
|
if (prevScrollTop != newScrollTop) { |
|
|
vScrollDir = (prevScrollTop + oldOffset < newScrollTop + offset) ? 1 : -1; |
|
|
$viewport[0].scrollTop = (lastRenderedScrollTop = scrollTop = prevScrollTop = newScrollTop); |
|
|
|
|
|
trigger(self.onViewportChanged, {}); |
|
|
} |
|
|
} |
|
|
|
|
|
function defaultFormatter(row, cell, value, columnDef, dataContext) { |
|
|
if (value == null) { |
|
|
return ""; |
|
|
} else { |
|
|
return (value + "").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"); |
|
|
} |
|
|
} |
|
|
|
|
|
function getFormatter(row, column) { |
|
|
var rowMetadata = data.getItemMetadata && data.getItemMetadata(row); |
|
|
|
|
|
// look up by id, then index |
|
|
var columnOverrides = rowMetadata && |
|
|
rowMetadata.columns && |
|
|
(rowMetadata.columns[column.id] || rowMetadata.columns[getColumnIndex(column.id)]); |
|
|
|
|
|
return (columnOverrides && columnOverrides.formatter) || |
|
|
(rowMetadata && rowMetadata.formatter) || |
|
|
column.formatter || |
|
|
(options.formatterFactory && options.formatterFactory.getFormatter(column)) || |
|
|
options.defaultFormatter; |
|
|
} |
|
|
|
|
|
function getEditor(row, cell) { |
|
|
var column = columns[cell]; |
|
|
var rowMetadata = data.getItemMetadata && data.getItemMetadata(row); |
|
|
var columnMetadata = rowMetadata && rowMetadata.columns; |
|
|
|
|
|
if (columnMetadata && columnMetadata[column.id] && columnMetadata[column.id].editor !== undefined) { |
|
|
return columnMetadata[column.id].editor; |
|
|
} |
|
|
if (columnMetadata && columnMetadata[cell] && columnMetadata[cell].editor !== undefined) { |
|
|
return columnMetadata[cell].editor; |
|
|
} |
|
|
|
|
|
return column.editor || (options.editorFactory && options.editorFactory.getEditor(column)); |
|
|
} |
|
|
|
|
|
function getDataItemValueForColumn(item, columnDef) { |
|
|
if (options.dataItemColumnValueExtractor) { |
|
|
return options.dataItemColumnValueExtractor(item, columnDef); |
|
|
} |
|
|
return item[columnDef.field]; |
|
|
} |
|
|
|
|
|
function appendRowHtml(stringArray, row, range, dataLength) { |
|
|
var d = getDataItem(row); |
|
|
var dataLoading = row < dataLength && !d; |
|
|
var rowCss = "slick-row" + |
|
|
(dataLoading ? " loading" : "") + |
|
|
(row === activeRow ? " active" : "") + |
|
|
(row % 2 == 1 ? " odd" : " even"); |
|
|
|
|
|
if (!d) { |
|
|
rowCss += " " + options.addNewRowCssClass; |
|
|
} |
|
|
|
|
|
var metadata = data.getItemMetadata && data.getItemMetadata(row); |
|
|
|
|
|
if (metadata && metadata.cssClasses) { |
|
|
rowCss += " " + metadata.cssClasses; |
|
|
} |
|
|
|
|
|
stringArray.push("<div class='ui-widget-content " + rowCss + "' style='top:" + getRowTop(row) + "px'>"); |
|
|
|
|
|
var colspan, m; |
|
|
for (var i = 0, ii = columns.length; i < ii; i++) { |
|
|
m = columns[i]; |
|
|
colspan = 1; |
|
|
if (metadata && metadata.columns) { |
|
|
var columnData = metadata.columns[m.id] || metadata.columns[i]; |
|
|
colspan = (columnData && columnData.colspan) || 1; |
|
|
if (colspan === "*") { |
|
|
colspan = ii - i; |
|
|
} |
|
|
} |
|
|
|
|
|
// Do not render cells outside of the viewport. |
|
|
if (columnPosRight[Math.min(ii - 1, i + colspan - 1)] > range.leftPx) { |
|
|
if (columnPosLeft[i] > range.rightPx) { |
|
|
// All columns to the right are outside the range. |
|
|
break; |
|
|
} |
|
|
|
|
|
appendCellHtml(stringArray, row, i, colspan, d); |
|
|
} |
|
|
|
|
|
if (colspan > 1) { |
|
|
i += (colspan - 1); |
|
|
} |
|
|
} |
|
|
|
|
|
stringArray.push("</div>"); |
|
|
} |
|
|
|
|
|
function appendCellHtml(stringArray, row, cell, colspan, item) { |
|
|
var m = columns[cell]; |
|
|
var cellCss = "slick-cell l" + cell + " r" + Math.min(columns.length - 1, cell + colspan - 1) + |
|
|
(m.cssClass ? " " + m.cssClass : ""); |
|
|
if (row === activeRow && cell === activeCell) { |
|
|
cellCss += (" active"); |
|
|
} |
|
|
|
|
|
// TODO: merge them together in the setter |
|
|
for (var key in cellCssClasses) { |
|
|
if (cellCssClasses[key][row] && cellCssClasses[key][row][m.id]) { |
|
|
cellCss += (" " + cellCssClasses[key][row][m.id]); |
|
|
} |
|
|
} |
|
|
|
|
|
stringArray.push("<div class='" + cellCss + "'>"); |
|
|
|
|
|
// if there is a corresponding row (if not, this is the Add New row or this data hasn't been loaded yet) |
|
|
if (item) { |
|
|
var value = getDataItemValueForColumn(item, m); |
|
|
stringArray.push(getFormatter(row, m)(row, cell, value, m, item)); |
|
|
} |
|
|
|
|
|
stringArray.push("</div>"); |
|
|
|
|
|
rowsCache[row].cellRenderQueue.push(cell); |
|
|
rowsCache[row].cellColSpans[cell] = colspan; |
|
|
} |
|
|
|
|
|
|
|
|
function cleanupRows(rangeToKeep) { |
|
|
for (var i in rowsCache) { |
|
|
if (((i = parseInt(i, 10)) !== activeRow) && (i < rangeToKeep.top || i > rangeToKeep.bottom)) { |
|
|
removeRowFromCache(i); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function invalidate() { |
|
|
updateRowCount(); |
|
|
invalidateAllRows(); |
|
|
render(); |
|
|
} |
|
|
|
|
|
function invalidateAllRows() { |
|
|
if (currentEditor) { |
|
|
makeActiveCellNormal(); |
|
|
} |
|
|
for (var row in rowsCache) { |
|
|
removeRowFromCache(row); |
|
|
} |
|
|
} |
|
|
|
|
|
function removeRowFromCache(row) { |
|
|
var cacheEntry = rowsCache[row]; |
|
|
if (!cacheEntry) { |
|
|
return; |
|
|
} |
|
|
|
|
|
if (rowNodeFromLastMouseWheelEvent == cacheEntry.rowNode) { |
|
|
cacheEntry.rowNode.style.display = 'none'; |
|
|
zombieRowNodeFromLastMouseWheelEvent = rowNodeFromLastMouseWheelEvent; |
|
|
} else { |
|
|
$canvas[0].removeChild(cacheEntry.rowNode); |
|
|
} |
|
|
|
|
|
delete rowsCache[row]; |
|
|
delete postProcessedRows[row]; |
|
|
renderedRows--; |
|
|
counter_rows_removed++; |
|
|
} |
|
|
|
|
|
function invalidateRows(rows) { |
|
|
var i, rl; |
|
|
if (!rows || !rows.length) { |
|
|
return; |
|
|
} |
|
|
vScrollDir = 0; |
|
|
for (i = 0, rl = rows.length; i < rl; i++) { |
|
|
if (currentEditor && activeRow === rows[i]) { |
|
|
makeActiveCellNormal(); |
|
|
} |
|
|
if (rowsCache[rows[i]]) { |
|
|
removeRowFromCache(rows[i]); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function invalidateRow(row) { |
|
|
invalidateRows([row]); |
|
|
} |
|
|
|
|
|
function updateCell(row, cell) { |
|
|
var cellNode = getCellNode(row, cell); |
|
|
if (!cellNode) { |
|
|
return; |
|
|
} |
|
|
|
|
|
var m = columns[cell], d = getDataItem(row); |
|
|
if (currentEditor && activeRow === row && activeCell === cell) { |
|
|
currentEditor.loadValue(d); |
|
|
} else { |
|
|
cellNode.innerHTML = d ? getFormatter(row, m)(row, cell, getDataItemValueForColumn(d, m), m, d) : ""; |
|
|
invalidatePostProcessingResults(row); |
|
|
} |
|
|
} |
|
|
|
|
|
function updateRow(row) { |
|
|
var cacheEntry = rowsCache[row]; |
|
|
if (!cacheEntry) { |
|
|
return; |
|
|
} |
|
|
|
|
|
ensureCellNodesInRowsCache(row); |
|
|
|
|
|
var d = getDataItem(row); |
|
|
|
|
|
for (var columnIdx in cacheEntry.cellNodesByColumnIdx) { |
|
|
if (!cacheEntry.cellNodesByColumnIdx.hasOwnProperty(columnIdx)) { |
|
|
continue; |
|
|
} |
|
|
|
|
|
columnIdx = columnIdx | 0; |
|
|
var m = columns[columnIdx], |
|
|
node = cacheEntry.cellNodesByColumnIdx[columnIdx]; |
|
|
|
|
|
if (row === activeRow && columnIdx === activeCell && currentEditor) { |
|
|
currentEditor.loadValue(d); |
|
|
} else if (d) { |
|
|
node.innerHTML = getFormatter(row, m)(row, columnIdx, getDataItemValueForColumn(d, m), m, d); |
|
|
} else { |
|
|
node.innerHTML = ""; |
|
|
} |
|
|
} |
|
|
|
|
|
invalidatePostProcessingResults(row); |
|
|
} |
|
|
|
|
|
function getViewportHeight() { |
|
|
return parseFloat($.css($container[0], "height", true)) - |
|
|
parseFloat($.css($container[0], "paddingTop", true)) - |
|
|
parseFloat($.css($container[0], "paddingBottom", true)) - |
|
|
parseFloat($.css($headerScroller[0], "height")) - getVBoxDelta($headerScroller) - |
|
|
(options.showTopPanel ? options.topPanelHeight + getVBoxDelta($topPanelScroller) : 0) - |
|
|
(options.showHeaderRow ? options.headerRowHeight + getVBoxDelta($headerRowScroller) : 0); |
|
|
} |
|
|
|
|
|
function resizeCanvas() { |
|
|
if (!initialized) { return; } |
|
|
if (options.autoHeight) { |
|
|
viewportH = options.rowHeight * getDataLengthIncludingAddNew(); |
|
|
} else { |
|
|
viewportH = getViewportHeight(); |
|
|
} |
|
|
|
|
|
numVisibleRows = Math.ceil(viewportH / options.rowHeight); |
|
|
viewportW = parseFloat($.css($container[0], "width", true)); |
|
|
if (!options.autoHeight) { |
|
|
$viewport.height(viewportH); |
|
|
} |
|
|
|
|
|
if (options.forceFitColumns) { |
|
|
autosizeColumns(); |
|
|
} |
|
|
|
|
|
updateRowCount(); |
|
|
handleScroll(); |
|
|
// Since the width has changed, force the render() to reevaluate virtually rendered cells. |
|
|
lastRenderedScrollLeft = -1; |
|
|
render(); |
|
|
} |
|
|
|
|
|
function updateRowCount() { |
|
|
if (!initialized) { return; } |
|
|
|
|
|
var dataLengthIncludingAddNew = getDataLengthIncludingAddNew(); |
|
|
var numberOfRows = dataLengthIncludingAddNew + |
|
|
(options.leaveSpaceForNewRows ? numVisibleRows - 1 : 0); |
|
|
|
|
|
var oldViewportHasVScroll = viewportHasVScroll; |
|
|
// with autoHeight, we do not need to accommodate the vertical scroll bar |
|
|
viewportHasVScroll = !options.autoHeight && (numberOfRows * options.rowHeight > viewportH); |
|
|
|
|
|
makeActiveCellNormal(); |
|
|
|
|
|
// remove the rows that are now outside of the data range |
|
|
// this helps avoid redundant calls to .removeRow() when the size of the data decreased by thousands of rows |
|
|
var l = dataLengthIncludingAddNew - 1; |
|
|
for (var i in rowsCache) { |
|
|
if (i >= l) { |
|
|
removeRowFromCache(i); |
|
|
} |
|
|
} |
|
|
|
|
|
if (activeCellNode && activeRow > l) { |
|
|
resetActiveCell(); |
|
|
} |
|
|
|
|
|
var oldH = h; |
|
|
th = Math.max(options.rowHeight * numberOfRows, viewportH - scrollbarDimensions.height); |
|
|
if (th < maxSupportedCssHeight) { |
|
|
// just one page |
|
|
h = ph = th; |
|
|
n = 1; |
|
|
cj = 0; |
|
|
} else { |
|
|
// break into pages |
|
|
h = maxSupportedCssHeight; |
|
|
ph = h / 100; |
|
|
n = Math.floor(th / ph); |
|
|
cj = (th - h) / (n - 1); |
|
|
} |
|
|
|
|
|
if (h !== oldH) { |
|
|
$canvas.css("height", h); |
|
|
scrollTop = $viewport[0].scrollTop; |
|
|
} |
|
|
|
|
|
var oldScrollTopInRange = (scrollTop + offset <= th - viewportH); |
|
|
|
|
|
if (th == 0 || scrollTop == 0) { |
|
|
page = offset = 0; |
|
|
} else if (oldScrollTopInRange) { |
|
|
// maintain virtual position |
|
|
scrollTo(scrollTop + offset); |
|
|
} else { |
|
|
// scroll to bottom |
|
|
scrollTo(th - viewportH); |
|
|
} |
|
|
|
|
|
if (h != oldH && options.autoHeight) { |
|
|
resizeCanvas(); |
|
|
} |
|
|
|
|
|
if (options.forceFitColumns && oldViewportHasVScroll != viewportHasVScroll) { |
|
|
autosizeColumns(); |
|
|
} |
|
|
updateCanvasWidth(false); |
|
|
} |
|
|
|
|
|
function getVisibleRange(viewportTop, viewportLeft) { |
|
|
if (viewportTop == null) { |
|
|
viewportTop = scrollTop; |
|
|
} |
|
|
if (viewportLeft == null) { |
|
|
viewportLeft = scrollLeft; |
|
|
} |
|
|
|
|
|
return { |
|
|
top: getRowFromPosition(viewportTop), |
|
|
bottom: getRowFromPosition(viewportTop + viewportH) + 1, |
|
|
leftPx: viewportLeft, |
|
|
rightPx: viewportLeft + viewportW |
|
|
}; |
|
|
} |
|
|
|
|
|
function getRenderedRange(viewportTop, viewportLeft) { |
|
|
var range = getVisibleRange(viewportTop, viewportLeft); |
|
|
var buffer = Math.round(viewportH / options.rowHeight); |
|
|
var minBuffer = 3; |
|
|
|
|
|
if (vScrollDir == -1) { |
|
|
range.top -= buffer; |
|
|
range.bottom += minBuffer; |
|
|
} else if (vScrollDir == 1) { |
|
|
range.top -= minBuffer; |
|
|
range.bottom += buffer; |
|
|
} else { |
|
|
range.top -= minBuffer; |
|
|
range.bottom += minBuffer; |
|
|
} |
|
|
|
|
|
range.top = Math.max(0, range.top); |
|
|
range.bottom = Math.min(getDataLengthIncludingAddNew() - 1, range.bottom); |
|
|
|
|
|
range.leftPx -= viewportW; |
|
|
range.rightPx += viewportW; |
|
|
|
|
|
range.leftPx = Math.max(0, range.leftPx); |
|
|
range.rightPx = Math.min(canvasWidth, range.rightPx); |
|
|
|
|
|
return range; |
|
|
} |
|
|
|
|
|
function ensureCellNodesInRowsCache(row) { |
|
|
var cacheEntry = rowsCache[row]; |
|
|
if (cacheEntry) { |
|
|
if (cacheEntry.cellRenderQueue.length) { |
|
|
var lastChild = cacheEntry.rowNode.lastChild; |
|
|
while (cacheEntry.cellRenderQueue.length) { |
|
|
var columnIdx = cacheEntry.cellRenderQueue.pop(); |
|
|
cacheEntry.cellNodesByColumnIdx[columnIdx] = lastChild; |
|
|
lastChild = lastChild.previousSibling; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function cleanUpCells(range, row) { |
|
|
var totalCellsRemoved = 0; |
|
|
var cacheEntry = rowsCache[row]; |
|
|
|
|
|
// Remove cells outside the range. |
|
|
var cellsToRemove = []; |
|
|
for (var i in cacheEntry.cellNodesByColumnIdx) { |
|
|
// I really hate it when people mess with Array.prototype. |
|
|
if (!cacheEntry.cellNodesByColumnIdx.hasOwnProperty(i)) { |
|
|
continue; |
|
|
} |
|
|
|
|
|
// This is a string, so it needs to be cast back to a number. |
|
|
i = i | 0; |
|
|
|
|
|
var colspan = cacheEntry.cellColSpans[i]; |
|
|
if (columnPosLeft[i] > range.rightPx || |
|
|
columnPosRight[Math.min(columns.length - 1, i + colspan - 1)] < range.leftPx) { |
|
|
if (!(row == activeRow && i == activeCell)) { |
|
|
cellsToRemove.push(i); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
var cellToRemove; |
|
|
while ((cellToRemove = cellsToRemove.pop()) != null) { |
|
|
cacheEntry.rowNode.removeChild(cacheEntry.cellNodesByColumnIdx[cellToRemove]); |
|
|
delete cacheEntry.cellColSpans[cellToRemove]; |
|
|
delete cacheEntry.cellNodesByColumnIdx[cellToRemove]; |
|
|
if (postProcessedRows[row]) { |
|
|
delete postProcessedRows[row][cellToRemove]; |
|
|
} |
|
|
totalCellsRemoved++; |
|
|
} |
|
|
} |
|
|
|
|
|
function cleanUpAndRenderCells(range) { |
|
|
var cacheEntry; |
|
|
var stringArray = []; |
|
|
var processedRows = []; |
|
|
var cellsAdded; |
|
|
var totalCellsAdded = 0; |
|
|
var colspan; |
|
|
|
|
|
for (var row = range.top, btm = range.bottom; row <= btm; row++) { |
|
|
cacheEntry = rowsCache[row]; |
|
|
if (!cacheEntry) { |
|
|
continue; |
|
|
} |
|
|
|
|
|
// cellRenderQueue populated in renderRows() needs to be cleared first |
|
|
ensureCellNodesInRowsCache(row); |
|
|
|
|
|
cleanUpCells(range, row); |
|
|
|
|
|
// Render missing cells. |
|
|
cellsAdded = 0; |
|
|
|
|
|
var metadata = data.getItemMetadata && data.getItemMetadata(row); |
|
|
metadata = metadata && metadata.columns; |
|
|
|
|
|
var d = getDataItem(row); |
|
|
|
|
|
// TODO: shorten this loop (index? heuristics? binary search?) |
|
|
for (var i = 0, ii = columns.length; i < ii; i++) { |
|
|
// Cells to the right are outside the range. |
|
|
if (columnPosLeft[i] > range.rightPx) { |
|
|
break; |
|
|
} |
|
|
|
|
|
// Already rendered. |
|
|
if ((colspan = cacheEntry.cellColSpans[i]) != null) { |
|
|
i += (colspan > 1 ? colspan - 1 : 0); |
|
|
continue; |
|
|
} |
|
|
|
|
|
colspan = 1; |
|
|
if (metadata) { |
|
|
var columnData = metadata[columns[i].id] || metadata[i]; |
|
|
colspan = (columnData && columnData.colspan) || 1; |
|
|
if (colspan === "*") { |
|
|
colspan = ii - i; |
|
|
} |
|
|
} |
|
|
|
|
|
if (columnPosRight[Math.min(ii - 1, i + colspan - 1)] > range.leftPx) { |
|
|
appendCellHtml(stringArray, row, i, colspan, d); |
|
|
cellsAdded++; |
|
|
} |
|
|
|
|
|
i += (colspan > 1 ? colspan - 1 : 0); |
|
|
} |
|
|
|
|
|
if (cellsAdded) { |
|
|
totalCellsAdded += cellsAdded; |
|
|
processedRows.push(row); |
|
|
} |
|
|
} |
|
|
|
|
|
if (!stringArray.length) { |
|
|
return; |
|
|
} |
|
|
|
|
|
var x = document.createElement("div"); |
|
|
x.innerHTML = stringArray.join(""); |
|
|
|
|
|
var processedRow; |
|
|
var node; |
|
|
while ((processedRow = processedRows.pop()) != null) { |
|
|
cacheEntry = rowsCache[processedRow]; |
|
|
var columnIdx; |
|
|
while ((columnIdx = cacheEntry.cellRenderQueue.pop()) != null) { |
|
|
node = x.lastChild; |
|
|
cacheEntry.rowNode.appendChild(node); |
|
|
cacheEntry.cellNodesByColumnIdx[columnIdx] = node; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function renderRows(range) { |
|
|
var parentNode = $canvas[0], |
|
|
stringArray = [], |
|
|
rows = [], |
|
|
needToReselectCell = false, |
|
|
dataLength = getDataLength(); |
|
|
|
|
|
for (var i = range.top, ii = range.bottom; i <= ii; i++) { |
|
|
if (rowsCache[i]) { |
|
|
continue; |
|
|
} |
|
|
renderedRows++; |
|
|
rows.push(i); |
|
|
|
|
|
// Create an entry right away so that appendRowHtml() can |
|
|
// start populatating it. |
|
|
rowsCache[i] = { |
|
|
"rowNode": null, |
|
|
|
|
|
// ColSpans of rendered cells (by column idx). |
|
|
// Can also be used for checking whether a cell has been rendered. |
|
|
"cellColSpans": [], |
|
|
|
|
|
// Cell nodes (by column idx). Lazy-populated by ensureCellNodesInRowsCache(). |
|
|
"cellNodesByColumnIdx": [], |
|
|
|
|
|
// Column indices of cell nodes that have been rendered, but not yet indexed in |
|
|
// cellNodesByColumnIdx. These are in the same order as cell nodes added at the |
|
|
// end of the row. |
|
|
"cellRenderQueue": [] |
|
|
}; |
|
|
|
|
|
appendRowHtml(stringArray, i, range, dataLength); |
|
|
if (activeCellNode && activeRow === i) { |
|
|
needToReselectCell = true; |
|
|
} |
|
|
counter_rows_rendered++; |
|
|
} |
|
|
|
|
|
if (!rows.length) { return; } |
|
|
|
|
|
var x = document.createElement("div"); |
|
|
x.innerHTML = stringArray.join(""); |
|
|
|
|
|
for (var i = 0, ii = rows.length; i < ii; i++) { |
|
|
rowsCache[rows[i]].rowNode = parentNode.appendChild(x.firstChild); |
|
|
} |
|
|
|
|
|
if (needToReselectCell) { |
|
|
activeCellNode = getCellNode(activeRow, activeCell); |
|
|
} |
|
|
} |
|
|
|
|
|
function startPostProcessing() { |
|
|
if (!options.enableAsyncPostRender) { |
|
|
return; |
|
|
} |
|
|
clearTimeout(h_postrender); |
|
|
h_postrender = setTimeout(asyncPostProcessRows, options.asyncPostRenderDelay); |
|
|
} |
|
|
|
|
|
function invalidatePostProcessingResults(row) { |
|
|
delete postProcessedRows[row]; |
|
|
postProcessFromRow = Math.min(postProcessFromRow, row); |
|
|
postProcessToRow = Math.max(postProcessToRow, row); |
|
|
startPostProcessing(); |
|
|
} |
|
|
|
|
|
function updateRowPositions() { |
|
|
for (var row in rowsCache) { |
|
|
rowsCache[row].rowNode.style.top = getRowTop(row) + "px"; |
|
|
} |
|
|
} |
|
|
|
|
|
function render() { |
|
|
if (!initialized) { return; } |
|
|
var visible = getVisibleRange(); |
|
|
var rendered = getRenderedRange(); |
|
|
|
|
|
// remove rows no longer in the viewport |
|
|
cleanupRows(rendered); |
|
|
|
|
|
// add new rows & missing cells in existing rows |
|
|
if (lastRenderedScrollLeft != scrollLeft) { |
|
|
cleanUpAndRenderCells(rendered); |
|
|
} |
|
|
|
|
|
// render missing rows |
|
|
renderRows(rendered); |
|
|
|
|
|
postProcessFromRow = visible.top; |
|
|
postProcessToRow = Math.min(getDataLengthIncludingAddNew() - 1, visible.bottom); |
|
|
startPostProcessing(); |
|
|
|
|
|
lastRenderedScrollTop = scrollTop; |
|
|
lastRenderedScrollLeft = scrollLeft; |
|
|
h_render = null; |
|
|
} |
|
|
|
|
|
function handleHeaderRowScroll() { |
|
|
var scrollLeft = $headerRowScroller[0].scrollLeft; |
|
|
if (scrollLeft != $viewport[0].scrollLeft) { |
|
|
$viewport[0].scrollLeft = scrollLeft; |
|
|
} |
|
|
} |
|
|
|
|
|
function handleScroll() { |
|
|
scrollTop = $viewport[0].scrollTop; |
|
|
scrollLeft = $viewport[0].scrollLeft; |
|
|
var vScrollDist = Math.abs(scrollTop - prevScrollTop); |
|
|
var hScrollDist = Math.abs(scrollLeft - prevScrollLeft); |
|
|
|
|
|
if (hScrollDist) { |
|
|
prevScrollLeft = scrollLeft; |
|
|
$headerScroller[0].scrollLeft = scrollLeft; |
|
|
$topPanelScroller[0].scrollLeft = scrollLeft; |
|
|
$headerRowScroller[0].scrollLeft = scrollLeft; |
|
|
} |
|
|
|
|
|
if (vScrollDist) { |
|
|
vScrollDir = prevScrollTop < scrollTop ? 1 : -1; |
|
|
prevScrollTop = scrollTop; |
|
|
|
|
|
// switch virtual pages if needed |
|
|
if (vScrollDist < viewportH) { |
|
|
scrollTo(scrollTop + offset); |
|
|
} else { |
|
|
var oldOffset = offset; |
|
|
if (h == viewportH) { |
|
|
page = 0; |
|
|
} else { |
|
|
page = Math.min(n - 1, Math.floor(scrollTop * ((th - viewportH) / (h - viewportH)) * (1 / ph))); |
|
|
} |
|
|
offset = Math.round(page * cj); |
|
|
if (oldOffset != offset) { |
|
|
invalidateAllRows(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (hScrollDist || vScrollDist) { |
|
|
if (h_render) { |
|
|
clearTimeout(h_render); |
|
|
} |
|
|
|
|
|
if (Math.abs(lastRenderedScrollTop - scrollTop) > 20 || |
|
|
Math.abs(lastRenderedScrollLeft - scrollLeft) > 20) { |
|
|
if (options.forceSyncScrolling || ( |
|
|
Math.abs(lastRenderedScrollTop - scrollTop) < viewportH && |
|
|
Math.abs(lastRenderedScrollLeft - scrollLeft) < viewportW)) { |
|
|
render(); |
|
|
} else { |
|
|
h_render = setTimeout(render, 50); |
|
|
} |
|
|
|
|
|
trigger(self.onViewportChanged, {}); |
|
|
} |
|
|
} |
|
|
|
|
|
trigger(self.onScroll, {scrollLeft: scrollLeft, scrollTop: scrollTop}); |
|
|
} |
|
|
|
|
|
function asyncPostProcessRows() { |
|
|
var dataLength = getDataLength(); |
|
|
while (postProcessFromRow <= postProcessToRow) { |
|
|
var row = (vScrollDir >= 0) ? postProcessFromRow++ : postProcessToRow--; |
|
|
var cacheEntry = rowsCache[row]; |
|
|
if (!cacheEntry || row >= dataLength) { |
|
|
continue; |
|
|
} |
|
|
|
|
|
if (!postProcessedRows[row]) { |
|
|
postProcessedRows[row] = {}; |
|
|
} |
|
|
|
|
|
ensureCellNodesInRowsCache(row); |
|
|
for (var columnIdx in cacheEntry.cellNodesByColumnIdx) { |
|
|
if (!cacheEntry.cellNodesByColumnIdx.hasOwnProperty(columnIdx)) { |
|
|
continue; |
|
|
} |
|
|
|
|
|
columnIdx = columnIdx | 0; |
|
|
|
|
|
var m = columns[columnIdx]; |
|
|
if (m.asyncPostRender && !postProcessedRows[row][columnIdx]) { |
|
|
var node = cacheEntry.cellNodesByColumnIdx[columnIdx]; |
|
|
if (node) { |
|
|
m.asyncPostRender(node, row, getDataItem(row), m); |
|
|
} |
|
|
postProcessedRows[row][columnIdx] = true; |
|
|
} |
|
|
} |
|
|
|
|
|
h_postrender = setTimeout(asyncPostProcessRows, options.asyncPostRenderDelay); |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
function updateCellCssStylesOnRenderedRows(addedHash, removedHash) { |
|
|
var node, columnId, addedRowHash, removedRowHash; |
|
|
for (var row in rowsCache) { |
|
|
removedRowHash = removedHash && removedHash[row]; |
|
|
addedRowHash = addedHash && addedHash[row]; |
|
|
|
|
|
if (removedRowHash) { |
|
|
for (columnId in removedRowHash) { |
|
|
if (!addedRowHash || removedRowHash[columnId] != addedRowHash[columnId]) { |
|
|
node = getCellNode(row, getColumnIndex(columnId)); |
|
|
if (node) { |
|
|
$(node).removeClass(removedRowHash[columnId]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (addedRowHash) { |
|
|
for (columnId in addedRowHash) { |
|
|
if (!removedRowHash || removedRowHash[columnId] != addedRowHash[columnId]) { |
|
|
node = getCellNode(row, getColumnIndex(columnId)); |
|
|
if (node) { |
|
|
$(node).addClass(addedRowHash[columnId]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function addCellCssStyles(key, hash) { |
|
|
if (cellCssClasses[key]) { |
|
|
throw "addCellCssStyles: cell CSS hash with key '" + key + "' already exists."; |
|
|
} |
|
|
|
|
|
cellCssClasses[key] = hash; |
|
|
updateCellCssStylesOnRenderedRows(hash, null); |
|
|
|
|
|
trigger(self.onCellCssStylesChanged, { "key": key, "hash": hash }); |
|
|
} |
|
|
|
|
|
function removeCellCssStyles(key) { |
|
|
if (!cellCssClasses[key]) { |
|
|
return; |
|
|
} |
|
|
|
|
|
updateCellCssStylesOnRenderedRows(null, cellCssClasses[key]); |
|
|
delete cellCssClasses[key]; |
|
|
|
|
|
trigger(self.onCellCssStylesChanged, { "key": key, "hash": null }); |
|
|
} |
|
|
|
|
|
function setCellCssStyles(key, hash) { |
|
|
var prevHash = cellCssClasses[key]; |
|
|
|
|
|
cellCssClasses[key] = hash; |
|
|
updateCellCssStylesOnRenderedRows(hash, prevHash); |
|
|
|
|
|
trigger(self.onCellCssStylesChanged, { "key": key, "hash": hash }); |
|
|
} |
|
|
|
|
|
function getCellCssStyles(key) { |
|
|
return cellCssClasses[key]; |
|
|
} |
|
|
|
|
|
function flashCell(row, cell, speed) { |
|
|
speed = speed || 100; |
|
|
if (rowsCache[row]) { |
|
|
var $cell = $(getCellNode(row, cell)); |
|
|
|
|
|
function toggleCellClass(times) { |
|
|
if (!times) { |
|
|
return; |
|
|
} |
|
|
setTimeout(function () { |
|
|
$cell.queue(function () { |
|
|
$cell.toggleClass(options.cellFlashingCssClass).dequeue(); |
|
|
toggleCellClass(times - 1); |
|
|
}); |
|
|
}, |
|
|
speed); |
|
|
} |
|
|
|
|
|
toggleCellClass(4); |
|
|
} |
|
|
} |
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// Interactivity |
|
|
|
|
|
function handleMouseWheel(e) { |
|
|
var rowNode = $(e.target).closest(".slick-row")[0]; |
|
|
if (rowNode != rowNodeFromLastMouseWheelEvent) { |
|
|
if (zombieRowNodeFromLastMouseWheelEvent && zombieRowNodeFromLastMouseWheelEvent != rowNode) { |
|
|
$canvas[0].removeChild(zombieRowNodeFromLastMouseWheelEvent); |
|
|
zombieRowNodeFromLastMouseWheelEvent = null; |
|
|
} |
|
|
rowNodeFromLastMouseWheelEvent = rowNode; |
|
|
} |
|
|
} |
|
|
|
|
|
function handleDragInit(e, dd) { |
|
|
var cell = getCellFromEvent(e); |
|
|
if (!cell || !cellExists(cell.row, cell.cell)) { |
|
|
return false; |
|
|
} |
|
|
|
|
|
var retval = trigger(self.onDragInit, dd, e); |
|
|
if (e.isImmediatePropagationStopped()) { |
|
|
return retval; |
|
|
} |
|
|
|
|
|
// if nobody claims to be handling drag'n'drop by stopping immediate propagation, |
|
|
// cancel out of it |
|
|
return false; |
|
|
} |
|
|
|
|
|
function handleDragStart(e, dd) { |
|
|
var cell = getCellFromEvent(e); |
|
|
if (!cell || !cellExists(cell.row, cell.cell)) { |
|
|
return false; |
|
|
} |
|
|
|
|
|
var retval = trigger(self.onDragStart, dd, e); |
|
|
if (e.isImmediatePropagationStopped()) { |
|
|
return retval; |
|
|
} |
|
|
|
|
|
return false; |
|
|
} |
|
|
|
|
|
function handleDrag(e, dd) { |
|
|
return trigger(self.onDrag, dd, e); |
|
|
} |
|
|
|
|
|
function handleDragEnd(e, dd) { |
|
|
trigger(self.onDragEnd, dd, e); |
|
|
} |
|
|
|
|
|
function handleKeyDown(e) { |
|
|
trigger(self.onKeyDown, {row: activeRow, cell: activeCell}, e); |
|
|
var handled = e.isImmediatePropagationStopped(); |
|
|
|
|
|
if (!handled) { |
|
|
if (!e.shiftKey && !e.altKey && !e.ctrlKey) { |
|
|
if (e.which == 27) { |
|
|
if (!getEditorLock().isActive()) { |
|
|
return; // no editing mode to cancel, allow bubbling and default processing (exit without cancelling the event) |
|
|
} |
|
|
cancelEditAndSetFocus(); |
|
|
} else if (e.which == 34) { |
|
|
navigatePageDown(); |
|
|
handled = true; |
|
|
} else if (e.which == 33) { |
|
|
navigatePageUp(); |
|
|
handled = true; |
|
|
} else if (e.which == 37) { |
|
|
handled = navigateLeft(); |
|
|
} else if (e.which == 39) { |
|
|
handled = navigateRight(); |
|
|
} else if (e.which == 38) { |
|
|
handled = navigateUp(); |
|
|
} else if (e.which == 40) { |
|
|
handled = navigateDown(); |
|
|
} else if (e.which == 9) { |
|
|
handled = navigateNext(); |
|
|
} else if (e.which == 13) { |
|
|
if (options.editable) { |
|
|
if (currentEditor) { |
|
|
// adding new row |
|
|
if (activeRow === getDataLength()) { |
|
|
navigateDown(); |
|
|
} else { |
|
|
commitEditAndSetFocus(); |
|
|
} |
|
|
} else { |
|
|
if (getEditorLock().commitCurrentEdit()) { |
|
|
makeActiveCellEditable(); |
|
|
} |
|
|
} |
|
|
} |
|
|
handled = true; |
|
|
} |
|
|
} else if (e.which == 9 && e.shiftKey && !e.ctrlKey && !e.altKey) { |
|
|
handled = navigatePrev(); |
|
|
} |
|
|
} |
|
|
|
|
|
if (handled) { |
|
|
// the event has been handled so don't let parent element (bubbling/propagation) or browser (default) handle it |
|
|
e.stopPropagation(); |
|
|
e.preventDefault(); |
|
|
try { |
|
|
e.originalEvent.keyCode = 0; // prevent default behaviour for special keys in IE browsers (F3, F5, etc.) |
|
|
} |
|
|
// ignore exceptions - setting the original event's keycode throws access denied exception for "Ctrl" |
|
|
// (hitting control key only, nothing else), "Shift" (maybe others) |
|
|
catch (error) { |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function handleClick(e) { |
|
|
if (!currentEditor) { |
|
|
// if this click resulted in some cell child node getting focus, |
|
|
// don't steal it back - keyboard events will still bubble up |
|
|
// IE9+ seems to default DIVs to tabIndex=0 instead of -1, so check for cell clicks directly. |
|
|
if (e.target != document.activeElement || $(e.target).hasClass("slick-cell")) { |
|
|
setFocus(); |
|
|
} |
|
|
} |
|
|
|
|
|
var cell = getCellFromEvent(e); |
|
|
if (!cell || (currentEditor !== null && activeRow == cell.row && activeCell == cell.cell)) { |
|
|
return; |
|
|
} |
|
|
|
|
|
trigger(self.onClick, {row: cell.row, cell: cell.cell}, e); |
|
|
if (e.isImmediatePropagationStopped()) { |
|
|
return; |
|
|
} |
|
|
|
|
|
if ((activeCell != cell.cell || activeRow != cell.row) && canCellBeActive(cell.row, cell.cell)) { |
|
|
if (!getEditorLock().isActive() || getEditorLock().commitCurrentEdit()) { |
|
|
scrollRowIntoView(cell.row, false); |
|
|
setActiveCellInternal(getCellNode(cell.row, cell.cell)); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function handleContextMenu(e) { |
|
|
var $cell = $(e.target).closest(".slick-cell", $canvas); |
|
|
if ($cell.length === 0) { |
|
|
return; |
|
|
} |
|
|
|
|
|
// are we editing this cell? |
|
|
if (activeCellNode === $cell[0] && currentEditor !== null) { |
|
|
return; |
|
|
} |
|
|
|
|
|
trigger(self.onContextMenu, {}, e); |
|
|
} |
|
|
|
|
|
function handleDblClick(e) { |
|
|
var cell = getCellFromEvent(e); |
|
|
if (!cell || (currentEditor !== null && activeRow == cell.row && activeCell == cell.cell)) { |
|
|
return; |
|
|
} |
|
|
|
|
|
trigger(self.onDblClick, {row: cell.row, cell: cell.cell}, e); |
|
|
if (e.isImmediatePropagationStopped()) { |
|
|
return; |
|
|
} |
|
|
|
|
|
if (options.editable) { |
|
|
gotoCell(cell.row, cell.cell, true); |
|
|
} |
|
|
} |
|
|
|
|
|
function handleHeaderMouseEnter(e) { |
|
|
trigger(self.onHeaderMouseEnter, { |
|
|
"column": $(this).data("column") |
|
|
}, e); |
|
|
} |
|
|
|
|
|
function handleHeaderMouseLeave(e) { |
|
|
trigger(self.onHeaderMouseLeave, { |
|
|
"column": $(this).data("column") |
|
|
}, e); |
|
|
} |
|
|
|
|
|
function handleHeaderContextMenu(e) { |
|
|
var $header = $(e.target).closest(".slick-header-column", ".slick-header-columns"); |
|
|
var column = $header && $header.data("column"); |
|
|
trigger(self.onHeaderContextMenu, {column: column}, e); |
|
|
} |
|
|
|
|
|
function handleHeaderClick(e) { |
|
|
var $header = $(e.target).closest(".slick-header-column", ".slick-header-columns"); |
|
|
var column = $header && $header.data("column"); |
|
|
if (column) { |
|
|
trigger(self.onHeaderClick, {column: column}, e); |
|
|
} |
|
|
} |
|
|
|
|
|
function handleMouseEnter(e) { |
|
|
trigger(self.onMouseEnter, {}, e); |
|
|
} |
|
|
|
|
|
function handleMouseLeave(e) { |
|
|
trigger(self.onMouseLeave, {}, e); |
|
|
} |
|
|
|
|
|
function cellExists(row, cell) { |
|
|
return !(row < 0 || row >= getDataLength() || cell < 0 || cell >= columns.length); |
|
|
} |
|
|
|
|
|
function getCellFromPoint(x, y) { |
|
|
var row = getRowFromPosition(y); |
|
|
var cell = 0; |
|
|
|
|
|
var w = 0; |
|
|
for (var i = 0; i < columns.length && w < x; i++) { |
|
|
w += columns[i].width; |
|
|
cell++; |
|
|
} |
|
|
|
|
|
if (cell < 0) { |
|
|
cell = 0; |
|
|
} |
|
|
|
|
|
return {row: row, cell: cell - 1}; |
|
|
} |
|
|
|
|
|
function getCellFromNode(cellNode) { |
|
|
// read column number from .l<columnNumber> CSS class |
|
|
var cls = /l\d+/.exec(cellNode.className); |
|
|
if (!cls) { |
|
|
throw "getCellFromNode: cannot get cell - " + cellNode.className; |
|
|
} |
|
|
return parseInt(cls[0].substr(1, cls[0].length - 1), 10); |
|
|
} |
|
|
|
|
|
function getRowFromNode(rowNode) { |
|
|
for (var row in rowsCache) { |
|
|
if (rowsCache[row].rowNode === rowNode) { |
|
|
return row | 0; |
|
|
} |
|
|
} |
|
|
|
|
|
return null; |
|
|
} |
|
|
|
|
|
function getCellFromEvent(e) { |
|
|
var $cell = $(e.target).closest(".slick-cell", $canvas); |
|
|
if (!$cell.length) { |
|
|
return null; |
|
|
} |
|
|
|
|
|
var row = getRowFromNode($cell[0].parentNode); |
|
|
var cell = getCellFromNode($cell[0]); |
|
|
|
|
|
if (row == null || cell == null) { |
|
|
return null; |
|
|
} else { |
|
|
return { |
|
|
"row": row, |
|
|
"cell": cell |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
function getCellNodeBox(row, cell) { |
|
|
if (!cellExists(row, cell)) { |
|
|
return null; |
|
|
} |
|
|
|
|
|
var y1 = getRowTop(row); |
|
|
var y2 = y1 + options.rowHeight - 1; |
|
|
var x1 = 0; |
|
|
for (var i = 0; i < cell; i++) { |
|
|
x1 += columns[i].width; |
|
|
} |
|
|
var x2 = x1 + columns[cell].width; |
|
|
|
|
|
return { |
|
|
top: y1, |
|
|
left: x1, |
|
|
bottom: y2, |
|
|
right: x2 |
|
|
}; |
|
|
} |
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// Cell switching |
|
|
|
|
|
function resetActiveCell() { |
|
|
setActiveCellInternal(null, false); |
|
|
} |
|
|
|
|
|
function setFocus() { |
|
|
if (tabbingDirection == -1) { |
|
|
$focusSink[0].focus(); |
|
|
} else { |
|
|
$focusSink2[0].focus(); |
|
|
} |
|
|
} |
|
|
|
|
|
function scrollCellIntoView(row, cell, doPaging) { |
|
|
scrollRowIntoView(row, doPaging); |
|
|
|
|
|
var colspan = getColspan(row, cell); |
|
|
var left = columnPosLeft[cell], |
|
|
right = columnPosRight[cell + (colspan > 1 ? colspan - 1 : 0)], |
|
|
scrollRight = scrollLeft + viewportW; |
|
|
|
|
|
if (left < scrollLeft) { |
|
|
$viewport.scrollLeft(left); |
|
|
handleScroll(); |
|
|
render(); |
|
|
} else if (right > scrollRight) { |
|
|
$viewport.scrollLeft(Math.min(left, right - $viewport[0].clientWidth)); |
|
|
handleScroll(); |
|
|
render(); |
|
|
} |
|
|
} |
|
|
|
|
|
function setActiveCellInternal(newCell, opt_editMode) { |
|
|
if (activeCellNode !== null) { |
|
|
makeActiveCellNormal(); |
|
|
$(activeCellNode).removeClass("active"); |
|
|
if (rowsCache[activeRow]) { |
|
|
$(rowsCache[activeRow].rowNode).removeClass("active"); |
|
|
} |
|
|
} |
|
|
|
|
|
var activeCellChanged = (activeCellNode !== newCell); |
|
|
activeCellNode = newCell; |
|
|
|
|
|
if (activeCellNode != null) { |
|
|
activeRow = getRowFromNode(activeCellNode.parentNode); |
|
|
activeCell = activePosX = getCellFromNode(activeCellNode); |
|
|
|
|
|
if (opt_editMode == null) { |
|
|
opt_editMode = (activeRow == getDataLength()) || options.autoEdit; |
|
|
} |
|
|
|
|
|
$(activeCellNode).addClass("active"); |
|
|
$(rowsCache[activeRow].rowNode).addClass("active"); |
|
|
|
|
|
if (options.editable && opt_editMode && isCellPotentiallyEditable(activeRow, activeCell)) { |
|
|
clearTimeout(h_editorLoader); |
|
|
|
|
|
if (options.asyncEditorLoading) { |
|
|
h_editorLoader = setTimeout(function () { |
|
|
makeActiveCellEditable(); |
|
|
}, options.asyncEditorLoadDelay); |
|
|
} else { |
|
|
makeActiveCellEditable(); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
activeRow = activeCell = null; |
|
|
} |
|
|
|
|
|
if (activeCellChanged) { |
|
|
trigger(self.onActiveCellChanged, getActiveCell()); |
|
|
} |
|
|
} |
|
|
|
|
|
function clearTextSelection() { |
|
|
if (document.selection && document.selection.empty) { |
|
|
try { |
|
|
//IE fails here if selected element is not in dom |
|
|
document.selection.empty(); |
|
|
} catch (e) { } |
|
|
} else if (window.getSelection) { |
|
|
var sel = window.getSelection(); |
|
|
if (sel && sel.removeAllRanges) { |
|
|
sel.removeAllRanges(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function isCellPotentiallyEditable(row, cell) { |
|
|
var dataLength = getDataLength(); |
|
|
// is the data for this row loaded? |
|
|
if (row < dataLength && !getDataItem(row)) { |
|
|
return false; |
|
|
} |
|
|
|
|
|
// are we in the Add New row? can we create new from this cell? |
|
|
if (columns[cell].cannotTriggerInsert && row >= dataLength) { |
|
|
return false; |
|
|
} |
|
|
|
|
|
// does this cell have an editor? |
|
|
if (!getEditor(row, cell)) { |
|
|
return false; |
|
|
} |
|
|
|
|
|
return true; |
|
|
} |
|
|
|
|
|
function makeActiveCellNormal() { |
|
|
if (!currentEditor) { |
|
|
return; |
|
|
} |
|
|
trigger(self.onBeforeCellEditorDestroy, {editor: currentEditor}); |
|
|
currentEditor.destroy(); |
|
|
currentEditor = null; |
|
|
|
|
|
if (activeCellNode) { |
|
|
var d = getDataItem(activeRow); |
|
|
$(activeCellNode).removeClass("editable invalid"); |
|
|
if (d) { |
|
|
var column = columns[activeCell]; |
|
|
var formatter = getFormatter(activeRow, column); |
|
|
activeCellNode.innerHTML = formatter(activeRow, activeCell, getDataItemValueForColumn(d, column), column, d); |
|
|
invalidatePostProcessingResults(activeRow); |
|
|
} |
|
|
} |
|
|
|
|
|
// if there previously was text selected on a page (such as selected text in the edit cell just removed), |
|
|
// IE can't set focus to anything else correctly |
|
|
if (navigator.userAgent.toLowerCase().match(/msie/)) { |
|
|
clearTextSelection(); |
|
|
} |
|
|
|
|
|
getEditorLock().deactivate(editController); |
|
|
} |
|
|
|
|
|
function makeActiveCellEditable(editor) { |
|
|
if (!activeCellNode) { |
|
|
return; |
|
|
} |
|
|
if (!options.editable) { |
|
|
throw "Grid : makeActiveCellEditable : should never get called when options.editable is false"; |
|
|
} |
|
|
|
|
|
// cancel pending async call if there is one |
|
|
clearTimeout(h_editorLoader); |
|
|
|
|
|
if (!isCellPotentiallyEditable(activeRow, activeCell)) { |
|
|
return; |
|
|
} |
|
|
|
|
|
var columnDef = columns[activeCell]; |
|
|
var item = getDataItem(activeRow); |
|
|
|
|
|
if (trigger(self.onBeforeEditCell, {row: activeRow, cell: activeCell, item: item, column: columnDef}) === false) { |
|
|
setFocus(); |
|
|
return; |
|
|
} |
|
|
|
|
|
getEditorLock().activate(editController); |
|
|
$(activeCellNode).addClass("editable"); |
|
|
|
|
|
// don't clear the cell if a custom editor is passed through |
|
|
if (!editor) { |
|
|
activeCellNode.innerHTML = ""; |
|
|
} |
|
|
|
|
|
currentEditor = new (editor || getEditor(activeRow, activeCell))({ |
|
|
grid: self, |
|
|
gridPosition: absBox($container[0]), |
|
|
position: absBox(activeCellNode), |
|
|
container: activeCellNode, |
|
|
column: columnDef, |
|
|
item: item || {}, |
|
|
commitChanges: commitEditAndSetFocus, |
|
|
cancelChanges: cancelEditAndSetFocus |
|
|
}); |
|
|
|
|
|
if (item) { |
|
|
currentEditor.loadValue(item); |
|
|
} |
|
|
|
|
|
serializedEditorValue = currentEditor.serializeValue(); |
|
|
|
|
|
if (currentEditor.position) { |
|
|
handleActiveCellPositionChange(); |
|
|
} |
|
|
} |
|
|
|
|
|
function commitEditAndSetFocus() { |
|
|
// if the commit fails, it would do so due to a validation error |
|
|
// if so, do not steal the focus from the editor |
|
|
if (getEditorLock().commitCurrentEdit()) { |
|
|
setFocus(); |
|
|
if (options.autoEdit) { |
|
|
navigateDown(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function cancelEditAndSetFocus() { |
|
|
if (getEditorLock().cancelCurrentEdit()) { |
|
|
setFocus(); |
|
|
} |
|
|
} |
|
|
|
|
|
function absBox(elem) { |
|
|
var box = { |
|
|
top: elem.offsetTop, |
|
|
left: elem.offsetLeft, |
|
|
bottom: 0, |
|
|
right: 0, |
|
|
width: $(elem).outerWidth(), |
|
|
height: $(elem).outerHeight(), |
|
|
visible: true}; |
|
|
box.bottom = box.top + box.height; |
|
|
box.right = box.left + box.width; |
|
|
|
|
|
// walk up the tree |
|
|
var offsetParent = elem.offsetParent; |
|
|
while ((elem = elem.parentNode) != document.body) { |
|
|
if (box.visible && elem.scrollHeight != elem.offsetHeight && $(elem).css("overflowY") != "visible") { |
|
|
box.visible = box.bottom > elem.scrollTop && box.top < elem.scrollTop + elem.clientHeight; |
|
|
} |
|
|
|
|
|
if (box.visible && elem.scrollWidth != elem.offsetWidth && $(elem).css("overflowX") != "visible") { |
|
|
box.visible = box.right > elem.scrollLeft && box.left < elem.scrollLeft + elem.clientWidth; |
|
|
} |
|
|
|
|
|
box.left -= elem.scrollLeft; |
|
|
box.top -= elem.scrollTop; |
|
|
|
|
|
if (elem === offsetParent) { |
|
|
box.left += elem.offsetLeft; |
|
|
box.top += elem.offsetTop; |
|
|
offsetParent = elem.offsetParent; |
|
|
} |
|
|
|
|
|
box.bottom = box.top + box.height; |
|
|
box.right = box.left + box.width; |
|
|
} |
|
|
|
|
|
return box; |
|
|
} |
|
|
|
|
|
function getActiveCellPosition() { |
|
|
return absBox(activeCellNode); |
|
|
} |
|
|
|
|
|
function getGridPosition() { |
|
|
return absBox($container[0]) |
|
|
} |
|
|
|
|
|
function handleActiveCellPositionChange() { |
|
|
if (!activeCellNode) { |
|
|
return; |
|
|
} |
|
|
|
|
|
trigger(self.onActiveCellPositionChanged, {}); |
|
|
|
|
|
if (currentEditor) { |
|
|
var cellBox = getActiveCellPosition(); |
|
|
if (currentEditor.show && currentEditor.hide) { |
|
|
if (!cellBox.visible) { |
|
|
currentEditor.hide(); |
|
|
} else { |
|
|
currentEditor.show(); |
|
|
} |
|
|
} |
|
|
|
|
|
if (currentEditor.position) { |
|
|
currentEditor.position(cellBox); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function getCellEditor() { |
|
|
return currentEditor; |
|
|
} |
|
|
|
|
|
function getActiveCell() { |
|
|
if (!activeCellNode) { |
|
|
return null; |
|
|
} else { |
|
|
return {row: activeRow, cell: activeCell}; |
|
|
} |
|
|
} |
|
|
|
|
|
function getActiveCellNode() { |
|
|
return activeCellNode; |
|
|
} |
|
|
|
|
|
function scrollRowIntoView(row, doPaging) { |
|
|
var rowAtTop = row * options.rowHeight; |
|
|
var rowAtBottom = (row + 1) * options.rowHeight - viewportH + (viewportHasHScroll ? scrollbarDimensions.height : 0); |
|
|
|
|
|
// need to page down? |
|
|
if ((row + 1) * options.rowHeight > scrollTop + viewportH + offset) { |
|
|
scrollTo(doPaging ? rowAtTop : rowAtBottom); |
|
|
render(); |
|
|
} |
|
|
// or page up? |
|
|
else if (row * options.rowHeight < scrollTop + offset) { |
|
|
scrollTo(doPaging ? rowAtBottom : rowAtTop); |
|
|
render(); |
|
|
} |
|
|
} |
|
|
|
|
|
function scrollRowToTop(row) { |
|
|
scrollTo(row * options.rowHeight); |
|
|
render(); |
|
|
} |
|
|
|
|
|
function scrollPage(dir) { |
|
|
var deltaRows = dir * numVisibleRows; |
|
|
scrollTo((getRowFromPosition(scrollTop) + deltaRows) * options.rowHeight); |
|
|
render(); |
|
|
|
|
|
if (options.enableCellNavigation && activeRow != null) { |
|
|
var row = activeRow + deltaRows; |
|
|
var dataLengthIncludingAddNew = getDataLengthIncludingAddNew(); |
|
|
if (row >= dataLengthIncludingAddNew) { |
|
|
row = dataLengthIncludingAddNew - 1; |
|
|
} |
|
|
if (row < 0) { |
|
|
row = 0; |
|
|
} |
|
|
|
|
|
var cell = 0, prevCell = null; |
|
|
var prevActivePosX = activePosX; |
|
|
while (cell <= activePosX) { |
|
|
if (canCellBeActive(row, cell)) { |
|
|
prevCell = cell; |
|
|
} |
|
|
cell += getColspan(row, cell); |
|
|
} |
|
|
|
|
|
if (prevCell !== null) { |
|
|
setActiveCellInternal(getCellNode(row, prevCell)); |
|
|
activePosX = prevActivePosX; |
|
|
} else { |
|
|
resetActiveCell(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function navigatePageDown() { |
|
|
scrollPage(1); |
|
|
} |
|
|
|
|
|
function navigatePageUp() { |
|
|
scrollPage(-1); |
|
|
} |
|
|
|
|
|
function getColspan(row, cell) { |
|
|
var metadata = data.getItemMetadata && data.getItemMetadata(row); |
|
|
if (!metadata || !metadata.columns) { |
|
|
return 1; |
|
|
} |
|
|
|
|
|
var columnData = metadata.columns[columns[cell].id] || metadata.columns[cell]; |
|
|
var colspan = (columnData && columnData.colspan); |
|
|
if (colspan === "*") { |
|
|
colspan = columns.length - cell; |
|
|
} else { |
|
|
colspan = colspan || 1; |
|
|
} |
|
|
|
|
|
return colspan; |
|
|
} |
|
|
|
|
|
function findFirstFocusableCell(row) { |
|
|
var cell = 0; |
|
|
while (cell < columns.length) { |
|
|
if (canCellBeActive(row, cell)) { |
|
|
return cell; |
|
|
} |
|
|
cell += getColspan(row, cell); |
|
|
} |
|
|
return null; |
|
|
} |
|
|
|
|
|
function findLastFocusableCell(row) { |
|
|
var cell = 0; |
|
|
var lastFocusableCell = null; |
|
|
while (cell < columns.length) { |
|
|
if (canCellBeActive(row, cell)) { |
|
|
lastFocusableCell = cell; |
|
|
} |
|
|
cell += getColspan(row, cell); |
|
|
} |
|
|
return lastFocusableCell; |
|
|
} |
|
|
|
|
|
function gotoRight(row, cell, posX) { |
|
|
if (cell >= columns.length) { |
|
|
return null; |
|
|
} |
|
|
|
|
|
do { |
|
|
cell += getColspan(row, cell); |
|
|
} |
|
|
while (cell < columns.length && !canCellBeActive(row, cell)); |
|
|
|
|
|
if (cell < columns.length) { |
|
|
return { |
|
|
"row": row, |
|
|
"cell": cell, |
|
|
"posX": cell |
|
|
}; |
|
|
} |
|
|
return null; |
|
|
} |
|
|
|
|
|
function gotoLeft(row, cell, posX) { |
|
|
if (cell <= 0) { |
|
|
return null; |
|
|
} |
|
|
|
|
|
var firstFocusableCell = findFirstFocusableCell(row); |
|
|
if (firstFocusableCell === null || firstFocusableCell >= cell) { |
|
|
return null; |
|
|
} |
|
|
|
|
|
var prev = { |
|
|
"row": row, |
|
|
"cell": firstFocusableCell, |
|
|
"posX": firstFocusableCell |
|
|
}; |
|
|
var pos; |
|
|
while (true) { |
|
|
pos = gotoRight(prev.row, prev.cell, prev.posX); |
|
|
if (!pos) { |
|
|
return null; |
|
|
} |
|
|
if (pos.cell >= cell) { |
|
|
return prev; |
|
|
} |
|
|
prev = pos; |
|
|
} |
|
|
} |
|
|
|
|
|
function gotoDown(row, cell, posX) { |
|
|
var prevCell; |
|
|
var dataLengthIncludingAddNew = getDataLengthIncludingAddNew(); |
|
|
while (true) { |
|
|
if (++row >= dataLengthIncludingAddNew) { |
|
|
return null; |
|
|
} |
|
|
|
|
|
prevCell = cell = 0; |
|
|
while (cell <= posX) { |
|
|
prevCell = cell; |
|
|
cell += getColspan(row, cell); |
|
|
} |
|
|
|
|
|
if (canCellBeActive(row, prevCell)) { |
|
|
return { |
|
|
"row": row, |
|
|
"cell": prevCell, |
|
|
"posX": posX |
|
|
}; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function gotoUp(row, cell, posX) { |
|
|
var prevCell; |
|
|
while (true) { |
|
|
if (--row < 0) { |
|
|
return null; |
|
|
} |
|
|
|
|
|
prevCell = cell = 0; |
|
|
while (cell <= posX) { |
|
|
prevCell = cell; |
|
|
cell += getColspan(row, cell); |
|
|
} |
|
|
|
|
|
if (canCellBeActive(row, prevCell)) { |
|
|
return { |
|
|
"row": row, |
|
|
"cell": prevCell, |
|
|
"posX": posX |
|
|
}; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function gotoNext(row, cell, posX) { |
|
|
if (row == null && cell == null) { |
|
|
row = cell = posX = 0; |
|
|
if (canCellBeActive(row, cell)) { |
|
|
return { |
|
|
"row": row, |
|
|
"cell": cell, |
|
|
"posX": cell |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
var pos = gotoRight(row, cell, posX); |
|
|
if (pos) { |
|
|
return pos; |
|
|
} |
|
|
|
|
|
var firstFocusableCell = null; |
|
|
var dataLengthIncludingAddNew = getDataLengthIncludingAddNew(); |
|
|
while (++row < dataLengthIncludingAddNew) { |
|
|
firstFocusableCell = findFirstFocusableCell(row); |
|
|
if (firstFocusableCell !== null) { |
|
|
return { |
|
|
"row": row, |
|
|
"cell": firstFocusableCell, |
|
|
"posX": firstFocusableCell |
|
|
}; |
|
|
} |
|
|
} |
|
|
return null; |
|
|
} |
|
|
|
|
|
function gotoPrev(row, cell, posX) { |
|
|
if (row == null && cell == null) { |
|
|
row = getDataLengthIncludingAddNew() - 1; |
|
|
cell = posX = columns.length - 1; |
|
|
if (canCellBeActive(row, cell)) { |
|
|
return { |
|
|
"row": row, |
|
|
"cell": cell, |
|
|
"posX": cell |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
var pos; |
|
|
var lastSelectableCell; |
|
|
while (!pos) { |
|
|
pos = gotoLeft(row, cell, posX); |
|
|
if (pos) { |
|
|
break; |
|
|
} |
|
|
if (--row < 0) { |
|
|
return null; |
|
|
} |
|
|
|
|
|
cell = 0; |
|
|
lastSelectableCell = findLastFocusableCell(row); |
|
|
if (lastSelectableCell !== null) { |
|
|
pos = { |
|
|
"row": row, |
|
|
"cell": lastSelectableCell, |
|
|
"posX": lastSelectableCell |
|
|
}; |
|
|
} |
|
|
} |
|
|
return pos; |
|
|
} |
|
|
|
|
|
function navigateRight() { |
|
|
return navigate("right"); |
|
|
} |
|
|
|
|
|
function navigateLeft() { |
|
|
return navigate("left"); |
|
|
} |
|
|
|
|
|
function navigateDown() { |
|
|
return navigate("down"); |
|
|
} |
|
|
|
|
|
function navigateUp() { |
|
|
return navigate("up"); |
|
|
} |
|
|
|
|
|
function navigateNext() { |
|
|
return navigate("next"); |
|
|
} |
|
|
|
|
|
function navigatePrev() { |
|
|
return navigate("prev"); |
|
|
} |
|
|
|
|
|
/** |
|
|
* @param {string} dir Navigation direction. |
|
|
* @return {boolean} Whether navigation resulted in a change of active cell. |
|
|
*/ |
|
|
function navigate(dir) { |
|
|
if (!options.enableCellNavigation) { |
|
|
return false; |
|
|
} |
|
|
|
|
|
if (!activeCellNode && dir != "prev" && dir != "next") { |
|
|
return false; |
|
|
} |
|
|
|
|
|
if (!getEditorLock().commitCurrentEdit()) { |
|
|
return true; |
|
|
} |
|
|
setFocus(); |
|
|
|
|
|
var tabbingDirections = { |
|
|
"up": -1, |
|
|
"down": 1, |
|
|
"left": -1, |
|
|
"right": 1, |
|
|
"prev": -1, |
|
|
"next": 1 |
|
|
}; |
|
|
tabbingDirection = tabbingDirections[dir]; |
|
|
|
|
|
var stepFunctions = { |
|
|
"up": gotoUp, |
|
|
"down": gotoDown, |
|
|
"left": gotoLeft, |
|
|
"right": gotoRight, |
|
|
"prev": gotoPrev, |
|
|
"next": gotoNext |
|
|
}; |
|
|
var stepFn = stepFunctions[dir]; |
|
|
var pos = stepFn(activeRow, activeCell, activePosX); |
|
|
if (pos) { |
|
|
var isAddNewRow = (pos.row == getDataLength()); |
|
|
scrollCellIntoView(pos.row, pos.cell, !isAddNewRow); |
|
|
setActiveCellInternal(getCellNode(pos.row, pos.cell)); |
|
|
activePosX = pos.posX; |
|
|
return true; |
|
|
} else { |
|
|
setActiveCellInternal(getCellNode(activeRow, activeCell)); |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
function getCellNode(row, cell) { |
|
|
if (rowsCache[row]) { |
|
|
ensureCellNodesInRowsCache(row); |
|
|
return rowsCache[row].cellNodesByColumnIdx[cell]; |
|
|
} |
|
|
return null; |
|
|
} |
|
|
|
|
|
function setActiveCell(row, cell) { |
|
|
if (!initialized) { return; } |
|
|
if (row > getDataLength() || row < 0 || cell >= columns.length || cell < 0) { |
|
|
return; |
|
|
} |
|
|
|
|
|
if (!options.enableCellNavigation) { |
|
|
return; |
|
|
} |
|
|
|
|
|
scrollCellIntoView(row, cell, false); |
|
|
setActiveCellInternal(getCellNode(row, cell), false); |
|
|
} |
|
|
|
|
|
function canCellBeActive(row, cell) { |
|
|
if (!options.enableCellNavigation || row >= getDataLengthIncludingAddNew() || |
|
|
row < 0 || cell >= columns.length || cell < 0) { |
|
|
return false; |
|
|
} |
|
|
|
|
|
var rowMetadata = data.getItemMetadata && data.getItemMetadata(row); |
|
|
if (rowMetadata && typeof rowMetadata.focusable === "boolean") { |
|
|
return rowMetadata.focusable; |
|
|
} |
|
|
|
|
|
var columnMetadata = rowMetadata && rowMetadata.columns; |
|
|
if (columnMetadata && columnMetadata[columns[cell].id] && typeof columnMetadata[columns[cell].id].focusable === "boolean") { |
|
|
return columnMetadata[columns[cell].id].focusable; |
|
|
} |
|
|
if (columnMetadata && columnMetadata[cell] && typeof columnMetadata[cell].focusable === "boolean") { |
|
|
return columnMetadata[cell].focusable; |
|
|
} |
|
|
|
|
|
return columns[cell].focusable; |
|
|
} |
|
|
|
|
|
function canCellBeSelected(row, cell) { |
|
|
if (row >= getDataLength() || row < 0 || cell >= columns.length || cell < 0) { |
|
|
return false; |
|
|
} |
|
|
|
|
|
var rowMetadata = data.getItemMetadata && data.getItemMetadata(row); |
|
|
if (rowMetadata && typeof rowMetadata.selectable === "boolean") { |
|
|
return rowMetadata.selectable; |
|
|
} |
|
|
|
|
|
var columnMetadata = rowMetadata && rowMetadata.columns && (rowMetadata.columns[columns[cell].id] || rowMetadata.columns[cell]); |
|
|
if (columnMetadata && typeof columnMetadata.selectable === "boolean") { |
|
|
return columnMetadata.selectable; |
|
|
} |
|
|
|
|
|
return columns[cell].selectable; |
|
|
} |
|
|
|
|
|
function gotoCell(row, cell, forceEdit) { |
|
|
if (!initialized) { return; } |
|
|
if (!canCellBeActive(row, cell)) { |
|
|
return; |
|
|
} |
|
|
|
|
|
if (!getEditorLock().commitCurrentEdit()) { |
|
|
return; |
|
|
} |
|
|
|
|
|
scrollCellIntoView(row, cell, false); |
|
|
|
|
|
var newCell = getCellNode(row, cell); |
|
|
|
|
|
// if selecting the 'add new' row, start editing right away |
|
|
setActiveCellInternal(newCell, forceEdit || (row === getDataLength()) || options.autoEdit); |
|
|
|
|
|
// if no editor was created, set the focus back on the grid |
|
|
if (!currentEditor) { |
|
|
setFocus(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// IEditor implementation for the editor lock |
|
|
|
|
|
function commitCurrentEdit() { |
|
|
var item = getDataItem(activeRow); |
|
|
var column = columns[activeCell]; |
|
|
|
|
|
if (currentEditor) { |
|
|
if (currentEditor.isValueChanged()) { |
|
|
var validationResults = currentEditor.validate(); |
|
|
|
|
|
if (validationResults.valid) { |
|
|
if (activeRow < getDataLength()) { |
|
|
var editCommand = { |
|
|
row: activeRow, |
|
|
cell: activeCell, |
|
|
editor: currentEditor, |
|
|
serializedValue: currentEditor.serializeValue(), |
|
|
prevSerializedValue: serializedEditorValue, |
|
|
execute: function () { |
|
|
this.editor.applyValue(item, this.serializedValue); |
|
|
updateRow(this.row); |
|
|
trigger(self.onCellChange, { |
|
|
row: activeRow, |
|
|
cell: activeCell, |
|
|
item: item |
|
|
}); |
|
|
}, |
|
|
undo: function () { |
|
|
this.editor.applyValue(item, this.prevSerializedValue); |
|
|
updateRow(this.row); |
|
|
trigger(self.onCellChange, { |
|
|
row: activeRow, |
|
|
cell: activeCell, |
|
|
item: item |
|
|
}); |
|
|
} |
|
|
}; |
|
|
|
|
|
if (options.editCommandHandler) { |
|
|
makeActiveCellNormal(); |
|
|
options.editCommandHandler(item, column, editCommand); |
|
|
} else { |
|
|
editCommand.execute(); |
|
|
makeActiveCellNormal(); |
|
|
} |
|
|
|
|
|
} else { |
|
|
var newItem = {}; |
|
|
currentEditor.applyValue(newItem, currentEditor.serializeValue()); |
|
|
makeActiveCellNormal(); |
|
|
trigger(self.onAddNewRow, {item: newItem, column: column}); |
|
|
} |
|
|
|
|
|
// check whether the lock has been re-acquired by event handlers |
|
|
return !getEditorLock().isActive(); |
|
|
} else { |
|
|
// Re-add the CSS class to trigger transitions, if any. |
|
|
$(activeCellNode).removeClass("invalid"); |
|
|
$(activeCellNode).width(); // force layout |
|
|
$(activeCellNode).addClass("invalid"); |
|
|
|
|
|
trigger(self.onValidationError, { |
|
|
editor: currentEditor, |
|
|
cellNode: activeCellNode, |
|
|
validationResults: validationResults, |
|
|
row: activeRow, |
|
|
cell: activeCell, |
|
|
column: column |
|
|
}); |
|
|
|
|
|
currentEditor.focus(); |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
makeActiveCellNormal(); |
|
|
} |
|
|
return true; |
|
|
} |
|
|
|
|
|
function cancelCurrentEdit() { |
|
|
makeActiveCellNormal(); |
|
|
return true; |
|
|
} |
|
|
|
|
|
function rowsToRanges(rows) { |
|
|
var ranges = []; |
|
|
var lastCell = columns.length - 1; |
|
|
for (var i = 0; i < rows.length; i++) { |
|
|
ranges.push(new Slick.Range(rows[i], 0, rows[i], lastCell)); |
|
|
} |
|
|
return ranges; |
|
|
} |
|
|
|
|
|
function getSelectedRows() { |
|
|
if (!selectionModel) { |
|
|
throw "Selection model is not set"; |
|
|
} |
|
|
return selectedRows; |
|
|
} |
|
|
|
|
|
function setSelectedRows(rows) { |
|
|
if (!selectionModel) { |
|
|
throw "Selection model is not set"; |
|
|
} |
|
|
selectionModel.setSelectedRanges(rowsToRanges(rows)); |
|
|
} |
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// Debug |
|
|
|
|
|
this.debug = function () { |
|
|
var s = ""; |
|
|
|
|
|
s += ("\n" + "counter_rows_rendered: " + counter_rows_rendered); |
|
|
s += ("\n" + "counter_rows_removed: " + counter_rows_removed); |
|
|
s += ("\n" + "renderedRows: " + renderedRows); |
|
|
s += ("\n" + "numVisibleRows: " + numVisibleRows); |
|
|
s += ("\n" + "maxSupportedCssHeight: " + maxSupportedCssHeight); |
|
|
s += ("\n" + "n(umber of pages): " + n); |
|
|
s += ("\n" + "(current) page: " + page); |
|
|
s += ("\n" + "page height (ph): " + ph); |
|
|
s += ("\n" + "vScrollDir: " + vScrollDir); |
|
|
|
|
|
alert(s); |
|
|
}; |
|
|
|
|
|
// a debug helper to be able to access private members |
|
|
this.eval = function (expr) { |
|
|
return eval(expr); |
|
|
}; |
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
// Public API |
|
|
|
|
|
$.extend(this, { |
|
|
"slickGridVersion": "2.1", |
|
|
|
|
|
// Events |
|
|
"onScroll": new Slick.Event(), |
|
|
"onSort": new Slick.Event(), |
|
|
"onHeaderMouseEnter": new Slick.Event(), |
|
|
"onHeaderMouseLeave": new Slick.Event(), |
|
|
"onHeaderContextMenu": new Slick.Event(), |
|
|
"onHeaderClick": new Slick.Event(), |
|
|
"onHeaderCellRendered": new Slick.Event(), |
|
|
"onBeforeHeaderCellDestroy": new Slick.Event(), |
|
|
"onHeaderRowCellRendered": new Slick.Event(), |
|
|
"onBeforeHeaderRowCellDestroy": new Slick.Event(), |
|
|
"onMouseEnter": new Slick.Event(), |
|
|
"onMouseLeave": new Slick.Event(), |
|
|
"onClick": new Slick.Event(), |
|
|
"onDblClick": new Slick.Event(), |
|
|
"onContextMenu": new Slick.Event(), |
|
|
"onKeyDown": new Slick.Event(), |
|
|
"onAddNewRow": new Slick.Event(), |
|
|
"onValidationError": new Slick.Event(), |
|
|
"onViewportChanged": new Slick.Event(), |
|
|
"onColumnsReordered": new Slick.Event(), |
|
|
"onColumnsResized": new Slick.Event(), |
|
|
"onCellChange": new Slick.Event(), |
|
|
"onBeforeEditCell": new Slick.Event(), |
|
|
"onBeforeCellEditorDestroy": new Slick.Event(), |
|
|
"onBeforeDestroy": new Slick.Event(), |
|
|
"onActiveCellChanged": new Slick.Event(), |
|
|
"onActiveCellPositionChanged": new Slick.Event(), |
|
|
"onDragInit": new Slick.Event(), |
|
|
"onDragStart": new Slick.Event(), |
|
|
"onDrag": new Slick.Event(), |
|
|
"onDragEnd": new Slick.Event(), |
|
|
"onSelectedRowsChanged": new Slick.Event(), |
|
|
"onCellCssStylesChanged": new Slick.Event(), |
|
|
|
|
|
// Methods |
|
|
"registerPlugin": registerPlugin, |
|
|
"unregisterPlugin": unregisterPlugin, |
|
|
"getColumns": getColumns, |
|
|
"setColumns": setColumns, |
|
|
"getColumnIndex": getColumnIndex, |
|
|
"updateColumnHeader": updateColumnHeader, |
|
|
"setSortColumn": setSortColumn, |
|
|
"setSortColumns": setSortColumns, |
|
|
"getSortColumns": getSortColumns, |
|
|
"autosizeColumns": autosizeColumns, |
|
|
"getOptions": getOptions, |
|
|
"setOptions": setOptions, |
|
|
"getData": getData, |
|
|
"getDataLength": getDataLength, |
|
|
"getDataItem": getDataItem, |
|
|
"setData": setData, |
|
|
"getSelectionModel": getSelectionModel, |
|
|
"setSelectionModel": setSelectionModel, |
|
|
"getSelectedRows": getSelectedRows, |
|
|
"setSelectedRows": setSelectedRows, |
|
|
"getContainerNode": getContainerNode, |
|
|
|
|
|
"render": render, |
|
|
"invalidate": invalidate, |
|
|
"invalidateRow": invalidateRow, |
|
|
"invalidateRows": invalidateRows, |
|
|
"invalidateAllRows": invalidateAllRows, |
|
|
"updateCell": updateCell, |
|
|
"updateRow": updateRow, |
|
|
"getViewport": getVisibleRange, |
|
|
"getRenderedRange": getRenderedRange, |
|
|
"resizeCanvas": resizeCanvas, |
|
|
"updateRowCount": updateRowCount, |
|
|
"scrollRowIntoView": scrollRowIntoView, |
|
|
"scrollRowToTop": scrollRowToTop, |
|
|
"scrollCellIntoView": scrollCellIntoView, |
|
|
"getCanvasNode": getCanvasNode, |
|
|
"focus": setFocus, |
|
|
|
|
|
"getCellFromPoint": getCellFromPoint, |
|
|
"getCellFromEvent": getCellFromEvent, |
|
|
"getActiveCell": getActiveCell, |
|
|
"setActiveCell": setActiveCell, |
|
|
"getActiveCellNode": getActiveCellNode, |
|
|
"getActiveCellPosition": getActiveCellPosition, |
|
|
"resetActiveCell": resetActiveCell, |
|
|
"editActiveCell": makeActiveCellEditable, |
|
|
"getCellEditor": getCellEditor, |
|
|
"getCellNode": getCellNode, |
|
|
"getCellNodeBox": getCellNodeBox, |
|
|
"canCellBeSelected": canCellBeSelected, |
|
|
"canCellBeActive": canCellBeActive, |
|
|
"navigatePrev": navigatePrev, |
|
|
"navigateNext": navigateNext, |
|
|
"navigateUp": navigateUp, |
|
|
"navigateDown": navigateDown, |
|
|
"navigateLeft": navigateLeft, |
|
|
"navigateRight": navigateRight, |
|
|
"navigatePageUp": navigatePageUp, |
|
|
"navigatePageDown": navigatePageDown, |
|
|
"gotoCell": gotoCell, |
|
|
"getTopPanel": getTopPanel, |
|
|
"setTopPanelVisibility": setTopPanelVisibility, |
|
|
"setHeaderRowVisibility": setHeaderRowVisibility, |
|
|
"getHeaderRow": getHeaderRow, |
|
|
"getHeaderRowColumn": getHeaderRowColumn, |
|
|
"getGridPosition": getGridPosition, |
|
|
"flashCell": flashCell, |
|
|
"addCellCssStyles": addCellCssStyles, |
|
|
"setCellCssStyles": setCellCssStyles, |
|
|
"removeCellCssStyles": removeCellCssStyles, |
|
|
"getCellCssStyles": getCellCssStyles, |
|
|
|
|
|
"init": finishInitialization, |
|
|
"destroy": destroy, |
|
|
|
|
|
// IEditor implementation |
|
|
"getEditorLock": getEditorLock, |
|
|
"getEditController": getEditController |
|
|
}); |
|
|
|
|
|
init(); |
|
|
} |
|
|
}(jQuery)); |
|
|
/** |
|
|
* SlickGrid Enhancement Pager |
|
|
* |
|
|
* An easy-to-use slickgrid pager. |
|
|
* https://github.com/kingleema/SlickGridEnhancementPager |
|
|
* Released under the MIT license. |
|
|
* |
|
|
* Copyright 2012 KingleeMa <https://github.com/kingleema> |
|
|
* |
|
|
*/ |
|
|
(function ($) { |
|
|
function EnhancementPager(paramObj) { |
|
|
var waiting = parseInt(paramObj.waiting); |
|
|
if (isNaN(waiting)) { |
|
|
waiting = 30000; |
|
|
} |
|
|
|
|
|
var param = { pageSize: 10, pageIndex: 1 }; |
|
|
|
|
|
for (var attrname in paramObj.params) { |
|
|
param[attrname] = paramObj.params[attrname]; |
|
|
} |
|
|
|
|
|
$.ajax({ |
|
|
url: paramObj.remoteUrl, |
|
|
type: 'POST', |
|
|
cache: false, |
|
|
data: param , |
|
|
dataType: "text", |
|
|
crossDomain: false, |
|
|
timeout: waiting, |
|
|
beforeSend: function() { |
|
|
paramObj.container.html('<span class="dataloading"> </span>'); |
|
|
}, |
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) { |
|
|
paramObj.container.html('<span style="position:absolute;top:5px;left:5px;color:red;">Error! ' + errorThrown + '</span>'); |
|
|
}, |
|
|
success: function (data) { |
|
|
var total = $.evalJSON(data).Total; |
|
|
pagecount = parseInt(Math.floor(parseFloat(total / 10)) + 1); |
|
|
initPager(pagecount, paramObj.pagerType, paramObj.trans, waiting); |
|
|
|
|
|
getData(1, paramObj.remoteUrl, paramObj.pagerType, paramObj.params, waiting); |
|
|
} |
|
|
}); |
|
|
|
|
|
function initPager(pagecount, pagertype, trans, waiting) { |
|
|
paramObj.container.html(''); |
|
|
$('<span class="perpage" title="Records count of per page"><select class="recordsperpage">\ |
|
|
<option value="10">10</option>\ |
|
|
<option value="25">25</option>\ |
|
|
<option value="50">50</option>\ |
|
|
<option value="100">100</option>\ |
|
|
</select></span>\ |
|
|
<span class="spacer"> </span>\ |
|
|
<span class="pagelabel" style="vertical-align: middle;">Page</span>\ |
|
|
<input class="currentpage" title="Current Page" type="text" value="1" style="vertical-align: middle;width:7px" />\ |
|
|
<span style="vertical-align: middle;"> / </span>\ |
|
|
<span id="totalpages" style="vertical-align: middle;">#</span>\ |
|
|
<span class="spacer"> </span>\ |
|
|
<a id="dataloading" href="javascript:;" class="button-base-class refresh" title="Refresh"></a>\ |
|
|
<span class="spacer"> </span>\ |
|
|
<span class="recordstate"><span class="recordstatelabel">Display</span> <span id="recordsegment"></span> / <span id="totalrecords"></span></span>\ |
|
|
<a href="javascript:;" class="button-base-class currentrecords" title="Show/Hide Current Records State"></a>').appendTo(paramObj.container); |
|
|
$('.currentpage').keydown(function (e) { |
|
|
if (e.keyCode == 13) { |
|
|
var changedvalue = 1; |
|
|
if (isNaN(parseInt($(".currentpage").val()))) { |
|
|
$(".currentpage").val(changedvalue); |
|
|
} else { |
|
|
changedvalue = parseInt($(".currentpage").val()); |
|
|
if (changedvalue < 1) { |
|
|
changedvalue = 1; |
|
|
} |
|
|
if (changedvalue > parseInt($("#totalpages").text())) { |
|
|
changedvalue = parseInt($("#totalpages").text()); |
|
|
} |
|
|
$('.currentpage').val(changedvalue); |
|
|
} |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
} |
|
|
}); |
|
|
if (pagertype == "slider") { |
|
|
$('<span class="button-base-class pageminus" title="Previous Page"> </span>\ |
|
|
<span class="pagerslider"></span>\ |
|
|
<span class="button-base-class pageplus" title="Next Page"> </span>\ |
|
|
<span class="spacer"> </span>').insertBefore($('.pagelabel')); |
|
|
if (trans !== null && trans !== undefined) { |
|
|
$.each(trans, function (k, v) { |
|
|
if (k != "resultset_first" && k != "resultset_prev" && k != "resultset_next" && k != "resultset_last") { |
|
|
if (k == "pagelabel" || k == "recordstatelabel") { |
|
|
$('.' + k).text(v); |
|
|
} else { |
|
|
$('.' + k).attr("title", v); |
|
|
} |
|
|
} |
|
|
}); |
|
|
} |
|
|
$(".pagerslider").slider({ |
|
|
range: "min", |
|
|
value: 1, |
|
|
step: 1, |
|
|
min: 1, |
|
|
max: pagecount, |
|
|
slide: function (event, ui) { |
|
|
$(".currentpage").css("width", ui.value.toString().length * 7 + "px"); |
|
|
var pd = ui.value; |
|
|
$(".currentpage").val(pd); |
|
|
}, |
|
|
stop: function (event, ui) { |
|
|
var changedvalue = ui.value; |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
} |
|
|
}); |
|
|
$(".pageplus").click(function () { |
|
|
if (isNaN(parseInt($(".currentpage").val()))) { |
|
|
$(".currentpage").val(1); |
|
|
} |
|
|
var changedvalue = parseInt($(".currentpage").val()) + 1; |
|
|
if (changedvalue > parseInt($("#totalpages").text())) { |
|
|
changedvalue = parseInt($("#totalpages").text()); |
|
|
} |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
}); |
|
|
$(".pageminus").click(function () { |
|
|
if (isNaN(parseInt($(".currentpage").val()))) { |
|
|
$(".currentpage").val(1); |
|
|
} |
|
|
var changedvalue = parseInt($(".currentpage").val()) - 1; |
|
|
if (changedvalue < 1) { |
|
|
changedvalue = 1; |
|
|
} |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
}); |
|
|
} else { |
|
|
$('<a href="javascript:;" class="button-base-class resultset_first" title="First Page"></a>\ |
|
|
<a href="javascript:;" class="button-base-class resultset_prev" title="Previous Page"></a>\ |
|
|
<span class="spacer"> </span>').insertBefore($('.pagelabel')); |
|
|
$('<span class="spacer"> </span>\ |
|
|
<a href="javascript:;" class="button-base-class resultset_next" title="Next Page"></a>\ |
|
|
<a href="javascript:;" class="button-base-class resultset_last" title="Last Page"></a>').insertAfter($('#totalpages')); |
|
|
if (trans !== null && trans !== undefined) { |
|
|
$.each(trans, function (k, v) { |
|
|
if (k != "pageminus" && k != "pageplus") { |
|
|
if (k == "pagelabel" || k == "recordstatelabel") { |
|
|
$('.' + k).text(v); |
|
|
} else { |
|
|
$('.' + k).attr("title", v); |
|
|
} |
|
|
} |
|
|
}); |
|
|
} |
|
|
$(".resultset_first").click(function () { |
|
|
var changedvalue = 1; |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
}); |
|
|
$(".resultset_prev").click(function () { |
|
|
if (isNaN(parseInt($(".currentpage").val()))) { |
|
|
$(".currentpage").val(1); |
|
|
} |
|
|
var changedvalue = parseInt($(".currentpage").val()) - 1; |
|
|
if (changedvalue < 1) { |
|
|
changedvalue = 1; |
|
|
} |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
}); |
|
|
$(".resultset_next").click(function () { |
|
|
if (isNaN(parseInt($(".currentpage").val()))) { |
|
|
$(".currentpage").val(1); |
|
|
} |
|
|
var changedvalue = parseInt($(".currentpage").val()) + 1; |
|
|
if (changedvalue > parseInt($("#totalpages").text())) { |
|
|
changedvalue = parseInt($("#totalpages").text()); |
|
|
} |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
}); |
|
|
$(".resultset_last").click(function () { |
|
|
var changedvalue = parseInt($("#totalpages").text()); |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
}); |
|
|
} |
|
|
$('.recordsperpage').dropkick({ |
|
|
change: function (value, label) { |
|
|
var changedvalue = 1; |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
} |
|
|
}); |
|
|
$(".refresh").click(function () { |
|
|
if (isNaN(parseInt($(".currentpage").val()))) { |
|
|
$(".currentpage").val(1); |
|
|
} |
|
|
var changedvalue = parseInt($(".currentpage").val()); |
|
|
if (changedvalue < 1) { |
|
|
changedvalue = 1; |
|
|
} |
|
|
if (changedvalue > parseInt($("#totalpages").text())) { |
|
|
changedvalue = parseInt($("#totalpages").text()); |
|
|
} |
|
|
getData(changedvalue, paramObj.remoteUrl, pagertype, paramObj.params, waiting); |
|
|
}); |
|
|
$(".currentrecords").click(function () { |
|
|
$(".recordstate").toggle("fast"); |
|
|
}); |
|
|
} |
|
|
function getData(changedvalue, url, pagertype, params, waiting) { |
|
|
var pagesize = $('.recordsperpage').val(); |
|
|
var pageindex = changedvalue; |
|
|
var postedData = {}; |
|
|
postedData['pageSize'] = pagesize; |
|
|
postedData['pageIndex'] = pageindex; |
|
|
if (params !== null && params != undefined) { |
|
|
$.each(params, function (k, v) { |
|
|
postedData[k] = v; |
|
|
}); |
|
|
} |
|
|
//alert(); |
|
|
$.ajax({ |
|
|
url: url, |
|
|
type: 'POST', |
|
|
cache: false, |
|
|
dataType: "text", |
|
|
crossDomain: true, |
|
|
data: postedData, |
|
|
timeout: waiting, |
|
|
beforeSend: function() { |
|
|
$("#dataloading").attr("disabled","disabled"); |
|
|
$('#dataloading').removeClass('refresh'); |
|
|
$('#dataloading').addClass('dataloading'); |
|
|
}, |
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) { |
|
|
paramObj.container.html('<span style="position:absolute;top:5px;left:5px;color:red;">Error! ' + errorThrown + '</span>'); |
|
|
}, |
|
|
success: function (data) { |
|
|
var total = $.evalJSON(data).Total; |
|
|
var rows = $.evalJSON($.evalJSON(data).Rows); |
|
|
//alert(rows.user_id); |
|
|
paramObj.datagrid.setData(rows); |
|
|
paramObj.datagrid.render(); |
|
|
$(".currentpage").css("width", changedvalue.toString().length * 7 + "px"); |
|
|
$(".currentpage").val(changedvalue); |
|
|
var currentvalue = changedvalue; |
|
|
var pagesize = parseInt($('.recordsperpage').val()); |
|
|
var fromvalue = (currentvalue - 1) * pagesize + 1; |
|
|
var tovalue = fromvalue + pagesize - 1; |
|
|
if (tovalue > total) { |
|
|
tovalue = total; |
|
|
} |
|
|
$("#recordsegment").text(fromvalue + "-" + tovalue); |
|
|
$("#totalrecords").text(total); |
|
|
var totalpages = parseInt(Math.floor(parseFloat(total / pagesize)) + 1); |
|
|
$("#totalpages").text(totalpages); |
|
|
if (pagertype == "slider") { |
|
|
$(".pagerslider").slider("value", changedvalue); |
|
|
$(".pagerslider").slider("option", "max", totalpages); |
|
|
} |
|
|
$("#dataloading").removeAttr("disabled"); |
|
|
$('#dataloading').removeClass('dataloading'); |
|
|
$('#dataloading').addClass('refresh'); |
|
|
} |
|
|
}); |
|
|
} |
|
|
} |
|
|
$.extend(true, window, { Slick: { Controls: { EnhancementPager: EnhancementPager}} }); |
|
|
})(jQuery);/* |
|
|
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined |
|
|
* in FIPS 180-1 |
|
|
* Version 2.2 Copyright Paul Johnston 2000 - 2009. |
|
|
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet |
|
|
* Distributed under the BSD License |
|
|
* See http://pajhome.org.uk/crypt/md5 for details. |
|
|
*/ |
|
|
var hexcase=0;var b64pad="";function hex_sha1(a){return rstr2hex(rstr_sha1(str2rstr_utf8(a)))}function hex_hmac_sha1(a,b){return rstr2hex(rstr_hmac_sha1(str2rstr_utf8(a),str2rstr_utf8(b)))}function sha1_vm_test(){return hex_sha1("abc").toLowerCase()=="a9993e364706816aba3e25717850c26c9cd0d89d"}function rstr_sha1(a){return binb2rstr(binb_sha1(rstr2binb(a),a.length*8))}function rstr_hmac_sha1(c,f){var e=rstr2binb(c);if(e.length>16){e=binb_sha1(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=binb_sha1(a.concat(rstr2binb(f)),512+f.length*8);return binb2rstr(binb_sha1(d.concat(g),512+160))}function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);b+=f.charAt((a>>>4)&15)+f.charAt(a&15)}return b}function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d<c.length){a=c.charCodeAt(d);e=d+1<c.length?c.charCodeAt(d+1):0;if(55296<=a&&a<=56319&&56320<=e&&e<=57343){a=65536+((a&1023)<<10)+(e&1023);d++}if(a<=127){b+=String.fromCharCode(a)}else{if(a<=2047){b+=String.fromCharCode(192|((a>>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b}function rstr2binb(b){var a=Array(b.length>>2);for(var c=0;c<a.length;c++){a[c]=0}for(var c=0;c<b.length*8;c+=8){a[c>>5]|=(b.charCodeAt(c/8)&255)<<(24-c%32)}return a}function binb2rstr(b){var a="";for(var c=0;c<b.length*32;c+=8){a+=String.fromCharCode((b[c>>5]>>>(24-c%32))&255)}return a}function binb_sha1(v,o){v[o>>5]|=128<<(24-o%32);v[((o+64>>9)<<4)+15]=o;var y=Array(80);var u=1732584193;var s=-271733879;var r=-1732584194;var q=271733878;var p=-1009589776;for(var l=0;l<v.length;l+=16){var n=u;var m=s;var k=r;var h=q;var f=p;for(var g=0;g<80;g++){if(g<16){y[g]=v[l+g]}else{y[g]=bit_rol(y[g-3]^y[g-8]^y[g-14]^y[g-16],1)}var z=safe_add(safe_add(bit_rol(u,5),sha1_ft(g,s,r,q)),safe_add(safe_add(p,y[g]),sha1_kt(g)));p=q;q=r;r=bit_rol(s,30);s=u;u=z}u=safe_add(u,n);s=safe_add(s,m);r=safe_add(r,k);q=safe_add(q,h);p=safe_add(p,f)}return Array(u,s,r,q,p)}function sha1_ft(e,a,g,f){if(e<20){return(a&g)|((~a)&f)}if(e<40){return a^g^f}if(e<60){return(a&g)|(a&f)|(g&f)}return a^g^f}function sha1_kt(a){return(a<20)?1518500249:(a<40)?1859775393:(a<60)?-1894007588:-899497514}function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<<b)|(a>>>(32-b))};/*jslint browser: true*/ |
|
|
/*global $, Slick, grid, jQuery, alert*/ |
|
|
|
|
|
$(function () { |
|
|
"use strict"; |
|
|
|
|
|
// Selection des users |
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "include/ajax.php", |
|
|
dataType: 'json', |
|
|
data: "select=user", |
|
|
success: function (json) { |
|
|
// Bouton pour formater la cellule pour supprimer un user |
|
|
function buttonFormatter(row, cell, value, columnDef, dataContext) { |
|
|
var button = "<img src='images/drop.png' class='delete del_user' data-row='" + row + "' id='" + dataContext.user_id + "' />"; |
|
|
return button; |
|
|
} |
|
|
|
|
|
var |
|
|
i, |
|
|
columns = [ |
|
|
{id: "user_id", name: "ID", field: "user_id", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "user_pass", name: "Pass", field: "user_pass", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "user_mail", name: "Mail", field: "user_mail", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "user_phone", name: "Phone", field: "user_phone", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "user_online", name: "Online", field: "user_online", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "user_enable", name: "Enabled", field: "user_enable", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "user_start_date", name: "Start Date", field: "user_start_date", width: 120, cssClass: "cell-title", editor: Slick.Editors.Date}, |
|
|
{id: "user_end_date", name: "End Date", field: "user_end_date", width: 120, cssClass: "cell-title", editor: Slick.Editors.Date}, |
|
|
{id: "user_del", name: 'Delete', field: "user_del", width: 250, formatter: buttonFormatter} |
|
|
], |
|
|
|
|
|
// Options de la grid |
|
|
options = { |
|
|
editable: true, |
|
|
enableAddRow: true, |
|
|
enableCellNavigation: true, |
|
|
asyncEditorLoading: false, |
|
|
autoEdit: false, |
|
|
autoHeight: true |
|
|
}, |
|
|
|
|
|
// Création des données |
|
|
data = [], |
|
|
|
|
|
// Permet de sauvegarder l'ancien user_id lorsque l'admin modifie un utilisateur du VPN |
|
|
save = null, |
|
|
|
|
|
grid = null; |
|
|
|
|
|
|
|
|
|
|
|
// Action lorsqu'on veut supprimer un user |
|
|
$('.del_user').live('click', function () { |
|
|
|
|
|
// Suppression dans la bdd |
|
|
var me = $(this), id = me.attr('id'), |
|
|
data = grid.getData(); |
|
|
|
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "include/ajax.php", |
|
|
dataType: "json", |
|
|
data: {del_user_id: id}, |
|
|
error: function () { |
|
|
alert("Erreur dans la suppression de la donnée..."); |
|
|
} |
|
|
}); |
|
|
|
|
|
// Suppression de la ligne en question |
|
|
data.splice(me.attr('data-row'), 1); |
|
|
grid.setData(data); |
|
|
grid.render(); |
|
|
}); |
|
|
|
|
|
|
|
|
for (i = 0; i < json.length; i += 1) { |
|
|
data[i] = { |
|
|
user_id: json[i].user_id, |
|
|
user_pass: json[i].user_pass, |
|
|
user_mail: json[i].user_mail, |
|
|
user_phone: json[i].user_phone, |
|
|
user_online: json[i].user_online, |
|
|
user_enable: json[i].user_enable, |
|
|
user_start_date: json[i].user_start_date, |
|
|
user_end_date: json[i].user_end_date |
|
|
}; |
|
|
} |
|
|
|
|
|
// Grille des utilisateurs du VPN |
|
|
grid = new Slick.Grid($("#grid_user"), data, columns, options); |
|
|
|
|
|
$("#grid_user").on('click', function () { |
|
|
var $active = grid.getActiveCell(); |
|
|
|
|
|
if ($active !== undefined && $active.cell === 0) { |
|
|
save = $(grid.getActiveCellNode()).html(); |
|
|
} else { |
|
|
save = null; |
|
|
} |
|
|
}); |
|
|
|
|
|
// Lorsqu'on modifie une cellule d'un utilisateur |
|
|
grid.onCellChange.subscribe(function (e, args) { |
|
|
var item = args.item; |
|
|
|
|
|
// On sauvegarde l'ancien user_id |
|
|
if (save) { |
|
|
item.set_user = save; |
|
|
} else { |
|
|
item.set_user = item.user_id; |
|
|
} |
|
|
|
|
|
// Suppression dans la bdd |
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "include/ajax.php", |
|
|
dataType: "json", |
|
|
data: item, |
|
|
success: function () { |
|
|
// Transformation en sha1 du mdp |
|
|
if(args.cell == 1) { |
|
|
grid.invalidateRow(args.row); |
|
|
data[args.row][grid.getColumns()[args.cell].field] = hex_sha1(data[args.row][grid.getColumns()[args.cell].field]); |
|
|
grid.render(); |
|
|
} |
|
|
}, |
|
|
error: function () { |
|
|
alert("Erreur dans la modification des données..."); |
|
|
} |
|
|
}); |
|
|
|
|
|
delete item.set_user; |
|
|
}); |
|
|
|
|
|
// Ajout d'un nouvel utilisateur |
|
|
grid.onAddNewRow.subscribe(function (e, args) { |
|
|
var item = args.item; |
|
|
|
|
|
// On ne peut ajouter un utilisateur qu'en saisissant son id |
|
|
if (!item.user_id) { |
|
|
return; |
|
|
} |
|
|
|
|
|
// Modification dans la bdd |
|
|
item.add_user = true; |
|
|
|
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "include/ajax.php", |
|
|
dataType: "json", |
|
|
data: item, |
|
|
error: function () { |
|
|
alert("Erreur dans l'insertion des données..."); |
|
|
} |
|
|
}); |
|
|
|
|
|
delete item.add_user; |
|
|
|
|
|
// Maj de la grille |
|
|
grid.invalidateRow(data.length); |
|
|
data.push(item); |
|
|
grid.updateRowCount(); |
|
|
grid.render(); |
|
|
}); |
|
|
|
|
|
grid.autosizeColumns(); |
|
|
}, |
|
|
error: function () { |
|
|
alert('Erreur dans la récupération des données...'); |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
// Selection des admins |
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "include/ajax.php", |
|
|
dataType: 'json', |
|
|
data: "select=admin", |
|
|
success: function (json) { |
|
|
// Fonction créant la cellule pour supprimer un admin |
|
|
function buttonFormatter(row, cell, value, columnDef, dataContext) { |
|
|
var button = "<img src='images/drop.png' class='delete del_admin' data-row='" + row + "' id='" + dataContext.admin_id + "' />"; |
|
|
return button; |
|
|
} |
|
|
|
|
|
var |
|
|
i, |
|
|
|
|
|
// Header des colonnes |
|
|
columns = [ |
|
|
{id: "admin_id", name: "Admin ID", field: "admin_id", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "admin_pass", name: "Admin Pass", field: "admin_pass", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "admin_del", name: 'Delete', field: "admin_del", width: 250, formatter: buttonFormatter} |
|
|
], |
|
|
|
|
|
// Option de la grille |
|
|
options = { |
|
|
editable: true, |
|
|
enableAddRow: true, |
|
|
enableCellNavigation: true, |
|
|
asyncEditorLoading: false, |
|
|
autoEdit: false, |
|
|
autoHeight: true |
|
|
}, |
|
|
|
|
|
data = [], |
|
|
grid = null, |
|
|
|
|
|
// Sauvegarder l'ancien admin_id lorsqu'on modifie un admin |
|
|
save = null; |
|
|
|
|
|
|
|
|
|
|
|
// Lorsqu'on veut supprimer un admin |
|
|
$('.del_admin').live('click', function () { |
|
|
// Suppression dans la bdd |
|
|
var me = $(this), id = me.attr('id'), data = grid.getData(); |
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "include/ajax.php", |
|
|
dataType: "json", |
|
|
data: {del_admin_id: id}, |
|
|
error: function () { |
|
|
alert("Erreur dans la suppression de la donnée..."); |
|
|
} |
|
|
}); |
|
|
|
|
|
// Maj de la grille |
|
|
data.splice(me.attr('data-row'), 1); |
|
|
grid.setData(data); |
|
|
grid.render(); |
|
|
}); |
|
|
|
|
|
|
|
|
for (i = 0; i < json.length; i += 1) { |
|
|
data[i] = { |
|
|
admin_id: json[i].admin_id, |
|
|
admin_pass: json[i].admin_pass |
|
|
}; |
|
|
} |
|
|
|
|
|
grid = new Slick.Grid($("#grid_admin"), data, columns, options); |
|
|
|
|
|
$("#grid_admin").on('click', function () { |
|
|
var $active = grid.getActiveCell(); |
|
|
|
|
|
if ($active !== undefined && $active.cell === 0) { |
|
|
save = $(grid.getActiveCellNode()).html(); |
|
|
} else { |
|
|
save = null; |
|
|
} |
|
|
}); |
|
|
|
|
|
// Lorsqu'on modifie un admin |
|
|
grid.onCellChange.subscribe(function (e, args) { |
|
|
var item = args.item; |
|
|
|
|
|
// On stocke l'ancien admin_id |
|
|
if (save) { |
|
|
item.set_admin = save; |
|
|
} else { |
|
|
item.set_admin = item.admin_id; |
|
|
} |
|
|
|
|
|
// Modification de la bdd |
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "include/ajax.php", |
|
|
dataType: "json", |
|
|
data: item, |
|
|
error: function () { |
|
|
alert("Erreur dans la modification des données..."); |
|
|
} |
|
|
}); |
|
|
|
|
|
delete item.set_admin; |
|
|
}); |
|
|
|
|
|
// Ajout d'un nouvel admin |
|
|
grid.onAddNewRow.subscribe(function (e, args) { |
|
|
var item = args.item; |
|
|
|
|
|
// On peut ajouter un admin seulement en ajoutant un ID |
|
|
if (!item.admin_id) { |
|
|
return; |
|
|
} |
|
|
|
|
|
item.add_admin = true; |
|
|
|
|
|
// Maj de la bdd |
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "include/ajax.php", |
|
|
dataType: "json", |
|
|
data: item, |
|
|
error: function () { |
|
|
alert("Erreur dans l'insertion des données..."); |
|
|
} |
|
|
}); |
|
|
|
|
|
delete item.add_admin; |
|
|
|
|
|
// Maj de la grille |
|
|
grid.invalidateRow(data.length); |
|
|
data.push(item); |
|
|
grid.updateRowCount(); |
|
|
grid.render(); |
|
|
}); |
|
|
|
|
|
grid.autosizeColumns(); |
|
|
}, |
|
|
error: function () { |
|
|
alert('Erreur dans la récupération des données...'); |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Sélection des logs |
|
|
var |
|
|
i, |
|
|
|
|
|
// Header des colonnes |
|
|
columns = [ |
|
|
{id: "log_id", name: "Log ID", field: "log_id", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "user_id", name: "User ID", field: "user_id", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "log_trusted_ip", name: "Trusted IP", field: "log_trusted_ip", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "log_trusted_port", name: "Trusted Port", field: "log_trusted_port", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "log_remote_ip", name: "Remote IP", field: "log_remote_ip", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "log_remote_port", name: "Remote Port", field: "log_remote_port", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "log_start_time", name: "Start Time", field: "log_start_time", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "log_end_time", name: "End Time", field: "log_end_time", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "log_received", name: "Receveid", field: "log_received", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text}, |
|
|
{id: "log_send", name: "Sent", field: "log_send", width: 120, cssClass: "cell-title", editor: Slick.Editors.Text} |
|
|
], |
|
|
|
|
|
// Options de la grille |
|
|
options = { |
|
|
editable: false, |
|
|
enableAddRow: false, |
|
|
enableCellNavigation: true, |
|
|
asyncEditorLoading: false, |
|
|
autoEdit: false, |
|
|
autoHeight: true |
|
|
}, |
|
|
|
|
|
data = [], |
|
|
|
|
|
// Création de la grille |
|
|
grid = new Slick.Grid($("#grid_log"), data, columns, options), |
|
|
|
|
|
// Pagination |
|
|
pager = new Slick.Controls.EnhancementPager({ |
|
|
container: $("#pagination"), |
|
|
remoteUrl: "include/ajax.php", |
|
|
params: {select: "log"}, |
|
|
datagrid: grid, |
|
|
pagerType: "" |
|
|
}); |
|
|
|
|
|
grid.autosizeColumns(); |
|
|
|
|
|
});
|
|
|
|