woocommerce/assets/js/admin/woocommerce_admin.min.js

15 lines
40 KiB
JavaScript

(function(b,c){var a=0;b.widget("ech.multiselect",{options:{header:true,height:175,minWidth:225,classes:"",checkAllText:"Check all",uncheckAllText:"Uncheck all",noneSelectedText:"Select options",selectedText:"# selected",selectedList:0,show:"",hide:"",autoOpen:false,multiple:true,position:{}},_create:function(){var g=this.element.hide(),i=this.options;this.speed=b.fx.speeds._default;this._isOpen=false;var f=(this.button=b('<button type="button"><span class="ui-icon ui-icon-triangle-2-n-s"></span></button>')).addClass("ui-multiselect ui-widget ui-state-default ui-corner-all").addClass(i.classes).attr({title:g.attr("title"),"aria-haspopup":true,tabIndex:g.attr("tabIndex")}).insertAfter(g),d=(this.buttonlabel=b("<span />")).html(i.noneSelectedText).appendTo(f),h=(this.menu=b("<div />")).addClass("ui-multiselect-menu ui-widget ui-widget-content ui-corner-all").addClass(i.classes).insertAfter(f),k=(this.header=b("<div />")).addClass("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix").appendTo(h),e=(this.headerLinkContainer=b("<ul />")).addClass("ui-helper-reset").html(function(){if(i.header===true){return'<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>'+i.checkAllText+'</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>'+i.uncheckAllText+"</span></a></li>"}else{if(typeof i.header==="string"){return"<li>"+i.header+"</li>"}else{return""}}}).append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close"></span></a></li>').appendTo(k),j=(this.checkboxContainer=b("<ul />")).addClass("ui-multiselect-checkboxes ui-helper-reset").appendTo(h);this._bindEvents();this.refresh(true);if(!i.multiple){h.addClass("ui-multiselect-single")}},_init:function(){if(this.options.header===false){this.header.hide()}if(!this.options.multiple){this.headerLinkContainer.find(".ui-multiselect-all, .ui-multiselect-none").hide()}if(this.options.autoOpen){this.open()}if(this.element.is(":disabled")){this.disable()}},refresh:function(i){var f=this.element,h=this.options,g=this.menu,k=this.checkboxContainer,d=[],e=[],j=f.attr("id")||a++;this.element.find("option").each(function(n){var o=b(this),s=this.parentNode,q=this.innerHTML,u=this.title,r=this.value,m=this.id||"ui-multiselect-"+j+"-option-"+n,v=this.disabled,l=this.selected,p=["ui-corner-all"],t;if(s.tagName.toLowerCase()==="optgroup"){t=s.getAttribute("label");if(b.inArray(t,d)===-1){e.push('<li class="ui-multiselect-optgroup-label"><a href="#">'+t+"</a></li>");d.push(t)}}if(v){p.push("ui-state-disabled")}if(l&&!h.multiple){p.push("ui-state-active")}e.push('<li class="'+(v?"ui-multiselect-disabled":"")+'">');e.push('<label for="'+m+'" title="'+u+'" class="'+p.join(" ")+'">');e.push('<input id="'+m+'" name="multiselect_'+j+'" type="'+(h.multiple?"checkbox":"radio")+'" value="'+r+'" title="'+q+'"');if(l){e.push(' checked="checked"');e.push(' aria-selected="true"')}if(v){e.push(' disabled="disabled"');e.push(' aria-disabled="true"')}e.push(" /><span>"+q+"</span></label></li>");if(s.tagName.toLowerCase()==="optgroup"){var w=o.next("option").parent();if(!w.is("optgroup")){e.push('<li class="ui-multiselect-optgroup-last"></li>')}}});k.html(e.join(""));this.labels=g.find("label");this._setButtonWidth();this._setMenuWidth();this.button[0].defaultValue=this.update();if(!i){this._trigger("refresh")}},update:function(){var h=this.options,e=this.labels.find("input"),d=e.filter(":checked"),f=d.length,g;if(f===0){g=h.noneSelectedText}else{if(b.isFunction(h.selectedText)){g=h.selectedText.call(this,f,e.length,d.get())}else{if(/\d/.test(h.selectedList)&&h.selectedList>0&&f<=h.selectedList){g=d.map(function(){return this.title}).get().join(", ")}else{g=h.selectedText.replace("#",f).replace("#",e.length)}}}this.buttonlabel.html(g);return g},_bindEvents:function(){var d=this,e=this.button;function f(){d[d._isOpen?"close":"open"]();return false}e.find("span").bind("click.multiselect",f);e.bind({click:f,keypress:function(g){switch(g.which){case 27:case 38:case 37:d.close();break;case 39:case 40:d.open();break}},mouseenter:function(){if(!e.hasClass("ui-state-disabled")){b(this).addClass("ui-state-hover")}},mouseleave:function(){b(this).removeClass("ui-state-hover")},focus:function(){if(!e.hasClass("ui-state-disabled")){b(this).addClass("ui-state-focus")}},blur:function(){b(this).removeClass("ui-state-focus")}});this.header.delegate("a","click.multiselect",function(g){if(b(this).hasClass("ui-multiselect-close")){d.close()}else{d[b(this).hasClass("ui-multiselect-all")?"checkAll":"uncheckAll"]()}g.preventDefault()});this.menu.delegate("li.ui-multiselect-optgroup-label a","click.multiselect",function(k){k.preventDefault();var j=b(this),i=j.parent().nextUntil("li.ui-multiselect-optgroup-label, li.ui-multiselect-optgroup-last").find("input:visible:not(:disabled)"),g=i.get(),h=j.parent().text();if(d._trigger("beforeoptgrouptoggle",k,{inputs:g,label:h})===false){return}d._toggleChecked(i.filter(":checked").length!==i.length,i);d._trigger("optgrouptoggle",k,{inputs:g,label:h,checked:g[0].checked})}).delegate("label","mouseenter.multiselect",function(){if(!b(this).hasClass("ui-state-disabled")){d.labels.removeClass("ui-state-hover");b(this).addClass("ui-state-hover").find("input").focus()}}).delegate("label","keydown.multiselect",function(g){g.preventDefault();switch(g.which){case 9:case 27:d.close();break;case 38:case 40:case 37:case 39:d._traverse(g.which,this);break;case 13:b(this).find("input")[0].click();break}}).delegate('input[type="checkbox"], input[type="radio"]',"click.multiselect",function(j){var i=b(this),k=this.value,h=this.checked,g=d.element.find("option");if(this.disabled||d._trigger("click",j,{value:k,text:this.title,checked:h})===false){j.preventDefault();return}i.attr("aria-selected",h);g.each(function(){if(this.value===k){this.selected=h;if(h){this.setAttribute("selected","selected")}else{this.removeAttribute("selected")}}else{if(!d.options.multiple){this.selected=false}}});if(!d.options.multiple){d.labels.removeClass("ui-state-active");i.closest("label").toggleClass("ui-state-active",h);d.close()}d.element.trigger("change");setTimeout(b.proxy(d.update,d),10)});b(document).bind("mousedown.multiselect",function(g){if(d._isOpen&&!b.contains(d.menu[0],g.target)&&!b.contains(d.button[0],g.target)&&g.target!==d.button[0]){d.close()}});b(this.element[0].form).bind("reset.multiselect",function(){setTimeout(function(){d.update()},10)})},_setButtonWidth:function(){var d=this.element.outerWidth(),e=this.options;if(/\d/.test(e.minWidth)&&d<e.minWidth){d=e.minWidth}this.button.width(d)},_setMenuWidth:function(){var d=this.menu,e=this.button.outerWidth()-parseInt(d.css("padding-left"),10)-parseInt(d.css("padding-right"),10)-parseInt(d.css("border-right-width"),10)-parseInt(d.css("border-left-width"),10);d.width(e||this.button.outerWidth())},_traverse:function(h,i){var f=b(i),e=h===38||h===37,d=f.parent()[e?"prevAll":"nextAll"]("li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)")[e?"last":"first"]();if(!d.length){var g=this.menu.find("ul:last");this.menu.find("label")[e?"last":"first"]().trigger("mouseover");g.scrollTop(e?g.height():0)}else{d.find("label").trigger("mouseover")}},_toggleCheckbox:function(e,d){return function(){!this.disabled&&(this[e]=d);if(d){this.setAttribute("aria-selected",true)}else{this.removeAttribute("aria-selected")}}},_toggleChecked:function(d,h){var g=(h&&h.length)?h:this.labels.find("input"),f=this;g.each(this._toggleCheckbox("checked",d));this.update();var e=g.map(function(){return this.value}).get();this.element.find("option").each(function(){if(!this.disabled&&b.inArray(this.value,e)>-1){f._toggleCheckbox("selected",d).call(this)}});if(g.length){this.element.trigger("change")}},_toggleDisabled:function(d){this.button.attr({disabled:d,"aria-disabled":d})[d?"addClass":"removeClass"]("ui-state-disabled");this.menu.find("input").attr({disabled:d,"aria-disabled":d}).parent()[d?"addClass":"removeClass"]("ui-state-disabled");this.element.attr({disabled:d,"aria-disabled":d})},open:function(i){var l=this,h=this.button,d=this.menu,g=this.speed,f=this.options;if(this._trigger("beforeopen")===false||h.hasClass("ui-state-disabled")||this._isOpen){return}var k=d.find("ul:last"),m=f.show,j=h.position();if(b.isArray(f.show)){m=f.show[0];g=f.show[1]||l.speed}k.scrollTop(0).height(f.height);if(b.ui.position&&!b.isEmptyObject(f.position)){f.position.of=f.position.of||h;d.show().position(f.position).hide().show(m,g)}else{d.css({top:j.top+h.outerHeight(),left:j.left}).show(m,g)}this.labels.eq(0).trigger("mouseover").trigger("mouseenter").find("input").trigger("focus");h.addClass("ui-state-active");this._isOpen=true;this._trigger("open")},close:function(){if(this._trigger("beforeclose")===false){return}var f=this.options,d=f.hide,e=this.speed;if(b.isArray(f.hide)){d=f.hide[0];e=f.hide[1]||this.speed}this.menu.hide(d,e);this.button.removeClass("ui-state-active").trigger("blur").trigger("mouseleave");this._isOpen=false;this._trigger("close")},enable:function(){this._toggleDisabled(false)},disable:function(){this._toggleDisabled(true)},checkAll:function(d){this._toggleChecked(true);this._trigger("checkAll")},uncheckAll:function(){this._toggleChecked(false);this._trigger("uncheckAll")},getChecked:function(){return this.menu.find("input").filter(":checked")},destroy:function(){b.Widget.prototype.destroy.call(this);this.button.remove();this.menu.remove();this.element.show();return this},isOpen:function(){return this._isOpen},widget:function(){return this.menu},_setOption:function(d,e){var f=this.menu;switch(d){case"header":f.find("div.ui-multiselect-header")[e?"show":"hide"]();break;case"checkAllText":f.find("a.ui-multiselect-all span").eq(-1).text(e);break;case"uncheckAllText":f.find("a.ui-multiselect-none span").eq(-1).text(e);break;case"height":f.find("ul:last").height(parseInt(e,10));break;case"minWidth":this.options[d]=parseInt(e,10);this._setButtonWidth();this._setMenuWidth();break;case"selectedText":case"selectedList":case"noneSelectedText":this.options[d]=e;this.update();break;case"classes":f.add(this.button).removeClass(this.options.classes).addClass(e);break}b.Widget.prototype._setOption.apply(this,arguments)}})})(jQuery);
/*
jQuery blockUI plugin
Version 2.37 (29-JAN-2011)
@requires jQuery v1.2.3 or later
Examples at: http://malsup.com/jquery/block/
Copyright (c) 2007-2010 M. Alsup
Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
Thanks to Amir-Hossein Sobhi for some excellent contributions!
*/
(function(i){if(/1\.(0|1|2)\.(0|1|2)/.test(i.fn.jquery)||/^1.1/.test(i.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later! You are using v"+i.fn.jquery);return}i.fn._fadeIn=i.fn.fadeIn;var c=function(){};var j=document.documentMode||0;var e=i.browser.msie&&((i.browser.version<8&&!j)||j<8);var f=i.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!j;i.blockUI=function(p){d(window,p)};i.unblockUI=function(p){h(window,p)};i.growlUI=function(t,r,s,p){var q=i('<div class="growlUI"></div>');if(t){q.append("<h1>"+t+"</h1>")}if(r){q.append("<h2>"+r+"</h2>")}if(s==undefined){s=3000}i.blockUI({message:q,fadeIn:700,fadeOut:1000,centerY:false,timeout:s,showOverlay:false,onUnblock:p,css:i.blockUI.defaults.growlCSS})};i.fn.block=function(p){return this.unblock({fadeOut:0}).each(function(){if(i.css(this,"position")=="static"){this.style.position="relative"}if(i.browser.msie){this.style.zoom=1}d(this,p)})};i.fn.unblock=function(p){return this.each(function(){h(this,p)})};i.blockUI.version=2.37;i.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var b=null;var g=[];function d(r,F){var A=(r==window);var w=F&&F.message!==undefined?F.message:undefined;F=i.extend({},i.blockUI.defaults,F||{});F.overlayCSS=i.extend({},i.blockUI.defaults.overlayCSS,F.overlayCSS||{});var C=i.extend({},i.blockUI.defaults.css,F.css||{});var N=i.extend({},i.blockUI.defaults.themedCSS,F.themedCSS||{});w=w===undefined?F.message:w;if(A&&b){h(window,{fadeOut:0})}if(w&&typeof w!="string"&&(w.parentNode||w.jquery)){var I=w.jquery?w[0]:w;var P={};i(r).data("blockUI.history",P);P.el=I;P.parent=I.parentNode;P.display=I.style.display;P.position=I.style.position;if(P.parent){P.parent.removeChild(I)}}var B=F.baseZ;var M=(i.browser.msie||F.forceIframe)?i('<iframe class="blockUI" style="z-index:'+(B++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+F.iframeSrc+'"></iframe>'):i('<div class="blockUI" style="display:none"></div>');var L=i('<div class="blockUI blockOverlay" style="z-index:'+(B++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var K,G;if(F.theme&&A){G='<div class="blockUI '+F.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+B+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(F.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(F.theme){G='<div class="blockUI '+F.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+B+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(F.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(A){G='<div class="blockUI '+F.blockMsgClass+' blockPage" style="z-index:'+B+';display:none;position:fixed"></div>'}else{G='<div class="blockUI '+F.blockMsgClass+' blockElement" style="z-index:'+B+';display:none;position:absolute"></div>'}}}K=i(G);if(w){if(F.theme){K.css(N);K.addClass("ui-widget-content")}else{K.css(C)}}if(!F.applyPlatformOpacityRules||!(i.browser.mozilla&&/Linux/.test(navigator.platform))){L.css(F.overlayCSS)}L.css("position",A?"fixed":"absolute");if(i.browser.msie||F.forceIframe){M.css("opacity",0)}var y=[M,L,K],O=A?i("body"):i(r);i.each(y,function(){this.appendTo(O)});if(F.theme&&F.draggable&&i.fn.draggable){K.draggable({handle:".ui-dialog-titlebar",cancel:"li"})}var v=e&&(!i.boxModel||i("object,embed",A?null:r).length>0);if(f||v){if(A&&F.allowBodyStretch&&i.boxModel){i("html,body").css("height","100%")}if((f||!i.boxModel)&&!A){var E=m(r,"borderTopWidth"),J=m(r,"borderLeftWidth");var x=E?"(0 - "+E+")":0;var D=J?"(0 - "+J+")":0}i.each([M,L,K],function(t,S){var z=S[0].style;z.position="absolute";if(t<2){A?z.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+F.quirksmodeOffsetHack+') + "px"'):z.setExpression("height",'this.parentNode.offsetHeight + "px"');A?z.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):z.setExpression("width",'this.parentNode.offsetWidth + "px"');if(D){z.setExpression("left",D)}if(x){z.setExpression("top",x)}}else{if(F.centerY){if(A){z.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}z.marginTop=0}else{if(!F.centerY&&A){var Q=(F.css&&F.css.top)?parseInt(F.css.top):0;var R="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+Q+') + "px"';z.setExpression("top",R)}}}})}if(w){if(F.theme){K.find(".ui-widget-content").append(w)}else{K.append(w)}if(w.jquery||w.nodeType){i(w).show()}}if((i.browser.msie||F.forceIframe)&&F.showOverlay){M.show()}if(F.fadeIn){var H=F.onBlock?F.onBlock:c;var q=(F.showOverlay&&!w)?H:c;var p=w?H:c;if(F.showOverlay){L._fadeIn(F.fadeIn,q)}if(w){K._fadeIn(F.fadeIn,p)}}else{if(F.showOverlay){L.show()}if(w){K.show()}if(F.onBlock){F.onBlock()}}l(1,r,F);if(A){b=K[0];g=i(":input:enabled:visible",b);if(F.focusInput){setTimeout(o,20)}}else{a(K[0],F.centerX,F.centerY)}if(F.timeout){var u=setTimeout(function(){A?i.unblockUI(F):i(r).unblock(F)},F.timeout);i(r).data("blockUI.timeout",u)}}function h(s,t){var r=(s==window);var q=i(s);var u=q.data("blockUI.history");var v=q.data("blockUI.timeout");if(v){clearTimeout(v);q.removeData("blockUI.timeout")}t=i.extend({},i.blockUI.defaults,t||{});l(0,s,t);var p;if(r){p=i("body").children().filter(".blockUI").add("body > .blockUI")}else{p=i(".blockUI",s)}if(r){b=g=null}if(t.fadeOut){p.fadeOut(t.fadeOut);setTimeout(function(){k(p,u,t,s)},t.fadeOut)}else{k(p,u,t,s)}}function k(p,s,r,q){p.each(function(t,u){if(this.parentNode){this.parentNode.removeChild(this)}});if(s&&s.el){s.el.style.display=s.display;s.el.style.position=s.position;if(s.parent){s.parent.appendChild(s.el)}i(q).removeData("blockUI.history")}if(typeof r.onUnblock=="function"){r.onUnblock(q,r)}}function l(p,t,u){var s=t==window,r=i(t);if(!p&&(s&&!b||!s&&!r.data("blockUI.isBlocked"))){return}if(!s){r.data("blockUI.isBlocked",p)}if(!u.bindEvents||(p&&!u.showOverlay)){return}var q="mousedown mouseup keydown keypress";p?i(document).bind(q,u,n):i(document).unbind(q,n)}function n(t){if(t.keyCode&&t.keyCode==9){if(b&&t.data.constrainTabKey){var r=g;var q=!t.shiftKey&&t.target===r[r.length-1];var p=t.shiftKey&&t.target===r[0];if(q||p){setTimeout(function(){o(p)},10);return false}}}var s=t.data;if(i(t.target).parents("div."+s.blockMsgClass).length>0){return true}return i(t.target).parents().children().filter("div.blockUI").length==0}function o(p){if(!g){return}var q=g[p===true?g.length-1:0];if(q){q.focus()}}function a(w,q,A){var z=w.parentNode,v=w.style;var r=((z.offsetWidth-w.offsetWidth)/2)-m(z,"borderLeftWidth");var u=((z.offsetHeight-w.offsetHeight)/2)-m(z,"borderTopWidth");if(q){v.left=r>0?(r+"px"):"0"}if(A){v.top=u>0?(u+"px"):"0"}}function m(q,r){return parseInt(i.css(q,r))||0}})(jQuery);Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.abbrDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.abbrMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.firstDayOfWeek=1;Date.format="dd/mm/yyyy";Date.fullYearStart="20";(function(){function b(c,d){if(!Date.prototype[c]){Date.prototype[c]=d}}b("isLeapYear",function(){var c=this.getFullYear();return(c%4==0&&c%100!=0)||c%400==0});b("isWeekend",function(){return this.getDay()==0||this.getDay()==6});b("isWeekDay",function(){return !this.isWeekend()});b("getDaysInMonth",function(){return[31,(this.isLeapYear()?29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()]});b("getDayName",function(c){return c?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()]});b("getMonthName",function(c){return c?Date.abbrMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()]});b("getDayOfYear",function(){var c=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-c.getTime())/86400000)});b("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7)});b("setDayOfYear",function(c){this.setMonth(0);this.setDate(c);return this});b("addYears",function(c){this.setFullYear(this.getFullYear()+c);return this});b("addMonths",function(d){var c=this.getDate();this.setMonth(this.getMonth()+d);if(c>this.getDate()){this.addDays(-this.getDate())}return this});b("addDays",function(c){this.setTime(this.getTime()+(c*86400000));return this});b("addHours",function(c){this.setHours(this.getHours()+c);return this});b("addMinutes",function(c){this.setMinutes(this.getMinutes()+c);return this});b("addSeconds",function(c){this.setSeconds(this.getSeconds()+c);return this});b("zeroTime",function(){this.setMilliseconds(0);this.setSeconds(0);this.setMinutes(0);this.setHours(0);return this});b("asString",function(d){var c=d||Date.format;return c.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(a(this.getMonth()+1)).split("dd").join(a(this.getDate())).split("hh").join(a(this.getHours())).split("min").join(a(this.getMinutes())).split("ss").join(a(this.getSeconds()))});Date.fromString=function(o,n){var j=n||Date.format;var m=new Date("01/01/1977");var k=0;var c=j.indexOf("mmmm");if(c>-1){for(var g=0;g<Date.monthNames.length;g++){var e=o.substr(c,Date.monthNames[g].length);if(Date.monthNames[g]==e){k=Date.monthNames[g].length-4;break}}m.setMonth(g)}else{c=j.indexOf("mmm");if(c>-1){var e=o.substr(c,3);for(var g=0;g<Date.abbrMonthNames.length;g++){if(Date.abbrMonthNames[g]==e){break}}m.setMonth(g)}else{m.setMonth(Number(o.substr(j.indexOf("mm"),2))-1)}}var l=j.indexOf("yyyy");if(l>-1){if(c<l){l+=k}m.setFullYear(Number(o.substr(l,4)))}else{if(c<l){l+=k}m.setFullYear(Number(Date.fullYearStart+o.substr(j.indexOf("yy"),2)))}var h=j.indexOf("dd");if(c<h){h+=k}m.setDate(Number(o.substr(h,2)));if(isNaN(m.getTime())){return false}return m};var a=function(c){var d="0"+c;return d.substring(d.length-2)}})();(function(a){a.fn.easyTooltip=function(b){var d={xOffset:10,yOffset:25,tooltipId:"easyTooltip",clickRemove:false,content:"",useElement:""};var b=a.extend(d,b);var c;this.each(function(){var e=a(this).attr("tip");a(this).hover(function(f){c=(b.content!="")?b.content:e;c=(b.useElement!="")?a("#"+b.useElement).html():c;a(this).attr("title","");if(c!=""&&c!=undefined){a("body").append("<div id='"+b.tooltipId+"'>"+c+"</div>");a("#"+b.tooltipId).css("position","absolute").css("top",(f.pageY-b.yOffset)+"px").css("left",(f.pageX+b.xOffset)+"px").css("display","none").fadeIn("fast")}},function(){a("#"+b.tooltipId).remove();a(this).attr("title",e)});a(this).mousemove(function(f){a("#"+b.tooltipId).css("top",(f.pageY-b.yOffset)+"px").css("left",(f.pageX+b.xOffset)+"px")});if(b.clickRemove){a(this).mousedown(function(f){a("#"+b.tooltipId).remove();a(this).attr("title",e)})}})}})(jQuery);jQuery(function(){jQuery(".tips").easyTooltip()});(function(c){if("placeholder" in document.createElement("input")){return}c(document).ready(function(){c(":input[placeholder]").each(function(){b(c(this))});c("form").submit(function(d){a(c(this))})});function b(e){var d=e.attr("placeholder");if(e.val()===""){e.val(d)}e.bind({focus:function(f){if(e.val()===d){e.val("")}},blur:function(f){if(e.val()===""){e.val(d)}}})}function a(d){d.find(":input[placeholder]").each(function(){var e=c(this);if(e.val()===e.attr("placeholder")){e.val("")}})}})(jQuery);if(jQuery.isFunction(jQuery.fn.sortable)){jQuery(document).ready(function(a){a("table.widefat.wp-list-table tbody th, table.widefat tbody td").css("cursor","move");a("table.widefat.wp-list-table tbody").sortable({items:"tr:not(.inline-edit-row)",cursor:"move",axis:"y",containment:"table.widefat",placeholder:"product-cat-placeholder",scrollSensitivity:40,helper:function(c,b){b.children().each(function(){jQuery(this).width(jQuery(this).width())});return b},start:function(b,c){if(!c.item.hasClass("alternate")){c.item.css("background-color","#ffffff")}c.item.children("td,th").css("border-bottom-width","0");c.item.css("outline","1px solid #aaa")},stop:function(b,c){c.item.removeAttr("style");c.item.children("td,th").css("border-bottom-width","1px")},update:function(e,f){var i=f.item.find(".check-column input").val();var h=f.item.find(".parent").html();var b=f.item.prev().find(".check-column input").val();var d=f.item.next().find(".check-column input").val();var c=undefined;if(b!=undefined){var c=f.item.prev().find(".parent").html();if(c!=h){b=undefined}}var g=undefined;if(d!=undefined){g=f.item.next().find(".parent").html();if(g!=h){d=undefined}}if((b==undefined&&d==undefined)||(d==undefined&&g==b)||(d!=undefined&&c==i)){a("table.widefat tbody").sortable("cancel");return}f.item.find(".check-column input").hide().after('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />');a.post(ajaxurl,{action:"woocommerce-categories-ordering",id:i,nextid:d},function(j){if(j=="children"){window.location.reload()}else{f.item.find(".check-column input").show().siblings("img").remove()}});a("table.widefat tbody tr").each(function(){var j=jQuery("table.widefat tbody tr").index(this);if(j%2==0){jQuery(this).addClass("alternate")}else{jQuery(this).removeClass("alternate")}})}})})}(function(d){d.fn.extend({renderCalendar:function(t){var C=function(i){return document.createElement(i)};t=d.extend({},d.fn.datePicker.defaults,t);if(t.showHeader!=d.dpConst.SHOW_HEADER_NONE){var o=d(C("tr"));for(var x=Date.firstDayOfWeek;x<Date.firstDayOfWeek+7;x++){var h=x%7;var v=Date.dayNames[h];o.append(jQuery(C("th")).attr({scope:"col",abbr:v,title:v,"class":(h==0||h==6?"weekend":"weekday")}).html(t.showHeader==d.dpConst.SHOW_HEADER_SHORT?v.substr(0,1):v))}}var e=d(C("table")).attr({cellspacing:2}).addClass("jCalendar").append((t.showHeader!=d.dpConst.SHOW_HEADER_NONE?d(C("thead")).append(o):C("thead")));var f=d(C("tbody"));var z=(new Date()).zeroTime();z.setHours(12);var B=t.month==undefined?z.getMonth():t.month;var p=t.year||z.getFullYear();var m=(new Date(p,B,1,12,0,0));var l=Date.firstDayOfWeek-m.getDay()+1;if(l>1){l-=7}var q=Math.ceil(((-1*l+1)+m.getDaysInMonth())/7);m.addDays(l-1);var A=function(i){return function(){if(t.hoverClass){var r=d(this);if(!t.selectWeek){r.addClass(t.hoverClass)}else{if(i&&!r.is(".disabled")){r.parent().addClass("activeWeekHover")}}}}};var g=function(){if(t.hoverClass){var i=d(this);i.removeClass(t.hoverClass);i.parent().removeClass("activeWeekHover")}};var n=0;while(n++<q){var u=jQuery(C("tr"));var k=t.dpController?m>t.dpController.startDate:false;for(var x=0;x<7;x++){var j=m.getMonth()==B;var y=d(C("td")).text(m.getDate()+"").addClass((j?"current-month ":"other-month ")+(m.isWeekend()?"weekend ":"weekday ")+(j&&m.getTime()==z.getTime()?"today ":"")).data("datePickerDate",m.asString()).hover(A(k),g);u.append(y);if(t.renderCallback){t.renderCallback(y,m,B,p)}m=new Date(m.getFullYear(),m.getMonth(),m.getDate()+1,12,0,0)}f.append(u)}e.append(f);return this.each(function(){d(this).empty().append(e)})},datePicker:function(e){if(!d.event._dpCache){d.event._dpCache=[]}e=d.extend({},d.fn.datePicker.defaults,e);return this.each(function(){var g=d(this);var i=true;if(!this._dpId){this._dpId=d.event.guid++;d.event._dpCache[this._dpId]=new a(this);i=false}if(e.inline){e.createButton=false;e.displayClose=false;e.closeOnSelect=false;g.empty()}var f=d.event._dpCache[this._dpId];f.init(e);if(!i&&e.createButton){f.button=d('<a href="#" class="dp-choose-date" title="'+d.dpText.TEXT_CHOOSE_DATE+'">'+d.dpText.TEXT_CHOOSE_DATE+"</a>").bind("click",function(){g.dpDisplay(this);this.blur();return false});g.after(f.button)}if(!i&&g.is(":text")){g.bind("dateSelected",function(k,j,l){this.value=j.asString()}).bind("change",function(){if(this.value==""){f.clearSelected()}else{var j=Date.fromString(this.value);if(j){f.setSelected(j,true,true)}}});if(e.clickInput){g.bind("click",function(){g.trigger("change");g.dpDisplay()})}var h=Date.fromString(this.value);if(this.value!=""&&h){f.setSelected(h,true,true)}}g.addClass("dp-applied")})},dpSetDisabled:function(e){return b.call(this,"setDisabled",e)},dpSetStartDate:function(e){return b.call(this,"setStartDate",e)},dpSetEndDate:function(e){return b.call(this,"setEndDate",e)},dpGetSelected:function(){var e=c(this[0]);if(e){return e.getSelected()}return null},dpSetSelected:function(i,g,f,h){if(g==undefined){g=true}if(f==undefined){f=true}if(h==undefined){h=true}return b.call(this,"setSelected",Date.fromString(i),g,f,h)},dpSetDisplayedMonth:function(e,f){return b.call(this,"setDisplayedMonth",Number(e),Number(f),true)},dpDisplay:function(f){return b.call(this,"display",f)},dpSetRenderCallback:function(e){return b.call(this,"setRenderCallback",e)},dpSetPosition:function(e,f){return b.call(this,"setPosition",e,f)},dpSetOffset:function(e,f){return b.call(this,"setOffset",e,f)},dpClose:function(){return b.call(this,"_closeCalendar",false,this[0])},dpRerenderCalendar:function(){return b.call(this,"_rerenderCalendar")},_dpDestroy:function(){}});var b=function(h,g,e,j,i){return this.each(function(){var f=c(this);if(f){f[h](g,e,j,i)}})};function a(e){this.ele=e;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={}}d.extend(a.prototype,{init:function(e){this.setStartDate(e.startDate);this.setEndDate(e.endDate);this.setDisplayedMonth(Number(e.month),Number(e.year));this.setRenderCallback(e.renderCallback);this.showYearNavigation=e.showYearNavigation;this.closeOnSelect=e.closeOnSelect;this.displayClose=e.displayClose;this.rememberViewedMonth=e.rememberViewedMonth;this.selectMultiple=e.selectMultiple;this.numSelectable=e.selectMultiple?e.numSelectable:1;this.numSelected=0;this.verticalPosition=e.verticalPosition;this.horizontalPosition=e.horizontalPosition;this.hoverClass=e.hoverClass;this.setOffset(e.verticalOffset,e.horizontalOffset);this.inline=e.inline;this.settings=e;if(this.inline){this.context=this.ele;this.display()}},setStartDate:function(e){if(e){this.startDate=Date.fromString(e)}if(!this.startDate){this.startDate=(new Date()).zeroTime()}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setEndDate:function(e){if(e){this.endDate=Date.fromString(e)}if(!this.endDate){this.endDate=(new Date("12/31/2999"))}if(this.endDate.getTime()<this.startDate.getTime()){this.endDate=this.startDate}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setPosition:function(e,f){this.verticalPosition=e;this.horizontalPosition=f},setOffset:function(e,f){this.verticalOffset=parseInt(e)||0;this.horizontalOffset=parseInt(f)||0},setDisabled:function(e){$e=d(this.ele);$e[e?"addClass":"removeClass"]("dp-disabled");if(this.button){$but=d(this.button);$but[e?"addClass":"removeClass"]("dp-disabled");$but.attr("title",e?"":d.dpText.TEXT_CHOOSE_DATE)}if($e.is(":text")){$e.attr("disabled",e?"disabled":"")}},setDisplayedMonth:function(f,n,j){if(this.startDate==undefined||this.endDate==undefined){return}var i=new Date(this.startDate.getTime());i.setDate(1);var l=new Date(this.endDate.getTime());l.setDate(1);var h;if((!f&&!n)||(isNaN(f)&&isNaN(n))){h=new Date().zeroTime();h.setDate(1)}else{if(isNaN(f)){h=new Date(n,this.displayedMonth,1)}else{if(isNaN(n)){h=new Date(this.displayedYear,f,1)}else{h=new Date(n,f,1)}}}if(h.getTime()<i.getTime()){h=i}else{if(h.getTime()>l.getTime()){h=l}}var g=this.displayedMonth;var k=this.displayedYear;this.displayedMonth=h.getMonth();this.displayedYear=h.getFullYear();if(j&&(this.displayedMonth!=g||this.displayedYear!=k)){this._rerenderCalendar();d(this.ele).trigger("dpMonthChanged",[this.displayedMonth,this.displayedYear])}},setSelected:function(l,e,f,h){if(l<this.startDate||l.zeroTime()>this.endDate.zeroTime()){return}var g=this.settings;if(g.selectWeek){l=l.addDays(-(l.getDay()-Date.firstDayOfWeek+7)%7);if(l<this.startDate){return}}if(e==this.isSelected(l)){return}if(this.selectMultiple==false){this.clearSelected()}else{if(e&&this.numSelected==this.numSelectable){return}}if(f&&(this.displayedMonth!=l.getMonth()||this.displayedYear!=l.getFullYear())){this.setDisplayedMonth(l.getMonth(),l.getFullYear(),true)}this.selectedDates[l.asString()]=e;this.numSelected+=e?1:-1;var j="td."+(l.getMonth()==this.displayedMonth?"current-month":"other-month");var k;d(j,this.context).each(function(){if(d(this).data("datePickerDate")==l.asString()){k=d(this);if(g.selectWeek){k.parent()[e?"addClass":"removeClass"]("selectedWeek")}k[e?"addClass":"removeClass"]("selected")}});d("td",this.context).not(".selected")[this.selectMultiple&&this.numSelected==this.numSelectable?"addClass":"removeClass"]("unselectable");if(h){var g=this.isSelected(l);$e=d(this.ele);var i=Date.fromString(l.asString());$e.trigger("dateSelected",[i,k,g]);$e.trigger("change")}},isSelected:function(e){return this.selectedDates[e.asString()]},getSelected:function(){var f=[];for(var e in this.selectedDates){if(this.selectedDates[e]==true){f.push(Date.fromString(e))}}return f},clearSelected:function(){this.selectedDates={};this.numSelected=0;d("td.selected",this.context).removeClass("selected").parent().removeClass("selectedWeek")},display:function(e){if(d(this.ele).is(".dp-disabled")){return}e=e||this.ele;var m=this;var i=d(e);var l=i.offset();var n;var o;var g;var j;if(m.inline){n=d(this.ele);o={id:"calendar-"+this.ele._dpId,"class":"dp-popup dp-popup-inline"};d(".dp-popup",n).remove();j={}}else{n=d("body");o={id:"dp-popup","class":"dp-popup"};j={top:l.top+m.verticalOffset,left:l.left+m.horizontalOffset};var k=function(r){var p=r.target;var q=d("#dp-popup")[0];while(true){if(p==q){return true}else{if(p==document){m._closeCalendar();return false}else{p=d(p).parent()[0]}}}};this._checkMouse=k;m._closeCalendar(true);d(document).bind("keydown.datepicker",function(p){if(p.keyCode==27){m._closeCalendar()}})}if(!m.rememberViewedMonth){var h=this.getSelected()[0];if(h){h=new Date(h);this.setDisplayedMonth(h.getMonth(),h.getFullYear(),false)}}n.append(d("<div></div>").attr(o).css(j).append(d("<h2></h2>"),d('<div class="dp-nav-prev"></div>').append(d('<a class="dp-nav-prev-year" href="#" title="'+d.dpText.TEXT_PREV_YEAR+'">&lt;&lt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,0,-1)}),d('<a class="dp-nav-prev-month" href="#" title="'+d.dpText.TEXT_PREV_MONTH+'">&lt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,-1,0)})),d('<div class="dp-nav-next"></div>').append(d('<a class="dp-nav-next-year" href="#" title="'+d.dpText.TEXT_NEXT_YEAR+'">&gt;&gt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,0,1)}),d('<a class="dp-nav-next-month" href="#" title="'+d.dpText.TEXT_NEXT_MONTH+'">&gt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,1,0)})),d('<div class="dp-calendar"></div>')).bgIframe());var f=this.inline?d(".dp-popup",this.context):d("#dp-popup");if(this.showYearNavigation==false){d(".dp-nav-prev-year, .dp-nav-next-year",m.context).css("display","none")}if(this.displayClose){f.append(d('<a href="#" id="dp-close">'+d.dpText.TEXT_CLOSE+"</a>").bind("click",function(){m._closeCalendar();return false}))}m._renderCalendar();d(this.ele).trigger("dpDisplayed",f);if(!m.inline){if(this.verticalPosition==d.dpConst.POS_BOTTOM){f.css("top",l.top+i.height()-f.height()+m.verticalOffset)}if(this.horizontalPosition==d.dpConst.POS_RIGHT){f.css("left",l.left+i.width()-f.width()+m.horizontalOffset)}d(document).bind("mousedown.datepicker",this._checkMouse)}},setRenderCallback:function(e){if(e==null){return}if(e&&typeof(e)=="function"){e=[e]}this.renderCallback=this.renderCallback.concat(e)},cellRender:function(i,e,g,f){var j=this.dpController;var h=new Date(e.getTime());i.bind("click",function(){var m=d(this);if(!m.is(".disabled")){j.setSelected(h,!m.is(".selected")||!j.selectMultiple,false,true);if(j.closeOnSelect){if(j.settings.autoFocusNextInput){var l=j.ele;var k=false;d(":input",l.form).each(function(){if(k){d(this).focus();return false}if(this==l){k=true}})}else{j.ele.focus()}j._closeCalendar()}}});if(j.isSelected(h)){i.addClass("selected");if(j.settings.selectWeek){i.parent().addClass("selectedWeek")}}else{if(j.selectMultiple&&j.numSelected==j.numSelectable){i.addClass("unselectable")}}},_applyRenderCallbacks:function(){var e=this;d("td",this.context).each(function(){for(var f=0;f<e.renderCallback.length;f++){$td=d(this);e.renderCallback[f].apply(this,[$td,Date.fromString($td.data("datePickerDate")),e.displayedMonth,e.displayedYear])}});return},_displayNewMonth:function(f,e,g){if(!d(f).is(".disabled")){this.setDisplayedMonth(this.displayedMonth+e,this.displayedYear+g,true)}f.blur();return false},_rerenderCalendar:function(){this._clearCalendar();this._renderCalendar()},_renderCalendar:function(){d("h2",this.context).html((new Date(this.displayedYear,this.displayedMonth,1)).asString(d.dpText.HEADER_FORMAT));d(".dp-calendar",this.context).renderCalendar(d.extend({},this.settings,{month:this.displayedMonth,year:this.displayedYear,renderCallback:this.cellRender,dpController:this,hoverClass:this.hoverClass}));if(this.displayedYear==this.startDate.getFullYear()&&this.displayedMonth==this.startDate.getMonth()){d(".dp-nav-prev-year",this.context).addClass("disabled");d(".dp-nav-prev-month",this.context).addClass("disabled");d(".dp-calendar td.other-month",this.context).each(function(){var i=d(this);if(Number(i.text())>20){i.addClass("disabled")}});var h=this.startDate.getDate();d(".dp-calendar td.current-month",this.context).each(function(){var i=d(this);if(Number(i.text())<h){i.addClass("disabled")}})}else{d(".dp-nav-prev-year",this.context).removeClass("disabled");d(".dp-nav-prev-month",this.context).removeClass("disabled");var h=this.startDate.getDate();if(h>20){var f=this.startDate.getTime();var g=new Date(f);g.addMonths(1);if(this.displayedYear==g.getFullYear()&&this.displayedMonth==g.getMonth()){d(".dp-calendar td.other-month",this.context).each(function(){var i=d(this);if(Date.fromString(i.data("datePickerDate")).getTime()<f){i.addClass("disabled")}})}}}if(this.displayedYear==this.endDate.getFullYear()&&this.displayedMonth==this.endDate.getMonth()){d(".dp-nav-next-year",this.context).addClass("disabled");d(".dp-nav-next-month",this.context).addClass("disabled");d(".dp-calendar td.other-month",this.context).each(function(){var i=d(this);if(Number(i.text())<14){i.addClass("disabled")}});var h=this.endDate.getDate();d(".dp-calendar td.current-month",this.context).each(function(){var i=d(this);if(Number(i.text())>h){i.addClass("disabled")}})}else{d(".dp-nav-next-year",this.context).removeClass("disabled");d(".dp-nav-next-month",this.context).removeClass("disabled");var h=this.endDate.getDate();if(h<13){var e=new Date(this.endDate.getTime());e.addMonths(-1);if(this.displayedYear==e.getFullYear()&&this.displayedMonth==e.getMonth()){d(".dp-calendar td.other-month",this.context).each(function(){var j=d(this);var i=Number(j.text());if(i<13&&i>h){j.addClass("disabled")}})}}}this._applyRenderCallbacks()},_closeCalendar:function(e,f){if(!f||f==this.ele){d(document).unbind("mousedown.datepicker");d(document).unbind("keydown.datepicker");this._clearCalendar();d("#dp-popup a").unbind();d("#dp-popup").empty().remove();if(!e){d(this.ele).trigger("dpClosed",[this.getSelected()])}}},_clearCalendar:function(){d(".dp-calendar td",this.context).unbind();d(".dp-calendar",this.context).empty()}});d.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"};d.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"};d.dpVersion="$Id: jquery.datePicker.js 102 2010-09-13 14:00:54Z kelvin.luck $";d.fn.datePicker.defaults={month:undefined,year:undefined,showHeader:d.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:d.dpConst.POS_TOP,horizontalPosition:d.dpConst.POS_LEFT,verticalOffset:0,horizontalOffset:0,hoverClass:"dp-hover",autoFocusNextInput:false};function c(e){if(e._dpId){return d.event._dpCache[e._dpId]}return false}if(d.fn.bgIframe==undefined){d.fn.bgIframe=function(){return this}}d(window).bind("unload",function(){var f=d.event._dpCache||[];for(var e in f){d(f[e].ele)._dpDestroy()}})})(jQuery);