").css("width",d))}),e.$table.prepend(f))},u.getColumnData=function(b,c,d,e,f){if("undefined"!=typeof c&&null!==c){b=a(b)[0];var g,h,i=b.config,j=f||i.$headers;if(c[d])return e?c[d]:c[j.index(j.filter('[data-column="'+d+'"]:last'))];for(h in c)if("string"==typeof h&&(g=j.filter('[data-column="'+d+'"]:last').filter(h).add(j.filter('[data-column="'+d+'"]:last').find(h)),g.length))return c[h]}},u.computeColumnIndex=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[],q={},r=0;for(c=0;ce;e++)for("undefined"==typeof p[e]&&(p[e]=[]),o=p[e],f=n;n+m>f;f++)o[f]="x"}return r+1},u.isProcessing=function(b,c,d){b=a(b);var e=b[0].config,f=d||b.find("."+u.css.header);c?("undefined"!=typeof d&&e.sortList.length>0&&(f=f.filter(function(){return this.sortDisabled?!1:u.isValueInArray(parseFloat(a(this).attr("data-column")),e.sortList)>=0})),b.add(f).addClass(u.css.processing+" "+e.cssProcessing)):b.add(f).removeClass(u.css.processing+" "+e.cssProcessing)},u.processTbody=function(b,c,d){b=a(b)[0];var e;return d?(b.isProcessing=!0,c.before(''),e=a.fn.detach?c.detach():c.remove()):(e=a(b).find("span.tablesorter-savemyplace"),c.insertAfter(e),e.remove(),void(b.isProcessing=!1))},u.clearTableBody=function(b){a(b)[0].config.$tbodies.children().detach()},u.bindEvents=function(b,c,e){b=a(b)[0];var f,h=b.config;e!==!0&&(h.$extraHeaders=h.$extraHeaders?h.$extraHeaders.add(c):c),c.find(h.selectorSort).add(c.filter(h.selectorSort)).unbind("mousedown mouseup sort keyup ".split(" ").join(h.namespace+" ").replace(/\s+/g," ")).bind("mousedown mouseup sort keyup ".split(" ").join(h.namespace+" "),function(e,i){var j,k=a(e.target),l=e.type;if(!(1!==(e.which||e.button)&&!/sort|keyup/.test(l)||"keyup"===l&&13!==e.which||"mouseup"===l&&i!==!0&&(new Date).getTime()-f>250)){if("mousedown"===l)return void(f=(new Date).getTime());if(j=a.fn.closest?k.closest("td,th"):k.parents("td,th").filter(":first"),/(input|select|button|textarea)/i.test(e.target.tagName)||k.hasClass(h.cssNoSort)||k.parents("."+h.cssNoSort).length>0||k.parents("button").length>0)return!h.cancelSelection;h.delayInit&&d(h.cache)&&g(b),j=a.fn.closest?a(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:a(this).parents("th, td")[0],j=h.$headers[c.index(j)],j.sortDisabled||p(b,j,e)}}),h.cancelSelection&&c.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},u.restoreHeaders=function(b){var c,d=a(b)[0].config;d.$table.find(d.selectorHeaders).each(function(b){c=a(this),c.find("."+u.css.headerIn).length&&c.html(d.headerContent[b])})},u.destroy=function(b,c,d){if(b=a(b)[0],b.hasInitialized){u.removeWidget(b,!0,!1);var e,f=a(b),g=b.config,h=f.find("thead:first"),i=h.find("tr."+u.css.headerRow).removeClass(u.css.headerRow+" "+g.cssHeaderRow),j=f.find("tfoot:first > tr").children("th, td");c===!1&&a.inArray("uitheme",g.widgets)>=0&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"])),h.find("tr").not(i).remove(),e="sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache "+"applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(g.namespace+" "),f.removeData("tablesorter").unbind(e.replace(/\s+/g," ")),g.$headers.add(j).removeClass([u.css.header,g.cssHeader,g.cssAsc,g.cssDesc,u.css.sortAsc,u.css.sortDesc,u.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(g.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(g.namespace+" ").replace(/\s+/g," ")),u.restoreHeaders(b),f.toggleClass(u.css.table+" "+g.tableClass+" tablesorter-"+g.theme,c===!1),b.hasInitialized=!1,delete b.config.cache,"function"==typeof d&&d(b)}},u.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},u.sortNatural=function(a,b){if(a===b)return 0;var c,d,e,f,g,h,i,j,k=u.regex;if(k.hex.test(b)){if(d=parseInt(a.match(k.hex),16),f=parseInt(b.match(k.hex),16),f>d)return-1;if(d>f)return 1}for(c=a.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),e=b.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),j=Math.max(c.length,e.length),i=0;j>i;i++){if(g=isNaN(c[i])?c[i]||0:parseFloat(c[i])||0,h=isNaN(e[i])?e[i]||0:parseFloat(e[i])||0,isNaN(g)!==isNaN(h))return isNaN(g)?1:-1;if(typeof g!=typeof h&&(g+="",h+=""),h>g)return-1;if(g>h)return 1}return 0},u.sortNaturalAsc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:f||1:u.sortNatural(a,b)},u.sortNaturalDesc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:u.sortNatural(b,a)},u.sortText=function(a,b){return a>b?1:b>a?-1:0},u.getTextValue=function(a,b,c){if(c){var d,e=a?a.length:0,f=c+b;for(d=0;e>d;d++)f+=a.charCodeAt(d);return b*f}return 0},u.sortNumericAsc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),a-b)},u.sortNumericDesc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),b-a)},u.sortNumeric=function(a,b){return a-b},u.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},u.replaceAccents=function(a){var b,c="[",d=u.characterEquivalents;if(!u.characterRegex){u.characterRegexArray={};for(b in d)"string"==typeof b&&(c+=d[b],u.characterRegexArray[b]=new RegExp("["+d[b]+"]","g"));u.characterRegex=new RegExp(c+"]")}if(u.characterRegex.test(a))for(b in d)"string"==typeof b&&(a=a.replace(u.characterRegexArray[b],b));return a},u.isValueInArray=function(a,b){var c,d=b.length;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},u.addParser=function(a){var b,c=u.parsers.length,d=!0;for(b=0;c>b;b++)u.parsers[b].id.toLowerCase()===a.id.toLowerCase()&&(d=!1);d&&u.parsers.push(a)},u.getParserById=function(a){if("false"==a)return!1;var b,c=u.parsers.length;for(b=0;c>b;b++)if(u.parsers[b].id.toLowerCase()===a.toString().toLowerCase())return u.parsers[b];return!1},u.addWidget=function(a){u.widgets.push(a)},u.hasWidget=function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},u.getWidgetById=function(a){var b,c,d=u.widgets.length;for(b=0;d>b;b++)if(c=u.widgets[b],c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase())return c},u.applyWidget=function(b,d,e){b=a(b)[0];var f,g,h,i,j=b.config,k=j.widgetOptions,l=" "+j.table.className+" ",m=[];d!==!1&&b.hasInitialized&&(b.isApplyingWidgets||b.isUpdating)||(j.debug&&(f=new Date),i=new RegExp("\\s"+j.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),l.match(i)&&(h=l.match(i),h&&a.each(h,function(a,b){j.widgets.push(b.replace(i,"$1"))})),j.widgets.length&&(b.isApplyingWidgets=!0,j.widgets=a.grep(j.widgets,function(b,c){return a.inArray(b,j.widgets)===c}),a.each(j.widgets||[],function(a,b){i=u.getWidgetById(b),i&&i.id&&(i.priority||(i.priority=10),m[a]=i)}),m.sort(function(a,b){return a.priorityf;f++)g=u.getWidgetById(d[f]),h=a.inArray(d[f],i.widgets),g&&"remove"in g&&(i.debug&&h>=0&&b('Removing "'+d[f]+'" widget'),g.remove(c,i,i.widgetOptions,e),i.widgetInit[d[f]]=!1),h>=0&&e!==!0&&i.widgets.splice(h,1)},u.refreshWidgets=function(b,c,d){b=a(b)[0];var e=b.config,f=e.widgets,g=[],h=function(b){a(b).trigger("refreshComplete")};a.each(u.widgets,function(b,d){d&&d.id&&(c||a.inArray(d.id,f)<0)&&g.push(d.id)}),u.removeWidget(b,g.join(","),!0),d!==!0?(u.applyWidget(b,c||!1,h),c&&u.applyWidget(b,!1,h)):h(b)},u.getData=function(b,c,d){var e,f,g="",h=a(b);return h.length?(e=a.metadata?h.metadata():!1,f=" "+(h.attr("class")||""),"undefined"!=typeof h.data(d)||"undefined"!=typeof h.data(d.toLowerCase())?g+=h.data(d)||h.data(d.toLowerCase()):e&&"undefined"!=typeof e[d]?g+=e[d]:c&&"undefined"!=typeof c[d]?g+=c[d]:" "!==f&&f.match(" "+d+"-")&&(g=f.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||""),a.trim(g)):""},u.formatFloat=function(b,c){if("string"!=typeof b||""===b)return b;var d,e=c&&c.config?c.config.usNumberFormat!==!1:"undefined"!=typeof c?c:!0;return b=e?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1")),d=parseFloat(b),isNaN(d)?a.trim(b):d},u.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var b=a.tablesorter;return a.fn.extend({tablesorter:b.construct}),b.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),b.addParser({id:"text",is:function(){return!0},format:function(c,d){var e=d.config;return c&&(c=a.trim(e.ignoreCase?c.toLocaleLowerCase():c),c=e.sortLocaleCompare?b.replaceAccents(c):c),c},type:"text"}),b.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"currency",is:function(a){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((a||"").replace(/[+\-,. ]/g,""))},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\//.test(a)},format:function(b){return b?a.trim(b.replace(/(https?|ftp|file):\/\//,"")):b},parsed:!0,type:"text"}),b.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(a)},format:function(a){var b=a?new Date(a.replace(/-/g,"/")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"percent",is:function(a){return/(\d\s*?%|%\s*?\d)/.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(/%/g,""),c):a},type:"numeric"}),b.addParser({id:"image",is:function(a,b,c,d){return d.find("img").length>0},format:function(b,c,d){return a(d).find("img").attr(c.config.imgAttr||"alt")||b},parsed:!0,type:"text"}),b.addParser({id:"usLongDate",is:function(a){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(a)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(a)},format:function(a){var b=a?new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"shortDate",is:function(a){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((a||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(a,c,d,e){if(a){var f,g,h=c.config,i=h.$headers.filter('[data-column="'+e+'"]:last'),j=i.length&&i[0].dateFormat||b.getData(i,b.getColumnData(c,h.headers,e),"dateFormat")||h.dateFormat;return g=a.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===j&&(g=g.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")),f=new Date(g),f instanceof Date&&isFinite(f)?f.getTime():a}return a},type:"numeric"}),b.addParser({id:"time",is:function(a){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a){var b=a?new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"metadata",is:function(){return!1
+},format:function(b,c,d){var e=c.config,f=e.parserMetadataName?e.parserMetadataName:"sortValue";return a(d).metadata()[f]},type:"numeric"}),b.addWidget({id:"zebra",priority:90,format:function(b,c,d){var e,f,g,h,i,j,k,l=new RegExp(c.cssChildRow,"i"),m=c.$tbodies;for(c.debug&&(j=new Date),k=0;k").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled], [readonly]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+b.name+"")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\])/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});;function get_dimensions()
+{
+ var dims = {width:0,height:0};
+
+ if( typeof( window.innerWidth ) == 'number' ) {
+ //Non-IE
+ dims.width = window.innerWidth;
+ dims.height = window.innerHeight;
+ } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
+ //IE 6+ in 'standards compliant mode'
+ dims.width = document.documentElement.clientWidth;
+ dims.height = document.documentElement.clientHeight;
+ } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
+ //IE 4 compatible
+ dims.width = document.body.clientWidth;
+ dims.height = document.body.clientHeight;
+ }
+
+ return dims;
+}
+
+function set_feedback(text, classname, keep_displayed)
+{
+ if(text)
+ {
+ $('#feedback_bar').removeClass().addClass(classname).html(text).css('opacity','1');
+
+ if(!keep_displayed)
+ {
+ $('#feedback_bar').fadeTo(5000, 1).fadeTo("fast",0);
+ }
+ }
+ else
+ {
+ $('#feedback_bar').css('opacity','0');
+ }
+}
+
+;(function($){
+ //keylisteners
+ $.each(['customers', 'items', 'reports', 'receivings', 'sales', 'employees', 'config', 'giftcards'], function(key, value) {
+ $(window).jkey('f' + (key+1), function(){
+ window.location = BASE_URL + '/' + value + '/index';
+ });
+ });
+})(jQuery);
+;/*
+ * Date prototype extensions. Doesn't depend on any
+ * other code. Doens't overwrite existing methods.
+ *
+ * Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear,
+ * isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear,
+ * setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods
+ *
+ * Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
+ *
+ * Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString -
+ * I've added my name to these methods so you know who to blame if they are broken!
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ */
+
+/**
+ * An Array of day names starting with Sunday.
+ *
+ * @example dayNames[0]
+ * @result 'Sunday'
+ *
+ * @name dayNames
+ * @type Array
+ * @cat Plugins/Methods/Date
+ */
+Date.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
+
+/**
+ * An Array of abbreviated day names starting with Sun.
+ *
+ * @example abbrDayNames[0]
+ * @result 'Sun'
+ *
+ * @name abbrDayNames
+ * @type Array
+ * @cat Plugins/Methods/Date
+ */
+Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+
+/**
+ * An Array of month names starting with Janurary.
+ *
+ * @example monthNames[0]
+ * @result 'January'
+ *
+ * @name monthNames
+ * @type Array
+ * @cat Plugins/Methods/Date
+ */
+Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
+
+/**
+ * An Array of abbreviated month names starting with Jan.
+ *
+ * @example abbrMonthNames[0]
+ * @result 'Jan'
+ *
+ * @name monthNames
+ * @type Array
+ * @cat Plugins/Methods/Date
+ */
+Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+
+/**
+ * The first day of the week for this locale.
+ *
+ * @name firstDayOfWeek
+ * @type Number
+ * @cat Plugins/Methods/Date
+ * @author Kelvin Luck
+ */
+Date.firstDayOfWeek = 1;
+
+/**
+ * The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc).
+ *
+ * @name format
+ * @type String
+ * @cat Plugins/Methods/Date
+ * @author Kelvin Luck
+ */
+Date.format = 'mm/dd/yyyy';
+//Date.format = 'mm/dd/yyyy';
+//Date.format = 'yyyy-mm-dd';
+//Date.format = 'dd mmm yy';
+
+/**
+ * The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear
+ * only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes.
+ *
+ * @name format
+ * @type String
+ * @cat Plugins/Methods/Date
+ * @author Kelvin Luck
+ */
+Date.fullYearStart = '20';
+
+(function() {
+
+ /**
+ * Adds a given method under the given name
+ * to the Date prototype if it doesn't
+ * currently exist.
+ *
+ * @private
+ */
+ function add(name, method) {
+ if( !Date.prototype[name] ) {
+ Date.prototype[name] = method;
+ }
+ };
+
+ /**
+ * Checks if the year is a leap year.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.isLeapYear();
+ * @result true
+ *
+ * @name isLeapYear
+ * @type Boolean
+ * @cat Plugins/Methods/Date
+ */
+ add("isLeapYear", function() {
+ var y = this.getFullYear();
+ return (y%4==0 && y%100!=0) || y%400==0;
+ });
+
+ /**
+ * Checks if the day is a weekend day (Sat or Sun).
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.isWeekend();
+ * @result false
+ *
+ * @name isWeekend
+ * @type Boolean
+ * @cat Plugins/Methods/Date
+ */
+ add("isWeekend", function() {
+ return this.getDay()==0 || this.getDay()==6;
+ });
+
+ /**
+ * Check if the day is a day of the week (Mon-Fri)
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.isWeekDay();
+ * @result false
+ *
+ * @name isWeekDay
+ * @type Boolean
+ * @cat Plugins/Methods/Date
+ */
+ add("isWeekDay", function() {
+ return !this.isWeekend();
+ });
+
+ /**
+ * Gets the number of days in the month.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.getDaysInMonth();
+ * @result 31
+ *
+ * @name getDaysInMonth
+ * @type Number
+ * @cat Plugins/Methods/Date
+ */
+ add("getDaysInMonth", function() {
+ return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()];
+ });
+
+ /**
+ * Gets the name of the day.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.getDayName();
+ * @result 'Saturday'
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.getDayName(true);
+ * @result 'Sat'
+ *
+ * @param abbreviated Boolean When set to true the name will be abbreviated.
+ * @name getDayName
+ * @type String
+ * @cat Plugins/Methods/Date
+ */
+ add("getDayName", function(abbreviated) {
+ return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()];
+ });
+
+ /**
+ * Gets the name of the month.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.getMonthName();
+ * @result 'Janurary'
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.getMonthName(true);
+ * @result 'Jan'
+ *
+ * @param abbreviated Boolean When set to true the name will be abbreviated.
+ * @name getDayName
+ * @type String
+ * @cat Plugins/Methods/Date
+ */
+ add("getMonthName", function(abbreviated) {
+ return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()];
+ });
+
+ /**
+ * Get the number of the day of the year.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.getDayOfYear();
+ * @result 11
+ *
+ * @name getDayOfYear
+ * @type Number
+ * @cat Plugins/Methods/Date
+ */
+ add("getDayOfYear", function() {
+ var tmpdtm = new Date("1/1/" + this.getFullYear());
+ return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000);
+ });
+
+ /**
+ * Get the number of the week of the year.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.getWeekOfYear();
+ * @result 2
+ *
+ * @name getWeekOfYear
+ * @type Number
+ * @cat Plugins/Methods/Date
+ */
+ add("getWeekOfYear", function() {
+ return Math.ceil(this.getDayOfYear() / 7);
+ });
+
+ /**
+ * Set the day of the year.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.setDayOfYear(1);
+ * dtm.toString();
+ * @result 'Tue Jan 01 2008 00:00:00'
+ *
+ * @name setDayOfYear
+ * @type Date
+ * @cat Plugins/Methods/Date
+ */
+ add("setDayOfYear", function(day) {
+ this.setMonth(0);
+ this.setDate(day);
+ return this;
+ });
+
+ /**
+ * Add a number of years to the date object.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.addYears(1);
+ * dtm.toString();
+ * @result 'Mon Jan 12 2009 00:00:00'
+ *
+ * @name addYears
+ * @type Date
+ * @cat Plugins/Methods/Date
+ */
+ add("addYears", function(num) {
+ this.setFullYear(this.getFullYear() + num);
+ return this;
+ });
+
+ /**
+ * Add a number of months to the date object.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.addMonths(1);
+ * dtm.toString();
+ * @result 'Tue Feb 12 2008 00:00:00'
+ *
+ * @name addMonths
+ * @type Date
+ * @cat Plugins/Methods/Date
+ */
+ add("addMonths", function(num) {
+ var tmpdtm = this.getDate();
+
+ this.setMonth(this.getMonth() + num);
+
+ if (tmpdtm > this.getDate())
+ this.addDays(-this.getDate());
+
+ return this;
+ });
+
+ /**
+ * Add a number of days to the date object.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.addDays(1);
+ * dtm.toString();
+ * @result 'Sun Jan 13 2008 00:00:00'
+ *
+ * @name addDays
+ * @type Date
+ * @cat Plugins/Methods/Date
+ */
+ add("addDays", function(num) {
+ //this.setDate(this.getDate() + num);
+ this.setTime(this.getTime() + (num*86400000) );
+ return this;
+ });
+
+ /**
+ * Add a number of hours to the date object.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.addHours(24);
+ * dtm.toString();
+ * @result 'Sun Jan 13 2008 00:00:00'
+ *
+ * @name addHours
+ * @type Date
+ * @cat Plugins/Methods/Date
+ */
+ add("addHours", function(num) {
+ this.setHours(this.getHours() + num);
+ return this;
+ });
+
+ /**
+ * Add a number of minutes to the date object.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.addMinutes(60);
+ * dtm.toString();
+ * @result 'Sat Jan 12 2008 01:00:00'
+ *
+ * @name addMinutes
+ * @type Date
+ * @cat Plugins/Methods/Date
+ */
+ add("addMinutes", function(num) {
+ this.setMinutes(this.getMinutes() + num);
+ return this;
+ });
+
+ /**
+ * Add a number of seconds to the date object.
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.addSeconds(60);
+ * dtm.toString();
+ * @result 'Sat Jan 12 2008 00:01:00'
+ *
+ * @name addSeconds
+ * @type Date
+ * @cat Plugins/Methods/Date
+ */
+ add("addSeconds", function(num) {
+ this.setSeconds(this.getSeconds() + num);
+ return this;
+ });
+
+ /**
+ * Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant.
+ *
+ * @example var dtm = new Date();
+ * dtm.zeroTime();
+ * dtm.toString();
+ * @result 'Sat Jan 12 2008 00:01:00'
+ *
+ * @name zeroTime
+ * @type Date
+ * @cat Plugins/Methods/Date
+ * @author Kelvin Luck
+ */
+ add("zeroTime", function() {
+ this.setMilliseconds(0);
+ this.setSeconds(0);
+ this.setMinutes(0);
+ this.setHours(0);
+ return this;
+ });
+
+ /**
+ * Returns a string representation of the date object according to Date.format.
+ * (Date.toString may be used in other places so I purposefully didn't overwrite it)
+ *
+ * @example var dtm = new Date("01/12/2008");
+ * dtm.asString();
+ * @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy'
+ *
+ * @name asString
+ * @type Date
+ * @cat Plugins/Methods/Date
+ * @author Kelvin Luck
+ */
+ add("asString", function(format) {
+ var r = format || Date.format;
+ return r
+ .split('yyyy').join(this.getFullYear())
+ .split('yy').join((this.getFullYear() + '').substring(2))
+ .split('mmmm').join(this.getMonthName(false))
+ .split('mmm').join(this.getMonthName(true))
+ .split('mm').join(_zeroPad(this.getMonth()+1))
+ .split('dd').join(_zeroPad(this.getDate()))
+ .split('hh').join(_zeroPad(this.getHours()))
+ .split('min').join(_zeroPad(this.getMinutes()))
+ .split('ss').join(_zeroPad(this.getSeconds()));
+ });
+
+ /**
+ * Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object
+ * (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere)
+ *
+ * @example var dtm = Date.fromString("12/01/2008");
+ * dtm.toString();
+ * @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy'
+ *
+ * @name fromString
+ * @type Date
+ * @cat Plugins/Methods/Date
+ * @author Kelvin Luck
+ */
+ Date.fromString = function(s, format)
+ {
+ var f = format || Date.format;
+ var d = new Date('01/01/1977');
+
+ var mLength = 0;
+
+ var iM = f.indexOf('mmmm');
+ if (iM > -1) {
+ for (var i=0; i -1) {
+ var mStr = s.substr(iM, 3);
+ for (var i=0; i -1) {
+ if (iM < iY)
+ {
+ iY += mLength;
+ }
+ d.setFullYear(Number(s.substr(iY, 4)));
+ } else {
+ if (iM < iY)
+ {
+ iY += mLength;
+ }
+ // TODO - this doesn't work very well - are there any rules for what is meant by a two digit year?
+ d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2)));
+ }
+ var iD = f.indexOf('dd');
+ if (iM < iD)
+ {
+ iD += mLength;
+ }
+ d.setDate(Number(s.substr(iD, 2)));
+ if (isNaN(d.getTime())) {
+ return false;
+ }
+ return d;
+ };
+
+ // utility method
+ var _zeroPad = function(num) {
+ var s = '0'+num;
+ return s.substring(s.length-2)
+ //return ('0'+num).substring(-2); // doesn't work on IE :(
+ };
+
+})();;/**
+ * Copyright (c) 2008 Kelvin Luck (http://www.kelvinluck.com/)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ * .
+ * $Id: jquery.datePicker.js 102 2010-09-13 14:00:54Z kelvin.luck $
+ **/
+
+(function($){
+
+ $.fn.extend({
+/**
+ * Render a calendar table into any matched elements.
+ *
+ * @param Object s (optional) Customize your calendars.
+ * @option Number month The month to render (NOTE that months are zero based). Default is today's month.
+ * @option Number year The year to render. Default is today's year.
+ * @option Function renderCallback A reference to a function that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Default is no callback.
+ * @option Number showHeader Whether or not to show the header row, possible values are: $.dpConst.SHOW_HEADER_NONE (no header), $.dpConst.SHOW_HEADER_SHORT (first letter of each day) and $.dpConst.SHOW_HEADER_LONG (full name of each day). Default is $.dpConst.SHOW_HEADER_SHORT.
+ * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
+ * @type jQuery
+ * @name renderCalendar
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('#calendar-me').renderCalendar({month:0, year:2007});
+ * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me.
+ *
+ * @example
+ * var testCallback = function($td, thisDate, month, year)
+ * {
+ * if ($td.is('.current-month') && thisDate.getDay() == 4) {
+ * var d = thisDate.getDate();
+ * $td.bind(
+ * 'click',
+ * function()
+ * {
+ * alert('You clicked on ' + d + '/' + (Number(month)+1) + '/' + year);
+ * }
+ * ).addClass('thursday');
+ * } else if (thisDate.getDay() == 5) {
+ * $td.html('Friday the ' + $td.html() + 'th');
+ * }
+ * }
+ * $('#calendar-me').renderCalendar({month:0, year:2007, renderCallback:testCallback});
+ *
+ * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. Every Thursday in the current month has a class of "thursday" applied to it, is clickable and shows an alert when clicked. Every Friday on the calendar has the number inside replaced with text.
+ **/
+ renderCalendar : function(s)
+ {
+ var dc = function(a)
+ {
+ return document.createElement(a);
+ };
+
+ s = $.extend({}, $.fn.datePicker.defaults, s);
+
+ if (s.showHeader != $.dpConst.SHOW_HEADER_NONE) {
+ var headRow = $(dc('tr'));
+ for (var i=Date.firstDayOfWeek; i 1) firstDayOffset -= 7;
+ var weeksToDraw = Math.ceil(( (-1*firstDayOffset+1) + currentDate.getDaysInMonth() ) /7);
+ currentDate.addDays(firstDayOffset-1);
+
+ var doHover = function(firstDayInBounds)
+ {
+ return function()
+ {
+ if (s.hoverClass) {
+ var $this = $(this);
+ if (!s.selectWeek) {
+ $this.addClass(s.hoverClass);
+ } else if (firstDayInBounds && !$this.is('.disabled')) {
+ $this.parent().addClass('activeWeekHover');
+ }
+ }
+ }
+ };
+ var unHover = function()
+ {
+ if (s.hoverClass) {
+ var $this = $(this);
+ $this.removeClass(s.hoverClass);
+ $this.parent().removeClass('activeWeekHover');
+ }
+ };
+
+ var w = 0;
+ while (w++ s.dpController.startDate : false;
+ for (var i=0; i<7; i++) {
+ var thisMonth = currentDate.getMonth() == month;
+ var d = $(dc('td'))
+ .text(currentDate.getDate() + '')
+ .addClass((thisMonth ? 'current-month ' : 'other-month ') +
+ (currentDate.isWeekend() ? 'weekend ' : 'weekday ') +
+ (thisMonth && currentDate.getTime() == today.getTime() ? 'today ' : '')
+ )
+ .data('datePickerDate', currentDate.asString())
+ .hover(doHover(firstDayInBounds), unHover)
+ ;
+ r.append(d);
+ if (s.renderCallback) {
+ s.renderCallback(d, currentDate, month, year);
+ }
+ // addDays(1) fails in some locales due to daylight savings. See issue 39.
+ //currentDate.addDays(1);
+ // set the time to midday to avoid any weird timezone issues??
+ currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()+1, 12, 0, 0);
+ }
+ tbody.append(r);
+ }
+ calendarTable.append(tbody);
+
+ return this.each(
+ function()
+ {
+ $(this).empty().append(calendarTable);
+ }
+ );
+ },
+/**
+ * Create a datePicker associated with each of the matched elements.
+ *
+ * The matched element will receive a few custom events with the following signatures:
+ *
+ * dateSelected(event, date, $td, status)
+ * Triggered when a date is selected. event is a reference to the event, date is the Date selected, $td is a jquery object wrapped around the TD that was clicked on and status is whether the date was selected (true) or deselected (false)
+ *
+ * dpClosed(event, selected)
+ * Triggered when the date picker is closed. event is a reference to the event and selected is an Array containing Date objects.
+ *
+ * dpMonthChanged(event, displayedMonth, displayedYear)
+ * Triggered when the month of the popped up calendar is changed. event is a reference to the event, displayedMonth is the number of the month now displayed (zero based) and displayedYear is the year of the month.
+ *
+ * dpDisplayed(event, $datePickerDiv)
+ * Triggered when the date picker is created. $datePickerDiv is the div containing the date picker. Use this event to add custom content/ listeners to the popped up date picker.
+ *
+ * @param Object s (optional) Customize your date pickers.
+ * @option Number month The month to render when the date picker is opened (NOTE that months are zero based). Default is today's month.
+ * @option Number year The year to render when the date picker is opened. Default is today's year.
+ * @option String startDate The first date date can be selected.
+ * @option String endDate The last date that can be selected.
+ * @option Boolean inline Whether to create the datePicker as inline (e.g. always on the page) or as a model popup. Default is false (== modal popup)
+ * @option Boolean createButton Whether to create a .dp-choose-date anchor directly after the matched element which when clicked will trigger the showing of the date picker. Default is true.
+ * @option Boolean showYearNavigation Whether to display buttons which allow the user to navigate through the months a year at a time. Default is true.
+ * @option Boolean closeOnSelect Whether to close the date picker when a date is selected. Default is true.
+ * @option Boolean displayClose Whether to create a "Close" button within the date picker popup. Default is false.
+ * @option Boolean selectMultiple Whether a user should be able to select multiple dates with this date picker. Default is false.
+ * @option Number numSelectable The maximum number of dates that can be selected where selectMultiple is true. Default is a very high number.
+ * @option Boolean clickInput If the matched element is an input type="text" and this option is true then clicking on the input will cause the date picker to appear.
+ * @option Boolean rememberViewedMonth Whether the datePicker should remember the last viewed month and open on it. If false then the date picker will always open with the month for the first selected date visible.
+ * @option Boolean selectWeek Whether to select a complete week at a time...
+ * @option Number verticalPosition The vertical alignment of the popped up date picker to the matched element. One of $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM. Default is $.dpConst.POS_TOP.
+ * @option Number horizontalPosition The horizontal alignment of the popped up date picker to the matched element. One of $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT.
+ * @option Number verticalOffset The number of pixels offset from the defined verticalPosition of this date picker that it should pop up in. Default in 0.
+ * @option Number horizontalOffset The number of pixels offset from the defined horizontalPosition of this date picker that it should pop up in. Default in 0.
+ * @option (Function|Array) renderCallback A reference to a function (or an array of separate functions) that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Each callback function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year. Default is no callback.
+ * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
+ * @option String autoFocusNextInput Whether focus should be passed onto the next input in the form (true) or remain on this input (false) when a date is selected and the calendar closes
+ * @type jQuery
+ * @name datePicker
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('input.date-picker').datePicker();
+ * @desc Creates a date picker button next to all matched input elements. When the button is clicked on the value of the selected date will be placed in the corresponding input (formatted according to Date.format).
+ *
+ * @example demo/index.html
+ * @desc See the projects homepage for many more complex examples...
+ **/
+ datePicker : function(s)
+ {
+ if (!$.event._dpCache) $.event._dpCache = [];
+
+ // initialise the date picker controller with the relevant settings...
+ s = $.extend({}, $.fn.datePicker.defaults, s);
+
+ return this.each(
+ function()
+ {
+ var $this = $(this);
+ var alreadyExists = true;
+
+ if (!this._dpId) {
+ this._dpId = $.event.guid++;
+ $.event._dpCache[this._dpId] = new DatePicker(this);
+ alreadyExists = false;
+ }
+
+ if (s.inline) {
+ s.createButton = false;
+ s.displayClose = false;
+ s.closeOnSelect = false;
+ $this.empty();
+ }
+
+ var controller = $.event._dpCache[this._dpId];
+
+ controller.init(s);
+
+ if (!alreadyExists && s.createButton) {
+ // create it!
+ controller.button = $('' + $.dpText.TEXT_CHOOSE_DATE + '')
+ .bind(
+ 'click',
+ function()
+ {
+ $this.dpDisplay(this);
+ this.blur();
+ return false;
+ }
+ );
+ $this.after(controller.button);
+ }
+
+ if (!alreadyExists && $this.is(':text')) {
+ $this
+ .bind(
+ 'dateSelected',
+ function(e, selectedDate, $td)
+ {
+ this.value = selectedDate.asString();
+ }
+ ).bind(
+ 'change',
+ function()
+ {
+ if (this.value == '') {
+ controller.clearSelected();
+ } else {
+ var d = Date.fromString(this.value);
+ if (d) {
+ controller.setSelected(d, true, true);
+ }
+ }
+ }
+ );
+ if (s.clickInput) {
+ $this.bind(
+ 'click',
+ function()
+ {
+ // The change event doesn't happen until the input loses focus so we need to manually trigger it...
+ $this.trigger('change');
+ $this.dpDisplay();
+ }
+ );
+ }
+ var d = Date.fromString(this.value);
+ if (this.value != '' && d) {
+ controller.setSelected(d, true, true);
+ }
+ }
+
+ $this.addClass('dp-applied');
+
+ }
+ )
+ },
+/**
+ * Disables or enables this date picker
+ *
+ * @param Boolean s Whether to disable (true) or enable (false) this datePicker
+ * @type jQuery
+ * @name dpSetDisabled
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('.date-picker').datePicker();
+ * $('.date-picker').dpSetDisabled(true);
+ * @desc Prevents this date picker from displaying and adds a class of dp-disabled to it (and it's associated button if it has one) for styling purposes. If the matched element is an input field then it will also set the disabled attribute to stop people directly editing the field.
+ **/
+ dpSetDisabled : function(s)
+ {
+ return _w.call(this, 'setDisabled', s);
+ },
+/**
+ * Updates the first selectable date for any date pickers on any matched elements.
+ *
+ * @param String d A string representing the first selectable date (formatted according to Date.format).
+ * @type jQuery
+ * @name dpSetStartDate
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('.date-picker').datePicker();
+ * $('.date-picker').dpSetStartDate('01/01/2000');
+ * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the first selectable date for each of these to the first day of the millenium.
+ **/
+ dpSetStartDate : function(d)
+ {
+ return _w.call(this, 'setStartDate', d);
+ },
+/**
+ * Updates the last selectable date for any date pickers on any matched elements.
+ *
+ * @param String d A string representing the last selectable date (formatted according to Date.format).
+ * @type jQuery
+ * @name dpSetEndDate
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('.date-picker').datePicker();
+ * $('.date-picker').dpSetEndDate('01/01/2010');
+ * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the last selectable date for each of these to the first Janurary 2010.
+ **/
+ dpSetEndDate : function(d)
+ {
+ return _w.call(this, 'setEndDate', d);
+ },
+/**
+ * Gets a list of Dates currently selected by this datePicker. This will be an empty array if no dates are currently selected or NULL if there is no datePicker associated with the matched element.
+ *
+ * @type Array
+ * @name dpGetSelected
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('.date-picker').datePicker();
+ * alert($('.date-picker').dpGetSelected());
+ * @desc Will alert an empty array (as nothing is selected yet)
+ **/
+ dpGetSelected : function()
+ {
+ var c = _getController(this[0]);
+ if (c) {
+ return c.getSelected();
+ }
+ return null;
+ },
+/**
+ * Selects or deselects a date on any matched element's date pickers. Deselcting is only useful on date pickers where selectMultiple==true. Selecting will only work if the passed date is within the startDate and endDate boundries for a given date picker.
+ *
+ * @param String d A string representing the date you want to select (formatted according to Date.format).
+ * @param Boolean v Whether you want to select (true) or deselect (false) this date. Optional - default = true.
+ * @param Boolean m Whether you want the date picker to open up on the month of this date when it is next opened. Optional - default = true.
+ * @param Boolean e Whether you want the date picker to dispatch events related to this change of selection. Optional - default = true.
+ * @type jQuery
+ * @name dpSetSelected
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('.date-picker').datePicker();
+ * $('.date-picker').dpSetSelected('01/01/2010');
+ * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010.
+ **/
+ dpSetSelected : function(d, v, m, e)
+ {
+ if (v == undefined) v=true;
+ if (m == undefined) m=true;
+ if (e == undefined) e=true;
+ return _w.call(this, 'setSelected', Date.fromString(d), v, m, e);
+ },
+/**
+ * Sets the month that will be displayed when the date picker is next opened. If the passed month is before startDate then the month containing startDate will be displayed instead. If the passed month is after endDate then the month containing the endDate will be displayed instead.
+ *
+ * @param Number m The month you want the date picker to display. Optional - defaults to the currently displayed month.
+ * @param Number y The year you want the date picker to display. Optional - defaults to the currently displayed year.
+ * @type jQuery
+ * @name dpSetDisplayedMonth
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('.date-picker').datePicker();
+ * $('.date-picker').dpSetDisplayedMonth(10, 2008);
+ * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010.
+ **/
+ dpSetDisplayedMonth : function(m, y)
+ {
+ return _w.call(this, 'setDisplayedMonth', Number(m), Number(y), true);
+ },
+/**
+ * Displays the date picker associated with the matched elements. Since only one date picker can be displayed at once then the date picker associated with the last matched element will be the one that is displayed.
+ *
+ * @param HTMLElement e An element that you want the date picker to pop up relative in position to. Optional - default behaviour is to pop up next to the element associated with this date picker.
+ * @type jQuery
+ * @name dpDisplay
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('#date-picker').datePicker();
+ * $('#date-picker').dpDisplay();
+ * @desc Creates a date picker associated with the element with an id of date-picker and then causes it to pop up.
+ **/
+ dpDisplay : function(e)
+ {
+ return _w.call(this, 'display', e);
+ },
+/**
+ * Sets a function or array of functions that is called when each TD of the date picker popup is rendered to the page
+ *
+ * @param (Function|Array) a A function or an array of functions that are called when each td is rendered. Each function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year.
+ * @type jQuery
+ * @name dpSetRenderCallback
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('#date-picker').datePicker();
+ * $('#date-picker').dpSetRenderCallback(function($td, thisDate, month, year)
+ * {
+ * // do stuff as each td is rendered dependant on the date in the td and the displayed month and year
+ * });
+ * @desc Creates a date picker associated with the element with an id of date-picker and then creates a function which is called as each td is rendered when this date picker is displayed.
+ **/
+ dpSetRenderCallback : function(a)
+ {
+ return _w.call(this, 'setRenderCallback', a);
+ },
+/**
+ * Sets the position that the datePicker will pop up (relative to it's associated element)
+ *
+ * @param Number v The vertical alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM
+ * @param Number h The horizontal alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT
+ * @type jQuery
+ * @name dpSetPosition
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('#date-picker').datePicker();
+ * $('#date-picker').dpSetPosition($.dpConst.POS_BOTTOM, $.dpConst.POS_RIGHT);
+ * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be bottom and right aligned to the #date-picker element.
+ **/
+ dpSetPosition : function(v, h)
+ {
+ return _w.call(this, 'setPosition', v, h);
+ },
+/**
+ * Sets the offset that the popped up date picker will have from it's default position relative to it's associated element (as set by dpSetPosition)
+ *
+ * @param Number v The vertical offset of the created date picker.
+ * @param Number h The horizontal offset of the created date picker.
+ * @type jQuery
+ * @name dpSetOffset
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('#date-picker').datePicker();
+ * $('#date-picker').dpSetOffset(-20, 200);
+ * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be 20 pixels above and 200 pixels to the right of it's default position.
+ **/
+ dpSetOffset : function(v, h)
+ {
+ return _w.call(this, 'setOffset', v, h);
+ },
+/**
+ * Closes the open date picker associated with this element.
+ *
+ * @type jQuery
+ * @name dpClose
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ * @example $('.date-pick')
+ * .datePicker()
+ * .bind(
+ * 'focus',
+ * function()
+ * {
+ * $(this).dpDisplay();
+ * }
+ * ).bind(
+ * 'blur',
+ * function()
+ * {
+ * $(this).dpClose();
+ * }
+ * );
+ **/
+ dpClose : function()
+ {
+ return _w.call(this, '_closeCalendar', false, this[0]);
+ },
+/**
+ * Rerenders the date picker's current month (for use with inline calendars and renderCallbacks).
+ *
+ * @type jQuery
+ * @name dpRerenderCalendar
+ * @cat plugins/datePicker
+ * @author Kelvin Luck (http://www.kelvinluck.com/)
+ *
+ **/
+ dpRerenderCalendar : function()
+ {
+ return _w.call(this, '_rerenderCalendar');
+ },
+ // private function called on unload to clean up any expandos etc and prevent memory links...
+ _dpDestroy : function()
+ {
+ // TODO - implement this?
+ }
+ });
+
+ // private internal function to cut down on the amount of code needed where we forward
+ // dp* methods on the jQuery object on to the relevant DatePicker controllers...
+ var _w = function(f, a1, a2, a3, a4)
+ {
+ return this.each(
+ function()
+ {
+ var c = _getController(this);
+ if (c) {
+ c[f](a1, a2, a3, a4);
+ }
+ }
+ );
+ };
+
+ function DatePicker(ele)
+ {
+ this.ele = ele;
+
+ // initial values...
+ this.displayedMonth = null;
+ this.displayedYear = null;
+ this.startDate = null;
+ this.endDate = null;
+ this.showYearNavigation = null;
+ this.closeOnSelect = null;
+ this.displayClose = null;
+ this.rememberViewedMonth= null;
+ this.selectMultiple = null;
+ this.numSelectable = null;
+ this.numSelected = null;
+ this.verticalPosition = null;
+ this.horizontalPosition = null;
+ this.verticalOffset = null;
+ this.horizontalOffset = null;
+ this.button = null;
+ this.renderCallback = [];
+ this.selectedDates = {};
+ this.inline = null;
+ this.context = '#dp-popup';
+ this.settings = {};
+ };
+ $.extend(
+ DatePicker.prototype,
+ {
+ init : function(s)
+ {
+ this.setStartDate(s.startDate);
+ this.setEndDate(s.endDate);
+ this.setDisplayedMonth(Number(s.month), Number(s.year));
+ this.setRenderCallback(s.renderCallback);
+ this.showYearNavigation = s.showYearNavigation;
+ this.closeOnSelect = s.closeOnSelect;
+ this.displayClose = s.displayClose;
+ this.rememberViewedMonth = s.rememberViewedMonth;
+ this.selectMultiple = s.selectMultiple;
+ this.numSelectable = s.selectMultiple ? s.numSelectable : 1;
+ this.numSelected = 0;
+ this.verticalPosition = s.verticalPosition;
+ this.horizontalPosition = s.horizontalPosition;
+ this.hoverClass = s.hoverClass;
+ this.setOffset(s.verticalOffset, s.horizontalOffset);
+ this.inline = s.inline;
+ this.settings = s;
+ if (this.inline) {
+ this.context = this.ele;
+ this.display();
+ }
+ },
+ setStartDate : function(d)
+ {
+ if (d) {
+ this.startDate = Date.fromString(d);
+ }
+ if (!this.startDate) {
+ this.startDate = (new Date()).zeroTime();
+ }
+ this.setDisplayedMonth(this.displayedMonth, this.displayedYear);
+ },
+ setEndDate : function(d)
+ {
+ if (d) {
+ this.endDate = Date.fromString(d);
+ }
+ if (!this.endDate) {
+ this.endDate = (new Date('12/31/2999')); // using the JS Date.parse function which expects mm/dd/yyyy
+ }
+ if (this.endDate.getTime() < this.startDate.getTime()) {
+ this.endDate = this.startDate;
+ }
+ this.setDisplayedMonth(this.displayedMonth, this.displayedYear);
+ },
+ setPosition : function(v, h)
+ {
+ this.verticalPosition = v;
+ this.horizontalPosition = h;
+ },
+ setOffset : function(v, h)
+ {
+ this.verticalOffset = parseInt(v) || 0;
+ this.horizontalOffset = parseInt(h) || 0;
+ },
+ setDisabled : function(s)
+ {
+ $e = $(this.ele);
+ $e[s ? 'addClass' : 'removeClass']('dp-disabled');
+ if (this.button) {
+ $but = $(this.button);
+ $but[s ? 'addClass' : 'removeClass']('dp-disabled');
+ $but.attr('title', s ? '' : $.dpText.TEXT_CHOOSE_DATE);
+ }
+ if ($e.is(':text')) {
+ $e.attr('disabled', s ? 'disabled' : '');
+ }
+ },
+ setDisplayedMonth : function(m, y, rerender)
+ {
+ if (this.startDate == undefined || this.endDate == undefined) {
+ return;
+ }
+ var s = new Date(this.startDate.getTime());
+ s.setDate(1);
+ var e = new Date(this.endDate.getTime());
+ e.setDate(1);
+
+ var t;
+ if ((!m && !y) || (isNaN(m) && isNaN(y))) {
+ // no month or year passed - default to current month
+ t = new Date().zeroTime();
+ t.setDate(1);
+ } else if (isNaN(m)) {
+ // just year passed in - presume we want the displayedMonth
+ t = new Date(y, this.displayedMonth, 1);
+ } else if (isNaN(y)) {
+ // just month passed in - presume we want the displayedYear
+ t = new Date(this.displayedYear, m, 1);
+ } else {
+ // year and month passed in - that's the date we want!
+ t = new Date(y, m, 1)
+ }
+ // check if the desired date is within the range of our defined startDate and endDate
+ if (t.getTime() < s.getTime()) {
+ t = s;
+ } else if (t.getTime() > e.getTime()) {
+ t = e;
+ }
+ var oldMonth = this.displayedMonth;
+ var oldYear = this.displayedYear;
+ this.displayedMonth = t.getMonth();
+ this.displayedYear = t.getFullYear();
+
+ if (rerender && (this.displayedMonth != oldMonth || this.displayedYear != oldYear))
+ {
+ this._rerenderCalendar();
+ $(this.ele).trigger('dpMonthChanged', [this.displayedMonth, this.displayedYear]);
+ }
+ },
+ setSelected : function(d, v, moveToMonth, dispatchEvents)
+ {
+ if (d < this.startDate || d.zeroTime() > this.endDate.zeroTime()) {
+ // Don't allow people to select dates outside range...
+ return;
+ }
+ var s = this.settings;
+ if (s.selectWeek)
+ {
+ d = d.addDays(- (d.getDay() - Date.firstDayOfWeek + 7) % 7);
+ if (d < this.startDate) // The first day of this week is before the start date so is unselectable...
+ {
+ return;
+ }
+ }
+ if (v == this.isSelected(d)) // this date is already un/selected
+ {
+ return;
+ }
+ if (this.selectMultiple == false) {
+ this.clearSelected();
+ } else if (v && this.numSelected == this.numSelectable) {
+ // can't select any more dates...
+ return;
+ }
+ if (moveToMonth && (this.displayedMonth != d.getMonth() || this.displayedYear != d.getFullYear())) {
+ this.setDisplayedMonth(d.getMonth(), d.getFullYear(), true);
+ }
+ this.selectedDates[d.asString()] = v;
+ this.numSelected += v ? 1 : -1;
+ var selectorString = 'td.' + (d.getMonth() == this.displayedMonth ? 'current-month' : 'other-month');
+ var $td;
+ $(selectorString, this.context).each(
+ function()
+ {
+ if ($(this).data('datePickerDate') == d.asString()) {
+ $td = $(this);
+ if (s.selectWeek)
+ {
+ $td.parent()[v ? 'addClass' : 'removeClass']('selectedWeek');
+ }
+ $td[v ? 'addClass' : 'removeClass']('selected');
+ }
+ }
+ );
+ $('td', this.context).not('.selected')[this.selectMultiple && this.numSelected == this.numSelectable ? 'addClass' : 'removeClass']('unselectable');
+
+ if (dispatchEvents)
+ {
+ var s = this.isSelected(d);
+ $e = $(this.ele);
+ var dClone = Date.fromString(d.asString());
+ $e.trigger('dateSelected', [dClone, $td, s]);
+ $e.trigger('change');
+ }
+ },
+ isSelected : function(d)
+ {
+ return this.selectedDates[d.asString()];
+ },
+ getSelected : function()
+ {
+ var r = [];
+ for(var s in this.selectedDates) {
+ if (this.selectedDates[s] == true) {
+ r.push(Date.fromString(s));
+ }
+ }
+ return r;
+ },
+ clearSelected : function()
+ {
+ this.selectedDates = {};
+ this.numSelected = 0;
+ $('td.selected', this.context).removeClass('selected').parent().removeClass('selectedWeek');
+ },
+ display : function(eleAlignTo)
+ {
+ if ($(this.ele).is('.dp-disabled')) return;
+
+ eleAlignTo = eleAlignTo || this.ele;
+ var c = this;
+ var $ele = $(eleAlignTo);
+ var eleOffset = $ele.offset();
+
+ var $createIn;
+ var attrs;
+ var attrsCalendarHolder;
+ var cssRules;
+
+ if (c.inline) {
+ $createIn = $(this.ele);
+ attrs = {
+ 'id' : 'calendar-' + this.ele._dpId,
+ 'class' : 'dp-popup dp-popup-inline'
+ };
+
+ $('.dp-popup', $createIn).remove();
+ cssRules = {
+ };
+ } else {
+ $createIn = $('body');
+ attrs = {
+ 'id' : 'dp-popup',
+ 'class' : 'dp-popup'
+ };
+ cssRules = {
+ 'top' : eleOffset.top + c.verticalOffset,
+ 'left' : eleOffset.left + c.horizontalOffset
+ };
+
+ var _checkMouse = function(e)
+ {
+ var el = e.target;
+ var cal = $('#dp-popup')[0];
+
+ while (true){
+ if (el == cal) {
+ return true;
+ } else if (el == document) {
+ c._closeCalendar();
+ return false;
+ } else {
+ el = $(el).parent()[0];
+ }
+ }
+ };
+ this._checkMouse = _checkMouse;
+
+ c._closeCalendar(true);
+ $(document).bind(
+ 'keydown.datepicker',
+ function(event)
+ {
+ if (event.keyCode == 27) {
+ c._closeCalendar();
+ }
+ }
+ );
+ }
+
+ if (!c.rememberViewedMonth)
+ {
+ var selectedDate = this.getSelected()[0];
+ if (selectedDate) {
+ selectedDate = new Date(selectedDate);
+ this.setDisplayedMonth(selectedDate.getMonth(), selectedDate.getFullYear(), false);
+ }
+ }
+
+ $createIn
+ .append(
+ $('')
+ .attr(attrs)
+ .css(cssRules)
+ .append(
+// $('aaa'),
+ $(''),
+ $('')
+ .append(
+ $('<<')
+ .bind(
+ 'click',
+ function()
+ {
+ return c._displayNewMonth.call(c, this, 0, -1);
+ }
+ ),
+ $('<')
+ .bind(
+ 'click',
+ function()
+ {
+ return c._displayNewMonth.call(c, this, -1, 0);
+ }
+ )
+ ),
+ $('')
+ .append(
+ $('>>')
+ .bind(
+ 'click',
+ function()
+ {
+ return c._displayNewMonth.call(c, this, 0, 1);
+ }
+ ),
+ $('>')
+ .bind(
+ 'click',
+ function()
+ {
+ return c._displayNewMonth.call(c, this, 1, 0);
+ }
+ )
+ ),
+ $('')
+ )
+ .bgIframe()
+ );
+
+ var $pop = this.inline ? $('.dp-popup', this.context) : $('#dp-popup');
+
+ if (this.showYearNavigation == false) {
+ $('.dp-nav-prev-year, .dp-nav-next-year', c.context).css('display', 'none');
+ }
+ if (this.displayClose) {
+ $pop.append(
+ $('' + $.dpText.TEXT_CLOSE + '')
+ .bind(
+ 'click',
+ function()
+ {
+ c._closeCalendar();
+ return false;
+ }
+ )
+ );
+ }
+ c._renderCalendar();
+
+ $(this.ele).trigger('dpDisplayed', $pop);
+
+ if (!c.inline) {
+ if (this.verticalPosition == $.dpConst.POS_BOTTOM) {
+ $pop.css('top', eleOffset.top + $ele.height() - $pop.height() + c.verticalOffset);
+ }
+ if (this.horizontalPosition == $.dpConst.POS_RIGHT) {
+ $pop.css('left', eleOffset.left + $ele.width() - $pop.width() + c.horizontalOffset);
+ }
+// $('.selectee', this.context).focus();
+ $(document).bind('mousedown.datepicker', this._checkMouse);
+ }
+
+ },
+ setRenderCallback : function(a)
+ {
+ if (a == null) return;
+ if (a && typeof(a) == 'function') {
+ a = [a];
+ }
+ this.renderCallback = this.renderCallback.concat(a);
+ },
+ cellRender : function ($td, thisDate, month, year) {
+ var c = this.dpController;
+ var d = new Date(thisDate.getTime());
+
+ // add our click handlers to deal with it when the days are clicked...
+
+ $td.bind(
+ 'click',
+ function()
+ {
+ var $this = $(this);
+ if (!$this.is('.disabled')) {
+ c.setSelected(d, !$this.is('.selected') || !c.selectMultiple, false, true);
+ if (c.closeOnSelect) {
+ // Focus the next input in the form…
+ if (c.settings.autoFocusNextInput) {
+ var ele = c.ele;
+ var found = false;
+ $(':input', ele.form).each(
+ function()
+ {
+ if (found) {
+ $(this).focus();
+ return false;
+ }
+ if (this == ele) {
+ found = true;
+ }
+ }
+ );
+ } else {
+ c.ele.focus();
+ }
+ c._closeCalendar();
+ }
+ }
+ }
+ );
+ if (c.isSelected(d)) {
+ $td.addClass('selected');
+ if (c.settings.selectWeek)
+ {
+ $td.parent().addClass('selectedWeek');
+ }
+ } else if (c.selectMultiple && c.numSelected == c.numSelectable) {
+ $td.addClass('unselectable');
+ }
+
+ },
+ _applyRenderCallbacks : function()
+ {
+ var c = this;
+ $('td', this.context).each(
+ function()
+ {
+ for (var i=0; i 20) {
+ $this.addClass('disabled');
+ }
+ }
+ );
+ var d = this.startDate.getDate();
+ $('.dp-calendar td.current-month', this.context).each(
+ function()
+ {
+ var $this = $(this);
+ if (Number($this.text()) < d) {
+ $this.addClass('disabled');
+ }
+ }
+ );
+ } else {
+ $('.dp-nav-prev-year', this.context).removeClass('disabled');
+ $('.dp-nav-prev-month', this.context).removeClass('disabled');
+ var d = this.startDate.getDate();
+ if (d > 20) {
+ // check if the startDate is last month as we might need to add some disabled classes...
+ var st = this.startDate.getTime();
+ var sd = new Date(st);
+ sd.addMonths(1);
+ if (this.displayedYear == sd.getFullYear() && this.displayedMonth == sd.getMonth()) {
+ $('.dp-calendar td.other-month', this.context).each(
+ function()
+ {
+ var $this = $(this);
+ if (Date.fromString($this.data('datePickerDate')).getTime() < st) {
+ $this.addClass('disabled');
+ }
+ }
+ );
+ }
+ }
+ }
+ if (this.displayedYear == this.endDate.getFullYear() && this.displayedMonth == this.endDate.getMonth()) {
+ $('.dp-nav-next-year', this.context).addClass('disabled');
+ $('.dp-nav-next-month', this.context).addClass('disabled');
+ $('.dp-calendar td.other-month', this.context).each(
+ function()
+ {
+ var $this = $(this);
+ if (Number($this.text()) < 14) {
+ $this.addClass('disabled');
+ }
+ }
+ );
+ var d = this.endDate.getDate();
+ $('.dp-calendar td.current-month', this.context).each(
+ function()
+ {
+ var $this = $(this);
+ if (Number($this.text()) > d) {
+ $this.addClass('disabled');
+ }
+ }
+ );
+ } else {
+ $('.dp-nav-next-year', this.context).removeClass('disabled');
+ $('.dp-nav-next-month', this.context).removeClass('disabled');
+ var d = this.endDate.getDate();
+ if (d < 13) {
+ // check if the endDate is next month as we might need to add some disabled classes...
+ var ed = new Date(this.endDate.getTime());
+ ed.addMonths(-1);
+ if (this.displayedYear == ed.getFullYear() && this.displayedMonth == ed.getMonth()) {
+ $('.dp-calendar td.other-month', this.context).each(
+ function()
+ {
+ var $this = $(this);
+ var cellDay = Number($this.text());
+ if (cellDay < 13 && cellDay > d) {
+ $this.addClass('disabled');
+ }
+ }
+ );
+ }
+ }
+ }
+ this._applyRenderCallbacks();
+ },
+ _closeCalendar : function(programatic, ele)
+ {
+ if (!ele || ele == this.ele)
+ {
+ $(document).unbind('mousedown.datepicker');
+ $(document).unbind('keydown.datepicker');
+ this._clearCalendar();
+ $('#dp-popup a').unbind();
+ $('#dp-popup').empty().remove();
+ if (!programatic) {
+ $(this.ele).trigger('dpClosed', [this.getSelected()]);
+ }
+ }
+ },
+ // empties the current dp-calendar div and makes sure that all events are unbound
+ // and expandos removed to avoid memory leaks...
+ _clearCalendar : function()
+ {
+ // TODO.
+ $('.dp-calendar td', this.context).unbind();
+ $('.dp-calendar', this.context).empty();
+ }
+ }
+ );
+
+ // static constants
+ $.dpConst = {
+ SHOW_HEADER_NONE : 0,
+ SHOW_HEADER_SHORT : 1,
+ SHOW_HEADER_LONG : 2,
+ POS_TOP : 0,
+ POS_BOTTOM : 1,
+ POS_LEFT : 0,
+ POS_RIGHT : 1,
+ DP_INTERNAL_FOCUS : 'dpInternalFocusTrigger'
+ };
+ // localisable text
+ $.dpText = {
+ TEXT_PREV_YEAR : 'Previous year',
+ TEXT_PREV_MONTH : 'Previous month',
+ TEXT_NEXT_YEAR : 'Next year',
+ TEXT_NEXT_MONTH : 'Next month',
+ TEXT_CLOSE : 'Close',
+ TEXT_CHOOSE_DATE : 'Choose date',
+ HEADER_FORMAT : 'mmmm yyyy'
+ };
+ // version
+ $.dpVersion = '$Id: jquery.datePicker.js 102 2010-09-13 14:00:54Z kelvin.luck $';
+
+ $.fn.datePicker.defaults = {
+ month : undefined,
+ year : undefined,
+ showHeader : $.dpConst.SHOW_HEADER_SHORT,
+ startDate : undefined,
+ endDate : undefined,
+ inline : false,
+ renderCallback : null,
+ createButton : true,
+ showYearNavigation : true,
+ closeOnSelect : true,
+ displayClose : false,
+ selectMultiple : false,
+ numSelectable : Number.MAX_VALUE,
+ clickInput : false,
+ rememberViewedMonth : true,
+ selectWeek : false,
+ verticalPosition : $.dpConst.POS_TOP,
+ horizontalPosition : $.dpConst.POS_LEFT,
+ verticalOffset : 0,
+ horizontalOffset : 0,
+ hoverClass : 'dp-hover',
+ autoFocusNextInput : false
+ };
+
+ function _getController(ele)
+ {
+ if (ele._dpId) return $.event._dpCache[ele._dpId];
+ return false;
+ };
+
+ // make it so that no error is thrown if bgIframe plugin isn't included (allows you to use conditional
+ // comments to only include bgIframe where it is needed in IE without breaking this plugin).
+ if ($.fn.bgIframe == undefined) {
+ $.fn.bgIframe = function() {return this; };
+ };
+
+
+ // clean-up
+ $(window)
+ .bind('unload', function() {
+ var els = $.event._dpCache || [];
+ for (var i in els) {
+ $(els[i].ele)._dpDestroy();
+ }
+ });
+
+
+})(jQuery);;/*
+ * imgPreview jQuery plugin
+ * Copyright (c) 2009 James Padolsey
+ * j@qd9.co.uk | http://james.padolsey.com
+ * Dual licensed under MIT and GPL.
+ * Updated: 09/02/09
+ * @author James Padolsey
+ * @version 0.22
+ */
+(function($){
+
+ $.expr[':'].linkingToImage = function(elem, index, match){
+ // This will return true if the specified attribute contains a valid link to an image:
+ return !! ($(elem).attr(match[3]) && $(elem).attr(match[3]).match(/\.(gif|jpe?g|png|bmp)$/i));
+ };
+
+ $.fn.imgPreview = function(userDefinedSettings){
+
+ var s = $.extend({
+
+ /* DEFAULTS */
+
+ // CSS to be applied to image:
+ imgCSS: {},
+ // Distance between cursor and preview:
+ distanceFromCursor: {top:10, left:10},
+ // Boolean, whether or not to preload images:
+ preloadImages: true,
+ // Callback: run when link is hovered: container is shown:
+ onShow: function(){},
+ // Callback: container is hidden:
+ onHide: function(){},
+ // Callback: Run when image within container has loaded:
+ onLoad: function(){},
+ // ID to give to container (for CSS styling):
+ containerID: 'imgPreviewContainer',
+ // Class to be given to container while image is loading:
+ containerLoadingClass: 'loading',
+ // Prefix (if using thumbnails), e.g. 'thumb_'
+ thumbPrefix: '',
+ // Where to retrieve the image from:
+ srcAttr: 'href'
+
+ }, userDefinedSettings),
+
+ $container = $('').attr('id', s.containerID)
+ .append('').hide()
+ .css('position','absolute')
+ .appendTo('body'),
+
+ $img = $('img', $container).css(s.imgCSS),
+
+ // Get all valid elements (linking to images / ATTR with image link):
+ $collection = this.filter(':linkingToImage(' + s.srcAttr + ')');
+
+ // Re-usable means to add prefix (from setting):
+ function addPrefix(src) {
+ return src && src.replace(/(\/?)([^\/]+)$/,'$1' + s.thumbPrefix + '$2');
+ }
+
+ if (s.preloadImages) {
+ (function(i){
+ var tempIMG = new Image(),
+ callee = arguments.callee;
+ var src = $($collection[i]).attr(s.srcAttr)
+ if (src)
+ {
+ tempIMG.src = addPrefix(src);
+ tempIMG.onload = function(){
+ $collection[i + 1] && callee(i + 1);
+ };
+ }
+ })(0);
+ }
+
+ $collection
+ .mousemove(function(e){
+
+ $container.css({
+ top: e.pageY + s.distanceFromCursor.top + 'px',
+ left: e.pageX + s.distanceFromCursor.left + 'px'
+ });
+
+ })
+ .hover(function(){
+
+ var link = this;
+ $container
+ .addClass(s.containerLoadingClass)
+ .show();
+ $img
+ .load(function(){
+ $container.removeClass(s.containerLoadingClass);
+ $img.show();
+ s.onLoad.call($img[0], link);
+ })
+ .attr( 'src' , addPrefix($(link).attr(s.srcAttr)) );
+ s.onShow.call($container[0], link);
+
+ }, function(){
+
+ $container.hide();
+ $img.unbind('load').attr('src','').hide();
+ s.onHide.call($container[0], this);
+
+ });
+
+ // Return full selection, not $collection!
+ return this;
+
+ };
+
+})(jQuery);;function checkbox_click(event)
+{
+ event.stopPropagation();
+ do_email(enable_email.url);
+ if($(event.target).attr('checked'))
+ {
+ $(event.target).parent().parent().find("td").addClass('selected').css("backgroundColor","");
+ }
+ else
+ {
+ $(event.target).parent().parent().find("td").removeClass();
+ }
+}
+
+function enable_search(suggest_url,confirm_search_message,format_item)
+{
+ if (!format_item) {
+ format_item = function(results) {
+ return results[0];
+ };
+ }
+ //Keep track of enable_email has been called
+ if(!enable_search.enabled)
+ enable_search.enabled=true;
+
+ $('#search').click(function()
+ {
+ $(this).attr('value','');
+ });
+
+ $("#search").autocomplete(suggest_url,{max:100,delay:10, selectFirst: false, formatItem : format_item});
+ $("#search").result(function(event, data, formatted)
+ {
+ do_search(true);
+ });
+
+ attach_search_listener();
+
+ $('#search_form').submit(function(event)
+ {
+ event.preventDefault();
+ // reset page number when selecting a specific page number
+ $('#limit_from').val(0);
+ if(get_selected_values().length >0)
+ {
+ if(!confirm(confirm_search_message))
+ return;
+ }
+ do_search(true);
+ });
+}
+enable_search.enabled=false;
+
+function attach_search_listener()
+{
+ // prevent redirecting to link when search enabled
+ $("#pagination a").click(function(event) {
+ if ($("#search").val() || $("#search_form input:checked")) {
+ event.preventDefault();
+ // set limit_from to value included in the link
+ var uri_segments = event.currentTarget.href.split('/');
+ var limit_from = uri_segments.pop();
+ $('#limit_from').val(limit_from);
+ do_search(true);
+ }
+ });
+}
+
+function do_search(show_feedback,on_complete)
+{
+ //If search is not enabled, don't do anything
+ if(!enable_search.enabled)
+ return;
+
+ if(show_feedback)
+ $('#search').addClass("ac_loading");
+
+ $.post(
+ $('#search_form').attr('action'),
+ // serialize all the input fields in the form
+ $('#search_form').serialize(),
+ function(response) {
+ $('#sortable_table tbody').html(response.rows);
+ if(typeof on_complete=='function')
+ on_complete();
+ $('#search').removeClass("ac_loading");
+ //$('#spinner').hide();
+ //re-init elements in new table, as table tbody children were replaced
+ tb_init('#sortable_table a.thickbox');
+ $('#pagination').html(response.pagination);
+ $('#sortable_table tbody :checkbox').click(checkbox_click);
+ $("#select_all").attr('checked',false);
+ if (response.total_rows > 0)
+ {
+ update_sortable_table();
+ enable_row_selection();
+ }
+ attach_search_listener();
+ }, "json"
+ );
+}
+
+function enable_email(email_url)
+{
+ //Keep track of enable_email has been called
+ if(!enable_email.enabled)
+ enable_email.enabled=true;
+
+ //store url in function cache
+ if(!enable_email.url)
+ {
+ enable_email.url=email_url;
+ }
+
+ $('#select_all, #sortable_table tbody :checkbox').click(checkbox_click);
+}
+enable_email.enabled=false;
+enable_email.url=false;
+
+function do_email(url)
+{
+ //If email is not enabled, don't do anything
+ if(!enable_email.enabled)
+ return;
+
+ $.post(url, { 'ids[]': get_selected_values() },function(response)
+ {
+ $('#email').attr('href',response);
+ });
+
+}
+
+function enable_checkboxes()
+{
+ $('#sortable_table tbody :checkbox').click(checkbox_click);
+}
+
+function enable_delete(confirm_message,none_selected_message)
+{
+ //Keep track of enable_delete has been called
+ if(!enable_delete.enabled)
+ enable_delete.enabled=true;
+
+ $("#delete").click(function(event)
+ {
+ event.preventDefault();
+ if($("#sortable_table tbody :checkbox:checked").length >0)
+ {
+ if(confirm(confirm_message))
+ {
+ do_delete($(this).attr('href'));
+ }
+ }
+ else
+ {
+ alert(none_selected_message);
+ }
+ });
+}
+enable_delete.enabled=false;
+
+function do_delete(url)
+{
+ //If delete is not enabled, don't do anything
+ if(!enable_delete.enabled)
+ return;
+
+ var row_ids = get_selected_values();
+ var selected_rows = get_selected_rows();
+ $.post(url, { 'ids[]': row_ids },function(response)
+ {
+ //delete was successful, remove checkbox rows
+ if(response.success)
+ {
+ $(selected_rows).each(function(index, dom)
+ {
+ $(this).find("td").animate({backgroundColor:"green"},1200,"linear")
+ .end().animate({opacity:0},1200,"linear",function()
+ {
+ $(this).remove();
+ //Re-init sortable table as we removed a row
+ $("#sortable_table tbody tr").length > 0 && update_sortable_table();
+
+ });
+ });
+// for(index in response.ids) {
+// update_row(response.ids[index],url.replace(/[^\/]+$/,'get_row'));
+// }
+
+ set_feedback(response.message,'success_message',false);
+ }
+ else
+ {
+ set_feedback(response.message,'error_message',true);
+ }
+
+
+ },"json");
+}
+
+function enable_bulk_edit(none_selected_message)
+{
+ //Keep track of enable_bulk_edit has been called
+ if(!enable_bulk_edit.enabled)
+ enable_bulk_edit.enabled=true;
+
+ $('#bulk_edit').click(function(event)
+ {
+ event.preventDefault();
+ if($("#sortable_table tbody :checkbox:checked").length >0)
+ {
+ tb_show($(this).attr('title'),$(this).attr('href'),false);
+ $(this).blur();
+ }
+ else
+ {
+ alert(none_selected_message);
+ }
+ });
+}
+enable_bulk_edit.enabled=false;
+
+function enable_select_all()
+{
+ //Keep track of enable_select_all has been called
+ if(!enable_select_all.enabled)
+ enable_select_all.enabled=true;
+
+ $('#select_all').click(function()
+ {
+ if($(this).attr('checked'))
+ {
+ $("#sortable_table tbody :checkbox").each(function()
+ {
+ $(this).attr('checked',true);
+ $(this).parent().parent().find("td").addClass('selected').css("backgroundColor","");
+
+ });
+ }
+ else
+ {
+ $("#sortable_table tbody :checkbox").each(function()
+ {
+ $(this).attr('checked',false);
+ $(this).parent().parent().find("td").removeClass();
+ });
+ }
+ });
+}
+enable_select_all.enabled=false;
+
+function enable_row_selection(rows)
+{
+ //Keep track of enable_row_selection has been called
+ if(!enable_row_selection.enabled)
+ enable_row_selection.enabled=true;
+
+ if(typeof rows =="undefined")
+ rows=$("#sortable_table tbody tr");
+
+ rows.hover(
+ function row_over()
+ {
+ $(this).find("td").addClass('over').css("backgroundColor","");
+ $(this).css("cursor","pointer");
+ },
+
+ function row_out()
+ {
+ if(!$(this).find("td").hasClass("selected"))
+ {
+ $(this).find("td").removeClass();
+ }
+ }
+ );
+
+ rows.click(function row_click(event)
+ {
+
+ var checkbox = $(this).find(":checkbox");
+ checkbox.attr('checked',!checkbox.attr('checked'));
+ do_email(enable_email.url);
+
+ if(checkbox.attr('checked'))
+ {
+ $(this).find("td").addClass('selected').css("backgroundColor","");
+ }
+ else
+ {
+ $(this).find("td").removeClass();
+ }
+ });
+}
+enable_row_selection.enabled=false;
+
+function update_sortable_table()
+{
+ //let tablesorter know we changed and then triger a resort
+ $("#sortable_table").trigger("update");
+ if(typeof $("#sortable_table")[0].config!="undefined")
+ {
+ var sorting = $("#sortable_table")[0].config.sortList;
+ $("#sortable_table").trigger("sorton",[sorting]);
+ }
+}
+
+function get_table_row(id) {
+ id = id || $("input[name='sale_id']").val();
+ var $element = $("#sortable_table tbody :checkbox[value='" + id + "']");
+ if ($element.length === 0) {
+ $element = $("#sortable_table tbody a[href*='/" + id + "/']");
+ }
+ return $element;
+}
+
+function update_row(row_id,url,callback)
+{
+ $.post(url, { 'row_id': row_id },function(response)
+ {
+ //Replace previous row
+ var row_to_update = get_table_row(row_id).parent().parent();
+ row_to_update.replaceWith(response);
+ reinit_row(row_id);
+ hightlight_row(row_id);
+ callback && typeof(callback) == "function" && callback();
+ }, 'html');
+}
+
+function reinit_row(checkbox_id)
+{
+ var new_checkbox = $("#sortable_table tbody tr :checkbox[value="+checkbox_id+"]");
+ var new_row = new_checkbox.parent().parent();
+ enable_row_selection(new_row);
+ //Re-init some stuff as we replaced row
+ update_sortable_table();
+ tb_init(new_row.find("a.thickbox"));
+ //re-enable e-mail
+ new_checkbox.click(checkbox_click);
+}
+
+function animate_row(row,color)
+{
+ color = color || "#e1ffdd";
+ row.find("td").css("backgroundColor", "#ffffff").animate({backgroundColor:color},"slow","linear")
+ .animate({backgroundColor:color},5000)
+ .animate({backgroundColor:"#ffffff"},"slow","linear");
+}
+
+function hightlight_row(checkbox_id)
+{
+ var new_checkbox = $("#sortable_table tbody tr :checkbox[value="+checkbox_id+"]");
+ var new_row = new_checkbox.parent().parent();
+
+ animate_row(new_row);
+}
+
+function get_selected_values()
+{
+ var selected_values = new Array();
+ $("#sortable_table tbody :checkbox:checked").each(function()
+ {
+ selected_values.push($(this).val());
+ });
+ return selected_values;
+}
+
+function get_selected_rows()
+{
+ var selected_rows = new Array();
+ $("#sortable_table tbody :checkbox:checked").each(function()
+ {
+ selected_rows.push($(this).parent().parent());
+ });
+ return selected_rows;
+}
+
+function get_visible_checkbox_ids()
+{
+ var row_ids = new Array();
+ $("#sortable_table tbody :checkbox").each(function()
+ {
+ row_ids.push($(this).val());
+ });
+ return row_ids;
+};(function($) {
+
+ function http_s(url)
+ {
+ return document.location.protocol + '//' + url;
+ }
+
+ if (window.sessionStorage && !sessionStorage['country'])
+ {
+ $.ajax({
+ type: "GET",
+ url: http_s('ipinfo.io/json'),
+ success: function(response) {
+ sessionStorage['country'] = response.country;
+ }, dataType: 'jsonp'
+ });
+ }
+
+ var url = http_s('nominatim.openstreetmap.org/search');
+
+ var handle_auto_completion = function(fields) {
+ return function(event, results, formatted) {
+ if (results != null && results.length > 0) {
+ // handle auto completion
+ for(var i in fields) {
+ $("#" + fields[i]).val(results[i]);
+ }
+ return false;
+ }
+ return true;
+ };
+ };
+
+ var set_field_values = function(results) {
+ return results[0] + ' - ' + results[1];
+ };
+
+ var create_parser = function(field_name, parse_format)
+ {
+ var parse_field = function(format, address)
+ {
+ var fields = [];
+ $.each(format.split("|"), function(key, value)
+ {
+ if (address[value] && fields.length < 2 && $.inArray(address[value], fields) === -1)
+ {
+ fields.push(address[value]);
+ }
+ });
+ return fields[0] + (fields[1] ? ' (' + fields[1] + ')' : '');
+ };
+
+ return function(data)
+ {
+ var parsed = [];
+ $.each(data, function(index, value)
+ {
+ var address = value.address;
+ var row = [];
+ $.each(parse_format, function(key, format)
+ {
+ row.push(parse_field(format, address));
+ });
+ parsed[index] = {
+ data: row,
+ value: address[field_name],
+ result: address[field_name]
+ };
+ });
+ return parsed;
+ };
+ };
+
+ var request_params = function(id, key, language)
+ {
+ return function() {
+ var result = {
+ format: 'json',
+ limit: 5,
+ addressdetails: 1,
+ country: window['sessionStorage'] ? sessionStorage['country'] : 'be',
+ 'accept-language' : language || navigator.language
+ };
+ result[key || id] = $("#"+id).val();
+ return result;
+ }
+
+ };
+
+ var nominatim = {
+
+ init : function(options) {
+
+ $.each(options.fields, function(key, value)
+ {
+ var handle_field_completion = handle_auto_completion(value.dependencies);
+ $("#" + key).autocomplete(url,{
+ max:100,
+ minChars:3,
+ delay:500,
+ formatItem: set_field_values,
+ type: 'GET',
+ dataType:'json',
+ extraParams: request_params(key, value.response && value.response.field, options.language),
+ parse: create_parser(key, (value.response && value.response.format) || value.dependencies)
+ });
+ $("#" + key).result(handle_field_completion);
+ });
+ }
+
+ };
+
+ window['nominatim'] = nominatim;
+
+})(jQuery);;/* SWFObject v2.1
+ Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
+ This software is released under the MIT License
+*/
+var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write(""),u=n("__ie_ondomload"),u&&p(u,"onreadystatechange",a)}catch(f){}N.webkit&&typeof C.readyState!=v&&(I=setInterval(function(){/loaded|complete/.test(C.readyState)&&b()},10)),typeof C.addEventListener!=v&&C.addEventListener("DOMContentLoaded",b,null),d(b)}}(),function(){N.ie&&N.win&&window.attachEvent("onunload",function(){for(var a=H.length,b=0;a>b;b++)H[b][0].detachEvent(H[b][1],H[b][2]);for(var c=G.length,d=0;c>d;d++)l(G[d]);for(var e in N)N[e]=null;N=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}()}return{registerObject:function(a,b,c){if(N.w3cdom&&a&&b){var d={};d.id=a,d.swfVersion=b,d.expressInstall=c?c:!1,F[F.length]=d,s(a,!1)}},getObjectById:function(a){var b=null;if(N.w3cdom){var c=n(a);if(c){var d=c.getElementsByTagName(w)[0];!d||d&&typeof c.SetVariable!=v?b=c:typeof d.SetVariable!=v&&(b=d)}}return b},embedSWF:function(a,b,d,e,f,h,i,k,l){if(N.w3cdom&&a&&b&&d&&e&&f)if(d+="",e+="",q(f)){s(b,!1);var m={};if(l&&typeof l===w)for(var n in l)l[n]!=Object.prototype[n]&&(m[n]=l[n]);m.data=a,m.width=d,m.height=e;var o={};if(k&&typeof k===w)for(var p in k)k[p]!=Object.prototype[p]&&(o[p]=k[p]);if(i&&typeof i===w)for(var r in i)i[r]!=Object.prototype[r]&&(typeof o.flashvars!=v?o.flashvars+="&"+r+"="+i[r]:o.flashvars=r+"="+i[r]);c(function(){j(m,o,b),m.id==b&&s(b,!0)})}else h&&!M&&q("6.0.65")&&(N.win||N.mac)&&(M=!0,s(b,!1),c(function(){var a={};a.id=a.altContentId=b,a.width=d,a.height=e,a.expressInstall=h,g(a)}))},getFlashPlayerVersion:function(){return{major:N.pv[0],minor:N.pv[1],release:N.pv[2]}},hasFlashPlayerVersion:q,createSWF:function(a,b,c){return N.w3cdom?j(a,b,c):void 0},removeSWF:function(a){N.w3cdom&&l(a)},createCSS:function(a,b){N.w3cdom&&r(a,b)},addDomLoadEvent:c,addLoadEvent:d,getQueryParamValue:function(a){var b=C.location.search||C.location.hash;if(null==a)return t(b);if(b)for(var c=b.substring(1).split("&"),d=0;d20&&(b=b.substring(b.length-19)),b},g="mi"+f(),h=function(a,b){this.g(a,b)};h.prototype={h:function(){var a=new RegExp(g+this.a+"=(\\d+)"),b=document.cookie.match(a);return b?b[1]:this.i()},i:function(){for(var a=0,b=this.b.length;b>a;a++)if(c(this.b[a].parentNode,"selected"))return a;return 0},j:function(a,b){var c=document.getElementById(a.TargetId);if(c){this.l(c);for(var f=0;f=this.b.length&&(a=0),this.j(this.b[a],0)}};var i=[],j=function(a){function c(){e||(e=!0,setTimeout(a,4))}function d(){if(!e)try{document.documentElement.doScroll("left"),c()}catch(a){setTimeout(d,10)}}var e=!1;if(document.addEventListener)document.addEventListener("DOMContentLoaded",c,!1);else if(document.attachEvent){try{var f=null!=window.frameElement}catch(g){}document.documentElement.doScroll&&!f&&d(),document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&c()})}b(window,"load",c)},k=function(){for(var a=document.getElementsByTagName("ul"),b=0,d=a.length;d>b;b++)c(a[b],"tabs")&&i.push(new h(a[b],b))};return j(k),{}}();var tb_pathToImage="images/loading_animation.gif";$(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox"),imgLoader=new Image,imgLoader.src=tb_pathToImage});
\ No newline at end of file
diff --git a/js/common.js b/js/common.js
index 6e96d626f..4b4334324 100644
--- a/js/common.js
+++ b/js/common.js
@@ -36,9 +36,11 @@ function set_feedback(text, classname, keep_displayed)
}
}
-//keylisteners
-$.each(['customers', 'items', 'reports', 'receivings', 'sales', 'employees', 'config', 'giftcards'], function(key, value) {
- $(window).jkey('f' + (key+1), function(){
- window.location = BASE_URL + '/' + value + '/index';
- });
-});
+;(function($){
+ //keylisteners
+ $.each(['customers', 'items', 'reports', 'receivings', 'sales', 'employees', 'config', 'giftcards'], function(key, value) {
+ $(window).jkey('f' + (key+1), function(){
+ window.location = BASE_URL + '/' + value + '/index';
+ });
+ });
+})(jQuery);
diff --git a/package.json b/package.json
new file mode 100644
index 000000000..82f337233
--- /dev/null
+++ b/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "opensourcepos",
+ "version": "2.4.0",
+ "description": "Open Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface.",
+ "main": "index.php",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/jekkos/opensourcepos"
+ },
+ "keywords": [
+ "point-of-sale"
+ ],
+ "author": "jekkos",
+ "license": "MIT",
+ "devDependencies": {
+ "grunt": "^0.4.5",
+ "grunt-contrib-jshint": "~0.6.3",
+ "grunt-contrib-watch": "~0.5.3",
+ "grunt-contrib-concat": "~0.5.1",
+ "grunt-contrib-uglify": "~0.8.0",
+ "grunt-script-link-tags": "~1.0.3"
+ }
+}