AlkantarClanX12
Current Path : /home/thanudqk/public_html/wp-content/plugins/LayerSlider/assets/static/admin/js/ |
Current File : /home/thanudqk/public_html/wp-content/plugins/LayerSlider/assets/static/admin/js/ls-common-min.js |
function isNumber(t){return!isNaN(parseFloat(t))&&isFinite(t)}function ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}Array.prototype.indexOf||(Array.prototype.indexOf=function(t){"use strict";if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if(0===n)return-1;var o=0;if(arguments.length>1&&((o=Number(arguments[1]))!=o?o=0:0!=o&&o!=1/0&&o!=-1/0&&(o=(o>0||-1)*Math.floor(Math.abs(o)))),o>=n)return-1;for(var a=o>=0?o:Math.max(n-Math.abs(o),0);a<n;a++)if(a in e&&e[a]===t)return a;return-1}),Array.prototype.fill=function(t,e){for(;e--;)this[e]=t;return this},Storage.prototype.setObject=function(t,e){this.setItem(t,JSON.stringify(e))},Storage.prototype.getObject=function(t){var e=this.getItem(t);return e&&JSON.parse(e)},function($){$.fn.appendToWithIndex=function(t,e){return t instanceof jQuery||(t=$(t)),0==e?this.prependTo(t):this.insertAfter(t.children(":eq("+(e-1)+")")),this}}(jQuery);var LS_ContextMenu={open:function(t,e){e=e||{},t.preventDefault(),t.stopPropagation(),LS_ContextMenu.close(e);var n=t.pageY;ml=t.pageX;var o=jQuery(e.selector);o.length||(o=jQuery(jQuery(e.template).text()).prependTo("body")),e.width&&o.css("width",e.width);var a=o.width(),i=jQuery(window).width();i-(ml+a)>0?(o.removeClass("ls-context-left-subs"),o.css({top:n,left:ml+3})):(t.alignRight&&(n=t.alignRight.pageY||n,ml=t.alignRight.pageX||ml),o.addClass("ls-context-left-subs"),o.css({top:n,left:"auto",right:i-ml})),e.onBeforeOpen&&e.onBeforeOpen(o),o.addClass("ls-context-menu-opened"),e.onOpen&&e.onOpen(o),setTimeout((function(){jQuery("body").off("click.ls-context-menu").on("click.ls-context-menu",(function(){LS_ContextMenu.close(e)}))}),t.manualOpen?100:0)},close:function(t){t&&t.onClose&&t.onClose(),jQuery("body").off("click.ls-context-menu"),jQuery(".ls-context-menu").removeClass("ls-context-menu-opened")}},LS_CodeMirror={init:function(t){var e={mode:"css",theme:"solarized",lineNumbers:!0,lineWrapping:!0,autofocus:!0,indentUnit:4,indentWithTabs:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],styleActiveLine:!0,extraKeys:{"Ctrl-Q":function(t){t.foldCode(t.getCursor())}}};jQuery(".ls-codemirror").each((function(){var n=jQuery.extend(!0,{},e,t||{});jQuery(this).prop("readonly")&&(n.readOnly=!0,n.theme+=" readonly");var o=CodeMirror.fromTextArea(this,n);o.on("change",(function(t){t.save(),jQuery(t.getTextArea()).trigger("updated.ls",t)})),jQuery(this).closest("#lse-callback-events").length&&o.on("beforeChange",(function(t,e){0===e.from.line&&e.to.line===t.lastLine()?(t.setSelection({line:1,ch:0},{line:t.lastLine()-1,ch:99999}),t.replaceSelection(e.text[0]),e.cancel()):(0===e.from.line&&(e.from.line=1,"+delete"===e.origin&&e.cancel()),e.to.line===t.lastLine()&&(e.to.line=t.lastLine()-1,"+delete"===e.origin&&e.cancel())),jQuery(t.getTextArea()).trigger("updated.ls",t)}))}))}};jQuery((function($){"undefined"!=typeof LS_statusMessage&&kmUI.notify.show(LS_statusMessage),$(document).on("click",".ls-install-plugin-update",(function(t){if(t.preventDefault(),LS_slidersMeta.isActivatedSite)try{lsInstallPluginUpdate()}catch(t){$(this).attr("href")&&(window.location.href=$(this).attr("href"))}else lsDisplayActivationWindow()}));var t=0;$(document).on("click","#ls-plugin-update-success-modal .ls-checkmark-holder",(function(){var e=$(this),n=e.parent(),o=e.closest(".kmw-modal-container"),a=[-10,20,-30,15,-5,5],i=[1.6,1.3,1.1,1.8,1.6,1.4],s=a[t%a.length],l=i[t%i.length];e.css("transform","scale("+l+") rotate("+s+"deg)"),++t>12?(t=0,lsAddUpdateEasterEggExplosion(),setTimeout((function(){lsAddUpdateEasterEggExplosion()}),200),setTimeout((function(){lsAddUpdateEasterEggExplosion()}),400),setTimeout((function(){lsAddUpdateEasterEggExplosion()}),600),setTimeout((function(){lsAddUpdateEasterEggExplosion()}),800),setTimeout((function(){lsAddUpdateEasterEggExplosion()}),1e3),setTimeout((function(){lsAddUpdateEasterEggExplosion()}),1200),setTimeout((function(){lsAddUpdateEasterEggExplosion()}),1400),setTimeout((function(){lsAddUpdateEasterEggExplosion()}),1600),setTimeout((function(){kmw.modal.close(),lsDisplayUpdateEasterEgg()}),1600)):t>6?o.css("animation","ls-shake 500ms infinite"):t>4?n.addClass("ls-animate").css("animation-iteration-count","infinite"):t>2&&(n.removeClass("ls-animate"),setTimeout((function(){n.addClass("ls-animate")}),100))})),$(".ls-pagination-limit select").on("change",(function(){var t={action:"ls_save_pagination_limit",limit:jQuery(this).val()};$.post(ajaxurl,t,(function(){document.location.href=LS_l10n.adminURL+"?page=layerslider"}))}));var e={init:function(){$(document).on("click","[data-ls-su]",(function(){e.open($(this))}))},create:function(t){"static"==t.parent().css("position")&&t.parent().css("position","relative"),"static"==t.css("position")&&t.css("position","relative");var e=$("<div>"),n=$("<div>"),o=$("<div>");e.addClass("ls-su"),n.addClass("ls-su-inner"),o.addClass("ls-su-content"),t.parent().prepend(e.append(n.append(o)));var a=["borderRightStyle","borderRightWidth","borderRightColor","borderLeftStyle","borderLeftWidth","borderLeftColor","borderBottomStyle","borderBottomWidth","borderBottomColor","backgroundColor"];for(i=0;i<a.length;i++)n.css(a[i],t.css(a[i]));o.css({paddingTop:t.css("paddingLeft"),paddingLeft:t.css("paddingLeft"),paddingBottom:t.css("paddingLeft"),paddingRight:t.css("paddingRight")}),e.css({left:t.position().left+parseInt(t.css("marginLeft")),top:t.position().top+parseInt(t.css("marginTop"))+t.outerHeight(),width:t.width()+parseInt(t.css("paddingLeft"))+parseInt(t.css("paddingRight"))+parseInt(t.css("borderLeftWidth"))+parseInt(t.css("borderRightWidth"))}),o.append(t.siblings(".ls-su-data").html())},open:function(t){t.parent().find(".ls-su").length||e.create(t),$su=t.parent().find(".ls-su"),$sui=t.parent().find(".ls-su-inner"),$su.hasClass("ls-su-opened")||($su.addClass("ls-su-opened"),TweenLite.set($su.parent()[0],{z:100}),TweenLite.set($su[0],{opacity:.7,height:"auto",transformOrigin:"center top",rotationX:90,transformPerspective:500}),TweenLite.set($sui[0],{top:0}),TweenLite.to($su[0],2,{opacity:1,rotationX:0,ease:"Elastic.easeOut"}),$(document).one("click",(function(t){e.close($su,$sui)})))},close:function(t,e){TweenLite.to(e[0],.3,{top:-e.outerHeight(),ease:"Quart.easeIn"}),TweenLite.to(t[0],.3,{opacity:.7,height:0,ease:"Quart.easeIn",onComplete:function(){t.removeClass("ls-su-opened")}})}};e.init(),window.kmUI&&kmUI.popover.init(),-1===document.location.href.indexOf("&action=edit")&&LS_CodeMirror.init(),-1!==document.location.href.indexOf("section=skin-editor")&&$('select[name="skin"]').change((function(){document.location.href=LS_l10n.adminURL+"?page=layerslider§ion=skin-editor&skin="+$(this).children(":selected").val()})),-1!==navigator.platform.indexOf("Mac")&&$("body").addClass("ls-platform-mac")}));var lsDisplayActivationWindow=function(t){var e={into:"body",title:LS_l10n.activationFeature,content:"#tmpl-activation",minHeight:740,maxHeight:740};t=jQuery.extend(!0,e,t),kmw.modal.open({uid:"activation-window",into:t.into,title:t.title,content:t.content,minWidth:880,maxWidth:880,minHeight:t.minHeight,maxHeight:t.maxHeight,zIndex:9999999,modalClasses:"lse-activation-modal-window",overlaySettings:{animationIn:"fade",zIndex:9999999},onOpen:function(t){jQuery(t.element).addClass("kmw-modal-visible")}})},lsDisplayUpdateEasterEgg=function(){for(var t=0;t<150;t++)setTimeout((function(t){lsAddUpdateEasterEggIcon(t)}),600*t,t);kmw.modal.open({maxWidth:500,zIndex:100200,closeButton:!1,closeOnEscape:!1,content:"#tmpl-plugin-update-easter-egg-modal",animationIn:"scale",overlaySettings:{closeOnClick:!1,animationIn:"fade",zIndex:100100}})},lsInstallPluginUpdate=function(){wp.updates.maybeRequestFilesystemCredentials(),kmw.modal.open({content:"#tmpl-plugin-update-loading-modal",minWidth:300,maxWidth:300,closeButton:!1,closeOnEscape:!1,animationIn:"scale",overlaySettings:{closeOnClick:!1,animationIn:"fade"}}),wp.updates.ajax("update-plugin",{plugin:LS_ENV.base,slug:LS_ENV.slug,success:function(){kmw.modal.close(),kmw.modal.open({maxWidth:400,zIndex:100200,closeButton:!1,closeOnEscape:!1,content:"#tmpl-plugin-update-success-modal",animationIn:"scale",overlaySettings:{closeOnClick:!1,animationIn:"fade",zIndex:100100}})},error:function(){kmw.modal.close(),kmw.modal.open({maxWidth:500,closeButton:!1,closeOnEscape:!1,content:"#tmpl-plugin-update-error-modal",animationIn:"scale",overlaySettings:{closeOnClick:!1,animationIn:"fade"}})}})},lsAddUpdateEasterEggExplosion=function(){var t=jQuery(window).width()/1.5,e=jQuery(window).height()/1.5;["check","cat","heart","rocket","hourglass","ufo","station","alien","galaxy"].forEach((function(n){var o=jQuery(LS_InterfaceIcons.easteregg[n]).addClass("ls-update-easter-egg-explosion-icon").appendTo("body");setTimeout((function(){var n=Math.floor(90*Math.random())+1;n*=1==Math.floor(2*Math.random())?1:-1;var a=Math.floor(Math.random()*t)+1;a*=1==Math.floor(2*Math.random())?1:-1;var i=Math.floor(Math.random()*e)+1;i*=1==Math.floor(2*Math.random())?1:-1;var s=600+Math.floor(400*Math.random());o.css({transition:"transform "+s+"ms, opacity 200ms",transform:"translate("+a+"px, "+i+"px) rotate("+n+"deg)"}),setTimeout((function(){o.css("opacity",0),setTimeout((function(){o.remove()}),200)}),s+100)}),100)}))},lsAddUpdateEasterEggIcon=function(t){var e=["check","cat","heart","rocket","hourglass","ufo","station","alien","galaxy"],n=e[t%e.length],o=jQuery(LS_InterfaceIcons.easteregg[n]).addClass("ls-update-easter-egg-icon").appendTo("body"),a=Math.floor(45*Math.random())+1;a*=1==Math.floor(2*Math.random())?1:-1;var i=Math.floor(360*Math.random())+1;i*=1==Math.floor(2*Math.random())?1:-1;var s=jQuery(document).height(),l=jQuery(window).width(),r=((-19.9*Math.random()+20).toFixed(3),(-.9*Math.random()+1.8).toFixed(3)),c=Math.floor(Math.random()*l)+1;TweenLite.set(o[0],{y:-120,x:c,scale:r,rotation:a}),TweenLite.to(o[0],30,{y:s,rotation:i})},lsCommon={};jQuery(document).ready((function($){lsCommon={init:function(){lsCommon.smartAlert.init()},smartAlert:{nameSpace:"smartAlert",defaults:{buttons:{alert:{ok:{label:LS_l10n.ok,enter:!0,esc:!0}},confirm:{ok:{label:LS_l10n.ok,enter:!0},cancel:{label:LS_l10n.cancel,esc:!0}},triple:{ok:{label:LS_l10n.ok,enter:!0},other:{label:""},cancel:{label:LS_l10n.cancel,esc:!0}}},type:"alert"},init:function(){let t=this;t.$alert=$("lse-smart-alert").on("click."+t.nameSpace,(function(t){t.stopPropagation()})).prependTo("body"),t.$overlay=$("lse-smart-alert-overlay").on("click."+t.nameSpace,(function(e){e.preventDefault(),e.stopPropagation(),t.getAttention()})).prependTo("body")},open:function(t={}){this.opened&&this.close(),this.opened=!0,window.LS_preventKeyboardShortcuts=!0;let e=this;"string"==typeof t&&(t={text:t}),$(document).on("keydown."+e.nameSpace,(function(n){if(-1!==[13,27].indexOf(n.which)&&n.preventDefault(),t.disableKeys)switch(n.which){case 13:case 27:e.getAttention()}else switch(n.which){case 13:e.$alert.find('[data-smart-alert-action*="enter"]').click();break;case 27:e.$alert.find('[data-smart-alert-action*="esc"]').click()}})),t.theme&&e.$alert.addClass("lse-"+t.theme),t.title&&(e.$title=$("<lse-smart-alert-title>").text(t.title).prependTo(e.$alert)),t.width&&e.$alert.css("width",t.width),t.text&&(e.$text=$("<lse-smart-alert-text>").html(t.text).appendTo(e.$alert)),t.textAlign&&e.$text.css("text-align",t.textAlign),t.type||(t.type=e.defaults.type);let n=e.defaults.buttons[t.type];t.buttons&&(n=$.extend(!0,{},n,t.buttons)),e.$buttons=$("<lse-button-group>").appendTo(e.$alert);for(let a in n){let i=n[a],s=$("<lse-button>").attr("data-smart-alert-button-type",a).on("click."+e.nameSpace,(function(n){t.clickedButton=a,e.close(t)})).appendTo(e.$buttons);var o=[];for(let t in i)switch(t){case"label":s.text(i[t]);break;case"enter":o.push("enter");break;case"esc":o.push("esc");break;case"callback":s.on("click.custom"+e.nameSpace,(function(){i[t]()}))}s.attr("data-smart-alert-action",o.join(" "))}this.$alert.addClass("lse-visible"),this.$overlay.addClass("lse-visible"),this.options=t},confirm:function(t,e,n){2===arguments.length&&"function"==typeof e&&(n=e,e=t,t=""),this.open({title:t,text:e,type:"confirm",onConfirm:n})},close:function(t){t=t||this.options,this.$alert.removeAttr("class style").html(""),this.$overlay.removeClass("lse-visible"),$(document).off("keydown."+this.nameSpace),window.LS_preventKeyboardShortcuts=!1,t.onClose&&t.onClose(t.clickedButton),t.onConfirm&&"ok"===t.clickedButton&&t.onConfirm(),delete this.opened,delete this.options},getAttention:function(){let t=this;t.$alert.addClass("lse-get-attention"),setTimeout((function(){t.$alert.removeClass("lse-get-attention")}),400)}}},lsCommon.init()}));