test
Server : Apache System : Linux festive-vaughan.27-254-111-205.plesk.page 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 User : acaindustrial ( 10114) PHP Version : 8.2.25 Disable Function : opcache_get_status Directory : /var/www/vhosts/acaindustrial.co.th/httpdocs/wp-content/plugins/xo-liteslider/js/ |
Upload File : |
jQuery((function($){$("#xo-slider-slide").each((function(i,e){var wrapper=$(e),count=wrapper.find(".slide").length;wrapper.find(".slide-header-append-button").click((function(){count++;var parent=$(this).parents(".slide"),clone=parent.clone(!0,!0).hide();parent.find("select").each((function(i,e){clone.find("[name='"+$(this).attr("name")+"']").val($(this).val())})),clone.find("input, select, textarea, label").each((function(i,e){var attrname=$(this).attr("name");attrname&&$(this).attr("name",attrname.replace(/^(xo_slider_slides)\[(.+?)\]/,"$1["+count+"]"));var attrfor=$(this).attr("for");attrfor&&$(this).attr("for",attrfor.replace(/^(xo_slider_slides)\[(.+?)\]/,"$1["+count+"]"));var attrid=$(this).attr("id");attrid&&$(this).attr("id",attrid.replace(/^(xo_slider_slides)\[(.+?)\]/,"$1["+count+"]"))})),clone.find("input, textarea, label").each((function(i,e){$(this).val("")})),clone.find("img").remove(),clone.find(".filename").remove(),clone.find(".message").show(),parent.after(clone.fadeIn("normal"))})),wrapper.find(".slide-header-remove-button").click((function(){var slide;$(this).parents(".slide").fadeOut("normal",(function(){$(this).remove()}))})),wrapper.find(".slide-header-toggle-button").click((function(){var slide;$(this).parents(".slide").toggleClass("closed")})),wrapper.find(".slide-repeat").sortable({handle:".slide-header"}),wrapper.find(".slide-image").click((function(e){var custom_uploader_file;e.preventDefault();var outputImage=$(this).parent().parent().find(".slide-image"),outputMediaType=$(this).parent().find(".slide-media-type"),outputId=$(this).parent().find(".slide-media-id"),outputLink=$(this).parent().find(".slide-media-link");custom_uploader_file?custom_uploader_file.open():((custom_uploader_file=wp.media({title:messages.title,button:{text:messages.button},library:{type:"image,video"},multiple:!1,frame:"post"})).on("close",(function(){if("embed"==custom_uploader_file.state().get("id")){var embed=custom_uploader_file.state().props.toJSON();embed.url=embed.url||"";var mat=embed.url.match(/[\/?=]([a-zA-Z0-9_\-]{11})[&\?]?/);mat[1]&&(outputMediaType.val("youtube"),outputId.val("0"),outputLink.val(embed.url),outputImage.find(".message").hide(),outputImage.find("img").remove(),outputImage.prepend('<img src="http://img.youtube.com/vi/'+mat[1]+'/default.jpg">'),outputImage.append('<div class="filename"><div>'+embed.url+"</div></div>"))}else{var images;custom_uploader_file.state().get("selection").each((function(file){var attachment=file.toJSON();"image"==attachment.type&&(outputMediaType.val("image"),outputId.val(attachment.id),outputLink.val(""),outputImage.find(".message").hide(),outputImage.find("img").remove(),outputImage.prepend('<img src="'+attachment.sizes.thumbnail.url+'">'),outputImage.find(".filename").remove()),"video"==attachment.type&&(outputMediaType.val("video"),outputId.val(attachment.id),outputLink.val(""),outputImage.find(".message").hide(),outputImage.find("img").remove(),outputImage.prepend('<img src="'+attachment.image.src+'">'),outputImage.find(".filename").remove(),outputImage.append('<div class="filename"><div>'+attachment.filename+"</div></div>"))}))}})),custom_uploader_file.open())})),wrapper.find(".slide-image-clear").click((function(e){e.preventDefault(),$(this).parent().find(".slide-media-id").val(""),$(this).parent().find("img").remove(),$(this).parent().find(".filename").remove(),$(this).parent().find(".message").show()})),wrapper.find(".slide-panel-tabs").click((function(e){var target=$(e.target);return target.hasClass("nav-tab-link")&&(panelId=target.data("type"),wrapper=target.parents(".slide-panel-wrapper").first(),$(".tabs-panel-active",wrapper).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),$(".tabs-"+panelId,wrapper).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),$(".tabs",wrapper).removeClass("tabs"),target.parent().addClass("tabs")),!1}))})),$("#xo-slider-parameter .parameter-panel-tabs").click((function(e){var target=$(e.target);return target.hasClass("nav-tab-link")&&(panelId=target.data("type"),wrapper=target.parents(".parameter-panel-wrapper").first(),$(".tabs-panel-active",wrapper).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),$(".tabs-"+panelId,wrapper).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),$(".tabs",wrapper).removeClass("tabs"),target.parent().addClass("tabs")),!1})),$("#template-select").change((function(){const templateId=$("#template-select").val();$("#xo-slider-template .template-description").removeClass("active").addClass("inactive"),$("#xo-slider-template .template-description-"+templateId).removeClass("inactive").addClass("active")}))}));