(function(bd,L){var av=bd.document,bu=bd.navigator,bm=bd.locations;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bd.jQuery,bH=bd.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"3.6.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bd.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bd.attachEvent("onload",bF.ready);var b0=false;try{b0=bd.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0!=null&&b0==b0.window },isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bd.JSON&&bd.JSON.parse){return bd.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){if(typeof b2!=="string"||!b2){return null}var b0,b1;try{if(bd.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalevals:function(b0){if(b0&&bM.test(b0)){(bd.execScript||function(b1){bd["evals"].call(bd,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aK.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aK.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bH=bv.getElementsByTagName("*");bE=bv.getElementsByTagName("a")[0];if(!bH||!bH.length||!bE){return{}}bF=av.createElement("select");bx=bF.appendChild(av.createElement("option"));bD=bv.getElementsByTagName("input")[0];bI={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bE.getAttribute("style")),hrefNormalized:(bE.getAttribute("href")==="/a"),opacity:/^0.55/.test(bE.style.opacity),cssFloat:!!bE.style.cssFloat,checkOn:(bD.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true,pixelMargin:true};b.boxModel=bI.boxModel=(av.compatMode==="CSS1Compat");bD.checked=true;bI.noCloneChecked=bD.cloneNode(true).checked;bF.disabled=true;bI.optDisabled=!bx.disabled;try{delete bv.test}catch(bB){bI.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bI.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bD=av.createElement("input");bD.value="t";bD.setAttribute("type","radio");bI.radioValue=bD.value==="t";bD.setAttribute("checked","checked"); bD.setAttribute("name","t");bv.appendChild(bD);bC=av.createDocumentFragment();bC.appendChild(bv.lastChild);bI.checkClone=bC.cloneNode(true).cloneNode(true).lastChild.checked;bI.appendChecked=bD.checked;bC.removeChild(bD);bC.appendChild(bv);if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bA="on"+by;bw=(bA in bv);if(!bw){bv.setAttribute(bA,"return;");bw=(typeof bv[bA]==="function")}bI[by+"Bubbles"]=bw}}bC.removeChild(bv);bC=bF=bx=bv=bD=null;b(function(){var bM,bV,bW,bU,bO,bP,bR,bL,bK,bQ,bN,e,bT,bS=av.getElementsByTagName("body")[0];if(!bS){return}bL=1;bT="padding:0;margin:0;border:";bN="position:absolute;top:0;left:0;width:1px;height:1px;";e=bT+"0;visibility:hidden;";bK="style='"+bN+bT+"5px solid #000;";bQ="
"+""+"
";bM=av.createElement("div");bM.style.cssText=e+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bS.insertBefore(bM,bS.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bI.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);if(bd.getComputedStyle){bv.innerHTML="";bR=av.createElement("div");bR.style.width="0";bR.style.marginRight="0";bv.style.width="2px";bv.appendChild(bR);bI.reliableMarginRight=(parseInt((bd.getComputedStyle(bR,null)||{marginRight:0}).marginRight,10)||0)===0}if(typeof bv.style.zoom!=="undefined"){bv.innerHTML="";bv.style.width=bv.style.padding="1px";bv.style.border=0;bv.style.overflow="hidden";bv.style.display="inline";bv.style.zoom=1;bI.inlineBlockNeedsLayout=(bv.offsetWidth===3);bv.style.display="block";bv.style.overflow="visible";bv.innerHTML="
";bI.shrinkWrapBlocks=(bv.offsetWidth!==3)}bv.style.cssText=bN+e;bv.innerHTML=bQ;bV=bv.firstChild;bW=bV.firstChild;bO=bV.nextSibling.firstChild.firstChild;bP={doesNotAddBorder:(bW.offsetTop!==5),doesAddBorderForTableAndCells:(bO.offsetTop===5)};bW.style.position="fixed";bW.style.top="20px";bP.fixedPosition=(bW.offsetTop===20||bW.offsetTop===15);bW.style.position=bW.style.top="";bV.style.overflow="hidden";bV.style.position="relative";bP.subtractsBorderForOverflowNotVisible=(bW.offsetTop===-5);bP.doesNotIncludeMarginInBodyOffset=(bS.offsetTop!==bL);if(bd.getComputedStyle){bv.style.marginTop="1%";bI.pixelMargin=(bd.getComputedStyle(bv,null)||{marginTop:0}).marginTop!=="1%"}if(typeof bM.style.zoom!=="undefined"){bM.style.zoom=1}bS.removeChild(bM);bR=bv=bM=null;b.extend(bI,bP)});return bI})();var aT=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{"embed":true,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000","applet":true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA1,null,false)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function a6(bx,bw,by){if(by===L&&bx.nodeType===1){var bv="data-"+bw.replace(aA,"-$1").toLowerCase();by=bx.getAttribute(bv);if(typeof by==="string"){try{by=by==="true"?true:by==="false"?false:by==="null"?null:b.isNumeric(by)?+by:aT.test(by)?b.parseJSON(by):by}catch(bz){}b.data(bx,bw,by)}else{by=L}}return by}function S(bv){for(var e in bv){if(e==="data"&&b.isEmptyObject(bv[e])){continue}if(e!=="toJSON"){return false}}return true}function bj(by,bx,bA){var bw=bx+"defer",bv=bx+"queue",e=bx+"mark",bz=b._data(by,bw);if(bz&&(bA==="queue"||!b._data(by,bv))&&(bA==="mark"||!b._data(by,e))){setTimeout(function(){if(!b._data(by,bv)&&!b._data(by,e)){b.removeData(by,bw,true);bz.fire()}},0)}}b.extend({_mark:function(bv,e){if(bv){e=(e||"fx")+"mark";b._data(bv,e,(b._data(bv,e)||0)+1)}},_unmark:function(by,bx,bv){if(by!==true){bv=bx;bx=by;by=false}if(bx){bv=bv||"fx";var e=bv+"mark",bw=by?0:((b._data(bx,e)||1)-1);if(bw){b._data(bx,e,bw)}else{b.removeData(bx,e,true);bj(bx,bv,"mark")}}},queue:function(bv,e,bx){var bw;if(bv){e=(e||"fx")+"queue";bw=b._data(bv,e);if(bx){if(!bw||b.isArray(bx)){bw=b._data(bv,e,b.makeArray(bx))}else{bw.push(bx)}}return bw||[]}},dequeue:function(by,bx){bx=bx||"fx";var bv=b.queue(by,bx),bw=bv.shift(),e={};if(bw==="inprogress"){bw=bv.shift()}if(bw){if(bx==="fx"){bv.unshift("inprogress")}b._data(by,bx+".run",e);bw.call(by,function(){b.dequeue(by,bx)},e)}if(!bv.length){b.removeData(by,bx+"queue "+bx+".run",true);bj(by,bx,"queue")}}});b.fn.extend({queue:function(e,bv){var bw=2;if(typeof e!=="string"){bv=e;e="fx";bw--}if(arguments.length1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,bv){if($(this).is(".wp-new-prodcuts-detail-button-c img")){console.log(e,bv)}return b.access(this,b.prop,e,bv,arguments.length>1)},removeProp:function(e){e=b.propFix[e]||e;return this.each(function(){try{this[e]=L;delete this[e]}catch(bv){}})},addClass:function(by){var bA,bw,bv,bx,bz,bB,e;if(b.isFunction(by)){return this.each(function(bC){b(this).addClass(by.call(this,bC,this.className))})}if(by&&typeof by==="string"){bA=by.split(ag);for(bw=0,bv=this.length;bw-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.type]||b.valHooks[bw.nodeName.toLowerCase()];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aV,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aZ:bf)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(by,bA){var bz,bB,bw,e,bv,bx=0;if(bA&&by.nodeType===1){bB=bA.toLowerCase().split(ag);e=bB.length;for(;bx=0)}}})});var be=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/(?:^|\s)hover(\.\S+)?\b/,aP=/^key/,bg=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler;by=bv.selector}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bd,bI])}}for(bC=0;bCbC){bv.push({elem:this,matches:bD.slice(bC)})}for(bJ=0;bJ0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aP.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bg.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); (function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift() }b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}bE.match.globalPOS=bD; var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodevalsue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodevalsue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevalsl().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(B(bx[0])||B(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function B(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevalsl:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||bb.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aH(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e) }else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aS.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aS="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|"+"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ah=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,v=/]","i"),o=/checked\s*(?:[^=]|=\s*.checked.)/i,bn=/\/(java|ecma)script/i,aO=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){return b.access(this,function(bv){return bv===L?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(bv))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(e){return b.access(this,function(by){var bx=this[0]||{},bw=0,bv=this.length;if(by===L){return bx.nodeType===1?bx.innerHTML.replace(ah,""):null}if(typeof by==="string"&&!ae.test(by)&&(b.support.leadingWhitespace||!ar.test(by))&&!ax[(d.exec(by)||["",""])[1].toLowerCase()]){by=by.replace(R,"<$1>");try{for(;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bh(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function D(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function am(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||b.isXMLDoc(by)||!ai.test("<"+by.nodeName+">")?by.cloneNode(true):am(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){aj(by,bz);e=bh(by);bv=bh(bz);for(bx=0;e[bx];++bx){if(bv[bx]){aj(e[bx],bv[bx])}}}if(bA){s(by,bz);if(bw){e=bh(by);bv=bh(bz);for(bx=0;e[bx];++bx){s(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bI,bw,bv,bx){var bA,bH,bD,bJ=[];bw=bw||av;if(typeof bw.createElement==="undefined"){bw=bw.ownerDocument||bw[0]&&bw[0].ownerDocument||av}for(var bE=0,bG;(bG=bI[bE])!=null;bE++){if(typeof bG==="number"){bG+=""}if(!bG){continue}if(typeof bG==="string"){if(!W.test(bG)){bG=bw.createTextNode(bG)}else{bG=bG.replace(R,"<$1>");var bN=(d.exec(bG)||["",""])[1].toLowerCase(),bz=ax[bN]||ax._default,bK=bz[0],bB=bw.createElement("div"),bL=ac.childNodes,bM;if(bw===av){ac.appendChild(bB)}else{a(bw).appendChild(bB)}bB.innerHTML=bz[1]+bG+bz[2];while(bK--){bB=bB.lastChild}if(!b.support.tbody){var by=v.test(bG),e=bN==="table"&&!by?bB.firstChild&&bB.firstChild.childNodes:bz[1]===""&&!by?bB.childNodes:[];for(bD=e.length-1;bD>=0;--bD){if(b.nodeName(e[bD],"tbody")&&!e[bD].childNodes.length){e[bD].parentNode.removeChild(e[bD])}}}if(!b.support.leadingWhitespace&&ar.test(bG)){bB.insertBefore(bw.createTextNode(ar.exec(bG)[0]),bB.firstChild)}bG=bB.childNodes;if(bB){bB.parentNode.removeChild(bB);if(bL.length>0){bM=bL[bL.length-1];if(bM&&bM.parentNode){bM.parentNode.removeChild(bM)}}}}}var bF;if(!b.support.appendChecked){if(bG[0]&&typeof(bF=bG.length)==="number"){for(bD=0;bD1)};b.extend({cssHooks:{opacity:{get:function(bw,bv){if(bv){var e=Z(bw,"opacity");return e===""?"1":e}else{return bw.style.opacity}}}},cssNumber:{"fillOpacity":true,"fontWeight":true,"lineHeight":true,"opacity":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(bx,bw,bD,by){if(!bx||bx.nodeType===3||bx.nodeType===8||!bx.style){return}if($(bx).is("#layer8E786237F92D3E1D5D1896319EC165AD .fileicon")){console.log(bw,bD,by);console.trace()}var bB,bC,bz=b.camelCase(bw),bv=bx.style,bE=b.cssHooks[bz];bw=b.cssProps[bz]||bz;if(bD!==L){bC=typeof bD;if(bC==="string"&&(bB=I.exec(bD))){bD=(+(bB[1]+1)*+bB[2])+parseFloat(b.css(bx,bw));bC="number"}if(bD==null||bC==="number"&&isNaN(bD)){return}if(bC==="number"&&!b.cssNumber[bz]){bD+="px"}if(!bE||!("set" in bE)||(bD=bE.set(bx,bD))!==L){try{bv[bw]=bD}catch(bA){}}}else{if(bE&&"get" in bE&&(bB=bE.get(bx,false,by))!==L){return bB}return bv[bw]}},css:function(by,bx,bv){var bw,e;bx=b.camelCase(bx);e=b.cssHooks[bx];bx=b.cssProps[bx]||bx;if(bx==="cssFloat"){bx="float"}if(e&&"get" in e&&(bw=e.get(by,true,bv))!==L){return bw}else{if(Z){return Z(by,bx)}}},swap:function(by,bx,bz){var e={},bw,bv;for(bv in bx){e[bv]=by.style[bv];by.style[bv]=bx[bv]}bw=bz.call(by);for(bv in bx){by.style[bv]=e[bv]}return bw}});b.curCSS=b.css;if(av.defaultView&&av.defaultView.getComputedStyle){aJ=function(bA,bw){var bv,bz,e,by,bx=bA.style;bw=bw.replace(y,"-$1").toLowerCase();if((bz=bA.ownerDocument.defaultView)&&(e=bz.getComputedStyle(bA,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(bA.ownerDocument.documentElement,bA)){bv=b.style(bA,bw)}}if(!b.support.pixelMargin&&e&&aE.test(bw)&&a1.test(bv)){by=bx.width;bx.width=bv;bv=e.width;bx.width=by}return bv}}if(av.documentElement.currentStyle){aY=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv==null&&bx&&(by=bx[bw])){bv=by}if(a1.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":bv;bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aJ||aY;function af(by,bw,bv){var bz=bw==="width"?by.offsetWidth:by.offsetHeight,bx=bw==="width"?1:0,e=4;if(bz>0){if(bv!=="border"){for(;bx=1&&b.trim(bw.replace(al,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=al.test(bw)?bw.replace(al,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bv,e){return b.swap(bv,{"display":"inline-block"},function(){if(e){return Z(bv,"margin-right")}else{return bv.style.marginRight}})}}}});if(b.expr&&b.expr.filters){b.expr.filters.hidden=function(bw){var bv=bw.offsetWidth,e=bw.offsetHeight;return(bv===0&&e===0)||(!b.support.reliableHiddenOffsets&&((bw.style&&bw.style.display)||b.css(bw,"display"))==="none") };b.expr.filters.visible=function(e){return !b.expr.filters.hidden(e)}}b.each({margin:"",padding:"",border:"Width"},function(e,bv){b.cssHooks[e+bv]={expand:function(by){var bx,bz=typeof by==="string"?by.split(" "):[by],bw={};for(bx=0;bx<4;bx++){bw[e+G[bx]+bv]=bz[bx]||bz[bx-2]||bz[0]}return bw}}});var k=/%20/g,ap=/\[\]$/,bs=/\r?\n/g,bq=/#.*$/,aD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,a0=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aN=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,aR=/^(?:GET|HEAD)$/,c=/^\/\//,M=/\?/,a7=/)<[^<]*)*<\/script>/gi,p=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,z=b.fn.load,aa={},q={},aF,r,aW=["*/"]+["*"];try{aF=bm.href}catch(aw){aF=av.createElement("a");aF.href="";aF=aF.href}r=K.exec(aF.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a7,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||p.test(this.nodeName)||a0.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){an(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}an(bv,e);return bv},ajaxSettings:{url:aF,isLocal:aN.test(r[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bd.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(q),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bk(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=F(bD,bY);bX="success"; bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,r[1]+"http://");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=r[1]||bI[2]!=r[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(r[3]||(r[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aX(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aR.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aW+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aX(q,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){u(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function u(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{u(bw+"["+(typeof bz==="object"?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&b.type(by)==="object"){for(var e in by){u(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bk(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function F(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!ba){ba=av.createElement("iframe");ba.frameBorder=ba.width=ba.height=0}e.appendChild(ba);if(!m||!ba.createElement){m=(ba.contentWindow||ba.contentDocument).document;m.write((b.support.boxModel?"":"")+"

AG8旗舰厅

=bF[e]){return bF[bv]}return Math.max(bC.body[e],bF[e],bC.body[by],bF[by]) }if(bD===L){bG=b.css(bC,bB);bA=parseFloat(bG);return b.isNumeric(bA)?bA:bG}b(bC).css(bB,bD)},bx,bz,arguments.length,null)}});bd.jQuery=bd.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);; /* * jQuery UI 1.8.17 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI */ (function(D,B){function A(E){return !D(E).parents().andSelf().filter(function(){return D.curCSS(this,"visibility")==="hidden"||D.expr.filters.hidden(this)}).length}function C(H,I){var G=H.nodeName.toLowerCase();if("area"===G){var J=H.parentNode,E=J.name,F;if(!H.href||!E||J.nodeName.toLowerCase()!=="map"){return !1}F=D("img[usemap=#"+E+"]")[0];return !!F&&A(F)}return(/input|select|textarea|button|object/.test(G)?!H.disabled:"a"==G?H.href||I:I)&&A(H)}D.ui=D.ui||{};D.ui.version||(D.extend(D.ui,{version:"1.8.17",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),D.fn.extend({propAttr:D.fn.prop||D.fn.attr,_focus:D.fn.focus,focus:function(E,F){return typeof E=="number"?this.each(function(){var G=this;setTimeout(function(){D(G).focus(),F&&F.call(G)},E)}):this._focus.apply(this,arguments)},scrollParent:function(){var E;D.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?E=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(D.curCSS(this,"position",1))&&/(auto|scroll)/.test(D.curCSS(this,"overflow",1)+D.curCSS(this,"overflow-y",1)+D.curCSS(this,"overflow-x",1))}).eq(0):E=this.parents().filter(function(){return/(auto|scroll)/.test(D.curCSS(this,"overflow",1)+D.curCSS(this,"overflow-y",1)+D.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!E.length?D(document):E},zIndex:function(G){if(G!==B){return this.css("zIndex",G)}if(this.length){var E=D(this[0]),F,H;while(E.length&&E[0]!==document){F=E.css("position");if(F==="absolute"||F==="relative"||F==="fixed"){H=parseInt(E.css("zIndex"),10);if(!isNaN(H)&&H!==0){return H}}E=E.parent()}}return 0},disableSelection:function(){return this.bind((D.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(E){E.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),D.each(["Width","Height"],function(I,F){function E(L,M,K,N){D.each(G,function(){M-=parseFloat(D.curCSS(L,"padding"+this,!0))||0,K&&(M-=parseFloat(D.curCSS(L,"border"+this+"Width",!0))||0),N&&(M-=parseFloat(D.curCSS(L,"margin"+this,!0))||0)});return M}var G=F==="Width"?["Left","Right"]:["Top","Bottom"],J=F.toLowerCase(),H={innerWidth:D.fn.innerWidth,innerHeight:D.fn.innerHeight,outerWidth:D.fn.outerWidth,outerHeight:D.fn.outerHeight};D.fn["inner"+F]=function(K){if(K===B){return H["inner"+F].call(this)}return this.each(function(){D(this).css(J,E(this,K)+"px")})},D.fn["outer"+F]=function(K,L){if(typeof K!="number"){return H["outer"+F].call(this,K)}return this.each(function(){D(this).css(J,E(this,K,!0,L)+"px")})}}),D.extend(D.expr[":"],{data:function(F,G,E){return !!D.data(F,E[3])},focusable:function(E){return C(E,!isNaN(D.attr(E,"tabindex")))},tabbable:function(G){var E=D.attr(G,"tabindex"),F=isNaN(E);return(F||E>=0)&&C(G,!F)}}),D(function(){var E=document.body,F=E.appendChild(F=document.createElement("div"));D.extend(F.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),D.support.minHeight=F.offsetHeight===100,D.support.selectstart="onselectstart" in F,E.removeChild(F).style.display="none"}),D.extend(D.ui,{plugin:{add:function(G,H,E){var F=D.ui[G].prototype;for(var I in E){F.plugins[I]=F.plugins[I]||[],F.plugins[I].push([H,E[I]])}},call:function(I,G,H){var E=I.plugins[G];if(!!E&&!!I.element[0].parentNode){for(var F=0;F0){return !0}G[E]=1,F=G[E]>0,G[E]=0;return F},isOverAxis:function(G,E,F){return G>E&&G=9)&&!D.button){return this._mouseUp(D)}if(this._mouseStarted){this._mouseDrag(D);return D.preventDefault()}this._mouseDistanceMet(D)&&this._mouseDelayMet(D)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,D)!==!1,this._mouseStarted?this._mouseDrag(D):this._mouseUp(D));return !this._mouseStarted},_mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,D.target==this._mouseDownEvent.target&&C.data(D.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(D));return !1},_mouseDistanceMet:function(D){return Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance},_mouseDelayMet:function(D){return this.mouseDelayMet},_mouseStart:function(D){},_mouseDrag:function(D){},_mouseStop:function(D){},_mouseCapture:function(D){return !0}})})(jQuery);(function(B,A){B.widget("ui.draggable",B.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,concernAngle:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(D){var C=this.options;if(this.helper||C.disabled||B(D.target).is(".ui-resizable-handle,.ui-resizable-handle>.knob")){return false}this.handle=this._getHandle(D);if(!this.handle){return false}if(C.iframeFix){B(C.iframeFix===true?"iframe":C.iframeFix).each(function(){B('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(B(this).offset()).appendTo("body")})}return true},_mouseStart:function(E){var D=this.options;this.helper=this._createHelper(E);this._cacheHelperProportions();if(B.ui.ddmanager){B.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();if(D.concernAngle){var C=this.element.parent().offset();this.offset=this.positionAbs={left:C.left+B.parseInteger(this.element.css("left")),top:C.top+B.parseInteger(this.element.css("top"))}}this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};B.extend(this.offset,{click:{left:E.pageX-this.offset.left,top:E.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(E);if(D.concernAngle){this.originalPosition.left=B.parseInteger(this.element.css("left"))}this.originalPageX=E.pageX;this.originalPageY=E.pageY;(D.cursorAt&&this._adjustOffsetFromHelper(D.cursorAt));if(D.containment){this._setContainment()}if(this._trigger("start",E)===false){this._clear();return false}this._cacheHelperProportions();if(B.ui.ddmanager&&!D.dropBehaviour){B.ui.ddmanager.prepareOffsets(this,E)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(E,true);if(B.ui.ddmanager){B.ui.ddmanager.dragStart(this,E)}return true},_mouseDrag:function(E,D){this.position=this._generatePosition(E);this.positionAbs=this._convertPositionTo("absolute");if(!D){var C=this._uiHash();if(this._trigger("drag",E,C)===false){this._mouseUp({});return false}this.position=C.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(B.ui.ddmanager){B.ui.ddmanager.drag(this,E)}return false},_mouseStop:function(E){var D=false;if(B.ui.ddmanager&&!this.options.dropBehaviour){D=B.ui.ddmanager.drop(this,E)}if(this.dropped){D=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true||(B.isFunction(this.options.revert)&&this.options.revert.call(this.element,D))){var C=this;B(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(C._trigger("stop",E)!==false){C._clear()}})}else{if(this._trigger("stop",E)!==false){this._clear()}}return false},_mouseUp:function(C){if(this.options.iframeFix===true){B("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}if(B.ui.ddmanager){B.ui.ddmanager.dragStop(this,C)}return B.ui.mouse.prototype._mouseUp.call(this,C)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(D){var C=!this.options.handle||!B(this.options.handle,this.element).length?true:false;B(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==D.target){C=true}});return C},_createHelper:function(D){var C=this.options;var E=B.isFunction(C.helper)?B(C.helper.apply(this.element[0],[D])):(C.helper=="clone"?this.element.clone().removeAttr("id"):this.element);if(!E.parents("body").length){E.appendTo((C.appendTo=="parent"?this.element[0].parentNode:C.appendTo))}if(E[0]!=this.element[0]&&!(/(fixed|absolute)/).test(E.css("position"))){E.css("position","absolute")}return E},_adjustOffsetFromHelper:function(C){if(typeof C=="string"){C=C.split(" ")}if(B.isArray(C)){C={left:+C[0],top:+C[1]||0}}if("left" in C){this.offset.click.left=C.left+this.margins.left}if("right" in C){this.offset.click.left=this.helperProportions.width-C.right+this.margins.left}if("top" in C){this.offset.click.top=C.top+this.margins.top}if("bottom" in C){this.offset.click.top=this.helperProportions.height-C.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var C=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&B.ui.contains(this.scrollParent[0],this.offsetParent[0])){C.left+=this.scrollParent.scrollLeft();C.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&B.browser.msie)){C={top:0,left:0}}return{top:C.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:C.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var C=this.element.position();return{top:C.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:C.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var D=this.options;if(D.containment=="parent"){D.containment=this.helper[0].parentNode}if(D.containment=="document"||D.containment=="window"){this.containment=[D.containment=="document"?0:B(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,D.containment=="document"?0:B(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(D.containment=="document"?0:B(window).scrollLeft())+B(D.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(D.containment=="document"?0:B(window).scrollTop())+(B(D.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(D.containment)&&D.containment.constructor!=Array){var F=B(D.containment);var G=F[0];if(!G){return}var C=F.offset();var E=(B(G).css("overflow")!="hidden");this.containment=[(parseInt(B(G).css("borderLeftWidth"),10)||0)+(parseInt(B(G).css("paddingLeft"),10)||0),(parseInt(B(G).css("borderTopWidth"),10)||0)+(parseInt(B(G).css("paddingTop"),10)||0),(E?Math.max(G.scrollWidth,G.offsetWidth):G.offsetWidth)-(parseInt(B(G).css("borderLeftWidth"),10)||0)-(parseInt(B(G).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(E?Math.max(G.scrollHeight,G.offsetHeight):G.offsetHeight)-(parseInt(B(G).css("borderTopWidth"),10)||0)-(parseInt(B(G).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=F}else{if(D.containment.constructor==Array){this.containment=D.containment}}},_convertPositionTo:function(C,E){if(!E){E=this.position}var H=C=="absolute"?1:-1;var D=this.options,G=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&B.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,F=(/(html|body)/i).test(G[0].tagName);return{top:(E.top+this.offset.relative.top*H+this.offset.parent.top*H-(B.browser.safari&&B.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(F?0:G.scrollTop()))*H)),left:(E.left+this.offset.relative.left*H+this.offset.parent.left*H-(B.browser.safari&&B.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():F?0:G.scrollLeft())*H))}},_generatePosition:function(G){var K=this.options,L=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&B.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,C=(/(html|body)/i).test(L[0].tagName);var I=G.pageX;var H=G.pageY;if(this.originalPosition){var J;if(this.containment){if(this.relative_container){var F=this.relative_container.offset();J=[this.containment[0]+F.left,this.containment[1]+F.top,this.containment[2]+F.left,this.containment[3]+F.top]}else{J=this.containment}if(G.pageX-this.offset.click.leftJ[2]){I=J[2]+this.offset.click.left}if(G.pageY-this.offset.click.top>J[3]){H=J[3]+this.offset.click.top}}if(K.grid){var D=K.grid[1]?this.originalPageY+Math.round((H-this.originalPageY)/K.grid[1])*K.grid[1]:this.originalPageY;H=J?(!(D-this.offset.click.topJ[3])?D:(!(D-this.offset.click.topJ[2])?E:(!(E-this.offset.click.left=0;H--){var K=L.snapElements[H].left,C=K+L.snapElements[H].width,F=L.snapElements[H].top,M=F+L.snapElements[H].height;if(!((K-N=0;H--){var U=G.position.left;if(U<0){U=0}var X=U+L.helperProportions.width,V=G.position.top+R,Y=V+L.helperProportions.height;var J=L.snapElements[H].left,Q=J+L.snapElements[H].width,F=L.snapElements[H].top,P=F+L.snapElements[H].height;var T=Math.abs(J-U)<=O;var Z=Math.abs(J-X)<=O;var E=Math.abs(F-V)<=O;var K=Math.abs(F-Y)<=O;if(B(L.snapElements[H].item).closest(".rulerh").length){E=false;K=false}else{T=false;Z=false}if(T){G.position.left=G.position.left+J-U}if(Z){G.position.left=G.position.left+(J-X)}if(E){G.position.top=G.position.top+F-V}if(K){G.position.top=G.position.top+F-Y}var D=(E||K||T||Z);if((E||K||T||Z||D)){if(B(L.snapElements[H].item).closest(".rulerh").length){B(".rulerh .rulerguide.showline").each(function(){var c=B(this).data("snapel");var b=c.left;var d=G.position.left,a=d+L.helperProportions.width;if(!(Math.abs(b-d)<0.5||Math.abs(b-a)<0.5)){B(this).removeClass("showline")}})}else{B(".rulerv .rulerguide.showline").each(function(){var b=B(this).data("snapel");var c=b.top;var d=G.position.top+R,a=d+L.helperProportions.height;if(!(Math.abs(c-d)<0.5||Math.abs(c-a)<0.5)){B(this).removeClass("showline")}})}B(L.snapElements[H].item).addClass("showline")}else{L.snapElements[H].snapping=false;B(L.snapElements[H].item).removeClass("showline");continue}L.snapElements[H].snapping=(E||K||T||Z||D)}},stop:function(D,C){B(".rulerguide").removeClass("showline");B(this).unbind("layersnapstart")}});B.ui.plugin.add("draggable","wopop_snap2",{start:function(H,D){return;var J=B(this).data("draggable"),L=J.options;var K=L.wopop_snap;if(!K){return}if(B(this).data("deg")){return}if(!B(this).is(".cstlayer")){return}var E=false;B(".ui-modselected").each(function(){B(this).data("left",B(this).css("left"));B(this).data("top",B(this).css("top"));B(this).data("width",B(this).css("width"));B(this).data("height",B(this).css("height"));if(B(this).data("cstlayerstatus")=="unlock"){E=true}});if(E){return}if(B(this).closest(".fullpagesection").length){return}J.snapElements=[];var G=B(this).ab_pos_cnter("top")-J.originalPosition.top;J.wopop_ab_top=G;var M=[];var N=[];function C(P,R){for(var O=0;O";B("#scroll_container").append(W)}if(C(U,N)==-1){N.push(U);var W="
";B("#scroll_container").append(W)}if(C(T,M)==-1){M.push(T);var W="
";B("#scroll_container").append(W)}if(C(O,M)==-1){M.push(O);var W="
";B("#scroll_container").append(W)}}B(this).unbind("layersnapstart").bind("layersnapstart",function(){F();if(B.getElementAreaInf(B(this))=="canvas"){B("#canvas .cstlayer:not(.ui-modselected)").each(function(){I(B(this))})}else{B("#scroll_container .cstlayer:not(.ui-modselected)").each(function(){I(B(this))})}J.snapElements=[];var P=B("#scroll_container").scrollTop();var O=B("#canvas").offset().left;B(".wopop_snap").each(function(){var S=B(this);var R=S.offset();if(S.is(".wopop_snap_vertical")){var Q={item:this,width:0,height:S.outerHeight(),top:0,left:R.left-O};J.snapElements.push(Q);B(this).data("snapel",Q)}else{var Q={item:this,width:S.outerWidth(),height:0,top:parseInt(S.css("top"))||0,left:0};J.snapElements.push(Q);B(this).data("snapel",Q)}})});B(this).trigger("layersnapstart")},drag:function(S,G){return;var L=B(this).data("draggable"),I=L.options;var C=I.wopop_snap;if(!C){return}if(B(this).data("deg")){return}if(!B(this).is(".cstlayer")){return}var M="outer";var O=3;var N=B("#scroll_container").scrollTop();var W=L.ori_scct;if(N!=W){B(this).trigger("layersnapstart")}var R=L.wopop_ab_top;for(var H=L.snapElements.length-1;H>=0;H--){var U=G.position.left,X=U+L.helperProportions.width,V=G.position.top+R,Y=V+L.helperProportions.height;var J=L.snapElements[H].left,Q=J+L.snapElements[H].width,F=L.snapElements[H].top,P=F+L.snapElements[H].height;var T=Math.abs(J-U)<=O;var Z=Math.abs(J-X)<=O;var E=Math.abs(F-V)<=O;var K=Math.abs(F-Y)<=O;if(T){G.position.left=G.position.left+J-U}if(Z){G.position.left=G.position.left+(J-X)}if(E){G.position.top=G.position.top+F-V}if(K){G.position.top=G.position.top+F-Y}var D=(E||K||T||Z);if((E||K||T||Z||D)){if(B(L.snapElements[H].item).is(".wopop_snap_vertical")){B(".wopop_snap_vertical.showline").each(function(){var c=B(this).data("snapel");var b=c.left;var d=G.position.left,a=d+L.helperProportions.width;if(!(Math.abs(b-d)<0.5||Math.abs(b-a)<0.5)){B(this).removeClass("showline")}})}else{B(".wopop_snap_horizon.showline").each(function(){var b=B(this).data("snapel");var c=b.top;var d=G.position.top+R,a=d+L.helperProportions.height;if(!(Math.abs(c-d)<0.5||Math.abs(c-a)<0.5)){B(this).removeClass("showline")}})}B(L.snapElements[H].item).addClass("showline")}else{L.snapElements[H].snapping=false;B(L.snapElements[H].item).removeClass("showline");continue}L.snapElements[H].snapping=(E||K||T||Z||D)}},stop:function(D,C){return;B(".wopop_snap").remove();B(this).unbind("layersnapstart")}});B.ui.plugin.add("draggable","stack",{start:function(F,C){var E=B(this).data("draggable").options;var D=B.makeArray(B(E.stack)).sort(function(I,H){return(parseInt(B(I).css("zIndex"),10)||0)-(parseInt(B(H).css("zIndex"),10)||0)});if(!D.length){return}var G=parseInt(D[0].style.zIndex)||0;B(D).each(function(H){this.style.zIndex=G+H});this[0].style.zIndex=G+D.length}});B.ui.plugin.add("draggable","zIndex",{start:function(E,C){var F=B(C.helper),D=B(this).data("draggable").options;if(F.css("zIndex")){D._zIndex=F.css("zIndex")}F.css("zIndex",D.zIndex)},stop:function(E,C){var D=B(this).data("draggable").options;if(D._zIndex){B(C.helper).css("zIndex",D._zIndex)}}})})(jQuery);(function(B,A){B.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var C=this.options,D=C.accept;this.isover=0,this.isout=1,this.accept=B.isFunction(D)?D:function(E){return E.is(D)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},B.ui.ddmanager.droppables[C.scope]=B.ui.ddmanager.droppables[C.scope]||[],B.ui.ddmanager.droppables[C.scope].push(this),C.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var C=B.ui.ddmanager.droppables[this.options.scope];for(var D=0;D=E&&O<=J||F>=E&&F<=J||OJ)&&(C>=G&&C<=D||N>=G&&N<=D||CD);default:return !1}},B.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(G,H){var D=B.ui.ddmanager.droppables[G.options.scope]||[],E=H?H.type:null,I=(G.currentItem||G.element).find(":data(droppable)").andSelf();droppablesLoop:for(var C=0;C').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=H.handles||(!D(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var I=this.handles.split(",");this.handles={};for(var F=0;F');if(/sw|se|ne|nw/.test(E)){K.css({zIndex:++H.zIndex})}if("se"==E){K.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[E]=".ui-resizable-"+E;this.element.append(K)}}this._renderAxis=function(O){O=O||this.element;for(var L in this.handles){if(this.handles[L].constructor==String){this.handles[L]=D(this.handles[L],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var P=D(this.handles[L],this.element),N=0;N=/sw|ne|nw|se|n|s/.test(L)?P.outerHeight():P.outerWidth();var M=["padding",/ne|nw|n/.test(L)?"Top":/se|sw|s/.test(L)?"Bottom":/^e$/.test(L)?"Right":"Left"].join("");O.css(M,N);this._proportionallyResize()}if(!D(this.handles[L]).length){continue}}};this._renderAxis(this.element);this._handles=D(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!G.resizing){if(this.className){var L=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}G.axis=L&&L[1]?L[1]:"se"}});if(H.autoHide){this._handles.hide();D(this.element).addClass("ui-resizable-autohide").hover(function(){if(H.disabled){return}D(this).removeClass("ui-resizable-autohide");G._handles.show()},function(){if(H.disabled){return}if(!G.resizing){D(this).addClass("ui-resizable-autohide");G._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var F=function(G){D(G).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){F(this.element);var E=this.element;E.after(this.originalElement.css({position:E.css("position"),width:E.outerWidth(),height:E.outerHeight(),top:E.css("top"),left:E.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);F(this.originalElement);return this},_mouseCapture:function(G){var E=false;for(var F in this.handles){if(D(G.target).is(".down_arrow,.up_arrow")){return false}if(D(this.handles[F])[0]==G.target||D(this.handles[F])[0]==G.target.parentNode){E=true}}var H=true;if(this.options.concernLock&&this.element.data("cstlayerstatus")=="unlock"){H=false}return !this.options.disabled&&E&&H},_mouseStart:function(I){var G=this.options,H=this.element.position(),E=this.element;this.resizing=true;this.documentScroll={top:D(document).scrollTop(),left:D(document).scrollLeft()};if(!G.concernAngle&&!G.noinit){if(E.is(".ui-draggable")||(/absolute/).test(E.css("position"))){E.css({position:"absolute",top:H.top,left:H.left})}}if(D.browser.opera&&(/relative/).test(E.css("position"))){E.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var K=C(this.helper.css("left")),J=C(this.helper.css("top"));if(G.containment){K+=D(G.containment).scrollLeft()||0;J+=D(G.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:K,top:J};if(D.browser.msie&&D.browser.version<9&&E.data("deg")%360!=0){this.size={width:E.data("IEWidth"),height:E.data("IEHeight")}}else{this.size=this._helper?{width:E.outerWidth(),height:E.outerHeight()}:{width:E.width(),height:E.height()}}this.originalSize=this._helper?{width:E.outerWidth(),height:E.outerHeight()}:{width:E.width(),height:E.height()};this.originalPosition={left:K,top:J};this.sizeDiff={width:E.outerWidth()-E.width(),height:E.outerHeight()-E.height()};this.originalMousePosition={left:I.pageX,top:I.pageY};if(G.scroll&&(!G.concernAngle||G.concernAngle&&!this.element.data("deg"))){this.scrollParent=this.element.scrollParent();this.originalMousePosition.top+=this.scrollParent.scrollTop()}this.aspectRatio=(typeof G.aspectRatio=="number")?G.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);if(G.concernAngle){D.divrotate.getDegreeResizeCursor(this.element)}var F=this.element.find(".ui-resizable-"+this.axis).css("cursor");D("body").css("cursor",F=="auto"?this.axis+"-resize":F);E.addClass("ui-resizable-resizing");this._propagate("start",I);return true},_mouseDrag:function(H){var J=this.helper,L=this.options,I={},O=this,R=this.originalMousePosition,Q=this.axis;var K=H.pageY;if(L.scroll&&(!L.concernAngle||L.concernAngle&&!this.element.data("deg"))){K+=this.scrollParent.scrollTop()}var N=(H.pageX-R.left)||0,M=(K-R.top)||0;var E=this._change[Q];if(!E){return false}var G=E.apply(this,[H,N,M]),F=D.browser.msie&&D.browser.version<7,P=this.sizeDiff;this._updateVirtualBoundaries(H.shiftKey);if(!D.isFunction(L.aspectFunc)&&(this._aspectRatio||H.shiftKey)){G=this._updateRatio(G,H)}else{if(D.isFunction(L.aspectFunc)){G=this._updateAFunc(G,H)}}G=this._respectSize(G,H);this._propagate("resize",H);J.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(G);this._trigger("resize",H,this.ui());return false},_mouseStop:function(I){this.resizing=false;var M=this.options,K=this;if(this._helper){var F=this._proportionallyResizeElements,E=F.length&&(/textarea/i).test(F[0].nodeName),L=E&&D.ui.hasScroll(F[0],"left")?0:K.sizeDiff.height,N=E?0:K.sizeDiff.width;var G={width:(K.helper.width()-N),height:(K.helper.height()-L)},H=(parseInt(K.element.css("left"),10)+(K.position.left-K.originalPosition.left))||null,J=(parseInt(K.element.css("top"),10)+(K.position.top-K.originalPosition.top))||null;if(!M.animate){this.element.css(D.extend(G,{top:J,left:H}))}K.helper.height(K.size.height);K.helper.width(K.size.width);if(this._helper&&!M.animate){this._proportionallyResize()}}D("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",I);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(H){var E=this.options,I,J,G,F,K;K={minWidth:A(E.minWidth)?E.minWidth:0,maxWidth:A(E.maxWidth)?E.maxWidth:Infinity,minHeight:A(E.minHeight)?E.minHeight:0,maxHeight:A(E.maxHeight)?E.maxHeight:Infinity};if(this._aspectRatio||H){I=K.minHeight*this.aspectRatio;G=K.minWidth/this.aspectRatio;J=K.maxHeight*this.aspectRatio;F=K.maxWidth/this.aspectRatio;if(I>K.minWidth){K.minWidth=I}if(G>K.minHeight){K.minHeight=G}if(JI.width),G=A(I.height)&&O.minHeight&&(O.minHeight>I.height);if(H){I.width=O.minWidth}if(G){I.height=O.minHeight}if(L){I.width=O.maxWidth}if(F){I.height=O.maxHeight}var J=this.originalPosition.left+this.originalSize.width,P=this.position.top+this.size.height;var E=/sw|nw|w/.test(S),R=/nw|ne|n/.test(S);if(H&&E){I.left=J-O.minWidth}if(L&&E){I.left=J-O.maxWidth}if(G&&R){I.top=P-O.minHeight}if(F&&R){I.top=P-O.maxHeight}var Q=!I.width&&!I.height;if(Q&&!I.left&&I.top){I.top=null}else{if(Q&&!I.top&&I.left){I.left=null}}return I},_proportionallyResize:function(){var F=this.options;if(!this._proportionallyResizeElements.length){return}var I=this.helper||this.element;for(var E=0;E');var G=D.browser.msie&&D.browser.version<7,I=(G?1:0),H=(G?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+H,height:this.element.outerHeight()+H,position:"absolute",left:this.elementOffset.left-I+"px",top:this.elementOffset.top-I+"px",zIndex:++F.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(I,G,E){var F=this.options,J=this.originalSize,H=this.originalPosition;if(F.concernAngle&&this.element.data("deg")){return D.divrotate.getDegreeResizeChange(this.element,[G,E],H,J,"e")}return{width:this.originalSize.width+G}},w:function(I,G,E){var F=this.options,J=this.originalSize,H=this.originalPosition;if(F.concernAngle&&this.element.data("deg")){return D.divrotate.getDegreeResizeChange(this.element,[G,E],H,J,"w")}return{left:H.left+G,width:J.width-G}},n:function(I,G,E){var F=this.options,J=this.originalSize,H=this.originalPosition;if(F.concernAngle&&this.element.data("deg")){return D.divrotate.getDegreeResizeChange(this.element,[G,E],H,J,"n")}else{return{top:H.top+E,height:J.height-E}}},s:function(I,G,E){var F=this.options,J=this.originalSize,H=this.originalPosition;if(F.concernAngle&&this.element.data("deg")){return D.divrotate.getDegreeResizeChange(this.element,[G,E],H,J,"s")}return{height:this.originalSize.height+E}},se:function(G,F,E){return D.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[G,F,E]))},sw:function(G,F,E){return D.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[G,F,E]))},ne:function(G,F,E){return D.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[G,F,E]))},nw:function(G,M,L){var J=this.options,E=this.originalSize,F=this.originalPosition;if(J.concernAngle&&this.element.data("deg")){var K=F.left,H=F.top;var I=this._change.n.apply(this,arguments);var N=this._change.w.apply(this,arguments);var O=D.extend({},I,N);O.left=I.left+N.left-K;O.top=I.top+N.top-H;return O}return D.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[G,M,L]))}},_propagate:function(E,F){D.ui.plugin.call(this,E,[F,this.ui()]);(E!="resize"&&this._trigger(E,F,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});D.extend(D.ui.resizable,{version:"1.8.17"});D.ui.plugin.add("resizable","alsoResize",{start:function(H,E){var F=D(this).data("resizable"),G=F.options;var I=function(J){D(J).each(function(){var K=D(this);K.data("resizable-alsoresize",{width:parseInt(K.width(),10),height:parseInt(K.height(),10),left:parseInt(K.css("left"),10),top:parseInt(K.css("top"),10),position:K.css("position")})})};if(typeof(G.alsoResize)=="object"&&!G.alsoResize.parentNode){if(G.alsoResize.length){G.alsoResize=G.alsoResize[0];I(G.alsoResize)}else{D.each(G.alsoResize,function(J){I(J)})}}else{I(G.alsoResize)}},resize:function(G,E){var H=D(this).data("resizable"),I=H.options,L=H.originalSize,K=H.originalPosition;var J={height:(H.size.height-L.height)||0,width:(H.size.width-L.width)||0,top:(H.position.top-K.top)||0,left:(H.position.left-K.left)||0},F=function(M,N){D(M).each(function(){var O=D(this),R=D(this).data("resizable-alsoresize"),P={},Q=N&&N.length?N:O.parents(E.originalElement[0]).length?["width","height"]:["width","height","top","left"];D.each(Q,function(S,T){var U=(R[T]||0)+(J[T]||0);if(U&&U>=0){P[T]=U||null}});if(D.browser.opera&&/relative/.test(O.css("position"))){H._revertToRelativePosition=true;O.css({position:"absolute",top:"auto",left:"auto"})}O.css(P)})};if(typeof(I.alsoResize)=="object"&&!I.alsoResize.nodeType){D.each(I.alsoResize,function(M,N){F(M,N)})}else{F(I.alsoResize)}},stop:function(H,E){var F=D(this).data("resizable"),G=F.options;var I=function(J){D(J).each(function(){var K=D(this);K.css({position:K.data("resizable-alsoresize").position})})};if(F._revertToRelativePosition){F._revertToRelativePosition=false;if(typeof(G.alsoResize)=="object"&&!G.alsoResize.nodeType){D.each(G.alsoResize,function(J){I(J)})}else{I(G.alsoResize)}}D(this).removeData("resizable-alsoresize")}});D.ui.plugin.add("resizable","animate",{stop:function(H,G){var N=D(this).data("resizable"),M=N.options;var F=N._proportionallyResizeElements,E=F.length&&(/textarea/i).test(F[0].nodeName),L=E&&D.ui.hasScroll(F[0],"left")?0:N.sizeDiff.height,O=E?0:N.sizeDiff.width;var K={width:(N.size.width-O),height:(N.size.height-L)},J=(parseInt(N.element.css("left"),10)+(N.position.left-N.originalPosition.left))||null,I=(parseInt(N.element.css("top"),10)+(N.position.top-N.originalPosition.top))||null;N.element.animate(D.extend(K,I&&J?{top:I,left:J}:{}),{duration:M.animateDuration,easing:M.animateEasing,step:function(){var P={width:parseInt(N.element.css("width"),10),height:parseInt(N.element.css("height"),10),top:parseInt(N.element.css("top"),10),left:parseInt(N.element.css("left"),10)};if(F&&F.length){D(F[0]).css({width:P.width,height:P.height})}N._updateCache(P);N._propagate("resize",H)}})}});D.ui.plugin.add("resizable","containment",{start:function(J,G){var N=D(this).data("resizable"),L=N.options,K=N.element;var Q=L.containment,O=(Q instanceof D)?Q.get(0):(/parent/.test(Q))?K.parent().get(0):Q;if(!O){return}N.containerElement=D(O);if(/document/.test(Q)||Q==document){N.containerOffset={left:0,top:0};N.containerPosition={left:0,top:0};N.parentData={element:D(document),left:0,top:0,width:D(document).width(),height:D(document).height()||document.body.parentNode.scrollHeight}}else{var F=D(O),H=[];D(["Top","Right","Left","Bottom"]).each(function(S,T){H[S]=C(F.css("padding"+T))});N.containerOffset=F.offset();N.containerPosition=F.position();N.containerSize={height:(F.innerHeight()-H[3]),width:(F.innerWidth()-H[1])};var I=N.containerOffset,E=N.containerSize.height,P=N.containerSize.width,M=(D.ui.hasScroll(O,"left")?O.scrollWidth:P),R=(D.ui.hasScroll(O)?O.scrollHeight:E);N.parentData={element:O,left:I.left,top:I.top,width:M,height:R}}},resize:function(K,H){var P=D(this).data("resizable"),O=P.options,M=P.containerSize,J=P.containerOffset,G=P.size,S=P.position,N=P._aspectRatio||K.shiftKey,L={top:0,left:0},Q=P.containerElement;if(Q[0]!=document&&(/static/).test(Q.css("position"))){L=J}if(S.left<(P._helper?J.left:0)){P.size.width=P.size.width+(P._helper?(P.position.left-J.left):(P.position.left-L.left));if(N){P.size.height=P.size.width/O.aspectRatio}P.position.left=O.helper?J.left:0}if(S.top<(P._helper?J.top:0)){P.size.height=P.size.height+(P._helper?(P.position.top-J.top):P.position.top);if(N){P.size.width=P.size.height*O.aspectRatio}P.position.top=P._helper?J.top:0}P.offset.left=P.parentData.left+P.position.left;P.offset.top=P.parentData.top+P.position.top;var I=Math.abs((P._helper?P.offset.left-L.left:(P.offset.left-L.left))+P.sizeDiff.width),E=Math.abs((P._helper?P.offset.top-L.top:(P.offset.top-J.top))+P.sizeDiff.height);var F=P.containerElement.get(0)==P.element.parent().get(0),R=/relative|absolute/.test(P.containerElement.css("position"));if(F&&R){I-=P.parentData.left}if(I+P.size.width>=P.parentData.width){P.size.width=P.parentData.width-I;if(N){P.size.height=P.size.width/P.aspectRatio}}if(E+P.size.height>=P.parentData.height){P.size.height=P.parentData.height-E;if(N){P.size.width=P.size.height*P.aspectRatio}}},stop:function(I,F){var M=D(this).data("resizable"),K=M.options,P=M.position,H=M.containerOffset,J=M.containerPosition,N=M.containerElement;var O=D(M.helper),E=O.offset(),G=O.outerWidth()-M.sizeDiff.width,L=O.outerHeight()-M.sizeDiff.height;if(M._helper&&!K.animate&&(/relative/).test(N.css("position"))){D(this).css({left:E.left-J.left-H.left,width:G,height:L})}if(M._helper&&!K.animate&&(/static/).test(N.css("position"))){D(this).css({left:E.left-J.left-H.left,width:G,height:L})}}});D.ui.plugin.add("resizable","scroll",{start:function(G,E){var F=D(this).data("resizable");o=F.options;if(o.scroll&&(!o.concernAngle||o.concernAngle&&!F.element.data("deg"))){F.scrollout=1;if(F.scrollParent[0]!=document&&F.scrollParent[0].tagName!="HTML"){F.overflowOffset=F.scrollParent.offset()}}},resize:function(G,F){var J=D(this).data("resizable"),I=J.options,E=false;if(I.scroll&&(!I.concernAngle||I.concernAngle&&!J.element.data("deg"))){if(J.scrollParent[0]!=document&&J.scrollParent[0].tagName!="HTML"){var L=J.scrollParent[0].scrollTop;J.element.data("resize_oriscrolltop",L);var H=J.lastheightval||0;if((J.axis=="s"||J.axis=="n")&&H-J.size.height!=0){J.lastheightval=J.size.height;var K=0;var M=function(N){K=J.scrollParent[0].scrollTop-L;if(J.axis=="s"){if(J.scrollout==1){J.size.height+=K;J.scrollout=N}else{J.size.height+=K*2}}else{if(J.scrollout==1){J.size.height-=K;J.position.top+=K;J.scrollout=N}else{J.size.height-=K*2;J.position.top+=K*2}}};if((J.overflowOffset.top+J.scrollParent[0].offsetHeight)-G.pageY=0;K--){var N=P.snapElements[K].left,k=N+0,G=P.snapElements[K].top,X=G+0;var I=D(P.snapElements[K].item);var Y=false;if(R=="e"||R=="w"){if(!D(P.snapElements[K].item).closest(".rulerh").length){P.snapElements[K].snapping=false;I.removeClass("showline");continue}if(R=="e"){var V=g.left+n.size.width;var p=Math.abs(N-V)<=U;if(p){n.size.width=n.size.width+(N-V)-Z;Y=true}}else{var h=n.position.left;var J=Math.abs(N-h)<=U;if(J){n.size.width=n.size.width-(N-h)+Z;n.position.left=n.position.left+(N-h)-Z;Y=true}}}else{if(R=="n"||R=="s"){if(!D(P.snapElements[K].item).closest(".rulerv").length){P.snapElements[K].snapping=false;I.removeClass("showline");continue}if(R=="n"){var V=n.position.top+c;var F=Math.abs(G-V)<=U;if(F){n.size.height=n.size.height-(G-V);n.position.top=n.position.top+(G-V);Y=true}}else{var V=n.position.top+c+n.size.height;var O=Math.abs(X-V)<=U;if(O){n.size.height=n.size.height+(X-V);Y=true}}}else{var W=R.match(/./g);for(var f=0;f";D("#scroll_container").append(X)}if(E(V,O)==-1){O.push(V);var X="
";D("#scroll_container").append(X)}if(E(U,N)==-1){N.push(U);var X="
";D("#scroll_container").append(X)}if(E(P,N)==-1){N.push(P);var X="
";D("#scroll_container").append(X)}}D(this).unbind("layersnapstart").bind("layersnapstart",function(){G();if(D.getElementAreaInf(D(this))=="canvas"){D("#canvas .cstlayer:not(.ui-modselected)").each(function(){J(D(this))})}else{D("#scroll_container .cstlayer:not(.ui-modselected)").each(function(){J(D(this))})}K.snapElements=[];var Q=D("#scroll_container").scrollTop();var P=D("#canvas").offset().left;D(".wopop_snap").each(function(){var S=D(this);var R=S.offset();if(S.is(".wopop_snap_vertical")){K.snapElements.push({item:this,width:0,height:S.outerHeight(),top:0,left:R.left-P})}else{K.snapElements.push({item:this,width:S.outerWidth(),height:0,top:parseInt(S.css("top"))||0,left:0})}})});D(this).trigger("layersnapstart")},resize:function(e,H){return;var P=D(this).data("resizable"),M=P.options;var E=M.wopop_snap;if(!E){return}if(D(this).data("deg")){return}if(!D(this).is(".cstlayer")){return}var S="outer";var U=3;var T=D("#scroll_container").scrollTop();var m=P.ori_scct;if(T!=m){D(this).trigger("layersnapstart")}var n=P;var Z=0;var j=n.size,L=n.originalSize,g=n.originalPosition,R=n.axis;var c=P.wopop_ab_top;for(var K=P.snapElements.length-1;K>=0;K--){var N=P.snapElements[K].left,k=N+P.snapElements[K].width,G=P.snapElements[K].top,X=G+P.snapElements[K].height;var I=D(P.snapElements[K].item);var Y=false;if(R=="e"||R=="w"){if(!I.is(".wopop_snap_vertical")){P.snapElements[K].snapping=false;I.removeClass("showline");continue}if(R=="e"){var V=g.left+n.size.width;var p=Math.abs(N-V)<=U;if(p){n.size.width=n.size.width+(N-V)-Z;Y=true}}else{var h=n.position.left;var J=Math.abs(N-h)<=U;if(J){n.size.width=n.size.width-(N-h)+Z;n.position.left=n.position.left+(N-h)-Z;Y=true}}}else{if(R=="n"||R=="s"){if(!I.is(".wopop_snap_horizon")){P.snapElements[K].snapping=false;I.removeClass("showline");continue}if(R=="n"){var V=n.position.top+c;var F=Math.abs(G-V)<=U;if(F){n.size.height=n.size.height-(G-V);n.position.top=n.position.top+(G-V);Y=true}}else{var V=n.position.top+c+n.size.height;var O=Math.abs(X-V)<=U;if(O){n.size.height=n.size.height+(X-V);Y=true}}}else{var W=R.match(/./g);for(var f=0;f").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(E.range==="min"||E.range==="max"?" ui-slider-range-"+E.range:"")));for(var H=F.length;HP&&(L=P,M=C(this),H=O)}),K.range===!0&&this.values(1)===K.min&&(H+=1,M=C(this.handles[H])),E=this._start(J,H);if(E===!1){return !1}this._mouseSliding=!0,G._handleIndex=H,M.addClass("ui-state-active").focus(),F=M.offset(),I=!C(J.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=I?{left:0,top:0}:{left:J.pageX-F.left-M.width()/2,top:J.pageY-F.top-M.height()/2-(parseInt(M.css("borderTopWidth"),10)||0)-(parseInt(M.css("borderBottomWidth"),10)||0)+(parseInt(M.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(J,H,D),this._animateOff=!0;return !0},_mouseStart:function(D){return !0},_mouseDrag:function(F){var D={x:F.pageX,y:F.pageY},E=this._normValueFromMouse(D);this._slide(F,this._handleIndex,E);return !1},_mouseStop:function(D){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(D,this._handleIndex),this._change(D,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return !1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(H){var F,G,D,E,I;this.orientation==="horizontal"?(F=this.elementSize.width,G=H.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(F=this.elementSize.height,G=H.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),D=G/F,D>1&&(D=1),D<0&&(D=0),this.orientation==="vertical"&&(D=1-D),E=this._valueMax()-this._valueMin(),I=this._valueMin()+D*E;return this._trimAlignValue(I)},_start:function(F,D){var E={handle:this.handles[D],value:this.value()};this.options.values&&this.options.values.length&&(E.value=this.values(D),E.values=this.values());return this._trigger("start",F,E)},_slide:function(H,F,G){var D,E,I;this.options.values&&this.options.values.length?(D=this.values(F?0:1),this.options.values.length===2&&this.options.range===!0&&(F===0&&G>D||F===1&&G1){this.options.values[F]=this._trimAlignValue(G),this._refreshValue(),this._change(null,F)}else{if(!arguments.length){return this._values()}if(!C.isArray(arguments[0])){return this.options.values&&this.options.values.length?this._values(F):this.value()}D=this.options.values,E=arguments[0];for(H=0;H=this._valueMax()){return this._valueMax()}var E=this.options.step>0?this.options.step:1,F=(G-this._valueMin())%E,D=G-F;Math.abs(F)*2>=E&&(D+=F>0?E:-E);return parseFloat(D.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var I=this.options.range,J=this.options,M=this,D=this._animateOff?!1:J.animate,K,L={},G,H,E,F;this.options.values&&this.options.values.length?this.handles.each(function(O,N){K=(M.values(O)-M._valueMin())/(M._valueMax()-M._valueMin())*100,L[M.orientation==="horizontal"?"left":"bottom"]=K+"%",C(this).stop(1,1)[D?"animate":"css"](L,J.animate),M.options.range===!0&&(M.orientation==="horizontal"?(O===0&&M.range.stop(1,1)[D?"animate":"css"]({left:K+"%"},J.animate),O===1&&M.range[D?"animate":"css"]({width:K-G+"%"},{queue:!1,duration:J.animate})):(O===0&&M.range.stop(1,1)[D?"animate":"css"]({bottom:K+"%"},J.animate),O===1&&M.range[D?"animate":"css"]({height:K-G+"%"},{queue:!1,duration:J.animate}))),G=K}):(H=this.value(),E=this._valueMin(),F=this._valueMax(),K=F!==E?(H-E)/(F-E)*100:0,L[M.orientation==="horizontal"?"left":"bottom"]=K+"%",this.handle.stop(1,1)[D?"animate":"css"](L,J.animate),I==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[D?"animate":"css"]({width:K+"%"},J.animate),I==="max"&&this.orientation==="horizontal"&&this.range[D?"animate":"css"]({width:100-K+"%"},{queue:!1,duration:J.animate}),I==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[D?"animate":"css"]({height:K+"%"},J.animate),I==="max"&&this.orientation==="vertical"&&this.range[D?"animate":"css"]({height:100-K+"%"},{queue:!1,duration:J.animate}))}}),C.extend(C.ui.slider,{version:"1.8.17"})})(jQuery);(function(E,C){E.ui=E.ui||{};var D=/left|center|right/,H=/top|center|bottom/,A="center",F={},G=E.fn.position,B=E.fn.offset;E.fn.position=function(P){if(!P||!P.of){return G.apply(this,arguments)}P=E.extend({},P);var K=E(P.of),L=K[0],I=(P.collision||"flip").split(" "),J=P.offset?P.offset.split(" "):[0,0],N,O,M;L.nodeType===9?(N=K.width(),O=K.height(),M={top:0,left:0}):L.setTimeout?(N=K.width(),O=K.height(),M={top:K.scrollTop(),left:K.scrollLeft()}):L.preventDefault?(P.at="left top",N=O=0,M={top:P.of.pageY,left:P.of.pageX}):(N=K.outerWidth(),O=K.outerHeight(),M=K.offset()),E.each(["my","at"],function(){var Q=(P[this]||"").split(" ");Q.length===1&&(Q=D.test(Q[0])?Q.concat([A]):H.test(Q[0])?[A].concat(Q):[A,A]),Q[0]=D.test(Q[0])?Q[0]:A,Q[1]=H.test(Q[1])?Q[1]:A,P[this]=Q}),I.length===1&&(I[1]=I[0]),J[0]=parseInt(J[0],10)||0,J.length===1&&(J[1]=J[0]),J[1]=parseInt(J[1],10)||0,P.at[0]==="right"?M.left+=N:P.at[0]===A&&(M.left+=N/2),P.at[1]==="bottom"?M.top+=O:P.at[1]===A&&(M.top+=O/2),M.left+=J[0],M.top+=J[1];return this.each(function(){var W=E(this),Y=W.outerWidth(),X=W.outerHeight(),T=parseInt(E.curCSS(this,"marginLeft",!0))||0,U=parseInt(E.curCSS(this,"marginTop",!0))||0,V=Y+T+(parseInt(E.curCSS(this,"marginRight",!0))||0),R=X+U+(parseInt(E.curCSS(this,"marginBottom",!0))||0),S=E.extend({},M),Q;P.my[0]==="right"?S.left-=Y:P.my[0]===A&&(S.left-=Y/2),P.my[1]==="bottom"?S.top-=X:P.my[1]===A&&(S.top-=X/2),F.fractions||(S.left=Math.round(S.left),S.top=Math.round(S.top)),Q={left:S.left-T,top:S.top-U},E.each(["left","top"],function(a,Z){E.ui.position[I[a]]&&E.ui.position[I[a]][Z](S,{targetWidth:N,targetHeight:O,elemWidth:Y,elemHeight:X,collisionPosition:Q,collisionWidth:V,collisionHeight:R,offset:J,my:P.my,at:P.at})}),E.fn.bgiframe&&W.bgiframe(),W.offset(E.extend(S,{using:P.using}))})},E.ui.position={fit:{left:function(K,L){var I=E(window),J=L.collisionPosition.left+L.collisionWidth-I.width()-I.scrollLeft();K.left=J>0?K.left-J:Math.max(K.left-L.collisionPosition.left,K.left)},top:function(K,L){var I=E(window),J=L.collisionPosition.top+L.collisionHeight-I.height()-I.scrollTop();K.top=J>0?K.top-J:Math.max(K.top-L.collisionPosition.top,K.top)}},flip:{left:function(M,N){if(N.at[0]!==A){var J=E(window),O=N.collisionPosition.left+N.collisionWidth-J.width()-J.scrollLeft(),I=N.my[0]==="left"?-N.elemWidth:N.my[0]==="right"?N.elemWidth:0,K=N.at[0]==="left"?N.targetWidth:-N.targetWidth,L=-2*N.offset[0];M.left+=N.collisionPosition.left<0?I+K+L:O>0?I+K+L:0}},top:function(M,N){if(N.at[1]!==A){var J=E(window),O=N.collisionPosition.top+N.collisionHeight-J.height()-J.scrollTop(),I=N.my[1]==="top"?-N.elemHeight:N.my[1]==="bottom"?N.elemHeight:0,K=N.at[1]==="top"?N.targetHeight:-N.targetHeight,L=-2*N.offset[1];M.top+=N.collisionPosition.top<0?I+K+L:O>0?I+K+L:0}}}},E.offset.setOffset||(E.offset.setOffset=function(M,N){/static/.test(E.curCSS(M,"position"))&&(M.style.position="relative");var J=E(M),K=J.offset(),O=parseInt(E.curCSS(M,"top",!0),10)||0,I=parseInt(E.curCSS(M,"left",!0),10)||0,L={top:N.top-K.top+O,left:N.left-K.left+I};"using" in N?N.using.call(M,L):J.css(L)},E.fn.offset=function(I){var J=this[0];if(!J||!J.ownerDocument){return null}if(I){return this.each(function(){E.offset.setOffset(this,I)})}return B.call(this)}),function(){var M=document.getElementsByTagName("body")[0],N=document.createElement("div"),P,I,O,K,L;P=document.createElement(M?"div":"body"),O={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},M&&jQuery.extend(O,{position:"absolute",left:"-1000px",top:"-1000px"});for(var J in O){P.style[J]=O[J]}P.appendChild(N),I=M||document.documentElement,I.insertBefore(P,I.firstChild),N.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",K=E(N).offset(function(R,Q){return Q}).offset(),P.innerHTML="",I.removeChild(P),L=K.top+K.left+(M?2000:0),F.fractions=L>21&&L<22}()})(jQuery);(function(D,E){var F=0;D.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,width:"auto",position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var A=this,B=this.element[0].ownerDocument,C;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(I){if(A.options.disabled||A.element.propAttr("readOnly")){return}C=false;var J=D.ui.keyCode;switch(I.keyCode){case J.PAGE_UP:A._move("previousPage",I);break;case J.PAGE_DOWN:A._move("nextPage",I);break;case J.UP:A._move("previous",I);I.preventDefault();break;case J.DOWN:A._move("next",I);I.preventDefault();break;case J.ENTER:case J.NUMPAD_ENTER:if(A.menu.active){C=true;I.preventDefault()}case J.TAB:if(!A.menu.active){return}A.menu.select(I);break;case J.ESCAPE:A.element.val(A.term);A.close(I);break;default:clearTimeout(A.searching);A.searching=setTimeout(function(){if(A.term!=A.element.val()){A.selectedItem=null;A.search(null,I)}},A.options.delay);break}}).bind("keypress.autocomplete",function(H){if(C){C=false;H.preventDefault()}}).bind("focus.autocomplete",function(){if(A.options.disabled){return}A.selectedItem=null;A.previous=A.element.val()}).bind("blur.autocomplete",function(H){if(A.options.disabled){return}clearTimeout(A.searching);A.closing=setTimeout(function(){A.close(H);A._change(H)},150)});this._initSource();this.response=function(){return A._response.apply(A,arguments)};this.menu=D("
    ").addClass("ui-autocomplete").appendTo(D(this.options.appendTo||"body",B)[0]).mousedown(function(J){var I=A.menu.element[0];if(!D(J.target).closest(".ui-menu-item").length){setTimeout(function(){D(document).one("mousedown",function(G){if(G.target!==A.element[0]&&G.target!==I&&!D.ui.contains(I,G.target)){A.close()}})},1)}setTimeout(function(){clearTimeout(A.closing)},13)}).menu({focus:function(K,L){var J=L.item.data("item.autocomplete");if(false!==A._trigger("focus",K,{item:J})){if(/^key/.test(K.originalEvent.type)){A.element.val(J.value)}}},selected:function(L,M){var N=M.item.data("item.autocomplete"),K=A.previous;if(A.element[0]!==B.activeElement){A.element.focus();A.previous=K;setTimeout(function(){A.previous=K;A.selectedItem=N},1)}if(false!==A._trigger("select",L,{item:N})){A.element.val(N.value)}A.term=A.element.val();A.close(L);A.selectedItem=N},blur:function(I,J){if(A.menu.element.is(":visible")&&(A.element.val()!==A.term)){A.element.val(A.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(D.fn.bgiframe){this.menu.element.bgiframe()}A.beforeunloadHandler=function(){A.element.removeAttr("autocomplete")};D(window).bind("beforeunload",A.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();D(window).unbind("beforeunload",this.beforeunloadHandler);D.Widget.prototype.destroy.call(this)},_setOption:function(B,A){D.Widget.prototype._setOption.apply(this,arguments);if(B==="source"){this._initSource()}if(B==="appendTo"){this.menu.element.appendTo(D(A||"body",this.element[0].ownerDocument)[0])}if(B==="disabled"&&A&&this.xhr){this.xhr.abort()}},_initSource:function(){var C=this,A,B;if(D.isArray(this.options.source)){A=this.options.source;this.source=function(I,J){J(D.ui.autocomplete.filter(A,I.term))}}else{if(typeof this.options.source==="string"){B=this.options.source;this.source=function(I,J){if(C.xhr){C.xhr.abort()}C.xhr=D.ajax({url:B,data:I,dataType:"json",autocompleteRequest:++F,success:function(H,G){if(this.autocompleteRequest===F){J(H)}},error:function(){if(this.autocompleteRequest===F){J([])}}})}}else{this.source=this.options.source}}},search:function(A,B){A=A!=null?A:this.element.val();this.term=this.element.val();if(A.length").data("item.autocomplete",A).append(D("").text(A.label)).appendTo(B)},_move:function(A,B){if(!this.menu.element.is(":visible")){this.search(null,B);return}if(this.menu.first()&&/^previous/.test(A)||this.menu.last()&&/^next/.test(A)){this.element.val(this.term);this.menu.deactivate();return}this.menu[A](B)},widget:function(){return this.menu.element}});D.extend(D.ui.autocomplete,{escapeRegex:function(A){return A.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(A,C){var B=new RegExp(D.ui.autocomplete.escapeRegex(C),"i");return D.grep(A,function(H){return B.test(H.label||H.value||H)})}})}(jQuery));(function(B){B.widget("ui.menu",{_create:function(){var A=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(D){if(!B(D.target).closest(".ui-menu-item a").length){return}D.preventDefault();A.select(D)});this.refresh()},refresh:function(){var D=this;var A=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");A.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(C){D.activate(C,B(this).parent())}).mouseleave(function(){D.deactivate()})},activate:function(J,A){this.deactivate();if(this.hasScroll()){var G=A.offset().top-this.element.offset().top,H=this.element.scrollTop(),I=this.element.height();if(G<0){this.element.scrollTop(H+G)}else{if(G>=I){this.element.scrollTop(H+G-I+A.height())}}}this.active=A.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",J,{item:A})},deactivate:function(){if(!this.active){return}this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null},next:function(A){this.move("next",".ui-menu-item:first",A)},previous:function(A){this.move("prev",".ui-menu-item:last",A)},first:function(){return this.active&&!this.active.prevalsl(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(H,G,A){if(!this.active){this.activate(A,this.element.children(G));return}var F=this.active[H+"All"](".ui-menu-item").eq(0);if(F.length){this.activate(A,F)}else{this.activate(A,this.element.children(G))}},nextPage:function(F){if(this.hasScroll()){if(!this.active||this.last()){this.activate(F,this.element.children(".ui-menu-item:first"));return}var G=this.active.offset().top,A=this.element.height(),H=this.element.children(".ui-menu-item").filter(function(){var C=B(this).offset().top-G-A+B(this).height();return C<10&&C>-10});if(!H.length){H=this.element.children(".ui-menu-item:last")}this.activate(F,H)}else{this.activate(F,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(A){if(this.hasScroll()){if(!this.active||this.first()){this.activate(A,this.element.children(".ui-menu-item:last"));return}var E=this.active.offset().top,F=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var C=B(this).offset().top-E+F-B(this).height();return C<10&&C>-10});if(!result.length){result=this.element.children(".ui-menu-item:first")}this.activate(A,result)}else{this.activate(A,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(E){var C=this;this.opos=[E.pageX,E.pageY];if(this.options.disabled){return}var D=this.options;this.selectees=B(D.filter,this.element[0]);this._trigger("start",E);B(D.appendTo).append(this.helper);this.helper.css({"left":E.clientX,"top":E.clientY,"width":0,"height":0});if(D.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var F=B.data(this,"selectable-item");F.startselected=true;if(!E.metaKey&&!E.ctrlKey){F.$element.removeClass("ui-selected");F.selected=false;F.$element.addClass("ui-unselecting");F.unselecting=true;C._trigger("unselecting",E,{unselecting:F.element})}});B(E.target).parents().andSelf().each(function(){var F=B.data(this,"selectable-item");if(F){var G=(!E.metaKey&&!E.ctrlKey)||!F.$element.hasClass("ui-selected");F.$element.removeClass(G?"ui-unselecting":"ui-selected").addClass(G?"ui-selecting":"ui-unselecting");F.unselecting=!G;F.selecting=G;F.selected=G;if(G){C._trigger("selecting",E,{selecting:F.element})}else{C._trigger("unselecting",E,{unselecting:F.element})}return false}})},_mouseDrag:function(F){var J=this;this.dragged=true;if(this.options.disabled){return}var I=this.options;var C=this.opos[0],D=this.opos[1],E=F.pageX,H=F.pageY;if(C>E){var G=E;E=C;C=G}if(D>H){var G=H;H=D;D=G}this.helper.css({left:C,top:D,width:E-C,height:H-D});this.selectees.each(function(){var K=B.data(this,"selectable-item");if(!K||K.element==J.element[0]){return}var L=false;if(I.tolerance=="touch"){L=(!(K.left>E||K.rightH||K.bottomC&&K.rightD&&K.bottom settings.failure_limit) { return false; } } } }); } if(options) { /* Maintain BC for a couple of versions. */ if (undefined !== options.failurelimit) { options.failure_limit = options.failurelimit; delete options.failurelimit; } if (undefined !== options.effectspeed) { options.effect_speed = options.effectspeed; delete options.effectspeed; } if($(this).is('.cstlayer img.img_lazy_load')){ if(!options.threshold || options.threshold<1200){ options.threshold=1200; } } $.extend(settings, options); } /* Cache container as jQuery as object. */ $container = (settings.container === undefined || settings.container === window) ? $window : $(settings.container); /* Fire one scroll event per scroll. Not one scroll event per image. */ if (0 === settings.event.indexOf("scroll")) { var ret=true; var timer; $container.bind(settings.event, function(e) { if(elements.length==0){ $container.unbind(e); return; } if(timer) clearTimeout(timer); timer=setTimeout(function(){ update(); var els=elements.filter(function(){return $(this).closest('body').length>0 && !$(this).data('lazy-loaded');}) elements=els; },200) return ret; }); } this.each(function() { var self = this; var $self = $(self); /* If no src attribute given use data:uri. */ if ($self.attr("src") === undefined || $self.attr("src") === false) { if ($self.is("img")) { $self.attr("src", settings.placeholder); } } /* fixed bug#1630 */ //if(parseInt($self.css("top"))<-100) $self.css("top",""); /* When appear is triggered load original image. */ $self.one("appear", function() { var selffunc=arguments.callee; if (!$(this).data('lazy-loaded')) { if (settings.appear) { var elements_left = elements.length; settings.appear.call(self, elements_left, settings); } $self.data('lazy-loaded',true); $("") .bind("load", function() { var original = $self.attr("data-" + settings.data_attribute); $self.hide(); if ($self.is("img")) { $self.attr("src", original); } else { $self.css("background-image", "url('" + original + "')"); } $self[settings.effect](settings.effect_speed); /* Remove image from array so it is not looped next time. */ var temp = $.grep(elements, function(element) { return !element.loaded; }); elements = $(temp); if (settings.load) { var elements_left = elements.length; settings.load.call(self, elements_left, settings); } }).bind('error',function(){ $self.data('lazy-loaded',false); if(selffunc){ var errortimes=$self.data('lazy_load_error_times'); var firsttime=$self.data('lazy_load_error_firsttime'); if(!errortimes) errortimes=0; if(!firsttime){ firsttime=new Date(); $self.data('lazy_load_error_firsttime',firsttime); }else{ var nowtime=new Date(); if(nowtime-firsttime<=100) return; } if(errortimes>1) return; $self.data('lazy_load_error_times',errortimes+1); setTimeout(function(){ selffunc(); },1000) } }) .attr("src", $self.attr("data-" + settings.data_attribute)); } }); /* When wanted event is triggered load original image */ /* by triggering appear. */ if (0 !== settings.event.indexOf("scroll")) { $self.bind(settings.event, function() { if (!$self.data('lazy-loaded')) { $self.trigger("appear"); } }); } }); /* Check if something appears when window is resized. */ $window.bind("resize", function() { update(); }); /* With ioses5 force loading images when navigating with back button. */ /* Non optimal workaround. */ if ((/(?:iphoness|ipods|ipads).*os 5/gi).test(navigator.appVersion)) { $window.bind("pageshow", function(event) { if (event.originalEvent && event.originalEvent.persisted) { elements.each(function() { if(!$(this).data('lazy-loaded')) $(this).trigger("appear"); }); } }); } update(); /* Force initial check if images should appear. */ $(document).ready(function() { update(); }); return this; }; /* Convenience methods in jQuery namespace. */ /* Use as $.belowthefold(element, {threshold : 100, container : window}) */ $.belowthefold = function(element, settings) { var fold; if (settings.container === undefined || settings.container === window) { fold = (window.innerHeight ? window.innerHeight : $window.height()) + $window.scrollTop(); } else { fold = $(settings.container).offset().top + $(settings.container).height(); } return fold <= $(element).offset().top - settings.threshold; }; $.rightoffold = function(element, settings) { var fold; if (settings.container === undefined || settings.container === window) { fold = $window.width() + $window.scrollLeft(); } else { fold = $(settings.container).offset().left + $(settings.container).width(); } return fold <= $(element).offset().left - settings.threshold; }; $.abovethetop = function(element, settings) { var fold; if (settings.container === undefined || settings.container === window) { fold = $window.scrollTop(); } else { fold = $(settings.container).offset().top; } //bug#2660 var eleparwid = $(element).height(); if(eleparwid==0&&$(element).parents().parents().attr('class')=='img_over'){ var eleparwid = $(element).parents().parents().height(); } return fold >= $(element).offset().top + settings.threshold + eleparwid; }; $.leftofbegin = function(element, settings) { var fold; if (settings.container === undefined || settings.container === window) { fold = $window.scrollLeft(); } else { fold = $(settings.container).offset().left; } return fold >= Math.max($(element).offset().left + $(element).width(),2)+ settings.threshold ; }; $.inviewport = function(element, settings) { return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) && !$.belowthefold(element, settings) && !$.abovethetop(element, settings); }; /* Custom selectors for your convenience. */ /* Use as $("img:below-the-fold").something() or */ /* $("img").filter(":below-the-fold").something() which is faster */ $.extend($.expr[":"], { "below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); }, "above-the-top" : function(a) { return !$.belowthefold(a, {threshold : 0}); }, "right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); }, "left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); }, "in-viewport" : function(a) { return $.inviewport(a, {threshold : 0}); }, /* Maintain BC for couple of versions. */ "above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); }, "right-of-fold" : function(a) { return $.rightoffold(a, {threshold : 0}); }, "left-of-fold" : function(a) { return !$.rightoffold(a, {threshold : 0}); } }); })(jQuery, window, document);; (function(E,C){var B={0:0};var A={0:1};var D={0:0};E.math={};E.math.sin=function(G){if(G<0){G=G+360}if(G>=360){G=G%360}if(B[G]==C){var F=Math.sin(G*Math.PI/180);B[G]=F}return B[G]};E.math.cos=function(G){if(G<0){G=G+360}if(G>=360){G=G%360}if(A[G]==C){var F=Math.cos(G*Math.PI/180);A[G]=F}return A[G]};E.math.tan=function(G){if(G<0){G=G+360}if(G>=360){G=G%360}if(D[G]==C){var F=Math.tan(G*Math.PI/180);D[G]=F}return D[G]};E.math.acos=function(F){var G=Math.acos(F);return Math.round(G*180/Math.PI)};E.parseInteger=function(G){var F=parseInt(G);if(isNaN(F)){return 0}return F};E.divrotate=function(L,G,M,F){L=E(L);var H=L.width();var K=L.height();if(F){H=F[0];K=F[1]}if(M){var J=M[0];var I=M[1];if(E.browser.msie&&E.browser.version<9){H=parseInt(L.data("IEWidth"));K=parseInt(L.data("IEHeight"));J=L.data("IELeft");if(J==C){J=M[0];L.data("IELeft",J)}I=L.data("IETop");if(I==C){I=M[1];L.data("IETop",I)}ieRotate({degree:G,left:J,top:I,width:H,height:K,dom:L})}else{L[0].style.left=Math.round(J)+"px";L[0].style.top=Math.round(I)+"px"}}if(E.browser.safari||E.browser.mozilla||E.browser.opera||(E.browser.msie&&E.browser.version=="9.0")){ieRotate({degree:G,dom:L})}};E.fn.modattr=function(F,G){if(F=="leftpos"){var H=this.data("prop_leftpos");if(!H){H=[parseInt(this.css("left")),parseInt(this.css("top"))]}if(G!=C){this.data("prop_leftpos",G)}return H}if(F=="degree"){var H=this.data("deg");if(!H){H=0}if(G!=C){this.data("deg",G)}return H}if(F=="size"){var H=this.data("prop_size");if(!H){H=[this.width(),this.height()]}if(G!=C){this.data("prop_size",G)}return H}};E.divrotate.reversePos=function(N,H,I,M){var K=N[0];var J=N[1];var O=E.math.cos(H);var L=E.math.sin(H);if(E.browser.msie&&E.browser.version<9){var F=K;if(H<90){F=K+M*L}else{if(H<180){F=K+M*L-I*O}else{if(H<270){F=K-I*O}else{F=K}}}var G=J;if(H<90){G=J}else{if(H<180){G=J-M*O}else{if(H<270){G=J-M*O-I*L}else{G=J-I*L}}}return[F,G]}else{return N}};E.divrotate.getMaxDistance=function(N){var G=N.data("deg");var K=parseInt(N.css("left"));var J=parseInt(N.css("top"));var H=N.width();var M=N.height();var L=canv.width();var P,I,F;if(!G){P=K;I=L-H-K;F=J}else{if(G>360){G=G%360}var O=E.math.cos(G);var Q=E.math.sin(G);if(G<=90){P=K-M*Q;I=L-K-H*O;F=J}else{if(G>90&&G<=180){P=K-M*Q+H*O;I=L-K;F=J+M*O}else{if(G>180&&G<=270){P=K+H*O;I=L-K+M*Q;F=J+M*O+H*Q}else{if(G>270&&G<=360){P=K;I=L-K+M*Q-H*O;F=J+H*Q}}}}}return{left:P,right:I,top:F}};E.divrotate.getDegreeModMaxPointOrigin=function(P,H,O,I,S){var M=E.getElementFatherid(P);var F=E("#"+M).ab_pos_cnter("top");var R=E("#"+M).ab_pos_cnter("left")||0;var H=H;if(!H){var N=0;var K=I[0];var L=I[1];switch(S){case"left":N=O[0]+R;break;case"right":N=O[0]+K+R;break;case"top":N=O[1]+F;break;case"buttom":N=O[1]+L+F;break}return N}else{if(E.browser.msie&&E.browser.version<9){var N=0;switch(S){case"left":N=P.position().left;break;case"right":N=P.position().left+P.width();break;case"top":N=P.position().top;break;case"buttom":N=P.position().top+P.height();break}return N}var N=0;var K=I[0];var L=I[1];var Q=O[0];var J=O[1];if(H>360){H=H%360}var G=E.math.cos(H);var T=E.math.sin(H);switch(S){case"left":if(H<=90){N=Q-L*T}else{if(H>90&&H<=180){N=Q-L*T+K*G}else{if(H>180&&H<=270){N=Q+K*G}else{if(H>270&&H<=360){N=Q}}}}N+=R;break;case"right":if(H<=90){N=Q+K*G}else{if(H>90&&H<=180){N=Q}else{if(H>180&&H<=270){N=Q-L*T}else{if(H>270&&H<=360){N=Q-L*T+K*G}}}}N+=R;break;case"top":if(H<=90){N=J}else{if(H>90&&H<=180){N=J+L*G}else{if(H>180&&H<=270){N=J+L*G+K*T}else{if(H>270&&H<=360){N=J+K*T}}}}N=N+F;break;case"buttom":if(H<=90){N=J+L*G+K*T}else{if(H>90&&H<=180){N=J+K*T}else{if(H>180&&H<=270){N=J}else{if(H>270&&H<=360){N=J+L*G}}}}N=N+F;break}return N}};E.divrotate.getDegreeModMaxPoint=function(F,H,J){var K=F.data("deg");if(H==null){H=[E.parseInteger(F.css("left")),E.parseInteger(F.css("top"))]}var I=F.width();var G=F.height();return E.divrotate.getDegreeModMaxPointOrigin(F,K,H,[I,G],J)};E.divrotate.getDegreeModMaxPointForRotate=function(F,K,H,J){var I=F.width();var G=F.height();return E.divrotate.getDegreeModMaxPointOrigin(F,K,H,[I,G],J)};E.divrotate.getDegreeResizeCursor=function(F){var G=F.data("deg");if(G==null){G=0}if(G>360){G=G%360}if(G<=22||G>=338){F.find(".ui-resizable-n").css("cursor","n-resize");F.find(".ui-resizable-e").css("cursor","e-resize");F.find(".ui-resizable-w").css("cursor","w-resize");F.find(".ui-resizable-s").css("cursor","s-resize");F.find(".ui-resizable-ne").css("cursor","ne-resize");F.find(".ui-resizable-se").css("cursor","se-resize");F.find(".ui-resizable-nw").css("cursor","nw-resize");F.find(".ui-resizable-sw").css("cursor","sw-resize")}else{if(G>22&&G<=67){F.find(".ui-resizable-n").css("cursor","ne-resize");F.find(".ui-resizable-e").css("cursor","se-resize");F.find(".ui-resizable-w").css("cursor","nw-resize");F.find(".ui-resizable-s").css("cursor","sw-resize");F.find(".ui-resizable-ne").css("cursor","e-resize");F.find(".ui-resizable-se").css("cursor","s-resize");F.find(".ui-resizable-nw").css("cursor","n-resize");F.find(".ui-resizable-sw").css("cursor","w-resize")}else{if(G>67&&G<=112){F.find(".ui-resizable-n").css("cursor","e-resize");F.find(".ui-resizable-e").css("cursor","s-resize");F.find(".ui-resizable-w").css("cursor","n-resize");F.find(".ui-resizable-s").css("cursor","w-resize");F.find(".ui-resizable-ne").css("cursor","se-resize");F.find(".ui-resizable-se").css("cursor","sw-resize");F.find(".ui-resizable-nw").css("cursor","ne-resize");F.find(".ui-resizable-sw").css("cursor","nw-resize")}else{if(G>112&&G<=157){F.find(".ui-resizable-n").css("cursor","se-resize");F.find(".ui-resizable-e").css("cursor","sw-resize");F.find(".ui-resizable-w").css("cursor","ne-resize");F.find(".ui-resizable-s").css("cursor","nw-resize");F.find(".ui-resizable-ne").css("cursor","s-resize");F.find(".ui-resizable-se").css("cursor","w-resize");F.find(".ui-resizable-nw").css("cursor","e-resize");F.find(".ui-resizable-sw").css("cursor","n-resize")}else{if(G>157&&G<=202){F.find(".ui-resizable-n").css("cursor","s-resize");F.find(".ui-resizable-e").css("cursor","w-resize");F.find(".ui-resizable-w").css("cursor","e-resize");F.find(".ui-resizable-s").css("cursor","n-resize");F.find(".ui-resizable-ne").css("cursor","sw-resize");F.find(".ui-resizable-se").css("cursor","nw-resize");F.find(".ui-resizable-nw").css("cursor","se-resize");F.find(".ui-resizable-sw").css("cursor","ne-resize")}else{if(G>202&&G<=247){F.find(".ui-resizable-n").css("cursor","sw-resize");F.find(".ui-resizable-e").css("cursor","nw-resize");F.find(".ui-resizable-w").css("cursor","se-resize");F.find(".ui-resizable-s").css("cursor","ne-resize");F.find(".ui-resizable-ne").css("cursor","w-resize");F.find(".ui-resizable-se").css("cursor","n-resize");F.find(".ui-resizable-nw").css("cursor","s-resize");F.find(".ui-resizable-sw").css("cursor","e-resize")}else{if(G>247&&G<=292){F.find(".ui-resizable-n").css("cursor","w-resize");F.find(".ui-resizable-e").css("cursor","n-resize");F.find(".ui-resizable-w").css("cursor","s-resize");F.find(".ui-resizable-s").css("cursor","e-resize");F.find(".ui-resizable-ne").css("cursor","nw-resize");F.find(".ui-resizable-se").css("cursor","ne-resize");F.find(".ui-resizable-nw").css("cursor","sw-resize");F.find(".ui-resizable-sw").css("cursor","se-resize")}else{if(G>292&&G<=337){F.find(".ui-resizable-n").css("cursor","nw-resize");F.find(".ui-resizable-e").css("cursor","ne-resize");F.find(".ui-resizable-w").css("cursor","sw-resize");F.find(".ui-resizable-s").css("cursor","se-resize");F.find(".ui-resizable-ne").css("cursor","n-resize");F.find(".ui-resizable-se").css("cursor","e-resize");F.find(".ui-resizable-nw").css("cursor","w-resize");F.find(".ui-resizable-sw").css("cursor","s-resize")}}}}}}}}};E.divrotate.getDegreeResizeChange=function(N,Y,S,K,M){var R=N.data("deg");if(R>360){R=R%360}var O=Math.sin(R*Math.PI/180);var V=Math.cos(R*Math.PI/180);if(E.browser.msie&&E.browser.version<9){var G=N.data("IEWidth");var J=N.data("IEHeight");if(R>=0&&R<90){var Z=S.left+J*O,H=S.top}else{if(R>=90&&R<180){var Z=J*O-G*V+S.left,H=S.top-J*V}else{if(R>180&&R<=270){var Z=S.left-G*V,H=S.top-G*O-J*V}else{if(R>270&&R<360){var Z=S.left,H=G*V+S.top}}}}}else{var G=K.width;var J=K.height;var Z=S.left,H=S.top}var L=Y[0];var U=Y[1];var Q=E.math.tan(R);var T,P,X;var I=function(a){T=E.math.acos((L+a*U)/(Math.sqrt(L*L+U*U)*Math.sqrt(1+a*a)));P=Math.sqrt(L*L+U*U)*E.math.sin(T);X=L*a-U};var W=function(a){T=E.math.acos((L-a*U)/(Math.sqrt(L*L+U*U)*Math.sqrt(1+a*a)));P=Math.sqrt(L*L+U*U)*E.math.sin(T);X=0-(L*a+U)};if(E.browser.msie&&E.browser.version<9){var F=null;switch(M){case"n":I(Q);if(X==0){return{}}if(R<=90){if(X>0){F={height:Math.round(J+P),left:Math.round(Z+P*E.math.sin(R)-(J+P)*E.math.sin(R)),top:Math.round(H-P*E.math.cos(R))}}else{if(X<0){F={height:Math.round(J-P),left:Math.round(Z-P*E.math.sin(R)-(J-P)*E.math.sin(R)),top:Math.round(H+P*E.math.cos(R))}}}}else{if(R>270&&R<360){if(X>0){F={height:Math.round(J+P),left:Math.round(Z+P*E.math.sin(R)),top:Math.round(H-P*E.math.cos(R)-G*E.math.cos(R))}}else{if(X<0){F={height:Math.round(J-P),left:Math.round(Z-P*E.math.sin(R)),top:Math.round(H+P*E.math.cos(R)-G*E.math.cos(R))}}}}else{if(R>90&&R<=180){if(X>0){F={height:Math.round(J-P),left:Math.round(Z-P*E.math.sin(R)-(J-P)*E.math.sin(R)+G*E.math.cos(R)),top:Math.round(H+P*E.math.cos(R)+(J-P)*E.math.cos(R))}}else{if(X<0){F={height:Math.round(J+P),left:Math.round(Z+P*E.math.sin(R)-(J+P)*E.math.sin(R)+G*E.math.cos(R)),top:Math.round(H-P*E.math.cos(R)+(J+P)*E.math.cos(R))}}}}else{if(R>180&&R<=270){if(X>0){F={height:Math.round(J-P),left:Math.round(Z-P*E.math.sin(R)+G*E.math.cos(R)),top:Math.round(H+P*E.math.cos(R)+(J-P)*E.math.cos(R)+G*E.math.sin(R))}}else{if(X<0){F={height:Math.round(J+P),left:Math.round(Z+P*E.math.sin(R)+G*E.math.cos(R)),top:Math.round(H-P*E.math.cos(R)+(J+P)*E.math.cos(R)+G*E.math.sin(R))}}}}}}}break;case"s":I(Q);if(X==0){return{}}if(R<=90){if(X>0){F={width:G,height:Math.round(J-P),left:Math.round(Z-(J-P)*E.math.sin(R)),top:H}}else{if(X<0){F={width:G,height:Math.round(J+P),left:Math.round(Z-(J+P)*E.math.sin(R)),top:H}}}}else{if(R>90&&R<=180){if(X>0){F={width:G,height:Math.round(J+P),left:Math.round(Z-(J+P)*E.math.sin(R)+G*E.math.cos(R)),top:Math.round(H+(J+P)*E.math.cos(R))}}else{if(X<0){F={width:G,height:Math.round(J-P),left:Math.round(Z-(J-P)*E.math.sin(R)+G*E.math.cos(R)),top:Math.round(H+(J-P)*E.math.cos(R))}}}}else{if(R>180&&R<=270){if(X>0){F={width:G,height:Math.round(J+P),left:Math.round(Z+G*E.math.cos(R)),top:Math.round(H+(J+P)*E.math.cos(R)+G*E.math.sin(R))}}else{if(X<0){F={width:G,height:Math.round(J-P),left:Math.round(Z+G*E.math.cos(R)),top:Math.round(H+(J-P)*E.math.cos(R)+G*E.math.sin(R))}}}}else{if(R>270&&R<360){if(X>0){F={width:G,height:Math.round(J-P),left:Z,top:Math.round(H-G*E.math.cos(R))}}else{if(X<0){F={width:G,height:Math.round(J+P),left:Z,top:Math.round(H-G*E.math.cos(R))}}}}}}}break;case"w":W(1/Q);if(X==0){return{}}if(R<=90){if(X>0){F={width:Math.round(G+P),height:J,left:Math.round(Z-P*E.math.cos(R)-J*E.math.sin(R)),top:Math.round(H-P*E.math.sin(R))}}else{if(X<0){F={width:Math.round(G-P),height:J,left:Math.round(Z+P*E.math.cos(R)-J*E.math.sin(R)),top:Math.round(H+P*E.math.sin(R))}}}}else{if(R>90&&R<=180){if(X>0){F={width:Math.round(G+P),height:J,left:Math.round(Z-P*E.math.cos(R)-J*E.math.sin(R)+(G+P)*E.math.cos(R)),top:Math.round(H-P*E.math.sin(R)+J*E.math.cos(R))}}else{if(X<0){F={width:Math.round(G-P),height:J,left:Math.round(Z+P*E.math.cos(R)-J*E.math.sin(R)+(G-P)*E.math.cos(R)),top:Math.round(H+P*E.math.sin(R)+J*E.math.cos(R))}}}}else{if(R>180&&R<=270){if(X>0){F={width:Math.round(G-P),height:J,left:Math.round(Z+P*E.math.cos(R)+(G-P)*E.math.cos(R)),top:Math.round(H+P*E.math.sin(R)+(G-P)*E.math.sin(R)+J*E.math.cos(R))}}else{if(X<0){F={width:Math.round(G+P),height:J,left:Math.round(Z-P*E.math.cos(R)+(G+P)*E.math.cos(R)),top:Math.round(H-P*E.math.sin(R)+(G+P)*E.math.sin(R)+J*E.math.cos(R))}}}}else{if(R>270&&R<360){if(X>0){F={width:Math.round(G-P),height:J,left:Math.round(Z+P*E.math.cos(R)),top:Math.round(H+P*E.math.sin(R)-(G-P)*E.math.cos(R))}}else{if(X<0){F={width:Math.round(G+P),height:J,left:Math.round(Z-P*E.math.cos(R)),top:Math.round(H-P*E.math.sin(R)-(G+P)*E.math.cos(R))}}}}}}}break;case"e":W(1/Q);if(X==0){return{}}if(R<=90){if(X>0){F={width:Math.round(G-P),height:J,left:Z-J*E.math.sin(R),top:H}}else{if(X<0){F={width:Math.round(G+P),height:J,left:Z-J*E.math.sin(R),top:H}}}}else{if(R>90&&R<=180){if(X>0){F={width:Math.round(G-P),height:J,left:Z-J*E.math.sin(R)+(G-P)*E.math.cos(R),top:H+J*E.math.cos(R)}}else{if(X<0){F={width:Math.round(G+P),height:J,left:Z-J*E.math.sin(R)+(G+P)*E.math.cos(R),top:H+J*E.math.cos(R)}}}}else{if(R>180&&R<=270){if(X>0){F={width:Math.round(G+P),height:J,left:Z+(G+P)*E.math.cos(R),top:H+(G+P)*E.math.sin(R)+J*E.math.cos(R)}}else{if(X<0){F={width:Math.round(G-P),height:J,left:Z+(G-P)*E.math.cos(R),top:H+(G-P)*E.math.sin(R)+J*E.math.cos(R)}}}}else{if(R>270&&R<360){if(X>0){F={width:Math.round(G+P),height:J,left:Z,top:H-(G+P)*E.math.cos(R)}}else{if(X<0){F={width:Math.round(G-P),height:J,left:Z,top:H-(G-P)*E.math.cos(R)}}}}}}}break}N.data("IEWidth_tmp",F.width||G).data("IEHeight_tmp",F.height||J);E(".propblk,.posblk").remove();return F}else{switch(M){case"n":I(Q);if(X==0){return{}}if(R<=90||(R>270&&R<=360)){if(X>0){return{height:Math.round(J+P),left:Math.round(Z+P*E.math.sin(R)),top:Math.round(H-P*E.math.cos(R))}}else{if(X<0){return{height:Math.round(J-P),left:Math.round(Z-P*E.math.sin(R)),top:Math.round(H+P*E.math.cos(R))}}}}else{if(R>90&&R<=270){if(X>0){return{height:Math.round(J-P),left:Math.round(Z-P*E.math.sin(R)),top:Math.round(H+P*E.math.cos(R))}}else{if(X<0){return{height:Math.round(J+P),left:Math.round(Z+P*E.math.sin(R)),top:Math.round(H-P*E.math.cos(R))}}}}}break;case"s":I(Q);if(X==0){return{}}if(R<=90||(R>270&&R<=360)){if(X>0){return{height:Math.round(J-P)}}else{if(X<0){return{height:Math.round(J+P)}}}}else{if(R>90&&R<=270){if(X>0){return{height:Math.round(J+P)}}else{if(X<0){return{height:Math.round(J-P)}}}}}break;case"w":W(1/Q);if(X==0){return{}}if(R<=180){if(X>0){return{width:Math.round(G+P),left:Math.round(Z-P*E.math.cos(R)),top:Math.round(H-P*E.math.sin(R))}}else{if(X<0){return{width:Math.round(G-P),left:Math.round(Z+P*E.math.cos(R)),top:Math.round(H+P*E.math.sin(R))}}}}else{if(R>180&&R<=360){if(X>0){return{width:Math.round(G-P),left:Math.round(Z+P*E.math.cos(R)),top:Math.round(H+P*E.math.sin(R))}}else{if(X<0){return{width:Math.round(G+P),left:Math.round(Z-P*E.math.cos(R)),top:Math.round(H-P*E.math.sin(R))}}}}}break;case"e":W(1/Q);if(X==0){return{}}if(R<=180){if(X>0){return{width:Math.round(G-P)}}else{if(X<0){return{width:Math.round(G+P)}}}}else{if(R>180&&R<=360){if(X>0){return{width:Math.round(G+P)}}else{if(X<0){return{width:Math.round(G-P)}}}}}break}}}})(jQuery);function rotateWithCenter(L,E){L=$(L);var B=L.modattr("leftpos");var O=B[0];var M=B[1];var D=L.modattr("degree");var F=L.width();var I=L.height();var K=$.math.sin(D);var N=$.math.cos(D);var G=[O+F/2*N-I/2*K,M+I/2*N+F/2*K];var A=$.math.sin(E);var J=$.math.cos(E);var C=G[0]+I/2*A-F/2*J;var H=G[1]-F/2*A-I/2*J;$.divrotate(L,E,[C,H]);toolbarRotate(L,E,{w:F,h:I})}function toolbarRotate(M,T,A,P){if(!P){P=$(".propblk")}if(P.length==0){return}M=$(M);if(P.is(".propblk")){var Q=M.data("toolbarsize")}else{Q=M.data("posizeblksize");if(T){P.data("rotatedegree",T)}}if(!Q){Q=[P.width(),P.height()];M.data("toolbarsize",Q)}if($.browser.msie&&$.browser.version<9){var K=Q[0];var D=Q[1];var C=$("#"+M.attr("id")).width();var G=$("#"+M.attr("id")).height();var F=$.resetModToolbarLeft($("#"+M.attr("id")).position().left);var U=$("#"+M.attr("id")).position().top;var J=T%360;var E=M.data("IEWidth");var N=M.data("IEHeight");if(M.data("sinx")==undefined){var L=Math.PI*J/180;var V=Math.cos(L);var O=Math.sin(L);M.data("sinx",O);M.data("cosx",V)}else{var V=M.data("cosx");var O=M.data("sinx")}if(J>0&&J<=90){var B=(C+F)-D*O;var X=U+(G-N*V)}else{if(J>90&&J<=180){var B=C+F-(D*O-K*V)-(-1*V*E);var X=G+U+D*V}else{if(J>180&&J<=270){var B=F+K*V;var X=U-N*V+D*V+K*O}else{if(J>270&&J<360){var B=F+E*V;var X=U+K*O}}}}P.css({filter:"progid:DXImageTransform.Microsoft.Matrix(M11="+V+",M12="+(-O)+",M21="+O+",M22="+V+",SizingMethod='auto expand')","left":B+"px","top":X+"px"})}else{var Y=M.data("prop_size");var C=0;if(Y){C=Y[0]}else{C=M.width()}if(!T){T=0}var Z=M.data("prop_leftpos");var R=parseInt(M.css("left"));var S=$.resetModToolbarLeft(parseInt(R));if(M.attr("fatherid")&&M.attr("fatherid")!=""&&$("#"+M.attr("fatherid")).is(".cstlayer")){S=R}var W=parseInt(M.css("top"));if(Z){R=Z[0];W=Z[1]}var G=35;var I=$.math.sin(T)*G+S+canv.offset().left-(window.mobilesOffsetLeft||0)+$("#"+$.getElementFatherid(M)).ab_pos_cnter("left");var H=parseInt(W)-$.math.cos(T)*G+$("#"+$.getElementFatherid(M)).ab_pos_cnter("top");$.divrotate(P,T,[I,H],Q)}}function modPosRotate(K,R,B){if($(".posblk").length==0){return}K=$(K);var S=K.data("modpossize");if(!S){S=[$(".posblk").width(),$(".posblk").height()];K.data("modpossize",S)}if(!R){R=0}var W=K.data("prop_leftpos");var U=parseInt(K.css("left"));var Q=parseInt(K.css("top"));if(W){U=W[0];Q=W[1]}K.data("deg",R);$(".posblk").find(".posblk-position").html(Math.round(U)+","+Math.round(Q)).andSelf().find(".posblk-deg").html(K.data("deg")%360);if($.browser.msie&&$.browser.version<9){var X=S[0];var L=S[1];var D=$("#"+K.attr("id")).width();var F=$("#"+K.attr("id")).height();var O=$("#"+K.attr("id")).position().left;var T=$("#"+K.attr("id")).position().top;var I=R%360;var E=K.data("IEWidth");var M=K.data("IEHeight");if(K.data("sinx")==undefined){var J=Math.PI*I/180;var A=Math.cos(J);var N=Math.sin(J);K.data("sinx",N);K.data("cosx",A)}else{var A=K.data("cosx");var N=K.data("sinx")}if(I>=0&&I<=90){var P=O+M*N;var C=T-L*A}else{if(I>90&&I<=180){var P=O+D+X*A;var C=T-M*A}else{if(I>180&&I<=270){var P=O-E*A+X*A+L*N;var C=T+F+X*N}else{if(I>270&&I<360){var P=O+L*N;var C=T-E*N-L*A+X*N}}}}$(".posblk").css({filter:"progid:DXImageTransform.Microsoft.Matrix(M11="+A+",M12="+(-N)+",M21="+N+",M22="+A+",SizingMethod='auto expand')","left":P+"px","top":C+"px"})}else{var V=K.data("prop_size");var D=0;if(V){D=V[0]+10}else{D=K.width()+10}var H=$.math.cos(R)*D+parseInt(U)+canv.offset().left-(window.mobilesOffsetLeft||0)+$("#"+$.getElementFatherid(K)).ab_pos_cnter("left");var G=$.math.sin(R)*D+parseInt(Q)+$("#"+$.getElementFatherid(K)).ab_pos_cnter("top");$.divrotate($(".posblk"),R,[H,G],S)}}function getOldProxyFromSize(J,C,D,F){var I=C%360;var A=$("#"+J.attr("id")).position().left;var L=$("#"+J.attr("id")).position().top;var K=$("#"+J.attr("id"));if(J.data("sinx")==undefined){var E=Math.PI*I/180;var H=Math.cos(E);var G=Math.sin(E);J.data("sinx",G);J.data("cosx",H)}else{var G=J.data("sinx");var H=J.data("cosx")}if(I==0){var B=A;var M=L}else{if(I>=0&&I<=90){var B=(F*G+D*H-D)/2+A;var M=(D*G+F*H-F)/2+L}else{if(I>90&&I<=180){var B=(F*G-D*H-D)/2+A;var M=(D*G-F*H-F)/2+L}else{if(I>180&&I<=270){var B=(-1*F*G-D*H-D)/2+A;var M=(-1*D*G-F*H-F)/2+L}else{if(I>270&&I<360){var B=(-1*F*G+D*H-D)/2+A;var M=(-1*D*G+F*H-F)/2+L}}}}}return[B,M]}function getLeftPointProxy(B,A){var I=A%360;var C=B.position().left,D=B.position().top;var J=Math.PI*I/180;var G=Math.sin(J),H=Math.cos(J);var F=B.data("IEWidth"),E=B.data("IEHeight");if(I>=0&&I<90){return[Math.round(C+E*G),Math.round(D)]}else{if(I>=90&&I<180){return[Math.round(C+E*G-F*H),Math.round(D-E*H)]}else{if(I>=180&&I<270){return[Math.round(C-F*H),Math.round(D-E*H-F*G)]}else{if(I>=270&&I<360){return[Math.round(C),Math.round(D-F*G)]}}}}};; /*! LAB.js (LABjs :: Loading And Blocking JavaScript) v2.0.3 (c) Kyle Simpson MIT License */ (function(o){var K=o.$LAB,y="UseLocalXHR",z="AlwaysPreserveOrder",u="AllowDuplicates",A="CacheBust",B="BasePath",C=/^[^?#]*\//.exec(locations.href)[0],D=/^\w+\:\/\/\/?[^\/]+/.exec(C)[0],i=document.head||document.getElementsByTagName("head"),L=(o.opera&&Object.prototype.toString.call(o.opera)=="[object Opera]")||("MozAppearance"in document.documentElement.style),q=document.createElement("script"),E=typeof q.preload=="boolean",r=E||(q.readyState&&q.readyState=="uninitialized"),F=!r&&q.async===true,M=!r&&!F&&!L;function G(a){return Object.prototype.toString.call(a)=="[object Function]"}function H(a){return Object.prototype.toString.call(a)=="[object Array]"}function N(a,c){var b=/^\w+\:\/\//;if(/^\/\/\/?/.test(a)){a=locations.protocol+a}else if(!b.test(a)&&a.charAt(0)!="/"){a=(c||"")+a}return b.test(a)?a:((a.charAt(0)=="/"?D:C)+a)}function s(a,c){for(var b in a){if(a.hasOwnProperty(b)){c[b]=a[b]}}return c}function O(a){var c=false;for(var b=0;b0){for(var a=0;a=0;){d=n.shift();a=a[d.type].apply(null,d.args)}return a},noConflict:function(){o.$LAB=K;return m},sandbox:function(){return J()}};return m}o.$LAB=J();(function(a,c,b){if(document.readyState==null&&document[a]){document.readyState="loading";document[a](c,b=function(){document.removeEventListener(c,b,false);document.readyState="complete"},false)}})("addEventListener","DOMContentLoaded")})(this);; var mclick = 'click',mtouchstart = 'mousedown',mtouchend = 'mouseup',mtouchmove = 'mousemove'; if (window.ontouchstart !== undefined) { mclick = 'click';mtouchstart = 'touchstart';mtouchend = 'touchend';mtouchmove = 'touchmove'; } /**Global Function**/ function getSessionExpiredUrl() { $(window).unbind('beforeunload'); alert(translate('page.sessionTimeout')); window.close(); return null; } function wp_heightAdapt(dom,oldHeight){} function is_website_mobiles(){ var type=getWebSiteType(); return type=='mobiles'; } function layer_img_lzld(layerid){ var imgcontainer=$('#scroll_container'); var ismobiles=is_website_mobiles(); if(!ismobiles){ var chromebug=$('#scroll_container').data('chrome_bug'); if(chromebug){ imgcontainer=window; } }else imgcontainer=window; $('#'+layerid+' img.img_lazy_load').lazyload({ threshold : 200, failure_limit : $('#'+layerid+' img.img_lazy_load').length, container : imgcontainer, placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'), load:function(){ var self=$(this); var id=self.closest('.cstlayer').prop('id'); if(window['set_thumb_'+id]) window['set_thumb_'+id](this); } }); } function initScrollcontainerHeight(){ var container=$('#scroll_container'); var cvhgt = window.innerHeight || window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; if (! window.mobilesModel) container.height(cvhgt); $('#scroll_container_bg').css('height',cvhgt); } function noRightClick(){ //禁用鼠标右键 CTRL+C 复制 CTRL+V 粘贴 CTRL+S 保存 $(function(){ document.body.oncontextmenu=function(){return false;} $(document).keydown(function(event) { if ((event.ctrlKey&&event.which==67) || (event.ctrlKey&&event.which==86)) { return false; } }) $(document).keydown(function(event) { if ((event.ctrlKey&&event.which==67) || (event.ctrlKey&&event.which==86) || (event.ctrlKey&&event.which==83)) { return false; } }) }) } function doc_end_exec(){ $(function(){ $(document).triggerHandler('lastexec'); }) $('#scroll_container').css("visibility", 'visible'); $('.mloading-mask').remove(); $(window).load(function(){ var heightadaptel=$("#canvas").find(".cstlayer[type='article_detail'],.cstlayer[type='product_detail'],.cstlayer[type='wzl'],.cstlayer[type='fxdp'],.cstlayer[type='mcoupon'],.cstlayer[type='coupon'],.cstlayer[type='tb_product_detail'],.cstlayer[type='tb_product_list'],.cstlayer[type='product_list'],.cstlayer[type='wkj'],.cstlayer[type='crowdfunding'],.cstlayer[type='btag'],.cstlayer[type='greetingcard'],.cstlayer[type='weiredpack'],.cstlayer[type='mseckill_detail'],.cstlayer[type='mgroupon_detail'],.cstlayer[type='mgroupons_detail'],.cstlayer[type='groupon_detail'],.cstlayer[type='jfpro_detail'],.cstlayer[type='mjfpro_detail'],.cstlayer[type='payknow_detail'],.cstlayer[type='mpayknow_detail']"); if(heightadaptel.length){ heightadaptel.each(function(){ if($(this).data('not_need_heightadapt')) return; wp_heightAdapt($(this)); }) window.scroll_container_adjust(); } }); var imgcontainer=$('#scroll_container'); var ismobiles=is_website_mobiles(); if(!ismobiles){ var chromebug=$('#scroll_container').data('chrome_bug'); if(chromebug){ imgcontainer=window; } }else imgcontainer=window; $('img.img_lazy_load').lazyload({ threshold : 200, failure_limit : $('img.img_lazy_load').length, container : imgcontainer, placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'), load:function(){ var self=$(this); var id=self.closest('.cstlayer').prop('id'); if(window['set_thumb_'+id]) window['set_thumb_'+id](this); } }); $(window).load(function(){ $('.cstlayer').showEffects(); }) } function wpfullcolumn_float(unbindFunc){ var wp_ibody = $('#scroll_container'),wp_icontent = $('#canvas'),wp_icontent_foot = $('#site_footer #footer_content'); $('.full_column,.cstlayer').filter('[infixed=1]').each(function(){ var fc_lid = '#'+$(this).attr('id'); var $fc_lid = $(this); var wp_layer_abs = $('#canvas '+fc_lid),wp_layer_abs_footer = $('#site_footer #footer_content '+fc_lid),wp_layer_fix= $('#scroll_container '+fc_lid); var currpoor = ($('.full_width').width() - $('.full_content').width())/2; var isinfixed = $fc_lid.attr('infixed'); var infixed_html = $(document).data(fc_lid+'infixed_content'); if(!infixed_html){ infixed_html =$fc_lid.html(); $(document).data(fc_lid+'infixed_content',infixed_html); } var fullc_wid_bgcolor = $(document).data(fc_lid+'fullc_wid_bgcolor'); if(!fullc_wid_bgcolor){ fullc_wid_bgcolor =$fc_lid.find('.full_width').css('background-color'); $(document).data(fc_lid+'fullc_wid_bgcolor',fullc_wid_bgcolor); } var fullc_con_bgcolor = $(document).data(fc_lid+'fullc_con_bgcolor'); if(!fullc_con_bgcolor){ fullc_con_bgcolor =$fc_lid.find('.full_content').css('background-color'); $(document).data(fc_lid+'fullc_con_bgcolor',fullc_con_bgcolor); } var fullc_hoverbgcolor = $(document).data(fc_lid+'fullc_hoverbgcolor'); if(!fullc_hoverbgcolor){ fullc_hoverbgcolor =$fc_lid.attr('zindextopcolor'); $(document).data(fc_lid+'fullc_hoverbgcolor',fullc_hoverbgcolor); } var fullc_zindextopOpacity = $(document).data(fc_lid+'fullc_zindextopOpacity'); if(!fullc_zindextopOpacity){ fullc_zindextopOpacity =$fc_lid.attr('zindextopOpacity'); $(document).data(fc_lid+'fullc_zindextopOpacity',fullc_zindextopOpacity); } var fullc_hoverbgcolorSet = $(document).data(fc_lid+'fullc_hoverbgcolorSet'); if(!fullc_hoverbgcolorSet){ fullc_hoverbgcolorSet =$fc_lid.attr('infixed'); var zindextopcolorset =$fc_lid.attr('zindextopcolorset'); if(!zindextopcolorset)fullc_hoverbgcolorSet='' $(document).data(fc_lid+'fullc_hoverbgcolorSet',fullc_hoverbgcolorSet); } if(isinfixed==1) { var nPos = $('#scroll_container').scrollTop() ; var container=$('#scroll_container'); var is_mobiles_preview=false; if(is_website_mobiles()){ nPos = $(window).scrollTop() ; } if($('.wp-mobiles-device-premask').length){ is_mobiles_preview=true; } //oPos get第一次正确的值,以后不再获得 var oPos_tmp = $(document).data("fixed_"+$(this).attr('id')+"_oPos"); var inbuttom=$(document).data("fixed_"+$(this).attr('id')+"_inbuttom"); if(!oPos_tmp){ oPos_tmp = $fc_lid.ab_pos_cnter('top'); $(document).data("fixed_"+$(this).attr('id')+"_oPos",oPos_tmp); } if(inbuttom==null){ inbuttom = $fc_lid.attr('inbuttom'); $(document).data("fixed_"+$(this).attr('id')+"_inbuttom",inbuttom); } var oPos = $(document).data("fixed_"+$(this).attr('id')+"_oPos"); if(oPos==0 && $fc_lid.parent().is('#canvas')) return; if(oPos==0){ var oldsty = $fc_lid.attr('oldstyle')||''; if(oldsty.match(/top:\d+px/)){ var oldtop = oldsty.match(/top:\d+px/); oldtop = oldtop[0].match(/\d+/); oPos = oldtop[0]; } } if(inbuttom>0){ //存在页脚中 if(nPos > oPos){ var newleft = $('.full_column').ab_pos('left') + currpoor ; if(wp_layer_abs_footer.is('.cstlayer')){ newleft =wp_layer_abs_footer.offset().left+$(container).scrollLeft(); if(is_mobiles_preview){ newleft =wp_layer_abs_footer .ab_pos_cnter('left'); } } if(wp_layer_abs_footer.length>0){ var oldstyle = wp_layer_abs_footer.attr('style'); wp_layer_fix = wp_layer_abs_footer.clone(true).appendTo(container) .attr('oldstyle',oldstyle).attr('inbuttom','1') .attr('fc_fh_istop','1') .addClass('full_column-fixed'); if(wp_layer_abs_footer.attr('fatherid')) wp_layer_fix.attr('fatherid',wp_layer_abs.attr('fatherid')); wp_layer_fix.show();wp_layer_fix.css({'position':'fixed','top':'','left':newleft,'z-index':'999'}); if(is_mobiles_preview){ wp_layer_fix.css({top:nPos+'px'}); } wp_layer_abs_footer.remove(); }else{ if(is_mobiles_preview){ wp_layer_fix.css({top:nPos+'px'}); } } if(fullc_hoverbgcolorSet){ wp_layer_fix.find('.full_width').css({'background-color':fullc_hoverbgcolor,'transition':'1.2s'}) wp_layer_fix.find('.full_content').css({'background-color':'','transition':'1.2s'}) } }else{ oldstyle = wp_layer_fix.attr('oldstyle'); if(wp_layer_abs_footer.length==0){ wp_icontent_foot=$('#site_footer #footer_content'); if(wp_layer_fix.attr('fatherid')){ wp_icontent_foot=$('#'+wp_layer_fix.attr('fatherid')); } wp_layer_abs_footer = wp_layer_fix.clone(true).appendTo(wp_icontent_foot) .attr('fc_fh_istop','') .attr('style',oldstyle).attr('inbuttom','1').removeClass('full_column-fixed'); if(wp_layer_fix.attr('fatherid')){ wp_layer_abs_footer.attr('fatherid',wp_layer_fix.attr('fatherid')); } wp_layer_abs_footer.show();wp_layer_fix.remove(); } if(fullc_hoverbgcolorSet){ wp_layer_fix.find('.full_width').css('background-color',fullc_wid_bgcolor) wp_layer_fix.find('.full_content').css('background-color',fullc_con_bgcolor) } } }else{ if(nPos > oPos){ var newleft = Math.abs(parseFloat($('.full_column').find('.full_width').css('left'))); if(wp_layer_abs.is('.cstlayer')){ newleft =wp_layer_abs.offset().left+$(container).scrollLeft(); if(is_mobiles_preview){ newleft =wp_layer_abs.ab_pos_cnter('left'); } } var fatherid=$.getElementFatherid(wp_layer_abs); $(document).data("fixed_"+wp_layer_abs.attr('id')+"_father",$('#'+fatherid)); //clone(true) has true 可以存储data if(wp_layer_abs.length>0){ var oldstyle = wp_layer_abs.attr('style'); var func=function(){ //未加载完拖拽滚动条为空异常处理 var success=true; var newleft = Math.abs(parseFloat($(fc_lid).find('.full_width').css('left'))); if(!(newleft)){success=false;} if(success){ $(fc_lid).css('left',newleft); }else { setTimeout(func,100); } } func(); var layerdiv=$("
    ").attr({ 'id':wp_layer_abs.attr('id'),'class':wp_layer_abs.attr('class'),'infixed':1,'style':wp_layer_abs.attr('style'),'zindextopcolor':wp_layer_abs.attr('zindextopcolor'),'zindextopcolorset':wp_layer_abs.attr('zindextopcolorset'),'zindextopopacity':wp_layer_abs.attr('zindextopopacity')}); if(wp_layer_abs.attr('fatherid')) layerdiv.attr('fatherid',wp_layer_abs.attr('fatherid')); container.append(layerdiv); wp_layer_abs.remove(); var wp_layer_fix =$(fc_lid).html(infixed_html) .attr('oldstyle',oldstyle) .attr('fc_fh_istop',1) .addClass('full_column-fixed'); wp_layer_fix.show();wp_layer_fix.css({'position':'fixed','top':'','left':newleft,'z-index':'999'}); if(is_mobiles_preview){ wp_layer_fix.css({top:nPos+'px'}); } if(fullc_hoverbgcolorSet){ var opacityval = wp_layer_fix.find('.full_width').css('opacity'); if(fullc_zindextopOpacity && fullc_zindextopOpacity>0) opacityval = fullc_zindextopOpacity; wp_layer_fix.find('.full_width').css({'background-color':fullc_hoverbgcolor,'transition':'1.2s','opacity': opacityval}) wp_layer_fix.find('.full_content').css({'background-color':"",'transition':'1.2s'}) // wp_layer_fix.css({'transition':'0.5s'}) } ////fix时 full_width宽为空异常处理 var funco=function(){ var full_width_val = Math.abs(parseFloat($(fc_lid).find('.full_width').css('left'))); if(!full_width_val){ $(fc_lid).children('.full_width').css({left:0-$('#canvas').offset().left-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()}); if(!(Math.abs(parseFloat($(fc_lid).find('.full_width').css('left'))))){ setTimeout(funco,100); } } } funco(); var imgcontainer=$('#scroll_container'); var ismobiles=is_website_mobiles(); if(!ismobiles){ var chromebug=$('#scroll_container').data('chrome_bug'); if(chromebug){ imgcontainer=window; } }else imgcontainer=window; $('.full_content img.img_lazy_load').lazyload({ threshold : 200, failure_limit : $('img.img_lazy_load').length, container : imgcontainer, placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'), load:function(){ var self=$(this); var id=self.closest('.cstlayer').prop('id'); if(window['set_thumb_'+id]) window['set_thumb_'+id](this); } }); }else{ if(is_mobiles_preview){ wp_layer_fix.css({top:nPos+'px'}); } if(oPos==0 && $.isFunction(unbindFunc)) unbindFunc(); } }else{ if( wp_layer_fix.data('always_fix')){ if(is_mobiles_preview){ wp_layer_fix.css({top:nPos+'px'}); } return; } oldstyle = wp_layer_fix.attr('oldstyle'); if(!wp_layer_abs.length>0){ var layerdiv=$("
    ").attr({ 'id':wp_layer_fix.attr('id'),'class':wp_layer_fix.attr('class'),'infixed':1,'style':wp_layer_fix.attr('oldstyle'),'zindextopcolor':wp_layer_fix.attr('zindextopcolor'),'zindextopcolorset':wp_layer_fix.attr('zindextopcolorset')}); if(wp_layer_fix.attr('fatherid')) layerdiv.attr('fatherid',wp_layer_fix.attr('fatherid')); wp_icontent = $(document).data("fixed_"+wp_layer_fix.attr('id')+"_father"); if(!wp_icontent.length) wp_icontent=$('#canvas'); wp_icontent.append(layerdiv); wp_layer_fix.remove(); wp_layer_abs =$(fc_lid).html(infixed_html) .attr('oldstyle',oldstyle) .attr('fc_fh_istop','') .removeClass('full_column-fixed'); wp_layer_abs.show(); // if(fullc_hoverbgcolorSet){ wp_layer_fix.find('.full_width').css('background-color',fullc_wid_bgcolor) wp_layer_fix.find('.full_content').css('background-color',fullc_con_bgcolor) } //为空异常处理 var funco=function(){ var full_width_val = Math.abs(parseFloat($(fc_lid).find('.full_width').css('left'))); if(!(full_width_val)){ $(fc_lid).children('.full_width').css({left:0-$('#canvas').offset().left-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()}); if(!(Math.abs(parseFloat($(fc_lid).find('.full_width').css('left'))))){ setTimeout(funco,100); } } } funco(); var imgcontainer=$('#scroll_container'); var ismobiles=is_website_mobiles(); if(!ismobiles){ var chromebug=$('#scroll_container').data('chrome_bug'); if(chromebug){ imgcontainer=window; } }else imgcontainer=window; $('.full_content img.img_lazy_load').lazyload({ threshold : 200, failure_limit : $('img.img_lazy_load').length, container : imgcontainer, placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'), load:function(){ var self=$(this); var id=self.closest('.cstlayer').prop('id'); if(window['set_thumb_'+id]) window['set_thumb_'+id](this); } }); } } } } }); } function getTop(){//for ie6 css hack return document.documentElement.scrollTop; } function init_fullcolumn_bottomfixed_code(){ var bottomel=$('.full_column,.cstlayer').filter('.full_column-bottomfixed'); bottomel.each(function(){ var self=$(this); var container=$('#scroll_container'); var newleft=$('#canvas').offset().left; var ismobiles=is_website_mobiles(); if(ismobiles){ setTimeout(function(){ var newleft=$('#canvas').offset().left; self.css({'left':newleft+'px'}) },500); }else if(self.attr('type')=='box'){ var old_left = self.offset().left; newleft += old_left; } self.css({'position':'fixed','top':'',bottom:'0','left':newleft+'px','z-index':'999',visibility:'visible'}); }) $(function(){ var is_mobiles_preview=false; if($('.wp-mobiles-device-placeholder').length){ is_mobiles_preview=true; } if(is_mobiles_preview){ setInterval(function(){ var oritop=$('#scroll_container').scrollTop(); bottomel.css('bottom',(0-oritop)+'px'); },60) } }) } function init_fullcolumn_fixed_code(){ $(function(){ setTimeout(function(){ $('.full_column,.cstlayer').filter('[infixed=1]').each(function(){ var self=$(this); var container=$('#scroll_container'); var is_mobiles_preview=false; if($('.wp-mobiles-device-premask').length){ is_mobiles_preview=true; } if(self.parent().is('#canvas')&&parseInt(self.css('top'))==0){ var currpoor = ($('.full_width').width() - $('.full_content').width())/2; var newleft = self.ab_pos('left') + currpoor ; if(self.is('.cstlayer')){ newleft =self.offset().left+$('#scroll_container').scrollLeft(); if(is_mobiles_preview){ newleft =self.ab_pos_cnter('left'); } } var wp_layer_abs=self; var layerid=wp_layer_abs.attr('id'); var oldstyle = wp_layer_abs.attr('style'); var layerhtml=wp_layer_abs.html(); var layerdiv=$("
    ").attr({ id:wp_layer_abs.attr('id'), 'class':wp_layer_abs.attr('class'), infixed:1, 'zindextopcolor':wp_layer_abs.attr('zindextopcolor'), style:wp_layer_abs.attr('style'), }); wp_layer_abs.remove(); container.append(layerdiv); var wp_layer_fix =$('#'+layerid).html(layerhtml) .attr('oldstyle',oldstyle) .addClass('full_column-fixed'); wp_layer_fix.data('always_fix',true); wp_layer_fix.show();wp_layer_fix.css({'position':'fixed','top':'','left':newleft,'z-index':'999'}) if($.browser.msie && ($.browser.version < 9)){ wp_layer_fix.css({'top':'0px'}); wp_layer_fix.find('.full_width').css({'top':'0px'}); } var ismobiles=is_website_mobiles(); var imgcontainer=window; if(!ismobiles) imgcontainer=$('#scroll_container').add(window); wp_layer_fix.find('img.img_lazy_load').lazyload({ threshold : 200, failure_limit : wp_layer_fix.find('img.img_lazy_load').length, container : imgcontainer, placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'), load:function(){ var self=$(this); var id=self.closest('.cstlayer').prop('id'); if(window['set_thumb_'+id]) window['set_thumb_'+id](this); } }); // 固定通栏里显示动画 wp_layer_fix.find('.cstlayer:not(.now_effecting)').showEffects(); //explain:修复bug(2282多语言模块放置固定的通栏后异常),author:fpf,date:2015/03/30,action:add; var $multilingual = $(document).find('.wp-multilingual_content'); if($multilingual.get(0) != 'undefined'){ var $multilingual_content = $multilingual.find('.wp-content > .overz'); if(parseInt($multilingual_content.length) > 1){ $multilingual.find('.wp-content > .overz:last').remove(); } } wp_layer_fix.find('.cstlayer[type=twitter]').each(function(){ var code=$(this).data('wpcode'); if(code){ $(this).find('.wp-twitter_content').html(code); } }) wp_layer_fix.find('.cstlayer[type=weibofollowbutton]').each(function(){ var code=$(this).data('wpcode'); $LAB.script('http://tjs.sjs.sinajs.cn/open/api/js/wb.js'); if(code){ $(this).find('.wp-weibofollowbutton_content').html(code); } }) } }); // 修复“通栏设置‘固定显示’后导致‘鼠标滚轮’事件异常(bug#4230)” $(document).bind("mousewheel DomMouseScroll MozMousePixelScroll", function(e){ e = e || window.event; var $target = $(e.target).closest('.full_column[infixed="1"],.cstlayer[infixed="1"]'); if ($target.length > 0) { var wheeldelta=e.wheelDelta; var detail=e.detail||e.originalEvent.detail; if(e.type=='mousewheel'){ var wheeldelta=e.deltaY || e.originalEvent.deltaY; wheeldelta=(wheeldelta>0)?1:-1; }else{ var wheeldelta=e.wheelDelta || e.originalEvent.wheelDelta; if(!wheeldelta) wheeldelta=detail; } var $win = $(window),$stainer = $('#scroll_container'), $scroll = $stainer.height() <= $win.height() ? $stainer : $win, movey = wheeldelta * -(Math.abs(detail) > 3 ? 1 : 40); $scroll.scrollTop($scroll.scrollTop() - movey); $win = $stainer = $scroll = movey = null; } $target = null; }); //explain:修复flash模块在360安全浏览器极速模式下鼠标:hover后无法触发滚动效果,该事件在采用Webkit内核的浏览器下都会触发,author:fpf,date:2015-01-15,action:add; $('div.wp-flash_content').each(function(){ $(this).unbind('mousewheel').bind('mousewheel',function(event){ var scrolltop=$('#scroll_container').scrollTop(); if(event.wheelDelta>0){ $('#scroll_container').scrollTop(scrolltop-50); } else{ $('#scroll_container').scrollTop(scrolltop+50); } }); }); },300); }) if(is_website_mobiles()){ var need_unbind=false; $(window).scroll(function(e){ var unbindfunc=function(){ need_unbind=true; } wpfullcolumn_float(unbindfunc); if(need_unbind){ $(window).unbind(e); } }); }else{ var need_unbind=false; $('#scroll_container').scroll(function(e){ var unbindfunc=function(){ need_unbind=true; } wpfullcolumn_float(unbindfunc); if(need_unbind){ $('#scroll_container').unbind(e); } }); } } function initCanvasHeight(){ var maxheight=0; var helperfunc=function(dom){ var degree=dom.data('deg')||dom.attr('deg'); var pos=[parseInt(dom.css('left')),parseInt(dom.css('top'))] var w=dom.width(); var h=dom.height(); if(dom.hasClass('cstlayer')){ var buttompos=$.divrotate.getDegreeModMaxPointOrigin(dom,degree,pos,[w,h],'buttom'); }else{ var buttompos=dom.ab_pos_cnter('top')+parseInt(dom.css('height')); } if(dom.data('wopop_effect_oristyle')) { var style=dom.data('wopop_effect_oristyle'); var topregexp=/(?:^|;)\s*top\s*:\s*(-?\d+)(?:\.\d+)?px/; var topmatches=style.match(topregexp); if(topmatches){ var oritop=parseInt(topmatches[1]); var nowt=parseInt(dom.css('top')) var domfatherid=$.getElementFatherid(dom); buttompos=buttompos-nowt+oritop; if(domfatherid && domfatherid!='canvas' && domfatherid!='site_footer' && $('#'+domfatherid).length){ buttompos=oritop+dom.height()+$('#'+domfatherid).ab_pos('top'); } } } return buttompos; } var filterfunc=function(){ return $(this).is(":not(div[deleted='deleted'])") && $(this).attr('childdel') != 'del'; } $('#canvas .cstlayer,#canvas .full_column').filter(filterfunc).each(function(){ var canvheight=helperfunc($(this)); if(canvheight>maxheight) maxheight=canvheight; }) $("#canvas").data('layermaxheight',maxheight); //#5460 setTimeout(function(){ $('#site_footer').find('.cstlayer').each(function(){ var sitetop = parseInt($('#site_footer').css('top')); var thistop = parseInt($(this).css('top')) if(thistop<0&&sitetop<-thistop) {$(this).css('top',-sitetop);} }) },100) } function fullcolumn_HoverInit(params){ if(!params.full_con.bg)params.full_con.bg='' if(!params.full.bg)params.full.bg='' var thisFHopacity= 1; var fc_lid = '#'+params.full.id var zindextopColor =$(fc_lid).attr('zindextopcolor'); var zindextopOpacity =$(fc_lid).attr('zindextopOpacity'); var zindextopColorSet =$(fc_lid).attr('zindextopcolorset'); if(!zindextopColorSet)zindextopColor='' if(params.full.hover){ $("body").on('mouseover','#'+params.full.id+' .full_width',function(e){ $("#"+params.full.id+" .full_width").css({"background-color":params.full.hover,"opacity":params.full.opacity}); }).on('mouseout','#'+params.full.id+' .full_width',function(e){ if(params.full.bgopacity){thisFHopacity = params.full.bgopacity;} else{thisFHopacity = "";} var parfbg = '' if($(fc_lid).attr('fc_fh_istop')&&zindextopColorSet){ parfbg=zindextopColor thisFHopacity = zindextopOpacity; }else parfbg = params.full.bg; $("#"+params.full.id+" .full_width").css({"background-color":parfbg,"opacity":thisFHopacity}); }); if(params.full_con.hover=='transparent'){ $("#scroll_container").on('mouseover','#'+params.full.id+' .full_content',function(e){ $("#"+params.full.id+" .full_content").css({"background-color":params.full.hover,"opacity":params.full.opacity}); }).on('mouseout','#'+params.full.id+' .full_content',function(e){ $("#"+params.full.id+" .full_content").css({"background-color":params.full.bg,"opacity":"1"}); }); } } if(params.full_con.hover||params.full.hover){ $("body").on('mouseover','#'+params.full_con.id+' .full_content',function(e){ var fc_opacity = params.full_con.opacity?params.full_con.opacity:'' if(fc_opacity==0)fc_opacity='' $("#"+params.full_con.id+" .full_content").css({"background-color":params.full_con.hover,"opacity":fc_opacity}); $("#"+params.full.id+" .full_width").css({"background-color":params.full.hover,"opacity":params.full.opacity}); }).on('mouseout','#'+params.full_con.id+' .full_content',function(e){ var parfcbg ='', parfbg1 = '' if($(fc_lid).attr('fc_fh_istop')&&zindextopColorSet){ parfbg1 = zindextopColor parfcbg='' }else{ parfcbg = params.full_con.bg;parfbg1 = params.full.bg; } $("#"+params.full_con.id+" .full_content").css({"background-color":parfcbg,"opacity":''}); if(params.full.bgopacity)thisFHopacity = params.full.bgopacity?params.full.bgopacity:''; $("#"+params.full.id+" .full_width").css({"background-color":parfbg1,"opacity":thisFHopacity}); }); } } function fullcolumn_bgvideo_init_func(videoParams){ var domid=videoParams.id,dom=$('#'+domid),$bauto=videoParams.bgauto,$ctauto=videoParams.ctauto,$buse=videoParams.bVideouse, $cuse=videoParams.cVideouse,videoH = videoParams.bgvHeight,videoW = videoParams.bgvWidth; var $fullwidth=$('#'+domid+' .full_width'),fheight=$fullwidth.height(),$contentwidth=$('#'+domid+' .full_content'); var dheight=dom.height(); if($buse=='usevideo'){ var $fullDiv=dom.find('.fullwidth_vdiv'), $fullBg=dom.find('.fullwidth_bg'), vwidht=$('.fullwidth_vdiv').width(); var videoRatio = videoH / videoW; var theight=$.parseInteger(vwidht*videoRatio); var newWidth=$.parseInteger(fheight/videoRatio); if (theight!='0') { var ntheight=theight; }else{ var ntheight=dheight; } $fullDiv.height(dheight); $fullDiv.find('.fullwidth_video').height(dheight); $fullDiv.find('.fullwidth_bg').height(dheight); } if($bauto=='noautoplay' && $buse=='usevideo'){ var $bvideo=$fullwidth.find('.fullwidth_video'); $('#'+domid).click(function(){ $bvideo[0].play(); }); } if($ctauto=='noautoplay' && $cuse=='usevideo'){ var $cvideo=$contentwidth.find('.content_video'); $('#'+domid).click(function(){ $cvideo[0].play(); }); } } $.fn.layer_ready=function(func){ var is_exec=false; var execfunc=function(){ if(is_exec) return; try{ func(); }catch(e){} is_exec=true; } $(this).bind('layer_ready',function(){ execfunc(); }) $(function(){ execfunc(); }) }; (function(){ var is_init=false; var init_pageinfo={} var is_layer_add={}; var PageHistory={ init:function(layerid,pageid){ if(history && history.pushState){ init_pageinfo[layerid]=pageid; if(is_init) return; window.onpopstate=function(e){ var state=e.state; if(state && state.action=='page'){ var layerid=state.layerid; $('#'+layerid).trigger('to_page',state.page); } } is_init=true; } }, add_page:function(layerid,pageid){ if(history && history.pushState){ var loc=window.locations.href; var layerend=layerid.replace(/.+(\w{5})$/,'$1'); var paramregexp=new RegExp(layerend+'_p=[^&]+'); var newloc=''; if(loc.match(paramregexp)){ newloc=loc.replace(paramregexp,layerend+'_p='+pageid); }else{ if(loc.indexOf('?')>0){ newloc=loc+'&'+layerend+"_p="+pageid }else{ newloc=loc+'?'+layerend+"_p="+pageid } } newloc=newloc.replace(/.+?\?/,'?'); if(!is_layer_add[layerid] && pageid != init_pageinfo[layerid]){ history.replaceState({action:'page',layerid:layerid,page:init_pageinfo[layerid]}, document.title, loc); is_layer_add[layerid]=true; } history.pushState({action:'page',layerid:layerid,page:pageid}, document.title, newloc); } } }; window.PageHistory=PageHistory; })(); (function(){ function resizeCanvasHeight(){ window.canv = $("#canvas"); var container=$('#scroll_container'); // 画布高度 var cvhgt = window.getdeviceheight || window.innerHeight || self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;//$(window).height(); var ua = /micromessenger/i.test(navigator.userAgent.toLowerCase()); if (window.isHandheld&&!ua) cvhgt = Math.min(cvhgt, mobilesUtils.getScreenHeight()); cvhgt -= container.offset().top,mfooterheight = $('#wp-mobiles-device-footer').height()||0; if (!window.isHandheld) { if (! window.mobilesModel) container.height(cvhgt - mfooterheight); } if($('#site_footer').length>0){ var canvheight=Math.max($("#canvas").data('layermaxheight'),cvhgt-$('#site_footer').height()-mfooterheight); if($('#site_footer:not(.only_copyright)').length>0){ canvheight=Math.max(canvheight,$("#canvas").height()); } }else{ var canvheight=Math.max($("#canvas").data('layermaxheight'),cvhgt); canvheight=Math.max($("#canvas").data('layermaxheight'),cvhgt-mfooterheight);//没有页脚时去设备底部高度,防没有任何模块时有滚动条bug/4574 } // 重置bSlider模块高度 2013/03/25 $('.cstlayer[type="bslider"]:not(.isplate)').each(function(i, dom){ $(dom).triggerHandler('resetbsliderheight', [canvheight]); }); if(!canv) var canv = $("#canvas"); canv.css('height',canvheight+'px'); var footermargintop=parseInt($('#site_footer').css('margin-top'))||0; var bottomfixedheight=0; if($('.full_column-bottomfixed:not(.cstlayer)').length){ bottomfixedheight=$('.full_column-bottomfixed').height(); } $('#scroll_container_bg').css('height',(canvheight+$('#site_footer').height()+footermargintop+bottomfixedheight)+'px'); if($(window).width()-canv.width()<0) $('#scroll_container_bg').width(canv.width()); else $('#scroll_container_bg').css('width','100%'); $('#scroll_container_bg').triggerHandler('after_resize'); // 更新标尺位置Start 2012/3/2 var canvleft = canv.offset().left; if (typeof $.fn.ruler_locate != 'undefined') { $.fn.ruler_locate({ x : {left:canvleft+'px'}, y : {height:canvheight+'px', left:(canvleft>17?canvleft-17:0)+'px'} }); $('.line_y').height(canvheight);// 辅助线高度 } // 在手机设备上访问 2014/02/08 if (window.isHandheld) { var $container = $('#scroll_container'),$footer = $('#site_footer'),$footer_ads = $('#footer_ads'), maxheight = $('#scroll_container_bg').height() + $('>.mblank_placeholder',$container).height(); //计算实际的页脚高度,防止页脚内元素超出页脚底部这一情况 if ($footer.length > 0 && $footer_ads.length > 0) { var maxh = $('#site_footer').height(); $('#site_footer > .full_content').children(':not(script)').each(function(){ var eleh = parseInt($(this).css('top')) + $(this).outerHeight(); maxh = (eleh > maxh) ? eleh : maxh; }); maxheight += (maxh - $('#site_footer').height()); } //如果显示页脚广告,再加上页脚广告的高度 if ($footer_ads.length > 0) maxheight += 35; $container.css({"height": maxheight+'px',"overflow-x": 'hidden',"overflow-y": 'hidden'}); if($footer.length) { if (/micromessenger/i.test(navigator.userAgent.toLowerCase())) { $footer.css({'position':'absolute','top':$('#canvas').height()}); } $footer.find('#footer_content').andSelf().width($('#canvas').width()); } //设置页脚广告的宽度,和页脚保持一致 $footer_ads.width($('#canvas').width()); $('.mloading-mask').remove(); $container.css("visibility", 'visible');$(window).triggerHandler("pageloaded"); // 修复ipads中iframe touchmove冲突问题(bug#97) 2014/09/16 if (/ipads/.test(navigator.userAgent.toLowerCase())) { $(document.body).parent().andSelf().css({"overflow-x": 'hidden',"overflow-y": 'auto'}); container.css({"height": 'auto',"overflow-y": 'auto'}); } } } window.resizeCanvasHeight=resizeCanvasHeight; function correctFooterPos(){ var canv = $("#canvas"); var canvheight=canv.height(); var footertop=canvheight; if (window.isHandheld) { footertop-=1; $('#scroll_container').css('height',($('#scroll_container').height()-1)+'px'); $('#scroll_container_bg').css('height',($('#scroll_container_bg').height()-1)+'px'); //手机正式访问时设置页脚广告的宽度,和页脚保持一致 $('#footer_ads').css('width',$('#canvas').width()+'px'); } var canvwidth=canv.width(); //编辑,预览,正式访问时都会调用这里来设置页脚的宽度 $('#site_footer').children('.full_content').andSelf().css('width',$('#canvas').width()+'px'); var containerOffsetLeft = $('#scroll_container').offset().left; $('#site_footer').css({left:canv.offset().left-containerOffsetLeft+$('#scroll_container').scrollLeft()+$.parseInteger($('#canvas').css("borderLeftWidth")),top:footertop}); $('#site_footer >.full_width').css({left:0-canv.offset().left+containerOffsetLeft-$('#scroll_container').scrollLeft()-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$(window.mobilesModel?'#canvas':'#scroll_container_bg').width()}); if($('#wp-mobiles-device-header').length) $('#site_footer >.full_width').css("left", '0px'); //计算页脚广告的位置,保证在页脚的下边 var footer_ads = $('#footer_ads'); if (footer_ads.length > 0) { if ($('#site_footer').length > 0) { var maxh = $('#site_footer').height(); $('#site_footer > .full_content').children(':not(script)').each(function(){ var eleh = parseInt($(this).css('top')) + $(this).outerHeight(); maxh = (eleh > maxh) ? eleh : maxh; }); footer_ads.css({top:footertop + maxh}); } else { footer_ads.css({top:footertop}); } } } window.correctFooterPos=correctFooterPos; window.scroll_container_adjust=function(){ initCanvasHeight(); //微信下初始化加载cvans高度过大出现滚动条。bug/4574 if (/micromessenger/i.test(navigator.userAgent.toLowerCase())) { var fxdpstr = $(window).data("fxdp_scrollpage")||'' setTimeout(function(){ // fixed bug#1107 var _scrtop = $(window).scrollTop(); if(fxdpstr == 'fxdp'){ resizeCanvasHeight(); $(window).scrollTop(_scrtop); correctFooterPos(); } // 修复"微信浏览器中锚点异常(bug#1059)"问题 var hstr = locations.hash||''; if(hstr.length > 0){locations.href = locations.href;locations.hash = hstr.substr(1)} },600) if(fxdpstr != 'fxdp'){ resizeCanvasHeight(); correctFooterPos(); } }else { resizeCanvasHeight(); correctFooterPos(); } } })() /**document ready js**/ $(document).bind('lastexec',function(){ // mobiles device 2014/01/06 if (window.mobilesModel) { var $scontainer = $('#scroll_container'),canvaswidth = $('#canvas').width(); $scontainer.unbind(".mbprevredhat.tmpredhat"); if ($('#wp-mobiles-device-header').length > 0) { // for '模拟滚轮事件' $scontainer.bind('mousewheel DomMouseScroll MozMousePixelScroll', function(e){ e = e || window.event; e.preventDefault(); if ($('.fullpage_alllist', this).length) return false; var wheeldelta = e.wheelDelta, detail = e.detail || e.originalEvent.detail; if (e.type == 'mousewheel') { var _deltay = e.deltaY || e.originalEvent.deltaY; wheeldelta = (_deltay > 0) ? 1 : -1 } else { var _wdelta = e.wheelDelta || e.originalEvent.wheelDelta; if (!_wdelta) wheeldelta = detail } var movey = wheeldelta * -(Math.abs(detail) > 3 ? 1 : 40); $(this).scrollTop($(this).scrollTop() - movey) }); // 手机模型定位 var mbtimer = setTimeout(function(){ var _scwidth = $scontainer.width() + 20, _scrleft = $scontainer.position().left + _scwidth; $scontainer.mscroll({ difleft: 10, maskleft: _scrleft, barleft: _scrleft, maskbg: '#ccc' }); clearTimeout(mbtimer); // for '窗口缩放时重置滚动条LEFT值' var $sclbar = $scontainer.prevalsl('.wp-mobiles-scrollbar'), $sclmask = $scontainer.prevalsl('.wp-mobiles-device-mask'); $(window).resize(function(e){ var _scleft = $scontainer.position().left + _scwidth; $sclmask.css('left', _scleft +'px'); $sclbar.css('left', (_scleft + 10) +'px') }) }, 100); // var screenWidth = window.innerWidth||self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth, // deviceOtherHeight = $('#wp-mobiles-device-header').closest('.wp-new-manage-toolbar-position').height() + $('#wp-mobiles-device-footer').height(); // var onlyOnce_resize_width = false; // $(window).bind("resize.mbeditor", function(e, status){ // var screenHeight = window.innerHeight||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight; // $('#wp-mobiles-device-sides').height(screenHeight - deviceOtherHeight).children('.mwrapper').height(screenHeight - deviceOtherHeight - 2); // // 自定义滚动条样式 // var sidewidth = 14;/* 手机模型边缘宽度 */ // var mbtimer = setTimeout(function(){ // var newleft = ($._parseFloat($('#wp-mobiles-device-header').css("left"))||0) + sidewidth; // $scontainer.css({"left": (newleft - 10)+'px',"width": function(){/*-10是为了修复"缩放句柄被遮"问题*/ // if( onlyOnce_resize_width == false ){ // onlyOnce_resize_width = true; // return ($(this).width() + (status?(sidewidth + 15 + 10):0))+'px'; // }else{ // return ; // } // },"margin": '0',"padding-left": '11px',"top": '-6px',"overflow-y": 'scroll'}); // $('#site_footer').css("left", '11px');/*11px是为了修复"缩放句柄被遮"问题*/ // if (status == undefined) $scontainer.mscroll("destroy"); // $scontainer.mscroll({difleft: 10,maskbg: '#ccc'});clearTimeout(mbtimer); // }, 100); // }).triggerHandler("resize.mbeditor", ['init']); // $('#wp-mobiles-device-header,#wp-mobiles-device-sides,#wp-mobiles-device-footer').css({"left": function(){ // return ((screenWidth - $(this).width()) / 2)+'px'; // }, "visibility": 'visible'}); // 保存布局 $('#wp-mobiles-device-footer > span').click(function(){ wp_floatpanel(parseToURL('wp_widgets','save_page'),{ title: translate('page.saveLayout'),width: 418,overlay: true,isCenter: true, contentClass: 'wp-site-set_panel_c',id: 'wp-page_save',zIndex: 9999,isSet:true }); }); } else {/* 预览模式 */ $scontainer.css("visibility", 'visible'); $(window).load(function(){ var $win = $(this),frmwidth = $win.width(),frmheight = window.getdeviceheight||565; $scontainer.height(frmheight); var mprevtimer = setTimeout(function(){ $scontainer.mscroll({"maskcname": 'wp-mobiles-device-premask',"difleft": -6, "height": frmheight,"barcname": 'wp-mobiles-prescrollbar',"maskleft": frmwidth,"barleft": frmwidth}); $scontainer.css('overflow-y','auto').css('width','350px'); $win.triggerHandler("pageloaded");clearTimeout(mprevtimer); // 模拟“触屏”模式 var maxtop = frmheight - $('.wp-mobiles-prescrollbar > span.pane').height(); $('.wp-mobiles-prescrollbar').css('visibility','hidden'); var scrollbartimer; var lasthidetime=0; var isBarShow=false; setInterval(function(){ var nowtime=(new Date()).getTime(); if(isBarShow && lasthidetime>0 && nowtime-lasthidetime>=600){ $('.wp-mobiles-prescrollbar').css('visibility','hidden'); isBarShow=false; lasthidetime=0; } },300); var showbar=function(){ if(!isBarShow){ $('.wp-mobiles-prescrollbar').css('visibility','visible'); isBarShow=true; } lasthidetime=0; } var hidebar=function(){ if(isBarShow && lasthidetime==0){ lasthidetime=(new Date()).getTime(); } } $scontainer.bind("scroll.prescrollbar",function(){ showbar(); hidebar(); }) $scontainer.data('preview_scroll',false); $scontainer.find('a').bind('click',function(e){ if($scontainer.data('preview_scroll')){ e.preventDefault(); } }) $scontainer.bind("mousedown.mbprevredhat", function(e){ if($(e.target).is('input')){ return; } e.preventDefault(); $scontainer.data('preview_scroll',false); showbar(); var $prebar = $('.wp-mobiles-prescrollbar');var pagey = e.pageY; var scrltop = $scontainer.scrollTop(),movey = e.pageY - pagey; if (scrltop < 0) scrltop = 0; $scontainer.bind("mousemove.tmpredhat", function(e){ e.preventDefault(); var movey = e.pageY - pagey; if(Math.abs(movey)>5){ $scontainer.data('preview_scroll',true); } $scontainer.scrollTop(scrltop - movey); }).bind("mouseup.tmpredhat", function(e){ e.preventDefault();$scontainer.unbind(".tmpredhat"); $(parent.document).unbind(".rmredhat"); hidebar(); }); $(parent.document).bind("mouseup.rmredhat",function(){$scontainer.unbind(".tmpredhat");hidebar();}); }); }, 150); }); } //编辑预览模式下设置页脚和页脚广告的宽度 $('#site_footer,#footer_content,#footer_ads').width(canvaswidth); } window.scroll_container_adjust(); if(!canv) var canv = $("#canvas"); $('.full_column').children('.full_content').andSelf().css('width',$('#canvas').width()+'px'); $('.full_column>.full_width').css({left:0-canv.offset().left+$('#scroll_container').offset().left-$('#scroll_container').scrollLeft()-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()}); //浏览器缩放是自动调整高度 var me = "orientation" in window && "onorientationchange" in window ? "orientationchange" : "resize" $(window).bind(me, function(e){ if(e.target==window||e.target==document){ setTimeout(function(){ resizeCanvasHeight(); correctFooterPos(); $('.full_column>.full_width').css({left:0-canv.offset().left+$('#scroll_container').offset().left-$('#scroll_container').scrollLeft()-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()}); if($('.full_column-fixed:not(.cstlayer)').length){ var full_column_left = 0-$('.full_column-fixed>.full_width').position().left; $('.full_column-fixed').css("left",full_column_left+"px"); } },100); } }) if (!window.isHandheld) rotateDom($('.cstlayer')); //Preview need resize window if(window.opener){ var winH = screen.availHeight || 768,winW = screen.availWidth || 1024; window.resizeTo(winW, winH); } // 新窗口打开超链接 $.extend({ openNewWin: function(URI){ var win = window.open(URI,'_blank'); win.focus; } }); }) function getImageProcessType(){ return 1; } function wp_pages_global_func(params){ var uname = params.domain, sessid = params.phpsessionid; window['parseToURL'] = function(module,action,anotherparams){ if (params.isedit == '1') { var defaultparams = {"_m": module,"_a": action,"domain": uname,"SessionID": sessid}; } else if (params.islogin == '1') { var defaultparams = {"_m": module,"_a": action,"domain": uname,"_v": 'preview',"SessionID": sessid}; } else { webmodel = {}; var defaultparams = {"_m": module,"_a": action}; } var urlparams=$.extend({}, anotherparams, defaultparams, webmodel); var paramstr=$.param(urlparams); var url=params.punyurl; var u = navigator.userAgent; if(u && u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){ url=params['p_rooturl']; } return url+"/index.php?"+paramstr; }; window['parseToAdminURL'] = function(module,action,anotherparams){ var defaultparams = {'_m': module,'_a': action,'domain': uname,"SessionID": sessid}; var urlparams = $.extend({}, anotherparams, defaultparams, webmodel); var paramstr = $.param(urlparams); return params['p_rooturl']+"/admin/index.php?"+paramstr; }; window['getSiteCurLang'] = function(){return params['interface_locale']}; window['getPreviewSiteCurLang'] = function(){return params['curr_locale']}; window['getSystemCurrentDomain'] = function(){return uname}; window['isSiteDevMode'] = function(){return params['dev_mode']=='1'?true:false;}; window['relativeToAbsoluteURL'] = function(relativeurl, nostatic){ if (nostatic == '1') return params['p_rooturl']+"/"+relativeurl; else return params['static_rooturl']+"/"+relativeurl; }; window['getWebSiteType'] = function(){return $.trim(params['mscript_name']||'').length > 0 ? 'mobiles' : 'pc'}; window['getSystemSession'] = function(){return params.getsession}; if ((params.isedit == '1') && params.converted) { if($.browser.msie && ($.browser.version < 9)) locations.href = parseToURL("wp_frontpage","browser"); } if ($.browser.msie && ($.browser.version < 7)) { locations.href = parseToURL("wp_frontpage","browser"); } } function wopop_navigator_standalone_func(){ $(window).load(function(){ if(locations.hash && locations.hash !='' && locations.hash !='#'){ locations.href=locations.hash; } }); if(('standalone' in window.navigator)&&window.navigator.standalone){ var noddy,remotes=false; document.addEventListener('click',function(event){ noddy=event.target; while(noddy.nodeName!=='A'&&noddy.nodeName!=='HTML') noddy=noddy.parentNode; if('href' in noddy&&noddy.href.indexOf('http')!==-1&&(noddy.href.indexOf(document.locations.host)!==-1||remotes)){ event.preventDefault(); document.locations.href=noddy.href; } },false); } } function wopop_wx_config(config){ config.openTagList=["wx-open-launch-weapp","wx-open-launch-app"]; wx.config(config) }; /* * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2013 Klaus Hartl * Released under the MIT license */ (function(A){if(typeof define==="function"&&define.amd){define(["jquery"],A)}else{if(typeof exports==="object"){A(require("jquery"))}else{A(jQuery)}}}(function(F){var G=/\+/g;function D(I){return B.raw?I:encodeURIComponent(I)}function E(I){return B.raw?I:decodeURIComponent(I)}function H(I){return D(B.json?JSON.stringify(I):String(I))}function C(I){if(I.indexOf('"')===0){I=I.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{I=decodeURIComponent(I.replace(G," "));return B.json?JSON.parse(I):I}catch(J){}}function A(I,J){var K=B.raw?I:C(I);return F.isFunction(J)?J(K):K}var B=F.cookie=function(R,M,O){if(M!==undefined&&!F.isFunction(M)){O=F.extend({},B.defaults,O);if(typeof O.expires==="number"){var K=O.expires,L=O.expires=new Date();L.setTime(+L+K*86400000)}return(document.cookie=[D(R),"=",H(M),O.expires?"; expires="+O.expires.toUTCString():"",O.path?"; path="+O.path:"",O.domain?"; domain="+O.domain:"",O.secure?"; secure":""].join(""))}var J=R?undefined:{};var I=document.cookie?document.cookie.split("; "):[];for(var N=0,P=I.length;N', closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null};b.modal.impl={d:{},init:function(a,d){if(this.d.data)return!1;n=b.browser.msie&&!b.support.boxModel;this.o=b.extend({},b.modal.defaults,d);this.zIndex=this.o.zIndex;this.occb=!1;if("object"===typeof a){if(a=a instanceof b?a:b(a),this.d.placeholder=!1,0").attr("id","simplemodal-placeholder").css({display:"none"})), this.d.placeholder=!0,this.display=a.css("display"),!this.o.persist))this.d.orig=a.clone(!0)}else if("string"===typeof a||"number"===typeof a)a=b("
    ").html(a);else return alert("SimpleModal Error: Unsupported data type: "+typeof a),this;this.create(a);this.open();b.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]);return this},create:function(a){this.getDimensions();if(this.o.modal&&m)this.d.iframe=b('').css(b.extend(this.o.iframeCss, {display:"none",opacity:0,position:"fixed",height:h[0],width:h[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo);this.d.overlay=b("
    ").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?j[0]:0,width:this.o.modal?j[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo);this.d.container=b("
    ").attr("id",this.o.containerId).addClass("simplemodal-container").css(b.extend({position:this.o.fixed? "fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?b(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo);this.d.wrap=b("
    ").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container);this.d.data=a.attr("id",a.attr("id")||this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss,{display:"none"})).appendTo("body");this.setContainerDimensions(); this.d.data.appendTo(this.d.wrap);(m||n)&&this.fixIE()},bindEvents:function(){var a=this;b("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});l.bind("keydown.simplemodal",function(b){a.o.modal&&9===b.keyCode?a.watchTab(b):a.o.close&&a.o.escClose&&27===b.keyCode&&(b.preventDefault(),a.close())});k.bind("resize.simplemodal orientationchange.simplemodal", function(){a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();m||n?a.fixIE():a.o.modal&&(a.d.iframe&&a.d.iframe.css({height:h[0],width:h[1]}),a.d.overlay.css({height:j[0],width:j[1]}))})},unbindEvents:function(){b("."+this.o.closeClass).unbind("click.simplemodal");l.unbind("keydown.simplemodal");k.unbind(".simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this.o.position;b.each([this.d.iframe||null,!this.o.modal?null:this.d.overlay, "fixed"===this.d.container.css("position")?this.d.container:null],function(b,f){if(f){var g=f[0].style;g.position="absolute";if(2>b)g.removeExpression("height"),g.removeExpression("width"),g.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),g.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"');else{var c,e;a&&a.constructor=== Array?(c=a[0]?"number"===typeof a[0]?a[0].toString():a[0].replace(/px/,""):f.css("top").replace(/px/,""),c=-1===c.indexOf("%")?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',a[1]&&(e="number"===typeof a[1]? a[1].toString():a[1].replace(/px/,""),e=-1===e.indexOf("%")?e+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(e.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(c='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"', e='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"');g.removeExpression("top");g.removeExpression("left");g.setExpression("top",c);g.setExpression("left",e)}}})},focus:function(a){var d=this,a=a&&-1!==b.inArray(a,["first","last"])?a:"first",f=b(":input:enabled:visible:"+a,d.d.wrap);setTimeout(function(){0c?c:dc?c:this.o.minHeight&&"auto"!==i&&fe?e:ae?e:this.o.minWidth&&"auto"!==c&&gd||g>a?"auto":"visible"});this.o.autoPosition&&this.setPosition()},setPosition:function(){var a,b;a=h[0]/2-this.d.container.outerHeight(!0)/2;b=h[1]/2-this.d.container.outerWidth(!0)/2;var f="fixed"!==this.d.container.css("position")?k.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(a=f+(this.o.position[0]||a),b=this.o.position[1]|| b):a=f+a;this.d.container.css({left:b,top:a})},watchTab:function(a){if(0' +'
    '; $(ol+pnl).appendTo('body'); var $cpnl = $('#wp-confirm_panel'); // 动态设置wp-alert_button宽度 var resetWtimer = setTimeout(function(){ var $altbtn = $cpnl.find('.wp-alert_button'); $altbtn.width($altbtn.outerWidth()); },30); // 定位Dialog panel_position($cpnl,width,'auto',true,'wp-confirmpnl_overlay',true); // Bind window resize $(window).resize(function(){ panel_position($cpnl,width,'auto',true,'wp-confirmpnl_overlay',true); }); $cpnl.bind('rename',function(e,name){ if (name.length) { var self = this; if(name.match(/,/)){ var btnstr = ''+translate('Sure')+''+translate('Edit')+''+translate('Cancel')+''; //var str_edit = $('.wp-manage-link',self).html(); var page = message.match(/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/); page = page[0]; var edit = name.split(',')[1]; var sure = name.split(',')[0]; $('.wp-alert_button',self).html(btnstr); $('a.wp-alert-edit',self).html(edit); $('a.wp-alert-sure',self).html(sure); $('a.wp-alert-edit',self).css("background","url(../images/wp-button-black-bg.gif) repeat-x #383838"); $('a.wp-alert-edit',self).hover(function(){ $('a.wp-alert-sure',self).css("background","url(../images/wp-button-black-bg.gif) repeat-x #383838"); $('a.wp-alert-edit',self).css({ "color":"#FFF", "background":"url(../images/wp-button-bg-hover.gif) repeat-x #366bbc"}); $('a.wp-alert-cancel',self).css("background","url(../images/wp-button-black-bg.gif) repeat-x #383838"); }); $('a.wp-alert-sure',self).hover(function(){ $('a.wp-alert-edit',self).css("background","url(../images/wp-button-black-bg.gif) repeat-x #383838"); $('a.wp-alert-sure',self).css({ "color":"#FFF", "background":"url(../images/wp-button-bg-hover.gif) repeat-x #366bbc"}); $('a.wp-alert-cancel',self).css("background","url(../images/wp-button-black-bg.gif) repeat-x #383838"); }); $('a.wp-alert-cancel',self).hover(function(){ $('a.wp-alert-cancel',self).css({ "color":"#FFF", "background":"url(../images/wp-button-bg-hover.gif) repeat-x #366bbc"}); $('a.wp-alert-sure',self).css("background","url(../images/wp-button-black-bg.gif) repeat-x #383838"); $('a.wp-alert-edit',self).css("background","url(../images/wp-button-black-bg.gif) repeat-x #383838"); }); var timerid = setTimeout(function(){ var newidth = $('a.wp-alert-edit',self).outerWidth(true) +$('a.wp-alert-sure',self).outerWidth(true) + $('a.wp-alert-cancel',self).outerWidth(true); $('.wp-alert_button',self).width(newidth);newidth = null; clearTimeout(timerid); }, 50); // 绑定"OK|Cancel"按钮 $cpnl.find('a.wp-alert-sure').click(function(e){ if(callback && $.isFunction(callback)) callback(); $cpnl.add('#wp-confirmpnl_overlay').remove(); if(resetWtimer) clearTimeout(resetWtimer); e.preventDefault(); }).end().find('a.wp-alert-cancel').click(function(e){ if(cancelBack && $.isFunction(cancelBack)) cancelBack(); $cpnl.add('#wp-confirmpnl_overlay').remove(); if(resetWtimer) clearTimeout(resetWtimer); e.preventDefault(); }).end().find('a.wp-alert-edit').click(function(e){ if(page){ window.locations.href = page; } }); }else{ $('a.wp-alert-sure',self).html(name); var timerid = setTimeout(function(){ var newidth = $('a.wp-alert-sure',self).outerWidth(true) + $('a.wp-alert-cancel',self).outerWidth(true); $('.wp-alert_button',self).width(newidth);newidth = null;clearTimeout(timerid); }, 50); } } }); // 绑定"OK|Cancel"按钮 $cpnl.find('a.wp-alert-sure').click(function(e){ if(callback && $.isFunction(callback)) callback(); $cpnl.add('#wp-confirmpnl_overlay').remove(); if(resetWtimer) clearTimeout(resetWtimer); e.preventDefault(); }).end().find('a.wp-alert-cancel').click(function(e){ if(cancelBack && $.isFunction(cancelBack)) cancelBack(); $cpnl.add('#wp-confirmpnl_overlay').remove(); if(resetWtimer) clearTimeout(resetWtimer); e.preventDefault(); }); // 绑定Enter事件 $(document).keydown(function(e){ if(e.keyCode == 13) $cpnl.find('a.wp-alert-sure').trigger('click'); }); return false; } function wp_editPicOnline(param) { var imgtype=parseInt(getImageProcessType())||0; //图片处理 0 使用aviary处理 1 使用美图秀秀处理 var imgprocess=['feather','xiuxiu']; if(imgtype >= imgprocess.length) imgtype=0; var imgtypestr=imgprocess[imgtype]; $LAB.script(relativeToAbsoluteURL('script/wopop2_'+imgtypestr+'.js')) .wait(function(){ wp_editPicOnlineActual(param); }) } function wp_viewPicOnline(param) { $LAB.script(relativeToAbsoluteURL('script/wopop2_preview.js')) .wait(function(){ wp_viewPicOnlineActual(param); }) } /** * Alert对话框 * (String)message - 欲显示的内容 */ function wp_alert(message,callback){ if ($('#wp-alertpnl_overlay,#wp-alert_panel').size()) return; var width = 286,pnl = '',ol = '
    '; pnl = '
    ' +'
    ' +'
    '; $(ol+pnl).appendTo('body'); var $apnl = $('#wp-alert_panel'); // 定位Dialog panel_position($apnl,width,'auto',true,'wp-alertpnl_overlay',true); // Bind window resize $(window).resize(function(){ panel_position($apnl,width,'auto',true,'wp-alertpnl_overlay',true); }); // 绑定"OK"按钮 $apnl.find('a.wp-alert-sure').click(function(e){ $apnl.add('#wp-alertpnl_overlay').remove(); if($.isFunction(callback)) callback(); e.preventDefault(); }); // 绑定Enter事件 $(document).keydown(function(e){ if(e.keyCode == 13) $apnl.find('a.wp-alert-sure').trigger('click'); }); return false; } /** * -------------------------------------------------------- * Popup对话框(临时函数) * -------------------------------------------------------- */ function show_dialog(load_url, title, width, height, callback, opentype){ var fn = $.extend({}, { open: function(d){}, close: function(d){} }, callback || {}); $('#osx-modal-content').modal({ overlayId: 'osx-overlay', containerId: 'osx-container', closeHTML: null, zIndex: 1000, opacity: 25, onOpen: function(d){ fn.open(d); var self = this, $container = d.container, container = $container[0]; var $data = $('#osx-modal-data', container); if (opentype == 'iframe') { $data.html(''); d.overlay.show(); $data.show(); $('#osx-modal-content,div.close', container).show(); $('#osx-modal-title', container).html(title).show(); $container.fadeTo('fast',1).draggable({handle: '#osx-modal-title',cursor: 'move'}); } else { var $ajaxload = $('#wp-ajaxsend_loading2'),$win = $(window); if($ajaxload.size()==0) $('
    ').appendTo('body'); $.get(load_url, function(data){ $data.html(data); d.overlay.show(); $data.show(); $('#osx-modal-content,div.close', container).show(); $('#osx-modal-title', container).html(title).show(); $container.fadeTo('fast',1).draggable({handle: '#osx-modal-title',cursor: 'move'}); self.setPosition(); $('#wp-ajaxsend_loading2').remove(); }).error(function(){ $('#wp-ajaxsend_loading2').remove(); alert(translate('Request failed!')); self.close();return; }); } if(width > 0) $container.css('width', width); $container.css('height', height || ''); $('#osx-modal-content').bind('add_loading',function(){ var loading=$data.children('.loading'); if(loading.size()) loading.remove(); $('
    ').appendTo($data); }) }, onClose: function(d){ fn.close(d); var self = this; d.container.hide(); d.overlay.hide(); $("#osx-modal-content").triggerHandler('dialogclose', d); $("#osx-modal-content").unbind('dialogclose'); $('#osx-modal-content').unbind('add_loading'); setTimeout(function(){ self.close(); },500) } }); } /*获取样式*/ function get_plugin_css(tagid,css){ var editmode=false; if($.saveLayout) editmode=true; if ($.trim(tagid||'').length == 0) return; var setcss=$("#page_set_css").html(); setcss=setcss.replace(/'); else{ $("#page_set_css").after($("#page_set_css").clone().attr('id','page_set_css2').html('')); $("#page_set_css").html('').remove(); $("#page_set_css2").attr('id','page_set_css'); } } (function( $, undefined ) { var callbackhash={}; var mod_property={}; $.modplugin={ addCallBack:function(type,funcname,func){ if($.isFunction(func)){ if(!callbackhash[type]) callbackhash[type]={}; callbackhash[type][funcname]=func; } }, fireCallBack:function(type,funcname,dom,data){ var func=callbackhash[type]; if(!func) return false; func=func[funcname]; if($.isFunction(func)){ return func(dom,data); }else{ return false; } } } $.fn.execPluginCallBack=function(funcname,data){ return $.modplugin.fireCallBack(this.attr('type'),funcname,this,data); } $.fn.mod_property=function(key,val){ if($.isPlainObject(key)){ for(var inkey in key){ this.mod_property(inkey,key[inkey]); } return ; } var id=this.prop('id'); if(!id) return null; var propertydata=mod_property[id]; if(!propertydata){ mod_property[id]=propertydata={}; } if(val !== undefined){ propertydata[key]=val; return val; }else{ return propertydata[key]; } } var PropertyCommand=null; function initPropCommand(){ if(PropertyCommand) return; PropertyCommand=Undo.Command.createModuleCommand(function(blockid,val){ var blockel=$('#'+blockid); if(val.propval!=undefined) blockel.mod_property(val.propkey,val.propval); else blockel.del_mod_property(val.propkey); blockel.execPluginCallBack('property_undo',val); },null,{returntype:'class'}); } var PropertyCommand2=null; function initPropCommand2(){ if(PropertyCommand2) return; PropertyCommand2=Undo.Command.createModuleCommand(function(blockid,val){ var blockel=$('#'+blockid); mod_property[blockid]=val.propval; blockel.execPluginCallBack('property_undo',val); },null,{returntype:'class'}); } $.fn.autoundo_mod_property2=function(val){ if(val === undefined) return this.get_mod_property(); initPropCommand2(); var oldval=this.get_mod_property(); mod_property[this.attr("id")]=val; var oldvalue={propval:oldval,act:'set',cmdtype:'undo'} var newvalue={propval:val,act:'set',cmdtype:'redo'} if(!Undo.Command.DefaultEqAct(oldval,val)) new PropertyCommand2(this.attr('id')).insertWithVals(oldvalue, newvalue); } $.fn.autoundo_mod_property=function(key,val){ if(val === undefined) return this.mod_property(key); initPropCommand(); var oldval=this.mod_property(key); this.mod_property(key,val); var oldvalue={propkey:key,propval:oldval,act:'set',cmdtype:'undo'} var newvalue={propkey:key,propval:val,act:'set',cmdtype:'redo'} if(!Undo.Command.DefaultEqAct(oldval,val)) new PropertyCommand(this.attr('id')).insertWithVals(oldvalue, newvalue); } $.fn.autoundo_del_mod_property=function(key){ initPropCommand(); var oldval=this.mod_property(key); this.del_mod_property(key); var oldvalue={propkey:key,propval:oldval,act:'del',cmdtype:'undo'} var newvalue={propkey:key,act:'del',cmdtype:'redo'} if(oldval != undefined) new PropertyCommand(this.attr('id')).insertWithVals(oldvalue, newvalue); } $.fn.del_mod_property=function(key){ var id=this.prop('id'); if(!id) return null; var propertydata=mod_property[id]; if($.isPlainObject(propertydata)){ var oldval=propertydata[key]; delete propertydata[key]; return oldval; } } $.fn.get_mod_property=function(){ var id=this.prop('id'); if(!id) return null; var propertydata=mod_property[id]; return propertydata||{}; } })(jQuery);; function footerinit(){ footerdrag(); footerresize(); $.showSiteFooterTips(); $('.full_column').each(function(){ fullcolumninit($(this)); }) } function fullcolumninit(dom){ $('.full_column').children('.full_content').andSelf().css('width',$('#canvas').width()+'px'); dom.children('.full_width').css({left:0-canv.offset().left-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()}); dom.wp_rightkey(); if(dom.is(':not(.isplate)')){ dom.wp_layerhover(); fullcolumndrag(dom); fullcolumnresize(dom); fullcolumndrop(dom); } } function footerdrag(){ var maxminusheight=0; var curcanvheight=canv.height(); var Command=Undo.Command.createModuleCommand(function(blockid,val){ var blockel=$('#'+blockid); blockel.css('top',val.top); canv.height(val.canvheight); $('#scroll_container_bg').css('height',(val.canvheight+blockel.height())+'px'); $.updateselectbgopt(); $.updatepospropblk(); $.canvasHeightChange(); },null,{returntype:'class'}); var undoobj=null; var oriFooterTop; var oriPosTop; $('#site_footer').draggable({ cursor: 'move', axis: "y", start: function(event, ui){ $(this).find('.ui-resizable-handle > .knob').hide(); $(this).find('.ui-resizable-n').css('border-top-color', '#83c521'); $(this).find('.ui-resizable-s').css('border-bottom-color', '#83c521'); $(this).find('.ui-resizable-e').css('border-right-color', '#83c521'); $(this).find('.ui-resizable-w').css('border-left-color', '#83c521'); initCanvasHeight(); var canvasminheight=canv.data('layermaxheight')||0; curcanvheight=canv.height(); maxminusheight=curcanvheight-canvasminheight; undoobj=new Command('site_footer'); undoobj.setOldVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight}); oriFooterTop=parseInt($(this).css('top')) ||0 ; oriPosTop=ui.originalPosition.top; }, drag: function(event, ui){ var topmovepx = ui.position.top - ui.originalPosition.top; ui.position.calctop=ui.position.top; ui.originalPosition.top=oriFooterTop; ui.position.top=oriFooterTop+topmovepx; if(topmovepx<0){ var delta=0-topmovepx; if(delta>maxminusheight){ var canvasminheight=canv.data('layermaxheight')||0; ui.position.top=ui.originalPosition.top-maxminusheight; ui.position.calctop=oriPosTop-maxminusheight; canv.height(canvasminheight); $('#scroll_container_bg').css('height',(canvasminheight+$(this).height()+100)+'px'); $.showselectbgopt($(this)); $('.bgblk').hide(); $('.posizeblk').html("x:"+(parseFloat($(this).css('left'))||0)+", y:"+ui.position.top).show(); $(this).triggerHandler('drag_progress',[{left:0,top:ui.position.top}]); ui.originalPosition.top=oriPosTop; return; } } $(this).triggerHandler('drag_progress',[{left:0,top:ui.position.top}]); canv.height(curcanvheight+topmovepx); $.showselectbgopt($(this)); $('.bgblk').hide(); $('.posizeblk').html("x:"+(parseFloat($(this).css('left'))||0)+", y:"+ui.position.top).show(); $('#scroll_container_bg').css('height',(curcanvheight+topmovepx+$(this).height()+100)+'px'); ui.originalPosition.top=oriPosTop; }, stop:function(event, ui){ if(ui.position.calctop!=null) ui.position.top=ui.position.calctop; $(this).find('.ui-resizable-handle > .knob').show(); $(this).find('.ui-resizable-n').css('border-top-color', '#ff872e'); $(this).find('.ui-resizable-s').css('border-bottom-color', '#ff872e'); $(this).find('.ui-resizable-e').css('border-right-color', '#ff872e'); $(this).find('.ui-resizable-w').css('border-left-color', '#ff872e'); var topmovepx = ui.position.top - ui.originalPosition.top; canv.height(curcanvheight+topmovepx); $('#scroll_container_bg').css('height',(curcanvheight+topmovepx+$(this).height()+100)+'px'); $.canvasHeightChange(); correctFooterPos(); undoobj.insertWithNewVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight+topmovepx}); undoobj=null; $('.bgblk').show(); $('.posizeblk').hide(); $(this).trigger('drag_stop',[{left:parseInt($(this).css('left')),top:parseInt($(this).css('top'))}]); } }); } function fullcolumndrag(dom){ dom.wp_drag(); } function fullcolumnresize(dom){ var createhandlefunc=function(handle){ dom.each(function(){ var hname = 'ui-resizable-'+handle; var down_arrow = ''; if(handle=='n'){ down_arrow = '

    '; }else if(handle=='s'){ down_arrow = '

    '; } var axis = $('

    '+down_arrow+'
    '); axis.css({zIndex: 1000}); $(this).children('.full_width').append(axis); }) } var createplaceholderfunc=function(handle){ dom.each(function(){ var hname = 'placeholder-'+handle; var axis = $('
    '); axis.css({zIndex: 1000}).hide(); $(this).children('.full_width').append(axis); }) } createhandlefunc('n'); createhandlefunc('s'); createplaceholderfunc('w'); createplaceholderfunc('e'); dom.modpressable({}); var fullcolumnbuttompos; dom.resizable({ handles: {n: '>.full_width .ui-resizable-n',s: '>.full_width .ui-resizable-s'}, noinit:true, canvascontain: '#canvas', distance: 0, concernLock:true, scroll: true, create:function(){ $(this).children('.full_width').find('.ui-resizable-handle').hide(); }, start: function(event, ui){ fullcolumnbuttompos=$.getFullColChildMaxButtom(dom); var self=$(this); var resizeundo=new ResizeCommand(self.attr('id')); var oldcssarr=['top','height']; var oldval={}; for(var i=0;inewHeight){ $(this).find('.fullwidth_vdiv').height($.parseInteger(newHeight)); $(this).find('.fullwidth_bg').height($.parseInteger(newHeight)); $(this).find('.fullwidth_video').height($.parseInteger(newHeight)); } var cmyvobj=$(this).find('.content_video'); var cvideoH = cmyvobj[0].videoHeight; var cvideoW = cmyvobj[0].videoWidth; var cvideoRatio = cvideoH / cvideoW; var cnewWidth=$.parseInteger($(this).height()/cvideoRatio); var cnewHeight=$('.full_content').width()*cvideoRatio; var cleft=$.parseInteger(($(this).width()-cnewWidth)/2); if(cnewWidth<=$('.full_content').width()){ $(this).find('.content_bg').css('margin-left',cleft); $(this).find('.content_bg').width(cnewWidth); } if($(this).height()>cnewHeight){ $(this).find('.content_bg').height($.parseInteger(cnewHeight)); $(this).find('.content_video').height($.parseInteger(cnewHeight)); } $(this).children('.full_content,.full_width').height($(this).height()); $(this).triggerHandler('resize_progress',[{ui:ui}]); $.showselectbgopt($(this)); $('.bgblk').hide(); $('.posizeblk').html("W:"+$(this).width()+", H:"+$(this).height()).show(); }, stop:function(event, ui){ $(this).find('.fullwidth_vdiv,.fullwidth_bg,.fullwidth_video').height($(this).height()); $(this).children('.full_content,.full_width').height($(this).height()); var myvobj=$(this).find('.fullwidth_video'); var $fullDiv=$(this).find('.fullwidth_vdiv'); var videoH = myvobj[0].videoHeight; var videoW = myvobj[0].videoWidth; var videoRatio = videoH / videoW; var newWidth=$.parseInteger($(this).height()/videoRatio); var newHeight=$('.full_width').width()*videoRatio; var twidth=$('.full_width').width(), widthRatio=newWidth/twidth, widthRatio=widthRatio.toFixed(2)*100; if(widthRatio>100){ var newWidthR='100%'; }else{ var newWidthR=widthRatio+'%'; } $fullDiv.attr('data-wratio',newWidthR); $fullDiv.attr('data-vwidth',videoW); $fullDiv.attr('data-vheight',videoH); if(newWidthnewHeight){ $(this).find('.fullwidth_vdiv').height($.parseInteger(newHeight)); $(this).find('.fullwidth_bg').height($.parseInteger(newHeight)); $(this).find('.fullwidth_video').height($.parseInteger(newHeight)); } $.showselectbgopt($(this)); var resizeundo=$(document).data('resizeundo'); $(document).removeData('resizeundo'); var self=$(this); var oldcssarr=['top','height']; var newval={}; for(var i=0;i

    '); axis.css({zIndex: 1000}); $('#site_footer >.full_width').append(axis); } var createplaceholderfunc=function(handle){ var hname = 'placeholder-'+handle; var axis = $('
    '); axis.css({zIndex: 1000}); $('#site_footer> .full_width').append(axis); } createhandlefunc('n'); createhandlefunc('s'); createplaceholderfunc('w'); createplaceholderfunc('e'); var maxminusheight=0; var curcanvheight=canv.height(); var canvasminheight=0; var Command=Undo.Command.createModuleCommand(function(blockid,val){ var blockel=$('#'+blockid); blockel.css('top',val.top); blockel.css('height',val.height); canv.height(val.canvheight); blockel.children('.full_content,.full_width').height(val.height); blockel.find('.fullwidth_bg').css('margin-left',val.margin-left); $('#scroll_container_bg').css('height',(val.canvheight+blockel.height())+'px'); $.updateselectbgopt(); $.updatepospropblk(); $.canvasHeightChange(); },null,{returntype:'class'}); var undoobj=null; var resizertimer=null; $('#site_footer').resizable({ handles: {n: '>.full_width .ui-resizable-n',s: '>.full_width .ui-resizable-s'}, noinit:true, distance: 0, scroll: true, create:function(){ $(this).children('.full_width').find('.ui-resizable-handle').hide(); }, start: function(event, ui){ initCanvasHeight(); if(resizertimer){ clearTimeout(resizertimer); resizertimer=null; } canvasminheight=canv.data('layermaxheight')||0; curcanvheight=canv.height(); maxminusheight=curcanvheight-canvasminheight; undoobj=new Command('site_footer'); undoobj.setOldVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight,height:$(this).height()}); $(this).triggerHandler('resize_progress',[{ui:ui}]); }, resize: function(event, ui){ var resizeobj=$(this).data('resizable'); var theaxis=resizeobj.axis; if(theaxis=='n'){ var changey= $(this).height()-ui.originalSize.height; if(changey>maxminusheight){ var mintop=canvasminheight; $(this).css({top:mintop,height:ui.originalSize.height+maxminusheight}); var oriscrolltop=$(this).data('resize_oriscrolltop'); $(this).scrollParent().scrollTop(oriscrolltop); $(this).children('.full_content,.full_width').height($(this).height()); canv.height(canvasminheight); $('#scroll_container_bg').css('height',(canvasminheight+$(this).height()+100)+'px'); $.showselectbgopt($(this)); $('.bgblk').hide(); $('.posizeblk').html("W:"+$(this).width()+", H:"+$(this).height()).show(); return; } canv.height(curcanvheight-changey); $(this).children('.full_content,.full_width').height($(this).height()); $('#scroll_container_bg').css('height',(canv.height()+$(this).height()+100)+'px'); }else{ $(this).children('.full_content,.full_width').height($(this).height()); $('#scroll_container_bg').css('height',(canv.height()+$(this).height()+100)+'px'); } $.showselectbgopt($(this)); $('.bgblk').hide(); $('.posizeblk').html("W:"+$(this).width()+", H:"+$(this).height()).show(); $(this).triggerHandler('resize_stop',[{ui:ui}]); }, stop:function(event, ui){ var self=$(this); undoobj.insertWithNewVal({top:$.parseInteger(self.css('top')),canvheight:canv.height(),height:self.height()}); undoobj=null; $('.bgblk').show(); $('.posizeblk').hide(); $.canvasHeightChange(); } }); } function fullcolumndrop(dom){ var createplaceholderfunc=function(handle){ dom.each(function(){ var hname = 'placeholder-'+handle; var axis = $('
    '); axis.css({zIndex: 1000}); $(this).children('.full_content').append(axis); }) } createplaceholderfunc('n'); createplaceholderfunc('s'); createplaceholderfunc('w'); createplaceholderfunc('e'); var contentblock=dom.children('.full_content'); contentblock.children('.li-placeholder').hide(); contentblock.children('.placeholder-n').css({'border-top':'#FF9900 dashed 4px'}); contentblock.children('.placeholder-s').css({'border-bottom':'#FF9900 dashed 4px'}); contentblock.children('.placeholder-e').css({'border-right':'#FF9900 dashed 4px'}); contentblock.children('.placeholder-w').css({'border-left':'#FF9900 dashed 4px'}); contentblock.droppable({ tolerance: 'pointer', //弹窗容器以及弹窗容器内的插件不能放在通栏中 accept:'.full_column,.cstlayer:not([type=pop_up],[type=pop_up] .cstlayer)', drop: function( event, ui ) { var draggable = $.ui.ddmanager.current; if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){ if(!dom.hasClass('ui-modselected')){ $(this).children('.li-placeholder').hide(); var existcolumn=$(document).data('layer_final_drop_id'); var biggercolumn=$.chooseBiggerColumn(existcolumn,dom.attr('id')); $(document).data('layer_final_drop_id',biggercolumn); } } }, over: function(event, ui){ //判断是否包含锁定元素 var has_layer_lock=false; $('.ui-modselected').each(function(){ if($(this).data('cstlayerstatus') == 'unlock' ){ has_layer_lock=true; } }); if(has_layer_lock) return; var draggable = $.ui.ddmanager.current; if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){ if(!dom.hasClass('ui-modselected')){ var thisid=dom.attr('id'); var existid=$(document).data('layer_drop_over_id'); if(thisid != existid){ var biggerid=$.chooseBiggerColumn(existid,thisid); if(biggerid == thisid){ var $this=$(this); $(this).children('.li-placeholder').show(); if(existid){ var existcolumnel = $('#'+existid); if(!existcolumnel.is('.wp_droppable')){ var dropobj=existcolumnel.children('.full_content').data('droppable'); }else{ var dropobj=existcolumnel.children('.drop_box').data('droppable'); } dropobj['isover'] = 0; dropobj['isout'] = 1; dropobj._out.call(dropobj, event); } $(document).data('layer_drop_over_id', thisid); }else{ var dropobj1=$(this).data('droppable'); dropobj1['isover'] = 0; dropobj1['isout'] = 1; } } } } }, out: function(event, ui){ //判断是否包含锁定元素 var has_layer_lock=false; $('.ui-modselected').each(function(){ if($(this).data('cstlayerstatus') == 'unlock' ){ has_layer_lock=true; } }); if(has_layer_lock) return; var draggable = $.ui.ddmanager.current; if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){ if(!dom.hasClass('ui-modselected') ){ $(this).children('.li-placeholder').hide(); var curoverid=$(document).data('layer_drop_over_id'); if(curoverid == dom.attr('id')) $(document).removeData('layer_drop_over_id'); } } } }); } function fullcolumn_propblk_init(){ var lvtimer; for(var key in $.backgroundPropDefaults){ (function(){ var curkey=key; var otherfunc=null; if(false){ var innertxt ='', lvtype = ''; switch(curkey){ case 'bg_moveto_prevop': lvtype = 'top'; innertxt = ''; break; case 'bg_moveto_nextop': lvtype = 'bottom'; innertxt = ''; break; } otherfunc={ mousedown:function(){ var $target = $(this) var apos =$target.offset(); var scrollctner=$('#scroll_container'); var scrolltop=scrollctner.scrollTop(); $(innertxt).appendTo(scrollctner).css({ top: function(){ return (apos.top+scrolltop - 25-39)+'px' },left: apos.left+'px' }).click(function(e){ $('#'+$.bgselectedid).wp_setorder(lvtype,$.bgselectedid); $(this).remove(); $target.removeClass('local'); e.preventDefault(); }); }, mouseup:function(){ } } } $('#'+curkey).mousedown(function(e){ var $target = $(this); $target.addClass('local'); if($('.wp-moveto_fstlevel,.wp-moveto_lstlevel').size()) $('.wp-moveto_fstlevel,.wp-moveto_lstlevel').remove(); if(otherfunc != null){ otherfunc.mousedown.apply(this); } e.preventDefault(); }).mouseup(function(e){ var self = this,$target = $(self); $target.removeClass('local'); $.backgroundPropDefaults[curkey].apply(this); if(otherfunc != null){ otherfunc.mouseup.apply(this); } e.preventDefault(); }) })(); } } (function($){ function getAllParents(el){ var parents={}; parents[el.prop('id')]='null'; var curel=el; while(true){ var parentid=$.getElementFatherid(curel); if(parentid =='none') break; parents[parentid]=curel.prop('id'); curel=$('#'+parentid); } return parents; } $.chooseBiggerColumn=function(existcolumnid,newcolumnid){ var biggercolumnid=newcolumnid; if(existcolumnid==newcolumnid) return biggercolumnid; if(existcolumnid){ var existcolumnel=$('#'+existcolumnid); var newcolumnel=$('#'+newcolumnid); var existcolumnfathers=getAllParents(existcolumnel); var newcolumnfathers=getAllParents(newcolumnel); var rootid='canvas'; if(!existcolumnfathers[rootid]) rootid='site_footer'; var existdifffather=rootid; var newdifffather=rootid; while(existdifffather == newdifffather){ existdifffather =existcolumnfathers[existdifffather]; newdifffather =newcolumnfathers[newdifffather]; if(existdifffather=='null' || newdifffather=='null') break; } if(existdifffather=='null') biggercolumnid=newcolumnid; else if(newdifffather=='null') biggercolumnid=existcolumnid; else{ var existfatherzindex=$.parseInteger($('#'+existdifffather).css('z-index')); var newfatherzindex=$.parseInteger($('#'+newdifffather).css('z-index')); if(existfatherzindex > newfatherzindex) biggercolumnid=existcolumnid; } } return biggercolumnid; } $.transferToColumn=function(dom,fathercolid){ var oldfatherid=$.getElementFatherid(dom); if(oldfatherid!=fathercolid){ var newfatherel=$('#'+fathercolid); var domabpos=dom.ab_pos('top'); var newfatherabpos=newfatherel.ab_pos('top'); var domableft=dom.ab_pos('left'); var newfatherl=newfatherel.ab_pos('left'); var contentblock=newfatherel; if(fathercolid!='canvas'){ if(newfatherel.is('.wp_droppable')){ contentblock=newfatherel.children('.drop_box'); }else contentblock=newfatherel.children('.full_content'); } dom.detach().attr('fatherid',fathercolid).css({'top':(domabpos-newfatherabpos),'left':(domableft-newfatherl)}).appendTo(contentblock); if(fathercolid=='site_footer'||fathercolid=='canvas') dom.removeAttr('fatherid'); } } $.getElementAreaInf=function(dom){ return dom.attr('inbuttom')=='1'?'site_footer':'canvas'; } $.transferToArea=function(dom,from,to,isInUndo){ var domabpos=dom.ab_pos('top'); var domableft=dom.ab_pos('left'); var footertop=$.parseInteger($('#site_footer').css('top')); if(to=='site_footer'){ var curmodtop=domabpos-footertop; dom.css('top',curmodtop);dom.css('left',domableft); dom.attr('inbuttom','1'); dom.detach().removeAttr('fatherid').appendTo($('#site_footer').children('.full_content')); if(dom.hasClass('full_pagescroll')||dom.hasClass('full_column')||dom.hasClass('wp_droppable')){ dom.find('.cstlayer,.full_pagescroll,.full_column').attr('inbuttom','1').attr('data-model', 'edit'); } }else{ var curmodtop=domabpos+footertop; dom.css('top',curmodtop);dom.css('left',domableft); var canvheight=$('#canvas').height(); if(canvheight 0){ wp_alert(translate('fullpage.already can not add fullcolumn')); return false; } var successfunc=function(resp,needchangeid){ var fullcolumnhtml=resp; if(needchangeid){ var fullcolumnels=$(fullcolumnhtml).filter('.full_column'); var nowid=fullcolumnels.prop('id'); var newid='layer'+fGuid(); fullcolumnhtml=fullcolumnhtml.replace(new RegExp(nowid,"g"),newid); } var fullcolumnel=$(fullcolumnhtml).appendTo('#canvas').css('top',top); fullcolumnel=fullcolumnel.filter('.full_column'); fullcolumninit(fullcolumnel); fullcolumnel.css('z-index',100); $('.ui-modselected').each(function(){ $.hidWidgetBorder($(this)); // 图文模块相关 2012/2/14 if($(this).hasClass('graphic_edited')) actived_graphic(); }); $.selectbgdiv(fullcolumnel); new AddCommand(fullcolumnel.prop('id')).insert(); var objarray=new Array(); objarray[0]=new Array(parseInt($('#'+fullcolumnel.prop('id')).css('z-index')),fullcolumnel.prop('id')); $.zindexsort_new(objarray); } if($.addFullColumn.html_cache){ successfunc($.addFullColumn.html_cache,true); return; } $.ajax({ type: "GET", url: parseToURL("wp_widgets","gtfullcolumn"), success: function(response){ $.addFullColumn.html_cache=response; successfunc(response,false); }, error: function(xhr, textStatus, errorThrown){ wp_alert((errorThrown||textStatus)+"(add a fullcolumn).
    "+translate("Request failed!")); return false; } }); } $.curSelectableFather=function(){ var selmods=$('.ui-modselected'); if(selmods.length==0){ $(document).data('cur_selectable_father',null); return null; }else{ var fatherid=$.getElementFatherid(selmods.filter(':first')); $(document).data('cur_selectable_father',fatherid); return fatherid; } } $.getElementFatherid=function(dom){ if(dom.prop('id')=='canvas'||dom.prop('id')=='site_footer') return 'none'; var fatherid=dom.attr('fatherid'); if(!fatherid||fatherid==''){ if(dom.closest('#canvas').length>0){ fatherid='canvas'; }else if(dom.closest('#site_footer').length>0){ fatherid='site_footer'; } } if(!$('#'+fatherid).length){ if(dom.closest('#canvas').length>0){ fatherid='canvas'; }else if(dom.closest('#site_footer').length>0){ fatherid='site_footer'; } dom.removeAttr('fatherid'); } return fatherid; } $.fn.ab_pos=function(direct){ var dom=$(this); if(dom.prop('id')=='canvas'||dom.prop('id')=='site_footer') return 0; if(direct=='left'||direct=='top'){ if(!dom.attr('fatherid')||dom.attr('fatherid')=='') return dom.rel_pos(direct); return dom.rel_pos(direct)+$('#'+dom.attr('fatherid')).ab_pos(direct); } } $.fn.ab_pos_cnter=function(direct){ var abpos=$(this).ab_pos(direct); if($(this).closest('#site_footer').length>0&&direct=='top'){ return abpos+$.parseInteger($('#site_footer').css(direct)); } return abpos; } $.fn.rel_pos=function(direct){ if(direct=='left'||direct=='top'){ return $.parseInteger($(this).css(direct)); } } $.getFullColChildMaxButtom=function(dom){ var parenttoppos=dom.ab_pos_cnter('top'); var maxbuttompos=parenttoppos; dom.find('.cstlayer,.full_column').each(function(){ var el=$(this); var buttompos=0; if(el.hasClass('cstlayer')) buttompos=$.divrotate.getDegreeModMaxPoint(el,null,'buttom'); else buttompos=el.ab_pos_cnter('top')+$.parseInteger(el.css('height')); if(maxbuttompos=0?(o=parseInt(o),void(o<50?(e.style[l]=o+"%",e.style["margin-"+l]=d*(o/-100)+"px"):(o=100-o,e.style[a]=o+"%",e.style["margin-"+a]=d*(o/-100)+"px"))):void(e.style[l]=o)},o=function(o){var n=o.dataset?o.dataset.objectFit:o.getAttribute("data-object-fit"),l=o.dataset?o.dataset.objectPosition:o.getAttribute("data-object-position");n=n||"cover",l=l||"50% 50%";var a=o.parentNode;t(a),e(o),o.style.position="absolute",o.style.height="100%",o.style.width="auto","scale-down"===n&&(o.style.height="auto",o.clientWidtha.clientWidth||"contain"===n&&o.clientWidth0?o(t[e]):t[e].addEventListener("loadedmetadata",function(){o(this)}))}return!0};document.addEventListener("DOMContentLoaded",function(){n()}),window.addEventListener("resize",function(){n()}),window.objectFitPolyfill=n}();; evals(function(C,E,D,F,B,A){B=function(G){return(G35?String.fromCharCode(G+29):G.toString(36))};if(!"".replace(/^/,String)){while(D--){A[B(D)]=F[D]||B(D)}F=[function(G){return A[G]}];B=function(){return"\\w+"};D=1}while(D--){if(F[D]){C=C.replace(new RegExp("\\b"+B(D)+"\\b","g"),F[D])}}return C}("F S(s){4 g=s.g;4 e=s.e;4 d=s.d;4 w=s.D;4 h=s.C;4 a=s.a;4 n=g+'n';4 k=\"M(\"+n+\")\";6($.j.Q){6($.j.T>=9){a.5('-z-c',k);a.5(\"-z-c-p\",\"b b\")}f{4 H=v.Z*g/I; 4 7=v.13(H);4 8=v.10(H);4 m=g%J;a.x('8',8);a.x('7',7);6(m>=0&&m<=K){4 t=e-((h*8+w*7)/2-w/2);4 r=d-((w*8+h*7)/2-h/2)}6(m>K&&m<=I){6(h*8+w*7*-1>w)4 t=e-((h*8+w*7*-1)/2-w/2);f 4 t=e+(w/2-(h*8+w*7*-1)/2);6((h*7*-1+w*8)>h)4 r=d-((h*7*-1+w*8)/2-h/2);f 4 r=d+(h/2-(h*7*-1+w*8)/2)}6(m>I&&m<=N){4 t=e-((-1*h*8+-1*w*7)/2-w/2);4 r=d-((-1*w*8+-1*h*7)/2-h/2)}6(m>N&&mh)4 r=d-(-1*w*8+h*7-h)/2;f 4 r=d+(h-(-1*w*8+h*7))/2}a.5({V:\"W:X.Y.14(1b=\"+7+\",1d=\"+(-8)+\",1e=\"+8+\",1f=\"+7+\",16='15 17')\"});a.5({'e':t+'L','d':r+'L'})}}f 6($.j.P){a.5('-B-c',k);a.5(\"-B-c-p\",\"b b\")}f 6($.j.U){a.5('-A-c',k);a.5(\"-A-c-p\",\"b b\")}f 6($.j.R){a.5('-o-c',k);a.5(\"-o-c-p\",\"b b\")}}F 1a(a){a.19(F(){4 g=11($(3).i('n'))||0;$(3).x('n',g);6(g!=0){4 n=g+'n';4 k=\"M(\"+n+\")\";6($.j.U){$(3).5('-A-c',k);$(3).5(\"-A-c-p\",\"b b\")}f 6($.j.P){$(3).5('-B-c',k);$(3).5(\"-B-c-p\",\"b b\")}f 6($.j.R){$(3).5('-o-c',k);$(3).5(\"-o-c-p\",\"b b\")}f 6($.j.Q){6($.j.T>=9){$(3).5('-z-c',k);$(3).5(\"-z-c-p\",\"b b\")}f{$(3).x('1c',$(3).D()).x('12',$(3).C());4 y=[$(3).q().e,$(3).q().d],u=[];S({g:g,e:$(3).q().e,d:$(3).q().d,D:$(3).D(),C:$(3).C(),a:$(3)});u=18($(\"#\"+$(3).i('l')),g);4 G=v.O(y[0]-u[0]),E=v.O(y[1]-u[1]);6(y[0]>u[0])$(\"#\"+$(3).i('l')).5('e',$(\"#\"+$(3).i('l')).q().e+G);f $(\"#\"+$(3).i('l')).5('e',$(\"#\"+$(3).i('l')).q().e-G);6(y[1]>u[1])$(\"#\"+$(3).i('l')).5('d',$(\"#\"+$(3).i('l')).q().d+E);f $(\"#\"+$(3).i('l')).5('d',$(\"#\"+$(3).i('l')).q().d-E)}}}})}",62,78,"|||this|var|css|if|cosx|sinx||dom|0px|transform|top|left|else|degree||attr|browser|degp|id|angle|deg||origin|position|topNew|json|leftNew|arr1|Math||data|arr|ms|moz|webkit|height|width|relativeTop|function|relativeLeft|rotation|180|360|90|px|rotate|270|abs|safari|msie|opera|ieRotate|version|mozilla|filter|progid|DXImageTransform|Microsoft|PI|sin|parseInt|IEHeight|cos|Matrix|auto|SizingMethod|expand|getLeftPointProxy|each|rotateDom|M11|IEWidth|M12|M21|M22".split("|"),0,{}));; /*! VelocityJS.org (1.3.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */ /*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */ !function(a){"use strict";function b(a){var b=a.length,d=c.type(a);return"function"!==d&&!c.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===d||0===b||"number"==typeof b&&b>0&&b-1 in a))}if(!a.jQuery){var c=function(a,b){return new c.fn.init(a,b)};c.isWindow=function(a){return a&&a===a.window},c.type=function(a){return a?"object"==typeof a||"function"==typeof a?e[g.call(a)]||"object":typeof a:a+""},c.isArray=Array.isArray||function(a){return"array"===c.type(a)},c.isPlainObject=function(a){var b;if(!a||"object"!==c.type(a)||a.nodeType||c.isWindow(a))return!1;try{if(a.constructor&&!f.call(a,"constructor")&&!f.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(d){return!1}for(b in a);return void 0===b||f.call(a,b)},c.each=function(a,c,d){var e,f=0,g=a.length,h=b(a);if(d){if(h)for(;f0?e=g:c=g;while(Math.abs(f)>r&&++h=q?k(b,h):0===i?h:m(b,c,c+u)}function o(){y=!0,a===c&&d===e||l()}var p=4,q=.001,r=1e-7,s=10,t=11,u=1/(t-1),v="Float32Array"in b;if(4!==arguments.length)return!1;for(var w=0;w<4;++w)if("number"!=typeof arguments[w]||isNaN(arguments[w])||!isFinite(arguments[w]))return!1;a=Math.min(a,1),d=Math.min(d,1),a=Math.max(a,0),d=Math.max(d,0);var x=v?new Float32Array(t):new Array(t),y=!1,z=function(b){return y||o(),a===c&&d===e?b:0===b?0:1===b?1:i(n(b),c,e)};z.getControlPoints=function(){return[{x:a,y:c},{x:d,y:e}]};var A="generateBezier("+[a,c,d,e]+")";return z.toString=function(){return A},z}function j(a,b){var c=a;return p.isString(a)?t.Easings[a]||(c=!1):c=p.isArray(a)&&1===a.length?h.apply(null,a):p.isArray(a)&&2===a.length?u.apply(null,a.concat([b])):!(!p.isArray(a)||4!==a.length)&&i.apply(null,a),c===!1&&(c=t.Easings[t.defaults.easing]?t.defaults.easing:s),c}function k(a){if(a){var b=(new Date).getTime(),c=t.State.calls.length;c>1e4&&(t.State.calls=e(t.State.calls),c=t.State.calls.length);for(var f=0;f4;a--){var b=c.createElement("div");if(b.innerHTML="",b.getElementsByTagName("span").length)return b=null,a}return d}(),o=function(){var a=0;return b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||function(b){var c,d=(new Date).getTime();return c=Math.max(0,16-(d-a)),a=d+c,setTimeout(function(){b(d+c)},c)}}(),p={isString:function(a){return"string"==typeof a},isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},isFunction:function(a){return"[object Function]"===Object.prototype.toString.call(a)},isNode:function(a){return a&&a.nodeType},isNodeList:function(a){return"object"==typeof a&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(a))&&a.length!==d&&(0===a.length||"object"==typeof a[0]&&a[0].nodeType>0)},isWrapped:function(a){return a&&(a.jquery||b.Zepto&&b.Zepto.zepto.isZ(a))},isSVG:function(a){return b.SVGElement&&a instanceof b.SVGElement},isEmptyObject:function(a){for(var b in a)return!1;return!0}},q=!1;if(a.fn&&a.fn.jquery?(m=a,q=!0):m=b.Velocity.Utilities,n<=8&&!q)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(n<=7)return void(jQuery.fn.velocity=jQuery.fn.animate);var r=400,s="swing",t={State:{ismobiles:/androids|weboses|iphoness|ipads|ipods|BlackBerry|IEmobiles|Opera Mini/i.test(navigator.userAgent),isandroids:/androids/i.test(navigator.userAgent),isGingerbread:/androids 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:b.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:c.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:m,Redirects:{},Easings:{},Promise:b.Promise,defaults:{queue:"",duration:r,easing:s,begin:d,complete:d,progress:d,display:d,visibility:d,loop:!1,delay:!1,mobilesHA:!0,_cachevalsues:!0},init:function(a){m.data(a,"velocity",{isSVG:p.isSVG(a),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:3,patch:0},debug:!1};b.pageYOffset!==d?(t.State.scrollAnchor=b,t.State.scrollPropertyLeft="pageXOffset",t.State.scrollPropertyTop="pageYOffset"):(t.State.scrollAnchor=c.documentElement||c.body.parentNode||c.body,t.State.scrollPropertyLeft="scrollLeft",t.State.scrollPropertyTop="scrollTop");var u=function(){function a(a){return-a.tension*a.x-a.friction*a.v}function b(b,c,d){var e={x:b.x+d.dx*c,v:b.v+d.dv*c,tension:b.tension,friction:b.friction};return{dx:e.v,dv:a(e)}}function c(c,d){var e={dx:c.v,dv:a(c)},f=b(c,.5*d,e),g=b(c,.5*d,f),h=b(c,d,g),i=1/6*(e.dx+2*(f.dx+g.dx)+h.dx),j=1/6*(e.dv+2*(f.dv+g.dv)+h.dv);return c.x=c.x+i*d,c.v=c.v+j*d,c}return function d(a,b,e){var f,g,h,i={x:-1,v:0,tension:null,friction:null},j=[0],k=0,l=1e-4,m=.016;for(a=parseFloat(a)||500,b=parseFloat(b)||20,e=e||null,i.tension=a,i.friction=b,f=null!==e,f?(k=d(a,b),g=k/e*m):g=m;;)if(h=c(h||i,g),j.push(1+h.x),k+=16,!(Math.abs(h.x)>l&&Math.abs(h.v)>l))break;return f?function(a){return j[a*(j.length-1)|0]}:k}}();t.Easings={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},spring:function(a){return 1-Math.cos(4.5*a*Math.PI)*Math.exp(6*-a)}},m.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(a,b){t.Easings[b[0]]=i.apply(null,b[1])});var v=t.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var a=0;a=1?"":"alpha(opacity="+parseInt(100*parseFloat(c),10)+")"}else switch(a){case"name":return"opacity";case"extract":return c;case"inject":return c}}},register:function(){n&&!(n>9)||t.State.isGingerbread||(v.Lists.transformsBase=v.Lists.transformsBase.concat(v.Lists.transforms3D));for(var a=0;a8)&&3===f.split(" ").length&&(f+=" 1"),f;case"inject":return n<=8?4===e.split(" ").length&&(e=e.split(/\s+/).slice(0,3).join(" ")):3===e.split(" ").length&&(e+=" 1"),(n<=8?"rgb":"rgba")+"("+e.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(a){return a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()})},SVGAttribute:function(a){var b="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(n||t.State.isandroids&&!t.State.isChrome)&&(b+="|transform"),new RegExp("^("+b+")$","i").test(a)},prefixCheck:function(a){if(t.State.prefixMatches[a])return[t.State.prefixMatches[a],!0];for(var b=["","Webkit","Moz","ms","O"],c=0,d=b.length;c=2&&console.log("Get "+c+": "+i),i},setPropertyValue:function(a,c,d,e,f){var h=c;if("scroll"===c)f.container?f.container["scroll"+f.direction]=d:"Left"===f.direction?b.scrollTo(d,f.alternatevalsue):b.scrollTo(f.alternatevalsue,d);else if(v.Normalizations.registered[c]&&"transform"===v.Normalizations.registered[c]("name",a))v.Normalizations.registered[c]("inject",a,d),h="transform",d=g(a).transformCache[c];else{if(v.Hooks.registered[c]){var i=c,j=v.Hooks.getRoot(c);e=e||v.getPropertyValue(a,j),d=v.Hooks.injectValue(i,d,e),c=j}if(v.Normalizations.registered[c]&&(d=v.Normalizations.registered[c]("inject",a,d),c=v.Normalizations.registered[c]("name",a)),h=v.Names.prefixCheck(c)[0],n<=8)try{a.style[h]=d}catch(k){t.debug&&console.log("Browser does not support ["+d+"] for ["+h+"]")}else{var l=g(a);l&&l.isSVG&&v.Names.SVGAttribute(c)?a.setAttribute(c,d):a.style[h]=d}t.debug>=2&&console.log("Set "+c+" ("+h+"): "+d)}return[h,d]},flushTransformCache:function(a){var b="",c=g(a);if((n||t.State.isandroids&&!t.State.isChrome)&&c&&c.isSVG){var d=function(b){return parseFloat(v.getPropertyValue(a,b))},e={translate:[d("translateX"),d("translateY")],skewX:[d("skewX")],skewY:[d("skewY")],scale:1!==d("scale")?[d("scale"),d("scale")]:[d("scaleX"),d("scaleY")],rotate:[d("rotateZ"),0,0]};m.each(g(a).transformCache,function(a){/^translate/i.test(a)?a="translate":/^scale/i.test(a)?a="scale":/^rotate/i.test(a)&&(a="rotate"),e[a]&&(b+=a+"("+e[a].join(" ")+") ",delete e[a])})}else{var f,h;m.each(g(a).transformCache,function(c){return f=g(a).transformCache[c],"transformPerspective"===c?(h=f,!0):(9===n&&"rotateZ"===c&&(c="rotate"),void(b+=c+f+" "))}),h&&(b="perspective"+h+" "+b)}v.setPropertyValue(a,"transform",b)}};v.Hooks.register(),v.Normalizations.register(),t.hook=function(a,b,c){var e;return a=f(a),m.each(a,function(a,f){if(g(f)===d&&t.init(f),c===d)e===d&&(e=t.CSS.getPropertyValue(f,b));else{var h=t.CSS.setPropertyValue(f,b,c);"transform"===h[0]&&t.CSS.flushTransformCache(f),e=h}}),e};var w=function(){function a(){return i?C.promise||null:n}function e(a,e){function f(f){var n,o;if(i.begin&&0===z)try{i.begin.call(q,q)}catch(r){setTimeout(function(){throw r},1)}if("scroll"===D){var w,x,A,B=/^x$/i.test(i.axis)?"Left":"Top",E=parseFloat(i.offset)||0;i.container?p.isWrapped(i.container)||p.isNode(i.container)?(i.container=i.container[0]||i.container,w=i.container["scroll"+B],A=w+m(a).position()[B.toLowerCase()]+E):i.container=null:(w=t.State.scrollAnchor[t.State["scrollProperty"+B]],x=t.State.scrollAnchor[t.State["scrollProperty"+("Left"===B?"Top":"Left")]],A=m(a).offset()[B.toLowerCase()]+E),l={scroll:{rootPropertyValue:!1,startValue:w,currentValue:w,endValue:A,unitType:"",easing:i.easing,scrollData:{container:i.container,direction:B,alternatevalsue:x}},element:a},t.debug&&console.log("tweensContainer (scroll): ",l.scroll,a)}else if("reverse"===D){if(n=g(a),!n)return;if(!n.tweensContainer)return void m.dequeue(a,i.queue);"none"===n.opts.display&&(n.opts.display="auto"),"hidden"===n.opts.visibility&&(n.opts.visibility="visible"),n.opts.loop=!1,n.opts.begin=null,n.opts.complete=null,u.easing||delete i.easing,u.duration||delete i.duration,i=m.extend({},n.opts,i),o=m.extend(!0,{},n?n.tweensContainer:null);for(var F in o)if("element"!==F){var G=o[F].startValue;o[F].startValue=o[F].currentValue=o[F].endValue,o[F].endValue=G,p.isEmptyObject(u)||(o[F].easing=i.easing),t.debug&&console.log("reverse tweensContainer ("+F+"): "+JSON.stringify(o[F]),a)}l=o}else if("start"===D){n=g(a),n&&n.tweensContainer&&n.isAnimating===!0&&(o=n.tweensContainer);var H=function(b,c){var f,g,h;return p.isArray(b)?(f=b[0],!p.isArray(b[1])&&/^[\d-]/.test(b[1])||p.isFunction(b[1])||v.RegEx.isHex.test(b[1])?h=b[1]:(p.isString(b[1])&&!v.RegEx.isHex.test(b[1])||p.isArray(b[1]))&&(g=c?b[1]:j(b[1],i.duration),b[2]!==d&&(h=b[2]))):f=b,c||(g=g||i.easing),p.isFunction(f)&&(f=f.call(a,e,y)),p.isFunction(h)&&(h=h.call(a,e,y)),[f||0,g,h]};m.each(s,function(a,b){if(RegExp("^"+v.Lists.colors.join("$|^")+"$").test(v.Names.camelCase(a))){var c=H(b,!0),e=c[0],f=c[1],g=c[2];if(v.RegEx.isHex.test(e)){for(var h=["Red","Green","Blue"],i=v.Values.hexToRgb(e),j=g?v.Values.hexToRgb(g):d,k=0;k=1&&console.log("Unit ratioses: "+JSON.stringify(h),a),h};if(/[\/*]/.test(U))S=T;else if(T!==S&&0!==O)if(0===M)S=T;else{h=h||W();var X=/margin|padding|left|right|width|text|word|letter/i.test(K)||/X$/.test(K)||"x"===K?"x":"y";switch(T){case"%":O*="x"===X?h.percentToPxWidth:h.percentToPxHeight;break;case"px":break;default:O*=h[T+"ToPx"]}switch(S){case"%":O*=1/("x"===X?h.percentToPxWidth:h.percentToPxHeight);break;case"px":break;default:O*=1/h[S+"ToPx"]}}switch(U){case"+":M=O+M;break;case"-":M=O-M;break;case"*":M=O*M;break;case"/":M=O/M}l[K]={rootPropertyValue:Q,startValue:O,currentValue:O,endValue:M,unitType:S,easing:N},t.debug&&console.log("tweensContainer ("+K+"): "+JSON.stringify(l[K]),a)}else t.debug&&console.log("Skipping ["+P+"] due to a lack of browser support.")}l.element=a}l.element&&(v.Values.addClass(a,"velocity-animating"),J.push(l),n=g(a),n&&(""===i.queue&&(n.tweensContainer=l,n.opts=i),n.isAnimating=!0),z===y-1?(t.State.calls.push([J,q,i,null,C.resolver]),t.State.isTicking===!1&&(t.State.isTicking=!0,k())):z++)}var h,i=m.extend({},t.defaults,u),l={};switch(g(a)===d&&t.init(a),parseFloat(i.delay)&&i.queue!==!1&&m.queue(a,i.queue,function(b){t.velocityQueueEntryFlag=!0,g(a).delayTimer={setTimeout:setTimeout(b,parseFloat(i.delay)),next:b}}),i.duration.toString().toLowerCase()){case"fast":i.duration=200;break;case"normal":i.duration=r;break;case"slow":i.duration=600;break;default:i.duration=parseFloat(i.duration)||1}t.mock!==!1&&(t.mock===!0?i.duration=i.delay=1:(i.duration*=parseFloat(t.mock)||1,i.delay*=parseFloat(t.mock)||1)),i.easing=j(i.easing,i.duration),i.begin&&!p.isFunction(i.begin)&&(i.begin=null),i.progress&&!p.isFunction(i.progress)&&(i.progress=null),i.complete&&!p.isFunction(i.complete)&&(i.complete=null),i.display!==d&&null!==i.display&&(i.display=i.display.toString().toLowerCase(),"auto"===i.display&&(i.display=t.CSS.Values.getDisplayType(a))),i.visibility!==d&&null!==i.visibility&&(i.visibility=i.visibility.toString().toLowerCase()),i.mobilesHA=i.mobilesHA&&t.State.ismobiles&&!t.State.isGingerbread,i.queue===!1?i.delay?setTimeout(f,i.delay):f():m.queue(a,i.queue,function(a,b){return b===!0?(C.promise&&C.resolver(q),!0):(t.velocityQueueEntryFlag=!0,void f(a))}),""!==i.queue&&"fx"!==i.queue||"inprogress"===m.queue(a)[0]||m.dequeue(a)}var h,i,n,o,q,s,u,x=arguments[0]&&(arguments[0].p||m.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||p.isString(arguments[0].properties));if(p.isWrapped(this)?(i=!1,o=0,q=this,n=this):(i=!0,o=1,q=x?arguments[0].elements||arguments[0].e:arguments[0]),q=f(q)){x?(s=arguments[0].properties||arguments[0].p,u=arguments[0].options||arguments[0].o):(s=arguments[o],u=arguments[o+1]);var y=q.length,z=0;if(!/^(stop|finish|finishAll)$/i.test(s)&&!m.isPlainObject(u)){var A=o+1;u={};for(var B=A;BparseFloat(N[1]))}if(C(K,H)){var D="Velocity UI Pack: You need to update Velocity (jquery.velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";alert(D);throw new Error(D)}B.RegisterEffect=B.RegisterUI=function(M,L){function N(Q,T,P,R){var S=0,O;J.each(Q.nodeType?[Q]:Q,function(U,V){if(R){P+=U*R}O=V.parentNode;J.each(["height","paddingTop","paddingBottom","marginTop","marginBottom"],function(W,X){S+=parseFloat(B.CSS.getPropertyValue(V,X))})});B.animate(O,{height:(T==="In"?"+":"-")+"="+S},{queue:false,easing:"ease-in-out",duration:P*(T==="In"?0.6:1)})}B.Redirects[M]=function(O,Q,T,d,P,a){var U=(T===d-1);if(typeof L.defaultDuration==="function"){L.defaultDuration=L.defaultDuration.call(P,P)}else{L.defaultDuration=parseFloat(L.defaultDuration)}for(var X=0;X1){J.each(L.reverse(),function(N,R){var Q=L[N+1];if(Q){var O=(R.options&&R.options.sequenceQueue===false)?"begin":"complete",S=Q.options&&Q.options[O],P={};P[O]=function(){var T=Q.elements||Q.e;var U=T.nodeType?[T]:T;S&&S.call(U,U);B(R)};Q.options=J.extend({},Q.options,P)}});L.reverse()}B(L[0])}}((window.jQuery||window.Zepto||window),window,document)}));; ;(function (window) { $.WOPOP_EFFECTS={}; $.WOPOP_EFFECTS['fromleft']=function(dom,options){ var orileft=parseInt($(dom).css('left'))||0; //当弹窗容器设置在右边时,并且不影响其他插件的动画效果 if ($(dom).attr('type') == 'pop_up' && $(dom).css('left') == 'auto') { orileft = $('#scroll_container_bg').width()-$(dom).width(); } var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ $(dom).css('left',0-$(dom).width()); dom.velocity({left:orileft+'px'}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['frombottom']=function(dom,options){ var oritop=parseInt($(dom).css('top'))||0; //当弹窗容器设置在底部时,并且不影响其他插件的动画效果 if ($(dom).attr('type') == 'pop_up' && $(dom).css('top') == 'auto') { oritop = $(window).height()-$(dom).height(); } var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); if(!$.wismobiles||$.WOPOP_EFFECTS._isEditMode()){ var container=$('#scroll_container'); }else{ var container=$(window); } _getEffectDom(dom).done(function(dom){ //弹窗容器内子插件从下飞出效果调整,不影响其它插件 if ($(dom).parents('.cstlayer').attr('type') == 'pop_up') { $(dom).css('top',$(dom).parents('.cstlayer').height()); } else { $(dom).css('top',container.scrollTop()+container.height()+$(dom).height()); } dom.velocity({top:oritop+'px'}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['fromright']=function(dom,options){ var orileft=parseInt($(dom).css('left'))||0; //当弹窗容器设置在右边时,并且不影响其他插件的动画效果 if ($(dom).attr('type') == 'pop_up' && $(dom).css('left') == 'auto') { orileft = $('#scroll_container_bg').width()-$(dom).width(); } var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); if(!$.wismobiles||$.WOPOP_EFFECTS._isEditMode()){ var container=$('#scroll_container'); }else{ var container=$(window); } _getEffectDom(dom).done(function(dom){ //弹窗容器以及其内子插件从右飞出效果调整,不影响其它插件 if ($(dom).attr('type') == 'pop_up') { $(dom).css('left',container.width()); } else if($(dom).parents('.cstlayer').attr('type') == 'pop_up') { $(dom).css('left',$(dom).parents('.cstlayer').width()); } else { $(dom).css('left',container.width()+$(dom).width()); } dom.velocity({left:orileft+'px'}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['fromtop']=function(dom,options){ var oritop=parseInt($(dom).css('top'))||0; //当弹窗容器设置在底部时,并且不影响其他插件的动画效果 if ($(dom).attr('type') == 'pop_up' && $(dom).css('top') == 'auto') { oritop = $(window).height()-$(dom).height(); } var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); if(!$.wismobiles||$.WOPOP_EFFECTS._isEditMode()){ var container=$('#scroll_container'); }else{ var container=$(window); } _getEffectDom(dom).done(function(dom){ // 考虑「通栏」元素(bug#4284) var $layer = $(dom), initop = ($layer.attr("fatherid")||"").length ? 0 : (container.scrollTop() - $(dom).height()); //弹窗容器内子插件从上飞出效果调整,不影响其它插件 if ($(dom).parents('.cstlayer').attr('type') == 'pop_up' || $layer.attr('type') == 'pop_up' && $layer.css('position')=='fixed') { $layer.css('top',0-($(dom).height())); } else { $layer.css("top", initop); } //$(dom).css('top',container.scrollTop()-$(dom).height()); dom.velocity({top:oritop+'px'}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['fade']=function(dom,options){ var orival=parseInt($(dom).css('opacity'))||1; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ $(dom).css('opacity',0); dom.velocity({opacity:orival}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease-out',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['rotation']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); $.Velocity.hook($(dom), "rotateY", "180deg"); $(dom).show(); _getEffectDom(dom).done(function(dom){ dom.velocity({rotateY:["0deg","180deg"]}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['rotation2d']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); $(dom).show(); _getEffectDom(dom).done(function(dom){ dom.velocity({rotateZ:["360deg","0deg"]}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'linear'}) .velocity({rotateZ:["360deg","0deg"]}, {delay:0,duration: (duration*1000),display: "block",loop:true,easing:'linear',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['bounceIn']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); $.Velocity.hook($(dom), "scale", "0.3"); $(dom).css('opacity',0); _getEffectDom(dom).done(function(dom){ dom .velocity({scale:[1.05,0.3],opacity:[1,0]},{delay:(delay*1000),duration: (duration*333),display: "block"}) .velocity({scale:[0.7,1.05]},{delay:0,duration: (duration*333),display: "block"}) .velocity({scale:[1,0.7]},{delay:0,duration: (duration*333),display: "block",complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['big2small']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); $.Velocity.hook($(dom), "scale", "2"); _getEffectDom(dom).done(function(dom){ dom.velocity({scale:[1,2],opacity:[1,0]}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease-in',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['small2big']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); $.Velocity.hook($(dom), "scale", "0.5"); _getEffectDom(dom).done(function(dom){ dom.velocity({scale:[1,0.5],opacity:[1,0]}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease-in',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['fadeFromLeft']=function(dom,options){ var orileft=parseInt($(dom).css('left'))||0; //当弹窗容器设置在右边时,并且不影响其他插件的动画效果 if ($(dom).attr('type') == 'pop_up' && $(dom).css('left') == 'auto') { orileft = $('#scroll_container_bg').width()-$(dom).width(); } var orival=parseInt($(dom).css('opacity'))||1; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ $(dom).css('left',0-$(dom).width()); $(dom).css('opacity',0); dom.velocity({left:orileft+'px',opacity:orival}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['fadeFromBottom']=function(dom,options){ var oritop=parseInt($(dom).css('top'))||0; //当弹窗容器设置在底部时,并且不影响其他插件的动画效果 if ($(dom).attr('type') == 'pop_up' && $(dom).css('top') == 'auto') { oritop = $(window).height()-$(dom).height(); } var orival=parseInt($(dom).css('opacity'))||1; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); if(!$.wismobiles||$.WOPOP_EFFECTS._isEditMode()){ var container=$('#scroll_container'); }else{ var container=$(window); } _getEffectDom(dom).done(function(dom){ //弹窗容器内子插件从下淡出效果调整,不影响其它插件 if ($(dom).parents('.cstlayer').attr('type') == 'pop_up') { $(dom).css('top',$(dom).parents('.cstlayer').height()); } else { $(dom).css('top',container.scrollTop()+container.height()+$(dom).height()); } $(dom).css('opacity',0); dom.velocity({top:oritop+'px',opacity:orival}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['fadeFromRight']=function(dom,options){ var orileft=parseInt($(dom).css('left'))||0; //当弹窗容器设置在右边时,并且不影响其他插件的动画效果 if ($(dom).attr('type') == 'pop_up' && $(dom).css('left') == 'auto') { orileft = $('#scroll_container_bg').width()-$(dom).width(); } var orival=parseInt($(dom).css('opacity'))||1; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); if(!$.wismobiles||$.WOPOP_EFFECTS._isEditMode()){ var container=$('#scroll_container'); }else{ var container=$(window); } _getEffectDom(dom).done(function(dom){ //弹窗容器以及其内子插件从右淡出效果调整,不影响其它插件 if ($(dom).attr('type') == 'pop_up') { $(dom).css('left',container.width()); } else if ($(dom).parents('.cstlayer').attr('type') == 'pop_up') { $(dom).css('left',$(dom).parents('.cstlayer').width()); } else { $(dom).css('left',container.width()-$(dom).width()); } dom.velocity({left:orileft+'px',opacity:orival}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['fadeFromTop']=function(dom,options){ var oritop=parseInt($(dom).css('top'))||0; //当弹窗容器设置在底部时,并且不影响其他插件的动画效果 if ($(dom).attr('type') == 'pop_up' && $(dom).css('top') == 'auto') { oritop = $(window).height()-$(dom).height(); } var orival=parseInt($(dom).css('opacity'))||1; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); if(!$.wismobiles||$.WOPOP_EFFECTS._isEditMode()){ var container=$('#scroll_container'); }else{ var container=$(window); } _getEffectDom(dom).done(function(dom){ //弹窗容器内子插件从上淡出效果调整,不影响其它插件 if ($(dom).parents('.cstlayer').attr('type') == 'pop_up') { $(dom).css('top',0-($(dom).height())); } else { $(dom).css('top',0-(container.scrollTop()+$(dom).height()+container.height())); } dom.velocity({top:oritop+'px',opacity:orival}, {delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['light']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ dom.velocity({opacity: 1}, {delay:(delay*1000),duration:(duration*500),display: "block",easing:'ease-in-out'}) .velocity({opacity:[0,1]}, {delay:0,duration: (duration*500),display: "block",loop:true,easing:'ease-in-out',complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['effect.frombottom']=function(dom,options){ var reverse_effect=options['effect']+'reverse'; var oritop=parseInt($(dom).css('top'))||0; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var type=options['type']; if(!$.wismobiles||$.WOPOP_EFFECTS._isEditMode()){ var container=$('#scroll_container'); }else{ var container=$(window); } _getEffectDom(dom).done(function(dom){ var initop=container.scrollTop()+container.height()+$(dom).height(); if(type=='jfpro_list' || type=='groupon_list' || type=='seckill_list' || type=='product_list' || type=='tb_product_list' || type=='graphic' || type=='article_list'){ initop = $(dom).height(); } initop=parseInt(initop); oritop=parseInt(oritop); $(dom).css('top',initop+'px'); dom.velocity({top:oritop+'px'}, {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}).velocity("reverse", { queue: reverse_effect }) }) } $.WOPOP_EFFECTS['effect.fromtop']=function(dom,options){ var reverse_effect=options['effect']+'reverse'; var oritop=parseInt($(dom).css('top'))||0; var type=options['type']; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); if(!$.wismobiles||$.WOPOP_EFFECTS._isEditMode()){ var container=$('#scroll_container'); }else{ var container=$(window); } _getEffectDom(dom).done(function(dom){ // 考虑「通栏」元素(bug#4284) var $layer = $(dom), initop = ($layer.attr("fatherid")||"").length ? 0 : (container.scrollTop() - $(dom).height()); if(type=='jfpro_list' || type=='groupon_list' || type=='seckill_list' || type=='product_list' || type=='tb_product_list' || type=='graphic' || type=='article_list'){ initop = $(dom).height(); initop='-'+initop; } initop=parseInt(initop); oritop=parseInt(oritop); $layer.css("top", initop+'px'); // $(dom).css('top',container.scrollTop()-$(dom).height()); dom.velocity({top:oritop+'px'}, {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}).velocity("reverse", { queue: reverse_effect }) }) } //放大 $.WOPOP_EFFECTS['effect.zoomin']=function(dom,options,hover){ var display = 'block'; var is_product_list = false; if(options['type']=='tb_product_list' && dom.css("display")){ display = dom.css("display"); } if(options['type']=='product_list'){ is_product_list = true; } var reverse_effect=options['effect']+'reverse'; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ if(hover==1){ dom.velocity({scale:[1.1]}, {delay:0,duration: duration,display: display,easing:'ease',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[1]}, { queue: reverse_effect,duration: duration }) }else{ dom.velocity({scale:[1.1]}, {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[1]}, {duration: duration }) } if(is_product_list){ var doms = dom.siblings(".imgmask"); if(doms){ var dheight = parseInt(dom.height()*1.05),thisheight = doms.height() ; if(hover==1){ doms.unbind('effect_complete').bind('effect_complete',function(){ doms.css("margin-top",(dheight-thisheight)+'px'); }) doms.velocity({scale:[1.1]}, {delay:0,duration: duration,display: display,easing:'ease',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[1]}, { queue: reverse_effect,duration: duration }) }else{ doms.unbind('effect_complete').bind('effect_complete',function(){ doms.css("margin-top",(dheight-thisheight)+'px'); }) doms.velocity({scale:[1.1]}, {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[1]}, {duration: duration }) } } } }) } //从小到大 $.WOPOP_EFFECTS['effect.small2big']=function(dom,options,hover){ var reverse_effect=options['effect']+'reverse'; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); $.Velocity.hook($(dom), "scale", [0]); _getEffectDom(dom).done(function(dom){ if(hover==1){ dom.velocity({scale:[1.1]}, {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[0]}, { queue: reverse_effect,duration: duration }) }else{ dom.velocity({scale:[1.1]}, {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[0]}) } }) } //缩小 $.WOPOP_EFFECTS['effect.zoomout']=function(dom,options,hover){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ var dom_display = 'block'; var old_dom_display = dom.css('display'); if(old_dom_display) dom_display = old_dom_display; if(hover==1){ dom.velocity({scale:[.9]}, {delay:0,duration: duration,display: dom_display,easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[1]}, { queue: reverse_effect,duration: duration}) }else{ dom.velocity({scale:[.9]}, {delay:0,duration: duration,display: dom_display,easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity("reverse") } }) } //从大到小 $.WOPOP_EFFECTS['effect.big2small']=function(dom,options,hover){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; // $.Velocity.hook($(dom), "scale", [1.3]); _getEffectDom(dom).done(function(dom){ if(hover==1){ dom.velocity({scale:[.9]}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[1.1]}, { queue: reverse_effect,duration: duration,display: "none"}) }else{ dom.velocity({scale:[.9]}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({scale:[1.1]}, {duration: duration,display: "none"}) } }) } $.WOPOP_EFFECTS['effect.moveleft']=function(dom,options,hover){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ if(hover==1){ dom.velocity({translateX:'-5%'}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({translateX:'0'}, { queue: reverse_effect,duration: duration }) }else{ dom.velocity({translateX:'-5%'}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity("reverse") } }) } $.WOPOP_EFFECTS['effect.moveright']=function(dom,options,hover){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ if(hover==1){ dom.velocity({translateX:'5%'}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({translateX:"0"}, { queue: reverse_effect,duration: duration }) }else{ dom.velocity({translateX:'5%'}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity("reverse") } }) } $.WOPOP_EFFECTS['effect.movetop']=function(dom,options,hover){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ if(hover==1){ dom.velocity({translateY:'-5%'}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({translateY:'0'}, { queue: reverse_effect,duration: duration }) }else{ dom.velocity({translateY:'-5%'}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity("reverse") } }) } $.WOPOP_EFFECTS['effect.movebottom']=function(dom,options,hover){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ if(hover==1){ dom.velocity({translateY:'5%'}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({translateY:'0'}, { queue: reverse_effect,duration: duration }) }else{ dom.velocity({translateY:'5%'}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity("reverse") } }) } $.WOPOP_EFFECTS['effect.rotation']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); $.Velocity.hook($(dom), "rotateY", "180deg"); _getEffectDom(dom).done(function(dom){ dom.velocity({rotateY:["0deg","180deg"]}, {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['effect.bounce']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); $(dom).show(); _getEffectDom(dom).done(function(dom){ dom.velocity("callout.bounce", {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['effect.shake']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ dom.velocity("callout.shake", {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['effect.flash']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ dom.velocity("callout.flash", {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['effect.pulse']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ dom.velocity("callout.pulse", {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['effect.swing']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ dom.velocity("callout.swing", {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) }) } $.WOPOP_EFFECTS['effect.tada']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ dom.velocity("callout.tada", {delay:0,duration: duration,display: "block",easing:'ease',begin:create_begin(),complete:create_complete(options)}) }) } //transition.fadeIn $.WOPOP_EFFECTS['effect.fade']=function(dom,options,hover){ var reverse_effect=options['effect']+'reverse'; var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); _getEffectDom(dom).done(function(dom){ if(hover==1){ dom.velocity("transition.fadeIn", { duration: duration }) .velocity("transition.fadeOut", { queue: reverse_effect,duration: duration }) }else{ dom.velocity("transition.fadeIn", { duration: duration }).velocity("reverse",{delay:500}); } }) } $.WOPOP_EFFECTS['effect.slidedown']=function(dom,options,hover){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ var domtop=parseInt(dom.css('top')); var lasttop=''; if(domtop){ lasttop=domtop; }else{ lasttop=0; } var $top=$(dom).height(); $(dom).css('top','-'+$top+'px'); if(hover==1){ dom.velocity({top:0}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({top:-$top}, { queue: reverse_effect,duration: duration }) }else{ dom.velocity({top:0}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({top:-$top},{delay:600} ) } }) } $.WOPOP_EFFECTS['effect.slidetop']=function(dom,options,hover){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ var $top=$(dom).height(); var org_top = $(dom).attr('data-top'); if(!org_top){org_top=0;} if(hover==1){ $(dom).css('top',$top+'px'); dom.velocity({top:org_top}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({top:$top}, { queue: reverse_effect }) }else{ $(dom).css('top',$top+'px'); dom.velocity({top:org_top}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({top:$top},{delay:600}) } }) } $.WOPOP_EFFECTS['effect.slideleft']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ var $left=$(dom).width(); $(dom).css('left','-'+$left+'px'); dom.velocity({left:0}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({left:-$left}, { queue: reverse_effect }) }) } $.WOPOP_EFFECTS['effect.slideright']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; _getEffectDom(dom).done(function(dom){ var $left=$(dom).width(); $(dom).css('left',$left+'px'); dom.velocity({left:0}, {delay:0,duration: duration,display: "block",easing:'ease-in',begin:create_begin(),complete:create_complete(options)}) .velocity({left:$left}, { queue: reverse_effect }) }) } $.WOPOP_EFFECTS['shutter.horizontal']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; $.Velocity.hook($(dom), "transformOriginX", [ "50%", "50%" ]); $.Velocity.hook($(dom), "scaleX", 0); _getEffectDom(dom).done(function(dom){ dom.velocity({scaleX: 1}, {delay:0,duration: duration,display: "block",easing:'ease-out',begin:create_begin(),complete:create_complete(options)}) .velocity({scaleX:0}, { queue: reverse_effect }) }) } $.WOPOP_EFFECTS['shutter.vertical']=function(dom,options){ var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1); var reverse_effect=options['effect']+'reverse'; $.Velocity.hook($(dom), "transformOriginY", [ "50%", "50%" ]); $.Velocity.hook($(dom), "scaleY", 0); _getEffectDom(dom).done(function(dom){ dom.velocity({scaleY: 1}, {delay:0,duration: duration,display: "block",easing:'ease-out',begin:create_begin(),complete:create_complete(options)}) .velocity({scaleY: 0}, { queue: reverse_effect }) }) } //新增缩放动画 $.WOPOP_EFFECTS['callout.scale']=function(dom,options){ var type = dom.attr('type'); var cont = dom.find('.wp-'+type+'_content'); var delay = $.WOPOP_EFFECTS._parseNum(options['delay'],1); var duration = $.WOPOP_EFFECTS._parseNum(options['duration'],1); var zoom = $.WOPOP_EFFECTS._parseNum(options['zoom'],2); dom.css('overflow','hidden'); dom.show(); $.Velocity.hook($(cont), "scale", zoom); _getEffectDom(dom).done(function(dom){ cont.velocity({scale:[1,zoom]},{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease-in',complete:create_complete(options)}) }) } var effect_map = 'callout.bounce,callout.shake,callout.flash,callout.pulse,callout.swing,callout.tada,'; effect_map += 'transition.flipBounceXOut,transition.flipBounceYOut,transition.whirlOut,transition.shrinkOut,transition.perspectiveLeftOut,'; effect_map += 'transition.expandOut,transition.bounceOut,transition.slideUpBigOut,transition.slideDownBigOut,transition.perspectiveRightOut,'; effect_map += 'transition.slideLeftBigOut,transition.slideRightBigOut,transition.perspectiveUpOut,transition.perspectiveDownOut'; $.each(effect_map.split(','), function(i, effect_name){ $.WOPOP_EFFECTS[effect_name] = function(dom, options){ var delay = $.WOPOP_EFFECTS._parseNum(options['delay'], 1); var duration = $.WOPOP_EFFECTS._parseNum(options['duration'], 1); var l = 0,loop = $.WOPOP_EFFECTS._parseNum(options['loop'], 0), loop_infinite = $.WOPOP_EFFECTS._parseNum(options['loop_infinite'], 0); _getEffectDom(dom).done(function(dom){ (function(){ var self = arguments.callee; dom.velocity(effect_name, { delay: (delay * 1000),duration: (duration * 1000), display: 'block',complete: function(){ if (loop_infinite ? true : l < loop) self(); else create_complete(options).call(this); l++; } }); })(); }); }; }); function create_complete(effects){ //返回conplete函数 return function(){ var dom=$(this); //缩放动画,this是layer的子元素content,所以这里要取其父元素,否则同插件的图片特效会出问题 if (effects.effect == 'callout.scale') { dom = dom.parent(); } $(dom).data('run',0); if(dom.data('wopop_effect_oristyle')){ dom.attr('style',dom.data('wopop_effect_oristyle')).show(); dom.removeData('wopop_effect_oristyle'); } dom.trigger('effect_complete'); dom.removeClass('now_effecting'); var cancontainer=$('#overflow_canvas_container'); if(cancontainer.length){ var stacks=cancontainer.data('stacks'); if(stacks && stacks.length){ var newstacks=[]; for(var i=0;i'; if(imgsrc == ''){ imgexit = ''; } self.after('
    ' + imgexit+'
    '); } self = self.siblings('#imgmask'); } if(imgeffects.effectrole=='content'){ var opacity=(1-(imgeffects.opacity)/100).toFixed(2); var colorval=imgeffects.popcolor,colorrgb=$.WOPOP_EFFECTS.colorRgb(colorval); var bgcolor = ''; if(colorrgb[1] == 'gradient'){ bgcolor = gradientHandler(colorrgb,opacity); }else{ bgcolor = 'rgba('+colorrgb[0]+','+colorrgb[1]+','+colorrgb[2]+','+opacity+')'; } var t_top=imgeffects.top,c_top=imgeffects.ctop; var clineheight = imgeffects.clineheight; var cmarginleft = imgeffects.cmarginleft; var cmarginright = imgeffects.cmarginright; var lineheight = imgeffects['line-height']; var marginleft = imgeffects['margin-left']; var marginright = imgeffects['margin-right']; var t_align=imgeffects['text-align'],c_align=imgeffects['ctext-align']; var t_weight=imgeffects['font-weight'],c_weight=imgeffects['cfont-weight']; var t_decoration=imgeffects['text-decoration'],c_decoration=imgeffects['ctext-decoration']; var t_family=imgeffects['font-family'],c_family=imgeffects['cfont-family']; var t_fontsize=imgeffects['font-size'],c_fontsize=imgeffects['cfont-size']; var cfontcolor=imgeffects['ccolor'],tfontcolor=imgeffects['color']; var twordcount=imgeffects['titlecount'],cwordcount=imgeffects['contentcount']; if(imgeffects.type=="tb_product_list" || imgeffects.type=="product_list" || imgeffects.type=="seckill_list" || imgeffects.type=="groupon_list" || imgeffects.type=="jfpro_list"){ self.each(function(){ var width = self.width()+2,height=self.height()+2; var imgparent = $(this).closest('li'); var effecttitle = $(this).attr('alt'); var effectcontent = imgparent.find('.product_desc').data('desc'); if(twordcount){ effecttitle=subString(effecttitle,twordcount); } if(cwordcount){ effectcontent=subString(effectcontent,cwordcount); } var myoffset=$(this).offset(); var myoffsetparent=$(this).offsetParent(); if(myoffset && myoffsetparent.length){ offsetleft=myoffset.left-myoffsetparent.offset().left; if(offsetleft<0) offsetleft=0; } var img_div = $(this).closest('.img'); var imgmask_top = (img_div.outerHeight()-height)/2; if(!$(this).siblings('#imgmask').length) { $(this).after('
    ' + '
    '+effecttitle+'
    ' + '
    '+effectcontent+'
    '); } }); } if(imgeffects.type=='article_list'){ self.each(function(){ var imgparent = $(this).closest('li'); var effecttitle = imgparent.find("input[class=articleid]").data('title'); var effectcontent = imgparent.find("input[class=abstract]").data('desc'); if(twordcount){ effecttitle=subString(effecttitle,twordcount); } if(cwordcount){ effectcontent=subString(effectcontent,cwordcount); } if(!$(this).siblings('#imgmask').length) { $(this).after('
    ' + '
    '+effecttitle+'
    ' + '
    '+effectcontent+'
    '); } }); } if(imgeffects.type=='media' || imgeffects.type=='graphic'){ var effecttitle=imgeffects.titledesc,effectcontent=imgeffects.contentdesc; effecttitle = effecttitle.replace(/\n/g,"
    "); effectcontent = effectcontent.replace(/\n/g,"
    "); if(!self.siblings('#imgmask').length){ self.after('
    ' + '
    '+effecttitle+'
    ' + '
    '+effectcontent+'
    '); } } self = self.siblings('#imgmask'); } if(imgeffects.effectrole=='title'){ var opacity=(1-(imgeffects.opacity)/100).toFixed(2); var colorval=imgeffects.popcolor,colorrgb=$.WOPOP_EFFECTS.colorRgb(colorval); var bgcolor='rgba('+colorrgb[0]+','+colorrgb[1]+','+colorrgb[2]+','+opacity+')'; var t_align=imgeffects['text-align'],t_weight=imgeffects['font-weight'],t_decoration=imgeffects['text-decoration'],t_fontsize=imgeffects['font-size'],t_family=imgeffects['font-family']; var tfontcolor=imgeffects['color']; var titlecount=imgeffects['titlecount']; if(imgeffects.type=="tb_product_list" || imgeffects.type=="product_list" || imgeffects.type=="seckill_list" || imgeffects.type=="groupon_list" || imgeffects.type=="jfpro_list"){ self.each(function(){ var imgparent = $(this).closest('li'); var effecttitle = $(this).attr('alt'); if(titlecount){ effecttitle=subString(effecttitle,titlecount); } var marginLeft=0; if(imgeffects.type=="tb_product_list"){var marginLeft=1}else{marginLeft=0} var heigth=$(this).height()+1; var width=$(this).width(); var popheight=imgeffects.popheight; var margintop=heigth-popheight; if(imgeffects.type=="product_list"){ var p_width = imgparent.find(".img").width()||$(this).width(); var p_height = imgparent.find(".img").height()||$(this).height(); marginLeft= (p_width-width)/2; margintop= (p_height-popheight); } if(!$(this).siblings('#imgmask').length) { $(this).after('
    ' + '
    '+effecttitle+'
    '); } }); } if(imgeffects.type=='article_list'){ self.each(function(){ var heigth=$(this).height(); var popheight=imgeffects.popheight; var margintop=heigth-popheight; var imgparent = $(this).closest('li'); if(imgparent.find("input[class=articleid]").length){ var effecttitle = imgparent.find("input[class=articleid]").data('title'); }else{ var effecttitle = imgparent.find("a.articleid img").attr('alt'); } if(titlecount){ effecttitle=subString(effecttitle,titlecount); } if(!$(this).siblings('#imgmask').length) { $(this).after('
    ' + '
    '+effecttitle+'
    '); } }); } if(imgeffects.type=='media' || imgeffects.type=='graphic'){ var effecttitle=imgeffects.contentdesc; if(!self.siblings('#imgmask').length){ var heigth=self.closest("div.img_over").height()+4; var width=self.width(); var popheight=imgeffects.popheight; var margintop=heigth-popheight; self.after('
    ' + '
    '+effecttitle+'
    '); } } self = self.siblings('#imgmask'); } if(infixedparentel.length){ if(infixedparentel.parent().is('#canvas')&&parseInt(infixedparentel.css('top'))==0){ return; } if(self.is('.now_effecting')) return; } if($.WOPOP_EFFECTS[imgeffects.effect] && browsersupport){ self.addClass('now_effecting'); if(!$.wismobiles&&self.closest('#canvas').length ){ _getEffectDom(self).done(function(){ var cancontainer=$('#overflow_canvas_container'); if(cancontainer.length){ var stacks=cancontainer.data('stacks'); if(!stacks) stacks=[]; if(!cancontainer.data('is_overflow')){ var canh=$('#canvas').outerHeight(); //cancontainer.css('overflow-y','hidden').css('height',canh+'px').data('is_overflow',true); cancontainer.css('height',canh+'px').data('is_overflow',true); var timer=setInterval(function(){ if(cancontainer.data('is_overflow')){ var nowcanh=$('#canvas').outerHeight(); if(nowcanh != canh){ canh=nowcanh; cancontainer.css('height',canh+'px'); } }else{ clearInterval(timer); } },1000); } stacks.push(self); cancontainer.data('stacks',stacks); } }) } $.WOPOP_EFFECTS[imgeffects.effect](self,imgeffects,hover); }else{ self.show(); } if(imgeffects.type=='media' && imgeffects.effectrole =='dantu'){ var leavedom=self; if(self.closest('.cstlayer').data('iseffectrotate')) leavedom=self.closest('.cstlayer'); }else if(imgeffects.type=='media' && imgeffects.effectrole !='dantu'){ var leavedom=self.parent(); if(self.closest('.cstlayer').data('iseffectrotate')) leavedom=self.closest('.cstlayer'); }else{ var leavedom=self.parent(); } // if(imgeffects.type=='media' && imgeffects.effectrole=='title'){ // var leavedom=self.parent(); // } // if(imgeffects.type=='media' && imgeffects.effect=='effect.big2small'){ // var leavedom=self.parent(); // } leavedom.mouseleave(function(){ var queue=imgeffects.effect+'reverse'; // self.velocity("stop"); self.velocity("finish"); self.data('run',0); self.dequeue(queue); if(imgeffects.effectrole !='dantu'){ setTimeout(function () { self.remove(); }, imgeffects.duration); }else{ self.data('over',''); } }); } } } $.fn.wopop_effect_command=function(command,args){ if(command=='stop'){ return this.each(function() { stop_effect($(this)); }); } } $.WOPOP_EFFECTS._parseNum=function(num,orival){ if(num==0) return 0; return num || orival; } function gradientHandler(colorrgb, opacity) { var rgbRegex = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/g; bgcolor = colorrgb[0][0]; var colorArr = bgcolor.match(rgbRegex); for(var i = 0; i < colorArr.length; i++){ var tempStr = colorArr[i]; var colorStr = tempStr.substr(0,tempStr.length - 1); colorStr = colorStr + ", " + opacity + ")"; bgcolor = bgcolor.replace(tempStr,colorStr); } bgcolor = bgcolor.replace(/rgb/g,"rgba"); var ua = window.navigator.userAgent; if(ua.indexOf('Edge') > 0 || ua.indexOf('Trident') > 0){ bgcolor = bgcolor.replace("-webkit-linear-gradient","-ms-linear-gradient"); } return bgcolor || ''; } function stop_effect(dom){ dom.velocity("stop", true); if(dom.data('wopop_effect_oristyle')) { $.Velocity.hook($(dom), "scale", "1"); $.Velocity.hook($(dom), "rotateY", "0deg"); var deg=dom.data('deg')||0; $.Velocity.hook($(dom), "rotateZ", deg+"deg"); dom.attr('style',dom.data('wopop_effect_oristyle')); } // if(dom.data('wopop_effect_oristyle')) console.log(dom,dom.data('wopop_effect_oristyle')) dom.removeData('wopop_effect_oristyle'); dom.removeClass('now_effecting'); dom.trigger('effect_complete'); var cancontainer=$('#overflow_canvas_container'); if(cancontainer.length){ var stacks=cancontainer.data('stacks'); if(stacks && stacks.length){ var newstacks=[]; for(var i=0;i dom.ab_pos_cnter('top');//parseInt(dom.css('top')); } function subString(str, len, hasDot) { //strip html tag var regex = /(<([^>]+)>)/ig str = str.replace(regex, ""); var newLength = 0; var hasDot=1; var newStr = ""; var chineseRegex = /[^\x00-\xff]/g; var singleChar = ""; var strLength = str.replace(chineseRegex,"**").length; for(var i = 0;i < strLength;i++) { singleChar = str.charAt(i).toString(); if(singleChar.match(chineseRegex) != null) { newLength += 1; } else { newLength++; } if(newLength > len) { break; } newStr += singleChar; } if(hasDot && strLength > len) { newStr += "..."; } return newStr; } $.WOPOP_EFFECTS.colorRgb=function(orival){ if ($.isArray(orival) == true){ return [orival,'gradient']; }else{ var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var sColor = orival.toLowerCase(); if(sColor && reg.test(sColor)){ if(sColor.length === 4){ var sColorNew = "#"; for(var i=1; i<4; i+=1){ sColorNew += sColor.slice(i,i+1).concat(sColor.slice(i,i+1)); } sColor = sColorNew; } //处理六位的颜色值 var sColorChange = []; for(var i=1; i<7; i+=2){ sColorChange.push(parseInt("0x"+sColor.slice(i,i+2))); } return sColorChange; }else{ return sColor; } } } $.WOPOP_EFFECTS._hasEffectFilter=function(){ var self=$(this); if(self.attr('deleted')=='deleted') return false; var effects=self.data('wopop_effects'); if(effects&&effects.effect){ return true; } return false; } $.WOPOP_EFFECTS._isEditMode=function(){ if($.saveLayout&&$.isFunction($.saveLayout.save)) return true; return false; } var curfullpageindex; $.WOPOP_EFFECTS._setindex=function(index){ curfullpageindex=index; } $.WOPOP_EFFECTS._getindex=function(){ return curfullpageindex; } var effectparams={ fromleft:{delay:0,duration:1.20}, frombottom:{delay:0,duration:1.20}, fromright:{delay:0,duration:1.20}, fromtop:{delay:0,duration:1.20}, fade:{delay:0,duration:0.90}, rotation:{delay:0,duration:1.20}, rotation2d:{delay:0,duration:1.20}, bounceIn:{delay:0,duration:2.20}, big2small:{delay:0,duration:1.20}, small2big:{delay:0,duration:1.20}, fadeFromLeft:{delay:0,duration:1.20}, fadeFromBottom:{delay:0,duration:1.20}, fadeFromRight:{delay:0,duration:1.20}, fadeFromTop:{delay:0,duration:1.20}, light:{delay:0,duration:1.20} } $.WOPOP_EFFECTS._getDefaultParam=function(effectname){ var opts=effectparams[effectname]; if(!opts) opts={delay:0,duration:1.20} return opts; } })(window); ; function fullpagefooterinit(){ $('.fullpage_alllist').each(function(){ if($('.full_column:not([deleted="deleted"])').length > 0){ wp_alert(translate('full_column.already in backplane')); } }) $('.full_pagescroll').each(function(){ fullpagescrollinit($(this)); }) //点亮滚亮操作 $(document).bind('fullpage_scroll_pro',function(e,section){ setTimeout(function(){ if($('#wp-property_settings2').length){ var index=''; $('#canvas #fullPage-nav li').each(function(e){ }) $('.fullpage_alllist .section').each(function(e){ if($(this).hasClass('active')) index = e + 1; }) if(index>0){ $('#all_extra_img_div .wp-manage-panel-album-img').each(function(i){ var j = i + 1; if(j==index) $(this).addClass('action'); else $(this).removeClass('action'); }) } } },100) }) } function fullpagescrollinit(dom){ dom.children('.full_width').css({left:0-canv.offset().left-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()}); dom.wp_rightkey(); if(dom.is(':not(.isplate)')){ fullpagescrollresize(dom); setTimeout(function(){ fullpagescrolldrop(dom); },1300); } } function fullpagescrolldrag(dom){ dom.wp_drag(); } function fullpagescrollresize(dom){ var createhandlefunc=function(handle){ dom.each(function(){ var hname = 'ui-resizable-'+handle; var axis = $('

    '); axis.css({zIndex: 1000}); $(this).children('.full_width').append(axis); }) } var createplaceholderfunc=function(handle){ dom.each(function(){ var hname = 'placeholder-'+handle; var axis = $('
    '); axis.css({zIndex: 1000}).hide(); $(this).children('.full_width').append(axis); }) } createhandlefunc('n'); createhandlefunc('s'); createplaceholderfunc('w'); createplaceholderfunc('e'); var fullpagescrollbuttompos; dom.resizable({ handles: {n: '>.full_width .ui-resizable-n',s: '>.full_width .ui-resizable-s'}, noinit:true, canvascontain: '#canvas', distance: 0, concernLock:true, scroll: true, create:function(){ $(this).children('.full_width').find('.ui-resizable-handle').hide(); }, start: function(event, ui){ fullpagescrollbuttompos=$.getFullColChildMaxButtomfullpage(dom); var self=$(this); var resizeundo=new ResizeCommand(self.attr('id')); var oldcssarr=['top','height']; var oldval={}; for(var i=0;i
    '); axis.css({zIndex: 1000}); $(this).children('.full_content').append(axis); }) } createplaceholderfunc('n'); createplaceholderfunc('s'); createplaceholderfunc('w'); createplaceholderfunc('e'); var contentblock=dom.children('.full_content'); contentblock.children('.li-placeholder').hide(); contentblock.children('.placeholder-n').css({'border-top':'#FF9900 dashed 4px'}); contentblock.children('.placeholder-s').css({'border-bottom':'#FF9900 dashed 4px'}); contentblock.children('.placeholder-e').css({'border-right':'#FF9900 dashed 4px'}); contentblock.children('.placeholder-w').css({'border-left':'#FF9900 dashed 4px'}); contentblock.droppable({ tolerance: 'pointer', accept:'.full_pagescroll,.cstlayer,.wp-new-tool-second-link,.wp-manage-plugin-block',//fullpage拖拽即时响应 drop: function( event, ui ) { var draggable = $.ui.ddmanager.current; //弹窗容器以及弹窗容器内的子插件在拖拽时不放在全屏滚动中 if ($(draggable.element).attr('type') == 'pop_up' || $(draggable.element).parents('.cstlayer').attr('type') == 'pop_up') { return; } if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){ if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){//fullpage拖拽即时响应 $(this).children('.li-placeholder').hide(); var existcolumn=$(document).data('layer_final_drop_id'); var biggercolumn=$.chooseBiggerColumn(existcolumn,dom.attr('id')); $(document).data('layer_final_drop_id',biggercolumn); } } }, over: function(event, ui){ //判断是否包含锁定元素 var has_layer_lock=false; $('.ui-modselected').each(function(){ if($(this).data('cstlayerstatus') == 'unlock' ){ has_layer_lock=true; } }); if(has_layer_lock) return; var draggable = $.ui.ddmanager.current; if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom) ||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){//fullpage拖拽即时响应 if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){//fullpage拖拽即时响应 var thisid=dom.attr('id'); var existid=$(document).data('layer_drop_over_id'); if(thisid != existid){ var biggerid=$.chooseBiggerColumn(existid,thisid); if(biggerid == thisid){ var $this=$(this); $(this).children('.li-placeholder').show(); if(existid){ var existcolumnel = $('#'+existid); var dropobj=existcolumnel.children('.full_content').data('droppable'); dropobj['isover'] = 0; dropobj['isout'] = 1; dropobj._out.call(dropobj, event); } $(document).data('layer_drop_over_id', thisid); }else{ var dropobj1=$(this).data('droppable'); dropobj1['isover'] = 0; dropobj1['isout'] = 1; } } } } }, out: function(event, ui){ //判断是否包含锁定元素 var has_layer_lock=false; $('.ui-modselected').each(function(){ if($(this).data('cstlayerstatus') == 'unlock' ){ has_layer_lock=true; } }); if(has_layer_lock) return; var draggable = $.ui.ddmanager.current; if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){ if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){//fullpage拖拽即时响应 $(this).children('.li-placeholder').hide(); var curoverid=$(document).data('layer_drop_over_id'); if(curoverid == dom.attr('id')) $(document).removeData('layer_drop_over_id'); } } } }); } function full_page_block_drop(contentBlock){ var dom=contentBlock.closest('.full_pagescroll'); contentBlock.droppable({ tolerance: 'pointer', accept:'.full_pagescroll,.cstlayer,.wp-new-tool-second-link,.wp-manage-plugin-block',//fullpage拖拽即时响应 drop: function( event, ui ) { var draggable = $.ui.ddmanager.current; if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){ if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){ $(this).children('.li-placeholder').hide(); var existcolumn=$(document).data('layer_final_drop_id'); var biggercolumn=$.chooseBiggerColumn(existcolumn,dom.attr('id')); $(document).data('layer_final_drop_id',biggercolumn); } } }, over: function(event, ui){ //判断是否包含锁定元素 var has_layer_lock=false; $('.ui-modselected').each(function(){ if($(this).data('cstlayerstatus') == 'unlock' ){ has_layer_lock=true; } }); if(has_layer_lock) return; var draggable = $.ui.ddmanager.current; if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom) ||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){ if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){ var thisid=dom.attr('id'); var existid=$(document).data('layer_drop_over_id'); if(thisid != existid){ var biggerid=$.chooseBiggerColumn(existid,thisid); if(biggerid == thisid){ var $this=$(this); $(this).children('.li-placeholder').show(); if(existid){ var existcolumnel = $('#'+existid); if(!existcolumnel.is('.wp_droppable')){ var dropobj=existcolumnel.children('.full_content').data('droppable'); }else{ var dropobj=existcolumnel.children('.drop_box').data('droppable'); } dropobj['isover'] = 0; dropobj['isout'] = 1; dropobj._out.call(dropobj, event); } $(document).data('layer_drop_over_id', thisid); }else{ var dropobj1=$(this).data('droppable'); dropobj1['isover'] = 0; dropobj1['isout'] = 1; } } } } }, out: function(event, ui){ //判断是否包含锁定元素 var has_layer_lock=false; $('.ui-modselected').each(function(){ if($(this).data('cstlayerstatus') == 'unlock' ){ has_layer_lock=true; } }); if(has_layer_lock) return; var draggable = $.ui.ddmanager.current; if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){ if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){ $(this).children('.li-placeholder').hide(); var curoverid=$(document).data('layer_drop_over_id'); if(curoverid == dom.attr('id')) $(document).removeData('layer_drop_over_id'); } } } }); } function fullpagescroll_propblk_init(){ var lvtimer; for(var key in $.fullpagebackgroundPropDefaults){ (function(){ var curkey=key; var otherfunc=null; if(false){ var innertxt ='', lvtype = ''; switch(curkey){ case 'fullpage_moveto_prevop': lvtype = 'top'; innertxt = ''; break; case 'fullpage_moveto_nextop': lvtype = 'bottom'; innertxt = ''; break; } otherfunc={ mousedown:function(){ var $target = $(this) var apos =$target.offset(); var scrollctner=$('#scroll_container'); var scrolltop=scrollctner.scrollTop(); $(innertxt).appendTo(scrollctner).css({ top: function(){ return (apos.top+scrolltop - 25-39)+'px' },left: apos.left+'px' }).click(function(e){ $('#'+$.bgselectedid).wp_setorder(lvtype,$.bgselectedid); $(this).remove(); $target.removeClass('local'); e.preventDefault(); }); }, mouseup:function(){ } } } $('#'+curkey).mousedown(function(e){ var $target = $(this); $target.addClass('local'); if($('.wp-moveto_fstlevel,.wp-moveto_lstlevel').size()) $('.wp-moveto_fstlevel,.wp-moveto_lstlevel').remove(); if(otherfunc != null){ otherfunc.mousedown.apply(this); } e.preventDefault(); }).mouseup(function(e){ var self = this,$target = $(self); $target.removeClass('local'); $.fullpagebackgroundPropDefaults[curkey].apply(this); if(otherfunc != null){ otherfunc.mouseup.apply(this); } e.preventDefault(); }) })(); } } (function($){ function fullpagegetAllParents(el){ var parents={}; parents[el.prop('id')]='null'; var curel=el; while(true){ var parentid=$.getElementFatherid(curel); if(parentid =='none') break; parents[parentid]=curel.prop('id'); curel=$('#'+parentid); } return parents; } $.chooseBiggerColumn=function(existcolumnid,newcolumnid){ var biggercolumnid=newcolumnid; if(existcolumnid==newcolumnid) return biggercolumnid; if(existcolumnid){ var existcolumnel=$('#'+existcolumnid); var newcolumnel=$('#'+newcolumnid); var existcolumnfathers=fullpagegetAllParents(existcolumnel); var newcolumnfathers=fullpagegetAllParents(newcolumnel); var rootid='canvas'; if(!existcolumnfathers[rootid]) rootid='site_footer'; var existdifffather=rootid; var newdifffather=rootid; while(existdifffather == newdifffather){ existdifffather =existcolumnfathers[existdifffather]; newdifffather =newcolumnfathers[newdifffather]; if(existdifffather=='null' || newdifffather=='null') break; } if(existdifffather=='null') biggercolumnid=newcolumnid; else if(newdifffather=='null') biggercolumnid=existcolumnid; else{ var existfatherzindex=$.parseInteger($('#'+existdifffather).css('z-index')); var newfatherzindex=$.parseInteger($('#'+newdifffather).css('z-index')); if(existfatherzindex > newfatherzindex) biggercolumnid=existcolumnid; } } return biggercolumnid; } $.transferToColumn=function(dom,fathercolid){ var oldfatherid=$.getElementFatherid(dom); if(oldfatherid!=fathercolid){ var newfatherel=$('#'+fathercolid); var domabpos=dom.ab_pos('top'); var newfatherabpos=newfatherel.ab_pos('top'); var domableft=dom.ab_pos('left'); var newfatherl=newfatherel.ab_pos('left'); var contentblock=newfatherel; if(fathercolid!='canvas'){ if(newfatherel.is('.wp_droppable')){ contentblock=newfatherel.children('.drop_box'); }else contentblock=newfatherel.children('.full_content'); } dom.detach().attr('fatherid',fathercolid).css({'top':(domabpos-newfatherabpos),'left':(domableft-newfatherl)}).appendTo(contentblock); if(fathercolid=='site_footer'||fathercolid=='canvas') dom.removeAttr('fatherid'); } } $.getElementAreaInf=function(dom){ return dom.attr('inbuttom')=='1'?'site_footer':'canvas'; } $.addFullPagescroll=function(top){ if($.wisplate){ wp_alert(translate('fullpage.plate do not support add')); return false; } if($('.fullpage_alllist:not([deleted="deleted"])').length > 0){ wp_alert(translate('fullpage.already plugin')); return false; } if($('.cstlayer[type="mads"]:not([deleted="deleted"])').length>0){ wp_alert(translate('Multi-filter and fullpage.already plugin')); return false; } if($('.full_column:not([deleted="deleted"])').length > 0){ wp_alert(translate('full_column.already Please remove')); return false; } //存在页脚元素时移除处理 setTimeout(function(){ if($('#site_footer').length > 0){ var fullpageClass='fullpage'; if($.wismobiles) fullpageClass='mfullpage'; if (confirm(translate('fullpage.Please hide site_footer'))) { $.post(parseToURL(fullpageClass,"prosf"), {pid:$.page_id},function(response){ var o_result = $.parseJSON(response); if(o_result.result == "OK") { $('#site_footer').remove(); }else{ locations.reload(); return false; } }).error(function() { locations.reload(); return false; }); }else{ return false; } } },500) var successfunc=function(resp,needchangeid){ var fullpagescrollhtml=resp; if(needchangeid){ var fullpagescrollels=$(fullpagescrollhtml).filter('.full_pagescroll'); var nowid=fullpagescrollels.prop('id'); var newid='layer'+fGuid(); fullpagescrollhtml=fullpagescrollhtml.replace(new RegExp(nowid,"g"),newid); } var fullpagescrollel=$(fullpagescrollhtml).appendTo('#canvas'); fullpagescrollel.find('.full_pagescroll').each(function(){ fullpagescrollinit($(this)); }) //初始化加截 默认模块内,内容模块加载样式 fullpagescrollel.css('z-index',100); var titlecss=relativeToAbsoluteURL('plugin/title/css/title.css'); if($('body').data('title') !=titlecss){ $('body').data('title',titlecss); var head = document.getElementsByTagName('head').item(0); var css = document.createElement('link'); css.href = titlecss; css.rel = 'stylesheet'; css.type = 'text/css'; head.appendChild(css); } $('.ui-modselected').each(function(){ $.hidWidgetBorder($(this)); // 图文模块相关 2012/2/14 if($(this).hasClass('graphic_edited')) actived_graphic(); }); $.fullpageunselectbgdiv(fullpagescrollel); //显示属性 初始显示属性.ui-modselected绑定至第一屏上.再根id .fullpage_alllist初始存在问题 $.fullpageselectbgdiv(fullpagescrollel.find('.full_pagescroll:eq(0)')); new AddCommand(fullpagescrollel.prop('id')).insert(); var objarray=new Array(); objarray[0]=new Array(parseInt($('#'+fullpagescrollel.prop('id')).css('z-index')),fullpagescrollel.prop('id')); $.zindexsort_new(objarray); } //使用缓存有问题 停用 if($.addFullPagescroll.html_cache){ successfunc($.addFullPagescroll.html_cache,true); return; } $.ajax({ type: "GET", url: parseToURL("wp_widgets","gtfullpagescroll"), success: function(response){ successfunc(response,false); }, error: function(xhr, textStatus, errorThrown){ wp_alert((errorThrown||textStatus)+"(add a fullpagescroll).
    "+translate("Request failed!")); return false; } }); } $.curSelectableFather=function(){ var selmods=$('.ui-modselected'); if(selmods.length==0){ $(document).data('cur_selectable_father',null); return null; }else{ var fatherid=$.getElementFatherid(selmods.filter(':first')); $(document).data('cur_selectable_father',fatherid); return fatherid; } } $.getElementFatherid=function(dom){ if(dom.prop('id')=='canvas'||dom.prop('id')=='site_footer') return 'none'; var fatherid=dom.attr('fatherid'); if(!fatherid||fatherid==''){ if(dom.closest('#canvas').length>0){ fatherid='canvas'; }else if(dom.closest('#site_footer').length>0){ fatherid='site_footer'; } } if(!$('#'+fatherid).length){ if(dom.closest('#canvas').length>0){ fatherid='canvas'; }else if(dom.closest('#site_footer').length>0){ fatherid='site_footer'; } dom.removeAttr('fatherid'); } return fatherid; } $.getFullColChildMaxButtomfullpage=function(dom){ var parenttoppos=dom.ab_pos_cnter('top'); var maxbuttompos=parenttoppos; dom.find('.cstlayer,.full_pagescroll').each(function(){ var el=$(this); var buttompos=0; if(el.hasClass('cstlayer')) buttompos=$.divrotate.getDegreeModMaxPoint(el,null,'buttom'); else buttompos=el.ab_pos_cnter('top')+$.parseInteger(el.css('height')); if(maxbuttomposimgw/imgh){ var theimgh=imgh*w/imgw $img.css({top:Math.ceil((h-theimgh)/2),left:0,width:w,height:'auto'}); }else{ var theimgw=imgw*h/imgh; $img.css({top:'0px',left:Math.ceil((w-theimgw)/2),width:'auto',height:h}); } } $img.css("position", 'relative');// fixed bug#4459 if(!originalSize || !originalSize.width){ var imgsrc=$img.prop('src'); var imgcache=$('#canvas').data('fullpage_imgcache') if(imgcache && imgcache[imgsrc]){ originalSize=imgcache[imgsrc]; func() }else{ var imgel=new Image() originalSize={width:0,height:0} imgel.onload=function(){ originalSize.width=imgel.width originalSize.height=imgel.height; if(!imgcache) imgcache={}; imgcache[imgsrc]=$.extend({},originalSize) $('#canvas').data('fullpage_imgcache',imgcache) func() } imgel.src=imgsrc } }else{ setTimeout(function(){ func() },0) } })(originalSize) }) } //判断浏览(PC|手机) $.wp_fullpag_mobiles=function(){ return (/iphoness|ipods|ipads|Macintosh|androids|Windows phones/i.test(navigator.userAgent.toLowerCase())); } $.wp_fpsjs_weixin=function(){ return (/micromessenger/i.test(navigator.userAgent.toLowerCase())); } $.wp_fpsjs_pad=function(){ return (/iphoness|ipods|ipads/i.test(navigator.userAgent.toLowerCase())); } //初始化resize 第一屏自适应处理 手机预览,编辑不处理 setTimeout(function(){ if($.wismobiles&&$.wisviewmode){}else{ var maxjson = {width:320,height:$(window).height()}; if(!$.wiseditmode){ maxjson = {width:$(window).width(),height:$(window).height()}; var fullnode = $('.fullpage_alllist'); var $paragraph_image = fullnode.find('.section.active .bg > img'); var json = {width:0,height:0}; $.wp_fullpagezoom(fullnode,maxjson,json,'noresize'); } } },800); })(jQuery); /* * To change this template, choose Tools | Templates * and open the template in the editor. */ function WaterfallsFlow(parDom,chdDom,options,befCallback,endCallback){ var uldom = parDom; var lidom = chdDom; var mar_right = parseInt(lidom.css("margin-right")) var colCount =0; //定义列数 var colHeightArry= [] //定义列高度数组 var liWidth = lidom.outerWidth(true) //子的宽度 var ulWidth = uldom.width(); //父的宽度 var modfalse = 0; //最右边边距设置判断 var tops = 0; //初始上间距 var lefts = 0; //初始左边间距 if(options && options.top) tops = options.top; if(options && options.left) lefts = options.left; if(befCallback && $.isFunction(befCallback)) befCallback(); colCount = ulWidth/liWidth //计算出列数 colCountfat = parseInt(colCount); if(colCount>colCountfat){ colCount = colCountfat; if( liWidth*(colCountfat + 1) - mar_right <= ulWidth ){ colCount = colCount+1 modfalse = 1 } } var colHeight = []; for(var i = 0 ; i < colCount; i ++){ colHeight[i] = tops; } function reset(){ var colHeightArry= [] for(var i = 0 ; i < colCount; i ++){ colHeightArry[i] = tops } lidom.each(function(){ var minValue = colHeightArry[0] var minIndex = 0 for(var i = 0 ; i < colCount; i ++){ if(colHeightArry[i] < minValue){ minValue = colHeightArry[i] minIndex = i } } var mar_rights = mar_right; if(minIndex >0 && ( (minIndex+1) % colCount ==0) ){ mar_rights =0; } $(this).css({ left: lefts+minIndex * liWidth, top: minValue, 'margin-right':mar_rights }) colHeightArry[minIndex] += $(this).outerHeight(true) colHeight[minIndex] += $(this).outerHeight(true); }) } reset(); colHeight.sort(function(a,b){return a-b;}) var max = colHeight[colHeight.length-1]; if(endCallback && $.isFunction(endCallback)) endCallback(max); } function openImageChooserDialog(options){ window._imageChooserDefered=new $.Deferred(); options=$.extend({},options); var title=options.title||translate('fileManager.selectImage'); var width=options.width||883; var filetype=options.filetype||'pic'; var dialogid=options.id||'wp-picmanage_panel'; var zindex=options.zIndex||1003; var multi=options.multi||0; var mask = options.overlay; if (typeof mask === 'undefined') mask = true; wp_floatpanel(parseToURL('wp_widgets','common_pic_chooser',{filetype:filetype,multi:multi}),{ title: title, id: dialogid, width: width, overlay: mask, isCenter: true, swfFix: true, zIndex: zindex, isSet:true }); if(!options.cancelNotCloseDialog){ window._imageChooserDefered.fail(function(){ $.modal.close(); }) } return window._imageChooserDefered.promise(); } // Add 'link to file' function 2013/02/25 function openMyDocChooserDialog(options){ window._myDocChooserDefered = new $.Deferred();options = $.extend({},options); var title = options.title||translate('fileManager.myFile'),dwidth = options.width||883,icenter = options.isCenter||true, dialogid = options.id||'wp-file_explore',zindex = options.zIndex||1003,mask = options.overlay; if (typeof mask === 'undefined') mask = true; wp_floatpanel(parseToURL('wp_fileexplore', 'file_explore', {"geturl": '1'}), {swfFix: true, title: title,width: dwidth,isCenter: icenter,id: dialogid,zIndex: zindex,overlay: mask }); return window._myDocChooserDefered.promise(); } function transferToPageSetDialog(showdiv,hidediv,options){ window._pagesetDefered=new $.Deferred(); options=$.extend({},options); var dialogwin=window; if(options.iframe) dialogwin=parent; var title=options.title||translate('page.add'); var mode=options.mode||'create'; var url =''; if(mode=='edit'){ var pageid=options.pageid; url =parseToURL("wp_page","editpage",{id:pageid}); }else{ var additionparam=options.createparam||{}; url =parseToURL("wp_page","addpage",additionparam); } $.get(url, function(data) { $(showdiv).html(data).show(); $(hidediv).hide(); wp_update_floatpanel($('#wp-manage_menu'),title,376,function(dom){ dom.find('.wp-panel_button').hide(); dom.find('#page_set_prop_div .wp-panel_button').show(); }); }).error(function(xhr, textStatus, errorThrown) { wp_alert((errorThrown||textStatus)+"(edit/add a page).
    "+translate("Request failed!")); }) return window._pagesetDefered.promise(); } function transferToPageSetDialogcur(showdiv,hidediv,options){ window._pagesetDefered=new $.Deferred(); options=$.extend({},options); var dialogwin=window; if(options.iframe) dialogwin=parent; var title=options.title||translate('page.add'); var mode=options.mode||'create'; var url =''; var pageid=options.pageid; var modact=options.modact||'navigation'; var page_id=options.page_id; var supid=options.blockid; if(mode=='edit'){ url =parseToURL(modact,"editpage",{id:pageid,page_id:page_id,blockid:supid}); }else{ var additionparam=options.createparam||{}; url =parseToURL(modact,"addpage",{page_id:page_id,blockid:supid,parentid:pageid}); } $.post(url, {menudata:$("#"+supid).data("menudata")}, function(data) { $(showdiv).html(data).show(); $(hidediv).hide(); }).error(function(xhr, textStatus, errorThrown) { wp_alert((errorThrown||textStatus)+"(edit/add a navigation page).
    "+translate("Request failed!")); }) return window._pagesetDefered.promise(); } function openPageSetDialog(options){ window._pagesetDefered=new $.Deferred(); options=$.extend({},options); var title=options.title||translate('page.add'); var width=options.width||400; var mode=options.mode||'create'; var url =''; if(mode=='edit'){ var pageid=options.pageid; url =parseToURL("wp_page","editpage",{id:pageid}); }else{ width = 400; var opts={}; if(options.mtype) opts._mtype=options.mtype; if(options.parentid) opts.parentid=options.parentid; url =parseToURL("wp_page","addpage",opts); } wp_floatpanel(url,{ title: title, contentClass: 'wp-site-set_panel_c', id: 'wp-add_page', overlay: true, isCenter: true, width: width, zIndex: 1002, isSet:true, cache:false, open: function(dom){ if(options.callback && $.isFunction(options.callback)){ $(dom).bind('addPageLink',function(e,url){ options.callback(url); }); } } }); if(!options.cancelDefaultOp){ window._pagesetDefered.done(function(data){ if(data.refresh){ $.saveLayout.save(true); window.locations.reload(); $('#wp-add_page').triggerHandler('wpdialogclose'); }else{ setTimeout(function(){ $.saveLayout.save(true); window.locations.href=data.forward; },100); } }) window._pagesetDefered.fail(function(){ $('#wp-add_page').triggerHandler('wpdialogclose'); }) } return window._pagesetDefered.promise(); } // 创建“文章/产品分类、列表”链接相关 2012/07/16 function setModuleLink(mtype,callback){ openPageSetDialog({"mtype":mtype,"callback":callback}); } // IFRAME自适应高度 2012/07/12 function initFrame(frame,contentClass,height){ var self = frame,bh = self.contentWindow.document.body.scrollHeight, dh = self.contentWindow.document.documentElement.scrollHeight,max = Math.max; var $parent = $(self).closest('.wp-floatpanel_dialog'),otherh = 0,temph = max(bh,dh); temph+=1; if($.browser.msie){ temph = temph+25; } $parent.find('.'+contentClass).siblings().each(function(i,dom){ otherh += $(dom).outerHeight(true); }); var _float = function(numString){ var number = parseFloat(numString); if(isNaN(number)) return 0; return number; }; var seth = _float(height),maxh = seth ? seth : $(document).height(), difw = maxh - otherh - 10;// 上下间隔5像素 if(difw < temph) temph = difw; frame.height = max(temph,200); $(self).closest('.wp-floatpanel_dialog').triggerHandler('wpdialogsetpos'); } (function($){ var cachedtimer={}; $.multi_exec_once=function(key,func,interval){ var timer=cachedtimer[key]; if(timer != null){ clearTimeout(timer); delete cachedtimer[key]; } timer=setTimeout(func, interval); cachedtimer[key]=timer; } // 注册beforeLoaded方法 2012/07/11 var loadedhash = {}; $.beforeLoaded = { add: function(type, event, func){ if ($.isFunction(func)) { if(!loadedhash[type]) loadedhash[type] = {}; loadedhash[type][event] = func; } }, run: function(type, event, data){ var func = loadedhash[type]; if(typeof func == 'undefined') return false; func = func[event]; if($.isFunction(func)) return func(data); return false; } }; })(jQuery); // 更新并定位浮动窗口 function wp_update_floatpanel(dom, title, width, callback){ var $title = dom.find('.wp-title > h2'),curtitle = $title.html(); dom.width(width); if(title) $title.data('origin_title',curtitle); else title = curtitle; $title.html(title); if(callback && $.isFunction(callback)) callback(dom); // setPosition var win = window,winw = $(win).width(),winh = $(win).height(), floor = Math.floor,newh = dom.outerHeight(true); dom.css({'left': floor((winw-width)/2),'top': floor((winh-newh)/2)}); } /** * 个性化下拉框 */ ;(function($,undefined){ var namespace = '.wpcstselect'; $.widget('wp.cstselect',{ options : { selectclass:'wp-diy-selected'http://样式 }, // 配置项 _create : function(){ var self = this; var selectclass=self.options.selectclass; if(selectclass.length==0){ selectclass='wp-diy-selected';} // 忽略多选的SELECT控件 if(self.element.prop("multiple")) return; self._doinit(self).done(function(dom,selopts){ var $ctarget = dom,$diysel = $ctarget.next('.'+selectclass+'-outside').find('.'+selectclass+''); // 设置默认值 setTimeout(function(){ var $cursel = $diysel.children('.'+selectclass+'-left'),difw = $cursel.siblings('.'+selectclass+'-button').outerWidth() + 2, pad = self._int($cursel.css("paddingLeft")) + self._int($cursel.css("paddingRight")),finalw = $diysel.width() - difw - pad + 1; if (finalw <= 0) finalw = Math.max(65, $ctarget.width()) - pad - 16; $cursel.width(finalw).attr("val",$ctarget.val()).html($ctarget.find('option:selected').html());$cursel = difw = finalw = null; },50); // 绑定CLICK事件 $diysel.bind('click'+namespace,function(e){ if(self.options.disabled || !selopts.length) return; var $selectedcnt = $(selopts).appendTo('body'),maxheight = $selectedcnt.outerHeight(true); self._selected($selectedcnt, $ctarget.val()); // 设置默认值 // 绑定LI:HOVER及CLICK事件 if ($selectedcnt.is(':hidden')) { var $target = $(this); $selectedcnt.find('li').bind('mouseenter'+namespace, function(e){ $(this).addClass('local').siblings().removeClass('local'); }).bind('mouseleave'+namespace, function(e){ $(this).removeClass('local'); }).bind('click'+namespace, function(e){ var $li = $(this),selval = $li.attr("val"); $target.children('.'+selectclass+'-left').html($li.html()).attr("val", selval); $ctarget.val(selval).trigger('change');// 捕获已绑定SELECT事件 }).end().slideDown('slow',function(){ var $selcnt = $(this); // 定位滚动条 2012/11/09 var selcnt = $selcnt[0],clienth = selcnt.clientHeight,$selected = $selcnt.find('li.local'); if ($selected.size() > 0) { var seltop = $._parseFloat($selcnt.css("top")), litop = seltop + $selected[0].offsetTop - selcnt.offsetTop + $selected.height(); if(clienth < litop) selcnt.scrollTop = litop - clienth; } // End $(document).one('click'+namespace,function(e){ $selcnt.slideUp().remove(); return false; }); }); $selectedcnt.find('input.searchable_txt').click(function(e){ e.stopPropagation(); }).bind('keyup',function(e){ if(e.keyCode==13) search_select_options($selectedcnt); }) $selectedcnt.find('.searchable_button').click(function(e){ e.stopPropagation(); search_select_options($selectedcnt); }) var txtw=$selectedcnt.find('.searchable_div').width()-10; $selectedcnt.find('input.searchable_txt').css('width',txtw+'px'); setSeloptsPos($target,$selectedcnt,maxheight); // 绑定RESIZE事件 $(window).resize(function(){ setSeloptsPos($target,$selectedcnt,maxheight); }); } }); function setSeloptsPos(target,dom,maxh){ var $target = target,pos = $target.offset(); dom.css({ "top": function(i,val){ var wnh = window.innerHeight||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight, _top = self._int(pos.top),_oh = $target.outerHeight(true),newtop = 0; if (wnh < _top + maxh + _oh) { newtop = Math.max(0, _top - maxh - 1); $(this).css({"border-bottom": 'none',"border-top": '1px solid #B5B5B5'}); } else newtop = _top + _oh + 1; wnh = _top = _oh = null; return newtop+'px'; },"left": function(i,val){ return self._int(pos.left)+'px'; } }); } function search_select_options($selectedcnt){ var search_value=$selectedcnt.find('input.searchable_txt').val(); $selectedcnt.find('li').each(function(){ var li_lel=$(this); var li_val= li_lel.html(); if(li_val.indexOf(search_value)===-1){ li_lel.hide(); }else{ li_lel.show(); } }) } }); }, value : function(value){ var self = this; var selectclass=self.options.selectclass; if(selectclass.length==0){ selectclass='wp-diy-selected';} var $target = self.element,$select = $target.next('.'+selectclass+'-outside'); $target.val(value); $select.find('.'+selectclass+'-left').attr("val",value).html($target.children('option:selected').html()); }, _doinit : function(dom){ var dtd = $.Deferred(),self = dom,$target = self.element; var isSearchable=self.element.hasClass('wp_hassearchable'); var selectclass=self.options.selectclass,_stripslashes = function(str){ return (str + '').replace(/\\(.?)/g, function(s, $1){ switch ($1) { case '\\': return '\\'; case '0': return '\u0000'; case '': return ''; default: return $1; } }); }; if(selectclass.length==0){ selectclass='wp-diy-selected';} $target.hide();// 隐藏SELECT控件 // 自定义类SELECT var selopt = '',selw = Math.max($target.width(), 65); var selhtm = '
    '; var search_html='';var search_class=''; if(isSearchable){ var imgsrc=relativeToAbsoluteURL('template/default/images/searchico.png'); search_html ='
    '; search_class=' hassearchable '; } $target.children('option').each(function(i,c){ var self = c; selopt += '
  • '+_stripslashes(self.innerHTML)+'
  • '; }); selhtm += '
     
    '; $target.after(selhtm); dtd.resolve($target,'
    '+search_html+'
      '+selopt+'
    '); return dtd.promise(); }, _int : function(numstr){ var number = parseInt(numstr); if(isNaN(number)) return 0; return number; }, _selected : function(dom,value){ dom.find('li').each(function(i,c){ var $target = $(c),ent = ''; ent = ($target.attr("val") == value)?'addClass':'removeClass'; $target[ent]('local'); }); return true; }, enable : function(){ var self = this; var selectclass=self.options.selectclass; if(selectclass.length==0){ selectclass='wp-diy-selected';} var $select = self.element.next('.'+selectclass+'-outside'); $select.find('.'+selectclass+'-left').css("color","#5A5A5A"); $select.find('.'+selectclass+'-button > a').removeClass('disabled'); $.Widget.prototype.enable.call(self); }, disable : function(){ var self = this; var selectclass=self.options.selectclass; if(selectclass.length==0){ selectclass='wp-diy-selected';} var $target = self.element,$select = $target.next('.'+selectclass+'-outside'); // 还原SELECT控件默认值 var firstopt = $target.find('option')[0]; $target[0].selectedIndex = 0; $select.find('.'+selectclass+'-left').css("color","#7C7C7C").attr("val",firstopt.value).html(firstopt.innerHTML); $select.find('.'+selectclass+'-button > a').addClass('disabled'); $.Widget.prototype.disable.call(self); }, destroy : function(){ var self = this; var selectclass=self.options.selectclass; if(selectclass.length==0){ selectclass='wp-diy-selected';} $(document).unbind(namespace); self.element.next('.'+selectclass+'-outside').unbind(namespace).remove(); $.Widget.prototype.destroy.call(self); } }); })(jQuery); /** * 文本框绑定的事件 * event(参数) - 触发回调的本地事件对象 * -> onkeydown: function(event){ * -> // do something * -> } * -> onkeyup: function(event){ * -> // do something * -> } * -> onchange: function(event){ * -> // do something * -> } * -> onfocus: function(event){ * -> // do something * -> } * -> onblur: function(event){ * -> // do something * -> } */ ;(function($,undefined){ var readyToOnBlur = true, eventNamespace = '.wpcstinput'; $.widget('wp.cstinput',{ options : { value : '', // 文本默认值, regexp : /^\d+(\.\d+)?$/, // 输入值验证正则 range : [0], // 可输入值范围[min,max](大于0) maxlength : 4, // 可输入值长度 unit : 'px', // 可输入值单位(像素) step : 1, // 递增/减步长 style : '', // 显示区域样式 nmnode_style : '', // 文本框父节点样式 btnnode_style : '', // 箭头父节点样式 upbtn_style : '', // 上箭头节点样式 downbtn_style : '', // 下箭头节点样式 complete : function(){} // 方向键的回调函数(第一个参数为当前对象,第二个参数为递增/减的值) }, _create : function(){ var $this = this, $input = $this.element, options = $this.options; var uistyle = (options.hasOwnProperty('style') && options.style.length) ? ' style="'+options.style+'"' : '', nmstyle = (options.hasOwnProperty('nmnode_style') && options.nmnode_style.length) ? ' style="'+options.nmnode_style+'"' : '', btnstyle = (options.hasOwnProperty('btnnode_style') && options.btnnode_style.length) ? ' style="'+options.btnnode_style+'"' : '', upstyle = (options.hasOwnProperty('upbtn_style') && options.upbtn_style.length) ? ' style="'+options.upbtn_style+'"' : '', downstyle = (options.hasOwnProperty('downbtn_style') && options.downbtn_style.length) ? ' style="'+options.downbtn_style+'"' : ''; $input.wrap('
    ' +'
    '); // Default value if(options.hasOwnProperty('value') && options.regexp.test(options.value)) $input.focus().val(options.value); // Maxlength if(options.hasOwnProperty('maxlength') && /^[1-9]{1}\d*$/.test(options.maxlength)) $input.attr('maxlength',options.maxlength); // Unit(像素) if(options.hasOwnProperty('unit') && options.unit.length) $input.closest('.wp_cstinput_helper').after('
    '+options.unit+'
    '); // Bind input events $.each(['keydown','keyup','change','focus','blur'],function(i,event){ $input.bind(event+eventNamespace,function(e){ if(!readyToOnBlur && (event == 'blur')) return false; $this._trigger('on'+event, e, null); }); }); // Bind buttons events var $buttons, upbtn, downbtn; $buttons = $this.buttons = $input.closest('.wp_cstinput_helper').find('.minplus_helper > span'); upbtn = $buttons[0]; downbtn = $buttons[1]; $buttons.mousedown(mouseDown).mouseup(mouseUp).mouseout(mouseUp); function mouseDown(){ if(options.disabled) return; var step = (this === upbtn) ? options.step : -options.step; $input.focus(); $input.select(); readyToOnBlur = false; $this._doCount(step); return false; } function mouseUp(){ if (!readyToOnBlur) { readyToOnBlur = true; } return false; } }, _doCount : function(step){ var newval, range = this.options.range, curval = this.element[0].value; if(!curval.length){ // input值为空时,点击值变为0 leiminglin 2014/4/22 curval = this.element[0].value = 0; } newval = this._parsevalsue(curval) + step; if($.isFunction(range)){ range=range.apply(this.element[0]) } // 范围限定 if ($.isArray(range) && (range.length > 0)) { var min,max; if(typeof range[0] != 'undefined') min = range[0]; if(typeof range[1] != 'undefined') max = range[1]; // 溢出判断 if((step < 0) && (typeof min === 'number') && (newval < min)) newval = min; if((step > 0) && (typeof max === 'number') && (newval > max)) newval = max; } this.element[0].value = newval; // 绑定方向键的回调函数 if($.isFunction(this.options.complete)) this.options.complete(this.element,newval); }, _parsevalsue : function(numString){ var number = parseFloat(numString); if(isNaN(number)) return 0; return number; }, enable : function(){ this.buttons.removeClass('cstinput_disabled'); $.Widget.prototype.enable.call(this); }, disable : function(){ this.buttons.addClass('cstinput_disabled'); $.Widget.prototype.disable.call(this); }, destroy : function(){ var $this = this.element, $cstinput_helper = $this.closest('.wp_cstinput_helper'); $this.removeAttr('maxlength').unbind(eventNamespace); $cstinput_helper.before($this[0]); $cstinput_helper.siblings('.wp_cstunit_helper').remove().end().remove(); $.Widget.prototype.destroy.call(this); } }); })(jQuery); // 自定义垂直滚动条 2014/02/07 ;(function($, undefined){ var namespace = 'simroll', getMscrollWidth = function(){ var noScroll,scroll,oDiv = document.createElement("DIV"); oDiv.style.cssText = "position:absolute;top:-1000px;width:100px;height:100px;overflow:hidden;"; noScroll = document.body.appendChild(oDiv).clientWidth; oDiv.style.overflowY = "scroll"; scroll = oDiv.clientWidth; document.body.removeChild(oDiv); return noScroll - scroll; }; $.widget('wp.mscroll', { options : { difleft: 0,/*滚动条自定义偏移量*/ maskleft: 0,/*滚动条遮罩层left*/ barleft: 0,/*滚动条滑块left*/ height: 0,/*滚动条height*/ maskbg: '#fff', maskcname: 'wp-mobiles-device-mask',/*滚动条遮罩层class*/ barcname: 'wp-mobiles-scrollbar'/*滚动条滑块class*/ }, _create : function(){ var self = this,creatid = '-'+self._getRandomStr(),maskbg = (self.options.maskbg||'').length?'background:'+self.options.maskbg:'', barstr = '
    '; barstr += '
    '; self.options.creatid = creatid; self.element.before(barstr); self._setScrollPos(creatid); if($("#scroll_container .fullpage_alllist").length>0){ $("#scroll_container").css('overflow','hidden'); $('.wp-mobiles-scrollbar .pane').css('height','0px'); return; } self._bindScroll(creatid); }, _setScrollPos : function(id){ var prefid = namespace+id,barleft = 0,self = this,$target = self.element, $mask = $target.prevalsl('#'+prefid+'-mask'),$bar = $target.prevalsl('#'+prefid+'-bar'); $mask.add($bar).css({"left": function(){ var curtype = $(this).attr("id").replace(prefid+'-', ''); if (self.options[curtype+'left']) barleft = self.options[curtype+'left']; else { var swidth = getMscrollWidth() || 16; barleft = self._parseFloat($target.css("left")) + $target.width() - swidth; } return barleft+'px'; },"height": ($target.height() + 1)+'px',"visibility": 'visible'}); $bar.css("left", function(){return (barleft + self._parseFloat(self.options.difleft||0))+'px'}); }, _bindScroll : function(id){ var self = this,$target = self.element,$bar = $target.prevalsl('#'+namespace+id+'-bar'),paneH = 0, $spane = $bar.children('span.pane'),containerH = $target.height(),paneContainerH = 0; $target.bind("scroll."+namespace, function(e){ var contentH = this.scrollHeight;$bar.height(self.options.height||containerH); if (containerH < contentH) paneH = self._parseFloat(containerH*containerH / contentH); $spane.height(paneH); var maxtop = containerH - paneH, movey = self._parseFloat(this.scrollTop * containerH / contentH); $spane.css("top", Math.min(movey, maxtop)+'px'); }).triggerHandler("scroll."+namespace); // Pane Handler (function(){ var curtop,curpagey; $spane.bind("mousedown."+namespace, function(e){ e.preventDefault();curpagey = e.pageY; curtop = self._parseFloat($spane.css("top")); $spane.addClass("scrolling"); $(document).bind("mousemove."+namespace, function(e){ if (! $spane.hasClass("scrolling")) return; var newtop = curtop + e.pageY - curpagey,panetop = Math.max(0, newtop), target = $target.get(0),contentH = target.scrollHeight; // Reset pane-top var scrltop = self._parseFloat(panetop * contentH / containerH), maxtop = containerH - $spane.height(); if (panetop >= maxtop) scrltop = contentH - target.clientHeight; $target.scrollTop(scrltop);return false; }).bind("mouseup."+namespace, function(e){ e.preventDefault();$(document).unbind("."+namespace); $(parent.document).unbind(".rmscroll"); if (! $spane.hasClass("scrolling")) return; $spane.removeClass("scrolling"); }); $(parent.document).bind("mouseup.rmscroll",function(){$(document).unbind("."+namespace)}); }).bind("mouseup."+namespace, function(e){ $(document).unbind("."+namespace); $(parent.document).unbind(".rmscroll");return false; }); })(); }, _getRandomStr : function(len){ len = len || 16; var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', maxlen = chars.length,result = ''; for(var i = 0; i < len; i++){ result += chars.charAt(Math.floor(Math.random() * maxlen)); } return result; }, _parseFloat : function(numstr){ var number = parseFloat(numstr); if (isNaN(number)) return 0; return number; }, destroy : function(){ var self = this,prefid = '#'+namespace+self.options.creatid; $(document).add(self.element).unbind("."+namespace); self.element.prevalsl(prefid+'-mask,'+prefid+'-bar').remove(); $.Widget.prototype.destroy.call(self); } }); })(jQuery); //js生成guid function fGuid(bOrg) { var sGuid=fGuidCst(); if(bOrg) return sGuid; return (sGuid+'').replace(/\{|\}|-/g,''); function fGuidCst() { var sGuid=''; for(var i=1; i<=32; i++) { var nNum=0; nNum=parseInt(Math.random()*16); sGuid+=nNum.toString(16); if(i==8||i==12||i==16||i==20)sGuid+='-'; } return '{'+sGuid.toUpperCase()+'}'; } } (function(window){ /** * 对话框缓存ajax请求 */ var html_caches={}; // 对话框ID var dialog_ids = []; /** * Float对话框 * (String)load_url - 加载的地址 * (Object)option - 配置项(title|titlebg|contentClass|id|width|height|left|top|isCenter|overlay|showBottom|zIndex|open|close) */ function wp_floatpanel(load_url,option){ var config = $.extend({},{ title: 'Title', titlebg: true, contentClass: 'wp-panel_outpadding', id: 'wp-float_panel', width: 286, height: 'auto', left: 5, top: 60, isCenter: false, overlay: false, isIframe: false, contain:$('body'), zIndex: 1000, showBottom: false, cache: true, postbody:false, swfFix: false, isSet:false, isProperty:false, open: function(){ var id = this.id; id && dialog_ids.push(id); }, close: function(){}, data: option['data']||"{}", },option||{}); // Remove old panel var pnl,$pnl,wp_timer,id = config.id,$target = id?$('#'+id):$('.wp-floatpanel_dialog'),$contain=config.contain; // Init parameters var rgx = /^\d+$/i,plw = config.width,plh = config.height,pllt = config.left,pltp = config.top,cc = config.contentClass, ct = config.isCenter,ol = config.overlay,z = config.zIndex,sm = config.showBottom,isfrm = config.isIframe,isset = config.isSet; if (!$target.size()) { // Init overlay var ols = ''; if (ol) { var $overlay = $('#wp-floatpanel_overlay'); if($overlay.size() > 0) $overlay.remove(); ols = '
    '; z += 1; } // Show or not bottom var sms = ''; if (sm) { sms += '
    '+translate('property.showInBottom')+'
    ' + '
    x:' + 'y:' + 'w:' + 'h:' + '
    '; } // Loading area var $tmpwin = $(window),$load = $('#wp-floatpanel_loading'),loadstr = '
    '; if($load.size() > 0) $load.remove(); // Create panel var superid = $.options ? $.options.superid : 0; var ovecss = (id == 'wp-tb_product_list-style')?'overflow:initial;':''; var $ap = $(''+ols+loadstr).appendTo($contain); pnl = $ap[0];$pnl = $(pnl); // Loading position var winWidth = $tmpwin.width(),pnlWidth = $pnl.width(); $('#wp-floatpanel_loading').width(winWidth).height($tmpwin.height()); // Events $pnl.draggable({handle: '.wp-title',cancel: '.wp-icon',cursor: 'move',scroll: false,iframeFix: true,start: function(e,ui){ var $target = $(this),titleH = $target.find('.wp-title').outerHeight(); $('.wp-diy-selected-content').slideUp().remove();// 拖拽弹窗时注销“自定义SELECT下拉框” 2012/11/09 // SWF object ghost lines if (config.swfFix) { var $swf = $target.find('object'); if ($swf.length > 0) { $swf.parent().data("wpswfsize",{"width": $swf.width(),"height": $swf.height()}); $swf.css({"height": '0',"width": '0',"visibility": 'hidden'}); } $swf = null; } if ($target.find('iframe').length > 0) { var $innerfrm = $target.find('.ui-resizable-innerIframeFix'); ($innerfrm.length > 0) && $innerfrm.remove(); $('
    ').css({ left: 0,top: titleH+'px',position: 'absolute',opacity: '0.001',zIndex: 1000, width: $target.width()+'px', height: ($target.height() - titleH)+'px' }).appendTo($target); } },drag: function(e,ui){ var pos = ui.position;// 防溢出 2012/10/29 if(pos.top < 0) pos.top = 0; if(pos.left <0) pos.left = 0; if(winWidth < pnlWidth + pos.left) pos.left = winWidth - pnlWidth; },stop: function(){ var $innerfrm = $('.ui-resizable-innerIframeFix', this); ($innerfrm.length > 0) && $innerfrm.remove(); // SWF object ghost lines if (config.swfFix) { var $swf = $(this).find('object'); if ($swf.length > 0) { var $swfprt = $swf.parent(),swfsize = $swfprt.data('wpswfsize'); $swf.css({"height": (swfsize.height||24)+'px',"width": (swfsize.width||82)+'px',"visibility": 'visible'}); $swfprt.removeData('wpswfsize');$swfprt = swfsize = null; } $swf = null; } }}).bind('wpdialogclose',function(e){ $pnl = {};// 注销$pnl对象 clearTimeout(wp_timer); var dom = $(e.target); var dialogid = dom.attr("id")||'', cancelarr = ['wp-add_page','wp-page-obj-chooser','wp-file_explore','wp_settemplate', 'wp-filecategory_panel','wp-manage_plugins','wp_multilang_setting','wp-backup', 'wp-page_setting','wp-seo_setting','wp-watermark_setting','wp-mobiles_setting', 'wp-add_template','wp-ask_page_name','wp-page_save']; if(ol) dom = dom.add('#wp-floatpanel_overlay'); if($.isFunction(config.close)) config.close(dom[0]); $(document).trigger('click');//IE8中无法移除cstselect插件的div.wp-diy-selected-content // Set storage-data for(var i = 0,l = dialog_ids.length;i < l;i++){ if (dialog_ids[i] == dialogid) { dialog_ids.splice(i, 1); break; } } if (! dialog_ids.length && ($.inArray(dialogid, cancelarr) < 0) && (typeof breakpoint_save != 'undefined')) { breakpoint_save.setObj({});/*for 'breakpoint save'*/ } return dom.add('#wp-floatpanel_loading').remove(); }); } else { $pnl = $target; pnl = $target[0]; } // Load content $.Deferred(function(dtd){ // Modal setting if (isfrm == false) { if(config.cache && html_caches[load_url]){ var data=html_caches[load_url]; dtd.resolve(data); }else{ var ajaxopts={}; if(config.postbody) ajaxopts={data:config.postbody}; $.ajax($.extend({ type: "POST",url: load_url, data: config.data, beforeSend: function(){ // 取消全局设置属性以修复IE“闪屏”问题 2012/10/30 },success: function(data){ if(data.length > 0){ if(data == 'Session expired') window.locations.href = getSessionExpiredUrl(); dtd.resolve(data); if(config.cache) html_caches[load_url]=data; } else dtd.reject(); },error: function(xhr, textStatus, errorThrown){ wp_alert((errorThrown||textStatus)+'('+config.title+')'+".
    "+translate('Request failed!')); $pnl.triggerHandler('wpdialogclose'); return false; } },ajaxopts)); } } else { var frmw = plw - 26/*左右padding值为2*13px*/,frame = '
    ' +''; dtd.resolve(frame); } return dtd.promise(); }).done(function(data){ $('#wp-floatpanel_loading').remove(); // Append innerHTML var ocs = {}; $('.'+cc,pnl).html(data); if(rgx.test(plw)) ocs['width'] = plw+'px'; if(rgx.test(plh)) ocs['height'] = plh+'px'; // Reset position if (ct || ol) { $pnl.show().css(ocs); wp_timer = setTimeout(function(){ $pnl.triggerHandler('wpdialogsetpos'); },30); // Bind window resize var $win = $(window), _winw = $win.width(), _winh = $win.height(); $(window).resize(function(){ var _iwinw = $(this).width(), _iwinh = $(this).height(); if (_winw * _winh == _iwinw * _iwinh) return false; _winw = _iwinw;_winh = _iwinh; panel_position($pnl,plw,plh,ol,'wp-floatpanel_overlay',isset); }); $pnl.bind('wpdialogsetpos',function(e){ panel_position($pnl,plw,plh,ol,'wp-floatpanel_overlay',isset); }); } else { if(window.mobilesModel && !isset && !config.isProperty){ panel_position($pnl,plw,plh,ol,'wp-floatpanel_overlay'); }else{ if(config.isProperty){ if(rgx.test(pllt)) ocs['right'] = pllt+'px'; }else{ if(rgx.test(pllt)) ocs['left'] = pllt+'px'; } if(rgx.test(pltp)) ocs['top'] = pltp+'px'; } $pnl.css(ocs).show();//.animate(ocs,'slow'); } config.open(pnl); }).fail(function(){ wp_alert(config.title+"(deferred fail).
    "+translate('Request failed!')); $pnl.triggerHandler('wpdialogclose'); return false; }); // Bind close events $('.wp-title a.close',pnl).bind('click',function(e){ $pnl.triggerHandler('wpdialogclose'); // IE下禁止触发onbeforeunload e.preventDefault(); }); return null; } window.wp_floatpanel=wp_floatpanel; })(window); // Dialog定位 function panel_position(dom,width,height,isoverlay,overlayid,isset){ if(!isset){ isset = false; } if(dom instanceof jQuery == false) return; var $target = dom,tpw = $target.outerWidth(true),tph = $target.outerHeight(true), floor = Math.floor,rgx = /^\d+$/i,ocs = {}; var scrolltop=$(document).scrollTop(); // Parse if(rgx.test(height)) tph = height; tpw = Math.max(tpw,width); var wnw = window.innerWidth || self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, wnh = window.innerHeight || self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; pltp = floor((wnh - tph)/2); pllt = floor((wnw - tpw)/2); // Overlay if(isoverlay) $('#'+overlayid).width(wnw).height(wnh); // Panel var mobWidth = $("#wp-mobiles-device-sides").width(); var plPos = 0; if(window.mobilesModel && !isset){ if(tpw > (wnw-mobWidth)/2){ ocs['right'] = plPos+'px'; }else{ plPos = (wnw+mobWidth)/2+20; ocs['left'] = plPos+'px'; } }else{ ocs['left'] = pllt+'px'; } ocs['top'] = ((pltp>0?pltp:0)+scrolltop)+'px'; $target.css(ocs); } $._parseFloat = function(numString){ var number = parseFloat(numString); if(isNaN(number)) return 0; return number; } function fix_img_url_path(imgurl){ var escapeRegExp = (function () { var specials = [ '-','[',']', '/','{', '}', '(',')', '*','+','?', '.','\\', '^','$', '|' ]; var regex = new RegExp('[' + specials.join('\\') + ']', 'g'); return function escapeRegExp(str) { return str.replace(regex, '\\$&'); }; })(); var imgfilenameregxp=/\/([^\/]+)$/; var matches=imgurl.match(imgfilenameregxp); var codedimgurl=''; if(matches){ var oldfilename=matches[1]; var newfilename=encodeURIComponent(oldfilename); var oldfileregexp=new RegExp(escapeRegExp(oldfilename)+'$'); codedimgurl=imgurl.replace(oldfileregexp,newfilename); }else{ codedimgurl=encodeURIComponent(imgurl); } return codedimgurl; } /** * 图片自适应 居中显示 */ function set_pic(obj) { var img = new Image(); img.src =$(obj).attr("src"); var width=img.width; var height=img.height; if(width==0){ width=107; } if(height==0){ height=107; } var W=107; var H=107; var _width=107; var _height=107; var _top=0; if(width>height){ _height=(height*H)/width; _top= (W-_height)/2; $(obj).attr('style','width: ' + _width + 'px;height:'+_height+'px;'); $(obj).parent().css('top', _top); }else{ _width=(width*H)/height; _top= (W-_width)/2; $(obj).attr('style','width: ' + _width + 'px;height:'+_height+'px;left:'+_top+'px;'); $(obj).parent().css({'top':0,'left':_top}); } } /** * 手机站弹窗(模拟新窗口打开) 2014/06/09 */ function msite_popup(url){ var $container = $('#scroll_container'),maxh = $(window).height(), bgimg = relativeToAbsoluteURL('template/default/images/loading.gif'), css = 'position:absolute;top:0;left:0;width:320px;overflow:hidden;z-index:10000', ihtml = '
    '; var $mask = $container.children('.mspopup_mask'); if(! $mask.length) $container.append(ihtml).attr("data-height", $container.height()).height(maxh); } function mspopup_onload(win){ win.height = 'auto'; var bodh = win.contentWindow.document.body.scrollHeight, doch = win.contentWindow.document.documentElement.scrollHeight, maxheight = Math.max(bodh, doch); // Reset height win.height = maxheight; $(win).parent('.mspopup_mask').height(maxheight) .parent('#scroll_container').height(maxheight); } function create_pc_media_set_pic(layer_id,editmode){ var func=function(obj) { var callback=function(img){ img.show(); img.closest('.img_over').children('.imgloading').remove(); if(!editmode){ $(function(){ var super_id=layer_id; var dom_img=$("#"+super_id).find('.paragraph_image'); var left_img=parseInt(dom_img.css('left')); var top_img=parseInt(dom_img.css('top')); var width_img=parseInt(dom_img.css("width")); var height_img=parseInt(dom_img.css("height")); if(isNaN(left_img)){ left_img=0; } if(isNaN(top_img)){ top_img=0; } var ii=0; $("#"+super_id).find(".wp_mapclass").each(function(){ var shape="rect"; shape=$(this).attr('shape'); if(shape != "circle"){ shape="rect"; } var leftz=parseInt($(this).css("left")); var topz=parseInt($(this).css("top")); var widthz=parseInt($(this).css("width")); var heightz=parseInt($(this).css("height")); if(shape != "circle"){ var coords='0,0,0,0'; }else{ var coords='0,0,0'; } if( (leftz+widthz) < left_img || (topz+heightz)< top_img){ }else{ var cleft=0; var ctop=0; var r=0; if(shape != "circle"){ cleft=leftz-left_img; ctop=topz-top_img; coords=cleft+','+ctop+','+(cleft+widthz)+','+(ctop+heightz); }else{ r=widthz/2; cleft=leftz-left_img+r; ctop=topz-top_img+r; coords=cleft+','+ctop+','+r; } } var classid="map_arear_"+ii; ii++; var mapd=$(this).parent().find("."+classid); mapd.attr('coords',coords); $(this).remove(); }); }) } } $(obj).each(function() { var img=$(this); callback(img); }); } window['set_thumb_'+layer_id]=func; }; /* * 模块高度自适应,对外接口,功能待扩展 * */ /** * 高度自适应模块,预览模式下触发 TODO:面向对象写法 */ function wp_heightAdapt(dom,oldHeight) { if(dom== undefined) return false; if ($.inArray(dom.attr("type"), ['bslider']) != -1) return; var heightfunc=function(){ var before=dom.data('oriheight'); if(!before){ before=layer_first_div(dom).height(); dom.data('oriheight',before); } return before; } var layer_first_div=function(el){ var firstdiv=el.children('div').eq(0); if(firstdiv.length==0 && el.attr('type')=='title'){ firstdiv=el.find('.wp-title_content') } return firstdiv; } var resetPos=function(el){ var oritop=el.data('adaptoritop'); var oriheight=el.data('adaptoriheight'); var pressArr=el.data('adaptpress'); var wrapArr=el.data('adaptwrap'); var id=dom.prop('id'); var toppos=$.parseInteger(el.css('top')); if(el.data('wopop_effect_oristyle')){ var style=el.data('wopop_effect_oristyle'); var topregexp=/(?:^|;)\s*top\s*:\s*(\d+)px/; var topmatches=style.match(topregexp); if(topmatches){ toppos=parseInt(topmatches[1]); } } if(!oritop&&oritop !==0){ el.data('adaptoritop',toppos); el.data('adaptoriheight',el.height()); return; } if(pressArr && pressArr.length){ var newpressarr=[] for(var i=0;iadaptModuleAfter) adaptModuleAfter=dom.data('layer_height_min_apapt'); } if(adaptModuleAfter < adaptModuleBefore){ layer_first_div(dom).css('height',adaptModuleBefore+'px'); if(adaptModuleBefore==actualContentHeight) return; }//还原 else{ layer_first_div(dom).css('height',adaptModuleAfter+'px'); if(adaptModuleAfter==actualContentHeight) return; } //bug 7531 特殊处理 限定mbox内 且高度差不高于10 var adaptdoms=$('#canvas').data('heightadaptdoms'); if(!adaptdoms) adaptdoms=[]; var domfatherid=dom.attr('fatherid'); var sameTopDiff=0; if(domfatherid&&domfatherid!=''&&domfatherid!='canvas' && domfatherid!='site_footer'){ if(adaptdoms && adaptdoms.length){ for(var i=0;i right_boundray) return true; if(dom.attr('id') == $(this).attr('id')) return true;//自己除外 //包在高度自适应模块外面的模块也要改变高度 if((tmp_left <= left_boundray && tmp_left+tmp_width >= right_boundray) && (tmp_top <= moduleTop && tmp_top+tmp_height >= moduleTop+moduleLayerHeight)) { wrapList.push($(this).attr('id')); return true; } } if($(this).parent().hasClass('full_content') || $(this).parent().hasClass('footer_content') || $(this).parent().hasClass('drop_box')) return true;//通栏和底部元素暂时不考虑 if(tmp_top >= (moduleTop + moduleLayerHeight)) { pressList.push($(this).attr('id')); if(minTop == 0) {minTop = tmp_top;minId = $(this).attr('id');} else { if(minTop > tmp_top) {minTop = tmp_top;minId = $(this).attr('id');} } } }); //ceshi offsetY = $("#"+minId).ab_pos_cnter('top') - (moduleTop + moduleLayerHeight); if(pressList.length > 0 && (moduleTop + moduleHeight) >= minTop) { diffY = moduleTop + moduleHeight + offsetY - minTop; for(var i = 0;i < pressList.length;i++) { var theel=$("#"+pressList[i]); var eltop=parseInt(theel.ab_pos_cnter('top'))+diffY-sameTopDiff; theel.css('top',eltop+'px'); //bug 5996 自适应导致模块style变化了,动画出错 if(theel.data('wopop_effect_oristyle')){ var style=theel.data('wopop_effect_oristyle'); style=style.replace(/((?:^|;)\s*top\s*:\s*)\d+px;/,'$1'+eltop+'px;'); theel.data('wopop_effect_oristyle',style); } var pressArrOld=theel.data('adaptpress'); if(!pressArrOld) pressArrOld=[]; var pressArr=[]; for(var j=0;j 0) { for(var i = 0;i < wrapList.length;i++) { var diffH=moduleHeight-moduleLayerHeight; var theel=$("#"+wrapList[i]); theel.height($("#"+wrapList[i]).height()+(diffH)); var wrapListPadding = parseInt(layer_first_div(theel).css('padding-top')) + parseInt(layer_first_div($("#"+wrapList[i])).css('padding-bottom')); var wrapListBorder = parseInt(layer_first_div(theel).css('border-top-width')) + parseInt(layer_first_div($("#"+wrapList[i])).css('border-bottom-width')); layer_first_div(theel).height(theel.height() - wrapListPadding - wrapListBorder); var wrapArrOld=theel.data('adaptwrap'); if(!wrapArrOld) wrapArrOld=[]; var wrapArr=[]; for(var j=0;j