/** Wonderplugin Gallery Plugin Free Version
 * Copyright 2019 Magic Hills Pty Ltd All Rights Reserved
 * Website: http://www.wonderplugin.com
 * Version 12.7 
 */
(function($){$(document).ready(function(){$(".wonderplugin-engine").css({display:"none"});$(document).on("click",".wonderplugin-dialog-tab-button",function(){if($(this).hasClass("wonderplugin-dialog-tab-button-selected"))return;var index=$(this).index();$(this).closest(".wonderplugin-dialog-tab-buttons").find("li").removeClass("wonderplugin-dialog-tab-button-selected");$(this).addClass("wonderplugin-dialog-tab-button-selected");var panelsID=$(this).closest(".wonderplugin-dialog-tab-buttons").data("panelsid");
$("#"+panelsID).children("li").removeClass("wonderplugin-dialog-tab-panel-selected");$("#"+panelsID).children("li").eq(index).addClass("wonderplugin-dialog-tab-panel-selected")});$("#wonderplugin-gallery-toolbar").find("li").each(function(index){$(this).click(function(){if($(this).hasClass("wonderplugin-tab-buttons-selected"))return;$(this).parent().find("li").removeClass("wonderplugin-tab-buttons-selected");if(!$(this).hasClass("laststep"))$(this).addClass("wonderplugin-tab-buttons-selected");$("#wonderplugin-gallery-tabs").children("li").removeClass("wonderplugin-tab-selected");
$("#wonderplugin-gallery-tabs").children("li").eq(index).addClass("wonderplugin-tab-selected");if(index==3)previewGallery();else if(index==4)publishGallery()})});$(".wonderplugin-tab-buttons-horizontal").each(function(){var index=$.wpgalleryCookie($(this).attr("id"));if(index>=0){$(this).children("li").removeClass("wonderplugin-tab-button-horizontal-selected");$(this).children("li").eq(index).addClass("wonderplugin-tab-button-horizontal-selected");var panelsID=$(this).data("panelsid");$("#"+panelsID).children("li").removeClass("wonderplugin-tab-horizontal-selected");
$("#"+panelsID).children("li").eq(index).addClass("wonderplugin-tab-horizontal-selected")}$(this).find("li").each(function(index){$(this).click(function(){if($(this).hasClass("wonderplugin-tab-button-horizontal-selected"))return;$(this).parent().find("li").removeClass("wonderplugin-tab-button-horizontal-selected");$(this).addClass("wonderplugin-tab-button-horizontal-selected");var panelsID=$(this).parent().data("panelsid");$("#"+panelsID).children("li").removeClass("wonderplugin-tab-horizontal-selected");
$("#"+panelsID).children("li").eq(index).addClass("wonderplugin-tab-horizontal-selected");$.wpgalleryCookie($(this).parent().attr("id"),index)})})});$(document).on("click",".wonderplugin-foldername",function(){var parent=$(this).closest(".wonderplugin-foldername-item");if(parent.hasClass("wonderplugin-folder-opened")){parent.removeClass("wonderplugin-folder-opened");$(".wonderplugin-foldername-list",parent).remove();return false}else parent.addClass("wonderplugin-folder-opening");var ajaxnonce=$("#wonderplugin-gallery-ajaxnonce").text();
var folderseperator=$("#wonderplugin-gallery-folderseperator").text();var folder=$(this).data("foldername");var inst=$(this);$("#wonderplugin-folder-selected").html(folder);jQuery.ajax({url:ajaxurl,type:"POST",data:{action:"wonderplugin_gallery_list_folder",nonce:ajaxnonce,foldername:folder},success:function(data){parent.addClass("wonderplugin-folder-opened");if(data&&data.length>0){var listcode='<ul class="wonderplugin-foldername-list">';for(var i=0;i<data.length;i++)listcode+='<li class="wonderplugin-foldername-item wonderplugin-folder"><a class="wonderplugin-foldername" href="#" data-foldername="'+
folder+folderseperator+data[i]+'">'+data[i]+"</a></li>";listcode+="</ul>";inst.append(listcode)}},error:function(){},complete:function(){parent.removeClass("wonderplugin-folder-opening")}});return false});var getURLParams=function(href){var result={};if(href.indexOf("?")<0)return result;var params=href.substring(href.indexOf("?")+1).split("&");for(var i=0;i<params.length;i++){var value=params[i].split("=");if(value&&value.length==2&&value[0].toLowerCase()!="v")result[value[0].toLowerCase()]=value[1]}return result};
var addMediaToList=function(data){if($("#wonderplugin-newestfirst").is(":checked"))wonderplugin_gallery_config.slides.unshift(data);else wonderplugin_gallery_config.slides.push(data)};var scheduleInitUI=function(){$(".wonderplugin-dialog-datepicker").datepicker({dateFormat:"yy-mm-dd"});$("#wonderplugin-dialog-schedule").click(function(){if($(this).is(":checked"))$(".wonderplugin-dialog-schedule-config").removeClass("wonderplugin-dialog-disabled");else $(".wonderplugin-dialog-schedule-config").addClass("wonderplugin-dialog-disabled")})};
var scheduleApplyData=function(data){if(data.schedule){$("#wonderplugin-dialog-schedule").attr("checked",data.schedule);if(data.starttime){var dd=data.starttime.split(" ");if(dd.length==2){$("#wonderplugin-dialog-starttimedate").val(dd[0]);var dt=dd[1].split(":");if(dt.length==3){$("#wonderplugin-dialog-starttimehour").val(dt[0]);$("#wonderplugin-dialog-starttimeminute").val(dt[1]);$("#wonderplugin-dialog-starttimesecond").val(dt[2])}}}if(data.endtime){var dd=data.endtime.split(" ");if(dd.length==
2){$("#wonderplugin-dialog-endtimedate").val(dd[0]);var dt=dd[1].split(":");if(dt.length==3){$("#wonderplugin-dialog-endtimehour").val(dt[0]);$("#wonderplugin-dialog-endtimeminute").val(dt[1]);$("#wonderplugin-dialog-endtimesecond").val(dt[2])}}}$(".wonderplugin-dialog-schedule-config").removeClass("wonderplugin-dialog-disabled")}else $(".wonderplugin-dialog-schedule-config").addClass("wonderplugin-dialog-disabled")};var scheduleDialogContent=function(){var servertime=$("#wonderplugin-gallery-servertime").text();
var serverdate=servertime.split(" ")[0];var dialogCode="<table class='wonderplugin-dialog-form'>";dialogCode+="<tr><th></th><td><label><input name='wonderplugin-dialog-schedule' type='checkbox' id='wonderplugin-dialog-schedule' value=1 /> Enable schedule display</label></td></tr>";dialogCode+="<tr class='wonderplugin-dialog-schedule-config wonderplugin-dialog-disabled'><th>Start Time</th><td>"+"<input type='text' class='wonderplugin-dialog-datepicker' value='"+serverdate+"' id='wonderplugin-dialog-starttimedate'>";
dialogCode+="<select style='margin-left:12px;' id='wonderplugin-dialog-starttimehour'>";for(var i=0;i<24;i++)dialogCode+="<option value="+i+">"+i+"</option>";dialogCode+="</select>";dialogCode+=" <b>:</b> <select id='wonderplugin-dialog-starttimeminute'>";for(var i=0;i<60;i++)dialogCode+="<option value="+i+">"+i+"</option>";dialogCode+="</select>";dialogCode+=" <b>:</b> <select id='wonderplugin-dialog-starttimesecond'>";for(var i=0;i<60;i++)dialogCode+="<option value="+i+">"+i+"</option>";dialogCode+=
"</select>";dialogCode+="</td></tr>"+"<tr class='wonderplugin-dialog-schedule-config wonderplugin-dialog-disabled'><th>End Time</th><td>"+"<input type='text' class='wonderplugin-dialog-datepicker' value='"+serverdate+"' id='wonderplugin-dialog-endtimedate'>";dialogCode+="<select style='margin-left:12px;' id='wonderplugin-dialog-endtimehour'>";for(var i=0;i<24;i++)dialogCode+="<option value="+i+">"+i+"</option>";dialogCode+="</select>";dialogCode+=" <b>:</b> <select id='wonderplugin-dialog-endtimeminute'>";
for(var i=0;i<60;i++)dialogCode+="<option value="+i+">"+i+"</option>";dialogCode+="</select>";dialogCode+=" <b>:</b> <select id='wonderplugin-dialog-endtimesecond'>";for(var i=0;i<60;i++)dialogCode+="<option value="+i+">"+i+"</option>";dialogCode+="</select>";dialogCode+="</td></tr>";dialogCode+="<tr><td colspan=2><p>* The Start Time and End Time are compared to the WordPress Loal Time. In your WordPress backend, left menu, goto Settings -> General, please check the Timezone option and make sure the Timezone and the Local Time are correct.</p></td></tr>";
dialogCode+="</table>";return dialogCode};var slideDialog=function(dialogType,onSuccess,data,dataIndex){var dialogTitle=["image","video","Youtube Video","Vimeo Video","Dailymotion Video","Iframe Video"];var langlist=$.parseJSON($("#wonderplugin-gallery-langlist").text());var dialogCode="<div class='wonderplugin-dialog-container'>"+"<div id='wonderplugin-dialog-langs' style='display:none;'></div>"+"<div class='wonderplugin-dialog-bg'></div>"+"<div class='wonderplugin-dialog'>"+"<h3 id='wonderplugin-dialog-title'></h3>"+
"<div class='error' id='wonderplugin-dialog-error' style='display:none;'></div>"+"<table class='wonderplugin-dialog-form'>";if(dialogType==2||dialogType==3||dialogType==4||dialogType==5){dialogCode+="<tr><th>"+dialogTitle[dialogType]+" URL</th><td><input name='wonderplugin-dialog-video' type='text' id='wonderplugin-dialog-video' value='' class='regular-text' />";if(dialogType==2||dialogType==3||dialogType==4)dialogCode+=" or <input type='button' class='button' id='wonderplugin-dialog-select-video' value='Enter' />";
dialogCode+="</td></tr>"}if(dialogType==1)dialogCode+="<tr>"+"<th>MP4 video URL</th>"+"<td><input name='wonderplugin-dialog-mp4' type='text' id='wonderplugin-dialog-mp4' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-mp4' id='wonderplugin-dialog-select-mp4' value='Upload' /></td>"+"</tr>"+"<tr>"+"<th>High quality MP4 video URL (Optional)</th>"+"<td><input name='wonderplugin-dialog-hdmp4' type='text' id='wonderplugin-dialog-hdmp4' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-hdmp4' id='wonderplugin-dialog-select-hdmp4' value='Upload' /></td>"+
"</tr>"+"<tr>"+"<th>WebM video URL (Optional)</th>"+"<td><input name='wonderplugin-dialog-webm' type='text' id='wonderplugin-dialog-webm' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-webm' id='wonderplugin-dialog-select-webm' value='Upload' /></td>"+"</tr>"+"<tr>"+"<th>High quality WebM video URL (Optional)</th>"+"<td><input name='wonderplugin-dialog-hdwebm' type='text' id='wonderplugin-dialog-hdwebm' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-hdwebm' id='wonderplugin-dialog-select-hdwebm' value='Upload' /></td>"+
"</tr>"+"<tr>"+"<th>Subtitle/Caption (.vtt file)</th>"+"<td><input name='wonderplugin-dialog-vtt' type='text' id='wonderplugin-dialog-vtt' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-vtt' id='wonderplugin-dialog-select-vtt' value='Upload' /></td>"+"</tr>";dialogCode+="<tr>"+"<th>"+(dialogType>0?"Poster ":"")+"Image URL</th>"+"<td><input name='wonderplugin-dialog-image' type='text' id='wonderplugin-dialog-image' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-image' id='wonderplugin-dialog-select-image' value='Upload' /></td>"+
"</tr>"+"<tr id='wonderplugin-dialog-image-display-tr' style='display:none;'>"+"<th></th>"+"<td><img id='wonderplugin-dialog-image-display' style='width:80px;height:80px;' /></td>"+"</tr>"+"<tr>"+"<th>Thumbnail URL</th>"+"<td><input name='wonderplugin-dialog-thumbnail' type='text' id='wonderplugin-dialog-thumbnail' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-thumbnail' id='wonderplugin-dialog-select-thumbnail' value='Upload' /></td>"+"</tr>";
dialogCode+="</table>";dialogCode+='<ul class="wonderplugin-dialog-tab-buttons" data-panelsid="wonderplugin-dialog-tab-panels-content">'+'<li class="wonderplugin-dialog-tab-button wonderplugin-dialog-tab-button-selected">Text</li>';if(dialogType==0||dialogType==1)dialogCode+='<li class="wonderplugin-dialog-tab-button">Weblink</li>';dialogCode+='<li class="wonderplugin-dialog-tab-button">Schedule</li></ul>';dialogCode+='<ul class="wonderplugin-dialog-tab-panels" id="wonderplugin-dialog-tab-panels-content">'+
'<li class="wonderplugin-dialog-tab-panel wonderplugin-dialog-tab-panel-selected">';dialogCode+="<table class='wonderplugin-dialog-form'>";dialogCode+="<tr>"+"<th>Title</th>"+"<td><input name='wonderplugin-dialog-image-title' type='text' id='wonderplugin-dialog-image-title' value='' class='large-text' /></td>"+"</tr>"+"<tr>"+"<th>Description</th>"+"<td><textarea name='wonderplugin-dialog-image-description' type='' id='wonderplugin-dialog-image-description' value='' class='large-text' /></td>"+"</tr>"+
"<tr>"+"<th>Img alt text</th>"+"<td><label><input name='wonderplugin-dialog-image-altusetitle' type='checkbox' id='wonderplugin-dialog-image-altusetitle' checked /> Use Title as img alt text. To use a different text, uncheck the option and enter it below:  </label><p><input name='wonderplugin-dialog-image-alt' type='text' id='wonderplugin-dialog-image-alt' value='' class='large-text' disabled /></p></td>"+"</tr>";if(langlist&&langlist.length>1)dialogCode+='<tr><th></th><td><input type="button" class="button button-primary" id="wonderplugin-dialog-multilingual" value="Multilingual Translation"></td></tr>';
if(dialogType==0||dialogType==1){dialogCode+="</table>";dialogCode+="</li>";dialogCode+='<li class="wonderplugin-dialog-tab-panel">';dialogCode+="<table class='wonderplugin-dialog-form'>";dialogCode+="<tr><th>Click to open web link</th>"+"<td>"+"<input name='wonderplugin-dialog-weblink' type='text' id='wonderplugin-dialog-weblink' value='' class='regular-text' />"+"</td>"+"</tr>"+"<tr><th>Set web link target</th>"+"<td>"+"<input name='wonderplugin-dialog-linktarget' type='text' id='wonderplugin-dialog-linktarget' value='' class='regular-text' />"+
"</td>"+"</tr>"}dialogCode+="</table>";dialogCode+="</li>";dialogCode+='<li class="wonderplugin-dialog-tab-panel">';dialogCode+=scheduleDialogContent();dialogCode+="</li></ul>";dialogCode+="<div class='wonderplugin-dialog-buttons'>"+"<input type='button' class='button button-primary' id='wonderplugin-dialog-ok' value='OK' />"+"<input type='button' class='button' id='wonderplugin-dialog-cancel' value='Cancel' />"+"</div>"+"</div>"+"</div>";var $slideDialog=$(dialogCode);$("body").append($slideDialog);
$(".wonderplugin-dialog").css({"margin-top":String($(document).scrollTop()+60)+"px"});$(".wonderplugin-dialog-bg").css({height:$(document).height()+"px"});$("#wonderplugin-dialog-title").html("Add "+dialogTitle[dialogType]);$("#wonderplugin-dialog-image-altusetitle").click(function(){$("#wonderplugin-dialog-image-alt").attr("disabled",$(this).is(":checked"))});if(langlist&&langlist.length>1)$("#wonderplugin-dialog-multilingual").click(function(){var defaultlang=$("#wonderplugin-gallery-defaultlang").text();
var form='<div><ul class="wonderplugin-dialog-tab-buttons" data-panelsid="wonderplugin-dialog-tab-panels-multilingual">';for(var i=0;i<langlist.length;i++)form+='<li class="wonderplugin-dialog-tab-button'+(defaultlang==langlist[i].code?" wonderplugin-dialog-tab-button-selected":"")+'">'+langlist[i].translated_name+(defaultlang==langlist[i].code?" (default)":"")+"</li>";form+="</ul>";form+='<ul class="wonderplugin-dialog-tab-panels" id="wonderplugin-dialog-tab-panels-multilingual">';for(var i=0;i<
langlist.length;i++){form+='<li data-langcode="'+langlist[i].code+'" class="wonderplugin-dialog-tab-panel-'+langlist[i].code+" wonderplugin-dialog-tab-panel"+(defaultlang==langlist[i].code?" wonderplugin-dialog-tab-panel-selected":"")+'">';form+='<table style="width:100%;">';form+='<tr><th>Title</th><td><input name="wonderplugin-dialog-multilingual-title" value="" type="text" class="large-text"></input></td></tr>';form+='<tr><th>Description</th><td><textarea name="wonderplugin-dialog-multilingual-description" class="large-text"></textarea></td></tr>';
form+='<tr><th>Img Alt Text</th><td><input name="wonderplugin-dialog-multilingual-alt" value="" type="text" class="large-text"></input></td></tr>';form+='<tr style="display:none;"><th>Button Text</th><td><input name="wonderplugin-dialog-multilingual-button" value="" type="text" class="large-text"></input></td></tr>';form+="</table>";form+="</li>"}form+="</ul></div>";$(form).dialog({title:"Multilingual Translation",resizable:true,modal:true,width:800,open:function(){var langs=null;try{langs=$.parseJSON($("#wonderplugin-dialog-langs").text())}catch(err){}var defaultlang=
$("#wonderplugin-gallery-defaultlang").text();if(langs)for(var key in langs){if(key==defaultlang){langs[key].title=$("#wonderplugin-dialog-image-title").val();langs[key].description=$("#wonderplugin-dialog-image-description").val();langs[key].alt=$("#wonderplugin-dialog-image-alt").val();langs[key].button=$("#wonderplugin-dialog-image-button").val()}var panel=$("#wonderplugin-dialog-tab-panels-multilingual .wonderplugin-dialog-tab-panel-"+key);if(panel.length>0){$("input[name=wonderplugin-dialog-multilingual-title]",
panel).val(langs[key].title);$("textarea[name=wonderplugin-dialog-multilingual-description]",panel).val(langs[key].description);$("input[name=wonderplugin-dialog-multilingual-alt]",panel).val(langs[key].alt);$("input[name=wonderplugin-dialog-multilingual-button]",panel).val(langs[key].button)}}else for(var i=0;i<langlist.length;i++){$("input[name=wonderplugin-dialog-multilingual-title]").val($("#wonderplugin-dialog-image-title").val());$("textarea[name=wonderplugin-dialog-multilingual-description]").val($("#wonderplugin-dialog-image-description").val());
$("input[name=wonderplugin-dialog-multilingual-alt]").val($("#wonderplugin-dialog-image-alt").val());$("input[name=wonderplugin-dialog-multilingual-button]").val($("#wonderplugin-dialog-image-button").val())}},buttons:{"Ok":function(){var defaultlang=$("#wonderplugin-gallery-defaultlang").text();var langs={};$("#wonderplugin-dialog-tab-panels-multilingual .wonderplugin-dialog-tab-panel").each(function(index){var langcode=$(this).data("langcode");langs[langcode]={title:$("input[name=wonderplugin-dialog-multilingual-title]",
this).val(),description:$("textarea[name=wonderplugin-dialog-multilingual-description]",this).val(),alt:$("input[name=wonderplugin-dialog-multilingual-alt]",this).val(),button:$("input[name=wonderplugin-dialog-multilingual-button]",this).val()};if(langcode==defaultlang){$("#wonderplugin-dialog-image-title").val(langs[langcode].title);$("#wonderplugin-dialog-image-description").val(langs[langcode].description);$("#wonderplugin-dialog-image-alt").val(langs[langcode].alt);$("#wonderplugin-dialog-image-button").val(langs[langcode].button)}});
$("#wonderplugin-dialog-langs").text(JSON.stringify(langs));$(this).dialog("destroy").remove()},"Cancel":function(){$(this).dialog("destroy").remove()}}})});scheduleInitUI();if(data){scheduleApplyData(data);if(data.langs)$("#wonderplugin-dialog-langs").text(data.langs);if(dialogType==2||dialogType==3||dialogType==4||dialogType==5)$("#wonderplugin-dialog-video").val(data.video);$("#wonderplugin-dialog-image").val(data.image);if(data.image){$("#wonderplugin-dialog-image-display-tr").css({display:"table-row"});
$("#wonderplugin-dialog-image-display").attr("src",data.image)}$("#wonderplugin-dialog-thumbnail").val(data.thumbnail);$("#wonderplugin-dialog-image-title").val(data.title);$("#wonderplugin-dialog-image-description").val(data.description);$("#wonderplugin-dialog-image-altusetitle").attr("checked",data.altusetitle);$("#wonderplugin-dialog-image-alt").val(data.alt);$("#wonderplugin-dialog-image-alt").attr("disabled",data.altusetitle);if(dialogType==1){$("#wonderplugin-dialog-mp4").val(data.mp4);$("#wonderplugin-dialog-hdmp4").val(data.hdmp4);
$("#wonderplugin-dialog-webm").val(data.webm);$("#wonderplugin-dialog-hdwebm").val(data.hdwebm);$("#wonderplugin-dialog-vtt").val(data.vtt)}if(dialogType==0||dialogType==1){$("#wonderplugin-dialog-weblink").val(data.weblink);$("#wonderplugin-dialog-linktarget").val(data.linktarget)}}if(dialogType==2||dialogType==3||dialogType==4)$("#wonderplugin-dialog-select-video").click(function(){var videoData={type:dialogType,video:$.trim($("#wonderplugin-dialog-video").val()),image:$.trim($("#wonderplugin-dialog-image").val()),
thumbnail:$.trim($("#wonderplugin-dialog-thumbnail").val()),title:$.trim($("#wonderplugin-dialog-image-title").val()),description:$.trim($("#wonderplugin-dialog-image-description").val()),altusetitle:$("#wonderplugin-dialog-image-altusetitle").is(":checked"),alt:$.trim($("#wonderplugin-dialog-image-alt").val())};$slideDialog.remove();onlineVideoDialog(dialogType,function(items){items.map(function(data){addMediaToList({type:dialogType,image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,
video:data.video,mp4:data.mp4,hdmp4:data.hdmp4,webm:data.webm,hdwebm:data.hdwebm,vtt:data.vtt,title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,linktarget:data.linktarget,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()},videoData,true,dataIndex)});var get_media_langs=function(items,callback){if(langlist&&langlist.length>1){var media=new Array;for(var i=0;i<items.length;i++)media.push(items[i].id);
var ajaxnonce=$("#wonderplugin-gallery-ajaxnonce").text();var loading='<div><div class="wonderplugin-dialog-loading"></div><p style="text-align:center;font-size:1.2em;">Loading multilingual text from Media Library ... </p></div>';var loadingDialog=$(loading).dialog({title:"Loading",width:500,resizable:false,modal:true});$.ajax({url:ajaxurl,type:"POST",data:{action:"wonderplugin_gallery_get_media_langs",nonce:ajaxnonce,item:JSON.stringify(media)},success:function(data){if(data){var defaultlang=$("#wonderplugin-gallery-defaultlang").text();
var currentlang=$("#wonderplugin-gallery-currentlang").text();for(var i=0;i<items.length;i++)for(var key in data)if(items[i].id==key){items[i].langs=JSON.stringify(data[key]);if(currentlang!=defaultlang&&data[key])for(var langcode in data[key])if(langcode==defaultlang){items[i].title=data[key][langcode].title;items[i].description=data[key][langcode].description;items[i].alt=data[key][langcode].alt;break}break}}},complete:function(){callback(items);loadingDialog.dialog("destroy").remove()}})}else callback(items)};
var media_upload_onclick=function(event){event.preventDefault();var buttonId=$(this).attr("id");var textId=$(this).data("textid");var library_title;var library_type;if(buttonId=="wonderplugin-dialog-select-image"||buttonId=="wonderplugin-dialog-select-thumbnail"){library_title="Add Image";library_type="image"}else if(buttonId=="wonderplugin-dialog-select-vtt"){library_title="Add Subtitle/Caption VTT";library_type="text"}else{library_title="Add Video";library_type="video"}var media_uploader=wp.media.frames.file_frame=
wp.media({title:library_title,library:{type:library_type},button:{text:library_title},multiple:dialogType==0&&buttonId=="wonderplugin-dialog-select-image"});media_uploader.on("select",function(event){var selection=media_uploader.state().get("selection");if(dialogType==0&&buttonId=="wonderplugin-dialog-select-image"&&selection.length>1){var items=[];selection.map(function(attachment){attachment=attachment.toJSON();if(attachment.type!="image")return;var thumbnail;var thumbnailsize=$("#wonderplugin-gallery-thumbnailsize").text();
if(thumbnailsize&&thumbnailsize.length>0&&attachment.sizes&&attachment.sizes[thumbnailsize]&&attachment.sizes[thumbnailsize].url)thumbnail=attachment.sizes[thumbnailsize].url;else if(attachment.sizes&&attachment.sizes.thumbnail&&attachment.sizes.thumbnail.url)thumbnail=attachment.sizes.thumbnail.url;else if(attachment.sizes&&attachment.sizes.medium&&attachment.sizes.medium.url)thumbnail=attachment.sizes.medium.url;else thumbnail=attachment.url;var imageurl;var imagesize=$("#wonderplugin-gallery-imagesize").text();
if(imagesize&&imagesize.length>0&&attachment.sizes&&attachment.sizes[imagesize]&&attachment.sizes[imagesize].url)imageurl=attachment.sizes[imagesize].url;else imageurl=attachment.url;var schedule=$("#wonderplugin-dialog-schedule").is(":checked");var starttime=$("#wonderplugin-dialog-starttimedate").val()+" "+$("#wonderplugin-dialog-starttimehour").val()+":"+$("#wonderplugin-dialog-starttimeminute").val()+":"+$("#wonderplugin-dialog-starttimesecond").val();var endtime=$("#wonderplugin-dialog-endtimedate").val()+
" "+$("#wonderplugin-dialog-endtimehour").val()+":"+$("#wonderplugin-dialog-endtimeminute").val()+":"+$("#wonderplugin-dialog-endtimesecond").val();items.push({id:attachment.id,image:imageurl,thumbnail:thumbnail,title:attachment.title,description:attachment.description,altusetitle:attachment.alt&&attachment.alt.length>0?false:true,alt:attachment.alt&&attachment.alt.length>0?attachment.alt:"",weblink:"",linktarget:"",schedule:schedule,starttime:starttime,endtime:endtime})});$slideDialog.remove();get_media_langs(items,
onSuccess)}else{attachment=selection.first().toJSON();if(buttonId=="wonderplugin-dialog-select-image"){if(attachment.type!="image"){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select an image file</p>");return}var thumbnail;var thumbnailsize=$("#wonderplugin-gallery-thumbnailsize").text();if(thumbnailsize&&thumbnailsize.length>0&&attachment.sizes&&attachment.sizes[thumbnailsize]&&attachment.sizes[thumbnailsize].url)thumbnail=attachment.sizes[thumbnailsize].url;else if(attachment.sizes&&
attachment.sizes.thumbnail&&attachment.sizes.thumbnail.url)thumbnail=attachment.sizes.thumbnail.url;else if(attachment.sizes&&attachment.sizes.medium&&attachment.sizes.medium.url)thumbnail=attachment.sizes.medium.url;else thumbnail=attachment.url;var imageurl;var imagesize=$("#wonderplugin-gallery-imagesize").text();if(imagesize&&imagesize.length>0&&attachment.sizes&&attachment.sizes[imagesize]&&attachment.sizes[imagesize].url)imageurl=attachment.sizes[imagesize].url;else imageurl=attachment.url;
$("#wonderplugin-dialog-image-display-tr").css({display:"table-row"});$("#wonderplugin-dialog-image-display").attr("src",imageurl);$("#wonderplugin-dialog-image").val(imageurl);$("#wonderplugin-dialog-thumbnail").val(thumbnail);$("#wonderplugin-dialog-image-title").val(attachment.title);$("#wonderplugin-dialog-image-description").val(attachment.description);if(attachment.alt&&attachment.alt.length>0){$("#wonderplugin-dialog-image-altusetitle").attr("checked",false);$("#wonderplugin-dialog-image-alt").val(attachment.alt);
$("#wonderplugin-dialog-image-alt").attr("disabled",false)}get_media_langs([{id:attachment.id}],function(data){if(data&&data.length>0){$("#wonderplugin-dialog-langs").text(data[0].langs);var defaultlang=$("#wonderplugin-gallery-defaultlang").text();var currentlang=$("#wonderplugin-gallery-currentlang").text();if(currentlang!=defaultlang&&data[0].langs){var langs=$.parseJSON(data[0].langs);for(var langcode in langs)if(langcode==defaultlang){$("#wonderplugin-dialog-image-title").val(langs[langcode].title);
$("#wonderplugin-dialog-image-description").val(langs[langcode].description);$("#wonderplugin-dialog-image-alt").val(langs[langcode].alt);break}}}})}else if(buttonId=="wonderplugin-dialog-select-thumbnail"){if(attachment.type!="image"){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select an image file</p>");return}$("#wonderplugin-dialog-thumbnail").val(attachment.url)}else if(buttonId=="wonderplugin-dialog-select-vtt")$("#"+textId).val(attachment.url);else{if(attachment.type!=
"video"){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select a video file</p>");return}$("#"+textId).val(attachment.url)}}$("#wonderplugin-dialog-error").css({display:"none"}).empty()});media_uploader.open()};if(parseInt($("#wonderplugin-gallery-wp-history-media-uploader").text())==1){var buttonId="";var textId="";var history_media_upload_onclick=function(event){buttonId=$(this).attr("id");textId=$(this).data("textid");var mediaType=buttonId=="wonderplugin-dialog-select-image"||
buttonId=="wonderplugin-dialog-select-thumbnail"?"image":"video";tb_show("Upload "+mediaType,"media-upload.php?referer=wonderplugin-gallery&type="+mediaType+"&TB_iframe=true",false);return false};window.send_to_editor=function(html){tb_remove();if(buttonId=="wonderplugin-dialog-select-image"){var $img=$("img",html);if(!$img.length){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select an image file</p>");return}var thumbnail=$img.attr("src");var src=$(html).is("a")?$(html).attr("href"):
thumbnail;$("#wonderplugin-dialog-image-display-tr").css({display:"table-row"});$("#wonderplugin-dialog-image-display").attr("src",thumbnail);$("#wonderplugin-dialog-image").val(src);$("#wonderplugin-dialog-thumbnail").val(thumbnail);$("#wonderplugin-dialog-image-title").val($("img",html).attr("title"))}else if(buttonId=="wonderplugin-dialog-select-thumbnail"){var $img=$("img",html);if(!$img.length){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select an image file</p>");
return}var thumbnail=$img.attr("src");var src=$(html).is("a")?$(html).attr("href"):thumbnail;$("#wonderplugin-dialog-thumbnail").val(src)}else{if($("img",html).length){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select a video file</p>");return}$("#"+textId).val($(html).attr("href"))}$("#wonderplugin-dialog-error").css({display:"none"}).empty()};$("#wonderplugin-dialog-select-image").click(history_media_upload_onclick);$("#wonderplugin-dialog-select-thumbnail").click(history_media_upload_onclick);
if(dialogType==1){$("#wonderplugin-dialog-select-mp4").click(history_media_upload_onclick);$("#wonderplugin-dialog-select-hdmp4").click(history_media_upload_onclick);$("#wonderplugin-dialog-select-webm").click(history_media_upload_onclick);$("#wonderplugin-dialog-select-hdwebm").click(history_media_upload_onclick);$("#wonderplugin-dialog-select-vtt").click(history_media_upload_onclick)}}else{$("#wonderplugin-dialog-select-image").click(media_upload_onclick);$("#wonderplugin-dialog-select-thumbnail").click(media_upload_onclick);
if(dialogType==1){$("#wonderplugin-dialog-select-mp4").click(media_upload_onclick);$("#wonderplugin-dialog-select-hdmp4").click(media_upload_onclick);$("#wonderplugin-dialog-select-webm").click(media_upload_onclick);$("#wonderplugin-dialog-select-hdwebm").click(media_upload_onclick);$("#wonderplugin-dialog-select-vtt").click(media_upload_onclick)}}$("#wonderplugin-dialog-ok").click(function(){if(dialogType==0&&$.trim($("#wonderplugin-dialog-image").val()).length<=0){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select an image file</p>");
$("#wonderplugin-dialog-image").focus();return}if(dialogType==1&&$.trim($("#wonderplugin-dialog-mp4").val()).length<=0){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select a video file</p>");$("#wonderplugin-dialog-mp4").focus();return}var langs=$.parseJSON($("#wonderplugin-dialog-langs").text());var defaultlang=$("#wonderplugin-gallery-defaultlang").text();for(var key in langs)if(key==defaultlang){langs[key].title=$("#wonderplugin-dialog-image-title").val();langs[key].description=
$("#wonderplugin-dialog-image-description").val();langs[key].alt=$("#wonderplugin-dialog-image-alt").val();langs[key].button=$("#wonderplugin-dialog-image-button").val()}var schedule=$("#wonderplugin-dialog-schedule").is(":checked");var starttime=$("#wonderplugin-dialog-starttimedate").val()+" "+$("#wonderplugin-dialog-starttimehour").val()+":"+$("#wonderplugin-dialog-starttimeminute").val()+":"+$("#wonderplugin-dialog-starttimesecond").val();var endtime=$("#wonderplugin-dialog-endtimedate").val()+
" "+$("#wonderplugin-dialog-endtimehour").val()+":"+$("#wonderplugin-dialog-endtimeminute").val()+":"+$("#wonderplugin-dialog-endtimesecond").val();var item={image:$.trim($("#wonderplugin-dialog-image").val()),thumbnail:$.trim($("#wonderplugin-dialog-thumbnail").val()),video:$.trim($("#wonderplugin-dialog-video").val()),mp4:$.trim($("#wonderplugin-dialog-mp4").val()),hdmp4:$.trim($("#wonderplugin-dialog-hdmp4").val()),webm:$.trim($("#wonderplugin-dialog-webm").val()),hdwebm:$.trim($("#wonderplugin-dialog-hdwebm").val()),
vtt:$.trim($("#wonderplugin-dialog-vtt").val()),title:$.trim($("#wonderplugin-dialog-image-title").val()),description:$.trim($("#wonderplugin-dialog-image-description").val()),altusetitle:$("#wonderplugin-dialog-image-altusetitle").is(":checked"),alt:$.trim($("#wonderplugin-dialog-image-alt").val()),weblink:$.trim($("#wonderplugin-dialog-weblink").val()),linktarget:$.trim($("#wonderplugin-dialog-linktarget").val()),langs:langs?JSON.stringify(langs):"",schedule:schedule,starttime:starttime,endtime:endtime};
$slideDialog.remove();onSuccess([item])});$("#wonderplugin-dialog-cancel").click(function(){$slideDialog.remove()})};var youtubePlaylistDialog=function(onSuccess,data,dataIndex){var dialogCode="<div class='wonderplugin-dialog-container'>"+"<div class='wonderplugin-dialog-bg'></div>"+"<div class='wonderplugin-dialog'>"+"<h3 id='wonderplugin-dialog-title'>Add YouTube Playlist</h3>"+"<div class='error' id='wonderplugin-dialog-error' style='display:none;'></div>"+'<ul class="wonderplugin-dialog-tab-buttons" data-panelsid="wonderplugin-dialog-tab-panels-content">'+
'<li class="wonderplugin-dialog-tab-button wonderplugin-dialog-tab-button-selected">YouTube Playlist</li>'+'<li class="wonderplugin-dialog-tab-button">Schedule</li></ul>'+'<ul class="wonderplugin-dialog-tab-panels" id="wonderplugin-dialog-tab-panels-content">'+'<li class="wonderplugin-dialog-tab-panel wonderplugin-dialog-tab-panel-selected">'+"<table class='wonderplugin-dialog-form'>"+"<tr>"+"<th>YouTube API key</th>"+"<td><input name='wonderplugin-dialog-youtubeapikey' type='text' id='wonderplugin-dialog-youtubeapikey' value='' class='regular-text' /></td>"+
"</tr>"+"<tr>"+"<th>YouTube playlist ID</th>"+"<td><input name='wonderplugin-dialog-youtubeplaylistid' type='text' id='wonderplugin-dialog-youtubeplaylistid' value='' class='regular-text' /></td>"+"</tr>"+"<tr>"+"<th>Maximum results</th>"+"<td><input name='wonderplugin-dialog-youtubeplaylistmaxresults' type='number' id='wonderplugin-dialog-youtubeplaylistmaxresults' value='50' class='small-text' /></td>"+"</tr>"+"</table>"+"<p style='margin-left:12px;text-align:left;'><a href='https://www.wonderplugin.com/youtube-api-key-and-playlist-id/' target='_blank'>Tutorial: How to apply for a YouTube API key and how to find your YouTube playlist ID</a></p>"+
"</li>"+'<li class="wonderplugin-dialog-tab-panel">'+scheduleDialogContent()+"</li>"+"<div class='wonderplugin-dialog-buttons'>"+"<input type='button' class='button button-primary' id='wonderplugin-dialog-ok' value='OK' />"+"<input type='button' class='button' id='wonderplugin-dialog-cancel' value='Cancel' />"+"</div>"+"</div>"+"</div>";var $playlistDialog=$(dialogCode);$("body").append($playlistDialog);$(".wonderplugin-dialog").css({"margin-top":String($(document).scrollTop()+60)+"px"});$(".wonderplugin-dialog-bg").css({height:$(document).height()+
"px"});scheduleInitUI();if(data){scheduleApplyData(data);$("#wonderplugin-dialog-youtubeapikey").val(data.youtubeapikey);$("#wonderplugin-dialog-youtubeplaylistid").val(data.youtubeplaylistid);$("#wonderplugin-dialog-youtubeplaylistmaxresults").val(data.youtubeplaylistmaxresults)}$("#wonderplugin-dialog-ok").click(function(){if($.trim($("#wonderplugin-dialog-youtubeapikey").val()).length<=0){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please enter your YouTube API key</p>");$("#wonderplugin-dialog-youtubeapikey").focus();
return}if($.trim($("#wonderplugin-dialog-youtubeplaylistid").val()).length<=0){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please enter your YouTube playlist ID</p>");$("#wonderplugin-dialog-youtubeplaylistid").focus();return}var schedule=$("#wonderplugin-dialog-schedule").is(":checked");var starttime=$("#wonderplugin-dialog-starttimedate").val()+" "+$("#wonderplugin-dialog-starttimehour").val()+":"+$("#wonderplugin-dialog-starttimeminute").val()+":"+$("#wonderplugin-dialog-starttimesecond").val();
var endtime=$("#wonderplugin-dialog-endtimedate").val()+" "+$("#wonderplugin-dialog-endtimehour").val()+":"+$("#wonderplugin-dialog-endtimeminute").val()+":"+$("#wonderplugin-dialog-endtimesecond").val();var item={youtubeapikey:$.trim($("#wonderplugin-dialog-youtubeapikey").val()),youtubeplaylistid:$.trim($("#wonderplugin-dialog-youtubeplaylistid").val()),youtubeplaylistmaxresults:$.trim($("#wonderplugin-dialog-youtubeplaylistmaxresults").val()),schedule:schedule,starttime:starttime,endtime:endtime};
$playlistDialog.remove();onSuccess([item])});$("#wonderplugin-dialog-cancel").click(function(){$playlistDialog.remove()})};var onlineVideoDialog=function(dialogType,onSuccess,videoData,invokeFromSlideDialog,dataIndex){var dialogTitle=["Image","Video","Youtube Video","Vimeo Video","Dailymotion Video"];var dialogExample=["","","https://www.youtube.com/watch?v=wswxQ3mhwqQ","https://vimeo.com/147079122","https://www.dailymotion.com/embed/video/x1yj6t9 or https://dai.ly/x1yj6t9"];var dialogCode="<div class='wonderplugin-dialog-container'>"+
"<div class='wonderplugin-dialog-bg'></div>"+"<div class='wonderplugin-dialog'>"+"<h3 id='wonderplugin-dialog-title'></h3>"+"<div class='error' id='wonderplugin-dialog-error' style='display:none;'></div>"+"<table class='wonderplugin-dialog-form'>"+"<tr>"+"<th>"+dialogTitle[dialogType]+" URL</th>"+"<td><input name='wonderplugin-dialog-video' type='text' id='wonderplugin-dialog-video' value='' class='regular-text' />"+"<p>URL Example: <span class='urlexample'>"+dialogExample[dialogType]+"</span><p>"+
"</td>"+"</tr>";dialogCode+="</table>"+"<div id='wonderplugin-gallery-video-dialog-loading'></div>"+"<div class='wonderplugin-dialog-buttons'>"+"<input type='button' class='button button-primary' id='wonderplugin-dialog-ok' value='OK' />"+"<input type='button' class='button' id='wonderplugin-dialog-cancel' value='Cancel' />"+"</div>"+"</div>"+"</div>";var $videoDialog=$(dialogCode);$("body").append($videoDialog);$(".wonderplugin-dialog").css({"margin-top":String($(document).scrollTop()+60)+"px"});
$(".wonderplugin-dialog-bg").css({height:$(document).height()+"px"});if(!videoData)videoData={type:dialogType};$("#wonderplugin-dialog-title").html("Add "+dialogTitle[dialogType]);var videoDataReturn=function(){$videoDialog.remove();slideDialog(dialogType,function(items){if(items&&items.length>0){if(typeof dataIndex!=="undefined"&&dataIndex>=0)wonderplugin_gallery_config.slides.splice(dataIndex,1);items.map(function(data){var result={type:dialogType,image:data.image,thumbnail:data.thumbnail?data.thumbnail:
data.image,video:data.video,mp4:data.mp4,hdmp4:data.hdmp4,webm:data.webm,hdwebm:data.hdwebm,vtt:data.vtt,title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,linktarget:data.linktarget,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime};if(typeof dataIndex!=="undefined"&&dataIndex>=0)wonderplugin_gallery_config.slides.splice(dataIndex,0,result);else addMediaToList(result)});updateMediaTable()}},videoData,dataIndex)};
$("#wonderplugin-dialog-ok").click(function(){var href=$.trim($("#wonderplugin-dialog-video").val());if(href.length<=0){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please enter a "+dialogTitle[dialogType]+" URL</p>");return}var protocol="https:";if(dialogType==2){var youtubeId="";var youtubedomain="youtube.com";var regExp=/^.*((youtu\.be)|(youtube\.com)|(youtube-nocookie\.com))\/((v\/)|(embed\/)|(watch\?v=))?([^#\&\?]*).*/;var match=href.match(regExp);if(match&&match[9]&&match[9].length==
11){youtubeId=match[9];if(match[1]=="youtube-nocookie.com")youtubedomain="youtube-nocookie.com"}else{$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please enter a valid Youtube URL</p>");return}var result=protocol+"//www."+youtubedomain+"/embed/"+youtubeId;var params=getURLParams(href);var first=true;for(var key in params){if(first){result+="?";first=false}else result+="&";result+=key+"="+params[key]}videoData.video=result;videoData.image=protocol+"//img.youtube.com/vi/"+youtubeId+
"/0.jpg";videoData.thumbnail=protocol+"//img.youtube.com/vi/"+youtubeId+"/0.jpg";videoDataReturn()}else if(dialogType==3){var vimeoId="";var regExp=/^.*(vimeo\.com\/)((video\/)|(channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/;var match=href.match(regExp);if(match&&match[6])vimeoId=match[6];else{$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please enter a valid Vimeo URL</p>");return}var result=protocol+"//player.vimeo.com/video/"+vimeoId;var params=getURLParams(href);var first=
true;for(var key in params){if(first){result+="?";first=false}else result+="&";result+=key+"="+params[key]}videoData.video=result;$("#wonderplugin-gallery-video-dialog-loading").css({display:"block"});$.ajax({url:protocol+"//www.vimeo.com/api/v2/video/"+vimeoId+".json?callback=?",dataType:"json",timeout:3E3,data:{format:"json"},success:function(data){videoData.image=data[0].thumbnail_large;videoData.thumbnail=data[0].thumbnail_medium;videoDataReturn()},error:function(){videoDataReturn()}})}else if(dialogType==
4){var dailymotionId="";if(href.match(/\:\/\/.*(dai\.ly)/i))dailymotionId=href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2];else if(href.match(/dailymotion\.com\/embed\/video\//i))dailymotionId=href.match(/(dailymotion\.com\/embed\/video\/)([a-zA-Z0-9\-\_]+)/)[2];else{$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please enter a valid Dailymotion URL</p>");return}var result=protocol+"//www.dailymotion.com/embed/video/"+dailymotionId;var params=getURLParams(href);var first=true;for(var key in params){if(first){result+=
"?";first=false}else result+="&";result+=key+"="+params[key]}videoData.video=result;videoData.image=protocol+"//www.dailymotion.com/thumbnail/video/"+dailymotionId;videoData.thumbnail=protocol+"//www.dailymotion.com/thumbnail/video/"+dailymotionId;videoDataReturn()}});$("#wonderplugin-dialog-cancel").click(function(){$videoDialog.remove();if(invokeFromSlideDialog)videoDataReturn()})};var updateMediaTable=function(){var mediaType=["Image","Video","YouTube","Vimeo","Dailymotion","Iframe Video","WordPress Posts",
"","","","YouTube Playlist","Import Folder"];$("#wonderplugin-gallery-media-table").empty();for(var i=0;i<wonderplugin_gallery_config.slides.length;i++){var thumbnail="";if(wonderplugin_gallery_config.slides[i].type==6)thumbnail=$("#wonderplugin-gallery-pluginfolder").text()+"images/wordpressposts.png";else if(wonderplugin_gallery_config.slides[i].type==10)thumbnail=$("#wonderplugin-gallery-pluginfolder").text()+"images/youtubeplaylist.png";else if(wonderplugin_gallery_config.slides[i].type==11)thumbnail=
$("#wonderplugin-gallery-pluginfolder").text()+"images/importfolder.png";else if(wonderplugin_gallery_config.slides[i].type>=1&&wonderplugin_gallery_config.slides[i].type<=5&&!wonderplugin_gallery_config.slides[i].thumbnail)thumbnail=$("#wonderplugin-gallery-pluginfolder").text()+"images/video.png";else thumbnail=wonderplugin_gallery_config.slides[i].thumbnail;$("#wonderplugin-gallery-media-table").append("<li>"+"<div class='wonderplugin-gallery-media-table-id'>"+(i+1)+"</div>"+"<div class='wonderplugin-gallery-media-table-img'>"+
"<img class='wonderplugin-gallery-media-table-image' data-order='"+i+"' src='"+thumbnail+"' />"+"</div>"+"<div class='wonderplugin-gallery-media-table-type'>"+mediaType[wonderplugin_gallery_config.slides[i].type]+"</div>"+"<div class='wonderplugin-gallery-media-table-buttons-edit'>"+"<a class='wonderplugin-gallery-media-table-button wonderplugin-gallery-media-table-edit'>Edit</a>&nbsp;|&nbsp;"+"<a class='wonderplugin-gallery-media-table-button wonderplugin-gallery-media-table-delete'>Delete</a>"+
"</div>"+"<div class='wonderplugin-gallery-media-table-buttons-move'>"+"<a class='wonderplugin-gallery-media-table-button wonderplugin-gallery-media-table-moveup'>Move Up</a>&nbsp;|&nbsp;"+"<a class='wonderplugin-gallery-media-table-button wonderplugin-gallery-media-table-movedown'>Move Down</a>"+"</div>"+"<div style='clear:both;'></div>"+"</li>")}$(".wonderplugin-gallery-media-table-image").wpdraggable(wonderPluginMediaTableMove)};$("#wonderplugin-add-image").click(function(){slideDialog(0,function(items){items.map(function(data){addMediaToList({type:0,
image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,video:data.video,mp4:data.mp4,hdmp4:data.hdmp4,webm:data.webm,hdwebm:data.hdwebm,vtt:data.vtt,title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,linktarget:data.linktarget,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()})});$("#wonderplugin-add-video").click(function(){slideDialog(1,function(items){items.map(function(data){addMediaToList({type:1,
image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,video:data.video,mp4:data.mp4,hdmp4:data.hdmp4,webm:data.webm,hdwebm:data.hdwebm,vtt:data.vtt,title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,linktarget:data.linktarget,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()})});$("#wonderplugin-add-youtube").click(function(){onlineVideoDialog(2,function(items){items.map(function(data){addMediaToList({type:2,
image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,video:data.video,mp4:data.mp4,hdmp4:data.hdmp4,webm:data.webm,hdwebm:data.hdwebm,vtt:data.vtt,title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,linktarget:data.linktarget,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()})});$("#wonderplugin-add-youtube-playlist").click(function(){youtubePlaylistDialog(function(items){items.map(function(data){addMediaToList({type:10,
youtubeapikey:data.youtubeapikey,youtubeplaylistid:data.youtubeplaylistid,youtubeplaylistmaxresults:data.youtubeplaylistmaxresults,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()})});$("#wonderplugin-add-vimeo").click(function(){onlineVideoDialog(3,function(items){items.map(function(data){addMediaToList({type:3,image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,video:data.video,mp4:data.mp4,hdmp4:data.hdmp4,webm:data.webm,hdwebm:data.hdwebm,
vtt:data.vtt,title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,linktarget:data.linktarget,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()})});$("#wonderplugin-add-dailymotion").click(function(){onlineVideoDialog(4,function(items){items.map(function(data){addMediaToList({type:4,image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,video:data.video,mp4:data.mp4,hdmp4:data.hdmp4,
webm:data.webm,hdwebm:data.hdwebm,vtt:data.vtt,title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,linktarget:data.linktarget,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()})});$("#wonderplugin-add-iframevideo").click(function(){slideDialog(5,function(items){items.map(function(data){addMediaToList({type:5,image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,video:data.video,
title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()})});$("#wonderplugin-reverselist").click(function(){wonderplugin_gallery_config.slides.reverse();updateMediaTable()});var addPostsDialog=function(dialogType,onSuccess,data,dataIndex){var dialogCode="<div class='wonderplugin-dialog-container'>"+"<div class='wonderplugin-dialog-bg'></div>"+"<div class='wonderplugin-dialog'>"+
"<h3 id='wonderplugin-dialog-title'>Add Posts</h3>"+"<div class='error' id='wonderplugin-dialog-error' style='display:none;'></div>"+"<table class='wonderplugin-dialog-form'>"+"<tr>"+"<th>Select Posts</th><td><select name='wonderplugin-dialog-postcategory' id='wonderplugin-dialog-postcategory'>";var catlist=$.parseJSON($("#wonderplugin-gallery-catlist").text());dialogCode+="<option value='-1'>Recent Posts</option>";for(var key in catlist)dialogCode+="<option value='"+catlist[key].ID+"'>Category: "+
catlist[key].cat_name+"</option>";dialogCode+="</select></td></tr>";dialogCode+="<tr><th>Maximum Posts</th><td><input name='wonderplugin-dialog-postnumber' id='wonderplugin-dialog-postnumber' type='number' value='10' class='small-text' /></td></tr>";dialogCode+="<tr><th>Thumbnail Image Size</th><td><select name='wonderplugin-dialog-featuredimagesize' id='wonderplugin-dialog-featuredimagesize'><option value='thumbnail'>Thumbnail</option><option value='medium'>Medium</option><option value='large'>Large</option><option value='full'>Full</option></select></td>";
dialogCode+="<tr><th>Maximum Excerpt Word Length</th><td><input name='wonderplugin-dialog-excerptlength' id='wonderplugin-dialog-excerptlength' type='number' value='25' class='small-text' /></td></tr>";dialogCode+="<tr><th>Link Target</th><td><div class='select-editable'><select onchange='this.nextElementSibling.value=this.value'><option value=''></option><option value='_blank'>_blank</option><option value='_self'>_self</option><option value='_parent'>_parent</option><option value='_top'>_top</option></select><input type='text' name='wonderplugin-dialog-postlinktarget' id='wonderplugin-dialog-postlinktarget' value='' /></div></td></tr>";
dialogCode+="<tr><th>Title</th><td><label><input name='wonderplugin-dialog-titlelink' type='checkbox' id='wonderplugin-dialog-titlelink' value='' /> Link title to the post page</label></td></tr>";dialogCode+="</table>"+"<ul style='margin-left:24px;list-style-position:outside;list-style-type:square;text-align:left;'><li>The featured image of a post will be used as the image of the gallery item. For how to define featured images for posts, please view <a href='https://codex.wordpress.org/Post_Thumbnails' target='_blank'>WordPress Featured Images</a>.</li>"+
"<li>The title of a post will be used as the title property of the gallery item.</li>"+"<li>The excerpt of a post will be used as the description property of the gallery item. For how to add excerpts for posts, please view <a href='https://codex.wordpress.org/Excerpt' target='_blank'>WordPress Excerpts</a>.</li></ul>"+"<div class='wonderplugin-dialog-buttons'>"+"<input type='button' class='button button-primary' id='wonderplugin-dialog-ok' value='OK' />"+"<input type='button' class='button' id='wonderplugin-dialog-cancel' value='Cancel' />"+
"</div>"+"</div>"+"</div>";var $postsDialog=$(dialogCode);$("body").append($postsDialog);$(".wonderplugin-dialog").css({"margin-top":String($(document).scrollTop()+60)+"px"});$(".wonderplugin-dialog-bg").css({height:$(document).height()+"px"});if(data){$("#wonderplugin-dialog-postcategory").val(data.postcategory);$("#wonderplugin-dialog-postnumber").val(data.postnumber);$("#wonderplugin-dialog-featuredimagesize").val(data.featuredimagesize);$("#wonderplugin-dialog-excerptlength").val(data.excerptlength);
$("#wonderplugin-dialog-postlinktarget").val(data.postlinktarget);if("posttitlelink"in data)$("#wonderplugin-dialog-titlelink").attr("checked",data.posttitlelink)}$("#wonderplugin-dialog-ok").click(function(){var item={type:dialogType,postcategory:$("#wonderplugin-dialog-postcategory").val(),postnumber:$("#wonderplugin-dialog-postnumber").val(),featuredimagesize:$("#wonderplugin-dialog-featuredimagesize").val(),excerptlength:$("#wonderplugin-dialog-excerptlength").val(),postlinktarget:$("#wonderplugin-dialog-postlinktarget").val(),
posttitlelink:$("#wonderplugin-dialog-titlelink").is(":checked")};$postsDialog.remove();onSuccess(item)});$("#wonderplugin-dialog-cancel").click(function(){$postsDialog.remove()})};$("#wonderplugin-add-posts").click(function(){addPostsDialog(6,function(data){addMediaToList(data);updateMediaTable()})});var addFolderDialog=function(dialogType,onSuccess,data,dataIndex){var dialogCode="<div class='wonderplugin-dialog-container wonderplugin-dialog-container-fixed'>"+"<div class='wonderplugin-dialog-bg'></div>"+
"<div class='wonderplugin-dialog'>"+"<h3 id='wonderplugin-dialog-title'>Import Folder</h3>"+"<div class='error' id='wonderplugin-dialog-error' style='display:none;'></div>";dialogCode+='<ul class="wonderplugin-dialog-tab-buttons" data-panelsid="wonderplugin-dialog-tab-panels-content">'+'<li class="wonderplugin-dialog-tab-button wonderplugin-dialog-tab-button-selected">Select a Folder</li>'+'<li class="wonderplugin-dialog-tab-button">Options</li>'+"</ul>";dialogCode+='<ul class="wonderplugin-dialog-tab-panels" id="wonderplugin-dialog-tab-panels-content">'+
'<li class="wonderplugin-dialog-tab-panel wonderplugin-dialog-tab-panel-selected">';dialogCode+="<p style='text-align:left;'><span style='font-weight:bold;'>Selected Folder</span>: <span id='wonderplugin-folder-selected'></span></p>";dialogCode+="<div id='wonderplugin-folder-tree'></div>";dialogCode+='</li><li class="wonderplugin-dialog-tab-panel">';dialogCode+='<table class="wonderplugin-dialog-form">';dialogCode+='<tr><th>Sorting order</th><td><select name="wonderplugin-dialog-sortorder" id="wonderplugin-dialog-sortorder"><option value="ASC">Ascending</option><option value="DESC">Descending</option></select></td>';
dialogCode+='<tr><th>Image extensions</th><td><input name="wonderplugin-dialog-imageext" id="wonderplugin-dialog-imageext" type="text" value="jpg|jpeg|gif|png" class="large-text" /></td></tr>';dialogCode+='<tr><th>Video extensions</th><td><input name="wonderplugin-dialog-videoext" id="wonderplugin-dialog-videoext" type="text" value="mp4|m4v" class="large-text" /></td></tr>';dialogCode+='<tr><th>Thumbnail suffix</th><td><input name="wonderplugin-dialog-thumbname" id="wonderplugin-dialog-thumbname" type="text" value="-thumb" class="large-text" /></td></tr>';
dialogCode+='<tr><th>Poster suffix</th><td><input name="wonderplugin-dialog-postername" id="wonderplugin-dialog-postername" type="text" value="-poster" class="large-text" /></td></tr>';dialogCode+='<tr><th></th><td><p class="wonderplugin-dialog-help">* If myimage.jpg and myimage-thumb.jpg are found in the folder, myimage-thumb.jpg will be used as the thumbnail of the image.</p><p class="wonderplugin-dialog-help">* If myvideo.mp4, myvideo-thumb.jpg and myvideo-poster.jpg are found in the folder, myvideo-thumb.jpg will be used as the thumbnail, myvideo-poster.jpg will be used as the poster image.</p></td></tr>';
dialogCode+='<tr><th>Title</th><td><label><input name="wonderplugin-dialog-usefilenameastitle" type="checkbox" id="wonderplugin-dialog-usefilenameastitle" value="" /> Use filename for title</label></td></tr>';dialogCode+='<tr><th>List.xml</th><td><label><input name="wonderplugin-dialog-onlyusexml" type="checkbox" id="wonderplugin-dialog-onlyusexml" value="" /> Only load items defined in list.xml file</label></td></tr>';dialogCode+="</table>";dialogCode+="</li></ul>";dialogCode+="<div class='wonderplugin-dialog-buttons'>"+
"<input type='button' class='button button-primary' id='wonderplugin-dialog-ok' value='OK' />"+"<input type='button' class='button' id='wonderplugin-dialog-cancel' value='Cancel' />"+"</div>"+"</div>"+"</div>";var $folderDialog=$(dialogCode);$("body").append($folderDialog);$(".wonderplugin-dialog").css({"margin-top":"60px"});$(".wonderplugin-dialog-bg").css({height:$(document).height()+"px"});var folderlist=$.parseJSON($("#wonderplugin-gallery-folderlist").text());if(folderlist==-1)$("#wonderplugin-folder-tree").html("No permissions to browse folders.");
else if(folderlist&&folderlist.length>0){var foldercode="<ul class='wonderplugin-foldername-list'>";for(var i=0;i<folderlist.length;i++)foldercode+="<li class='wonderplugin-foldername-item wonderplugin-folder'><a class='wonderplugin-foldername' href='#' data-foldername='"+folderlist[i]+"'>"+folderlist[i]+"</a></li>";foldercode+="</ul>";$("#wonderplugin-folder-tree").html(foldercode)}if(data){$("#wonderplugin-folder-selected").text(data.folder);$("#wonderplugin-dialog-sortorder").val(data.sortorder);
$("#wonderplugin-dialog-imageext").val(data.imageext);$("#wonderplugin-dialog-videoext").val(data.videoext);$("#wonderplugin-dialog-thumbname").val(data.thumbname);$("#wonderplugin-dialog-postername").val(data.postername);$("#wonderplugin-dialog-usefilenameastitle").attr("checked",data.usefilenameastitle);$("#wonderplugin-dialog-onlyusexml").attr("checked",data.onlyusexml)}$("#wonderplugin-dialog-ok").click(function(){var selectedfolder=$.trim($("#wonderplugin-folder-selected").text());if(!selectedfolder||
selectedfolder.length<=0)$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select a folder</p>");var item={type:dialogType,folder:selectedfolder,sortorder:$("#wonderplugin-dialog-sortorder").val(),imageext:$("#wonderplugin-dialog-imageext").val(),videoext:$("#wonderplugin-dialog-videoext").val(),thumbname:$("#wonderplugin-dialog-thumbname").val(),postername:$("#wonderplugin-dialog-postername").val(),usefilenameastitle:$("#wonderplugin-dialog-usefilenameastitle").is(":checked"),
onlyusexml:$("#wonderplugin-dialog-onlyusexml").is(":checked")};$folderDialog.remove();onSuccess(item)});$("#wonderplugin-dialog-cancel").click(function(){$folderDialog.remove()})};$("#wonderplugin-add-folder").click(function(){addFolderDialog(11,function(data){addMediaToList(data);updateMediaTable()})});$(document).on("click",".wonderplugin-gallery-media-table-edit",function(){var index=$(this).parent().parent().index();var mediaType=wonderplugin_gallery_config.slides[index].type;if(mediaType==10)youtubePlaylistDialog(function(items){if(items&&
items.length>0){wonderplugin_gallery_config.slides.splice(index,1);items.map(function(data){wonderplugin_gallery_config.slides.splice(index,0,{type:10,youtubeapikey:data.youtubeapikey,youtubeplaylistid:data.youtubeplaylistid,youtubeplaylistmaxresults:data.youtubeplaylistmaxresults,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()}},wonderplugin_gallery_config.slides[index],index);else if(mediaType==6)addPostsDialog(6,function(data){wonderplugin_gallery_config.slides.splice(index,
1);wonderplugin_gallery_config.slides.splice(index,0,data);updateMediaTable()},wonderplugin_gallery_config.slides[index],index);else if(mediaType==11)addFolderDialog(11,function(data){wonderplugin_gallery_config.slides.splice(index,1);wonderplugin_gallery_config.slides.splice(index,0,data);updateMediaTable()},wonderplugin_gallery_config.slides[index],index);else slideDialog(mediaType,function(items){if(items&&items.length>0){wonderplugin_gallery_config.slides.splice(index,1);items.map(function(data){wonderplugin_gallery_config.slides.splice(index,
0,{type:mediaType,image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,video:data.video,mp4:data.mp4,hdmp4:data.hdmp4,webm:data.webm,hdwebm:data.hdwebm,vtt:data.vtt,title:data.title,description:data.description,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,linktarget:data.linktarget,langs:data.langs,schedule:data.schedule,starttime:data.starttime,endtime:data.endtime})});updateMediaTable()}},wonderplugin_gallery_config.slides[index],index)});$(document).on("click",
".wonderplugin-gallery-media-table-delete",function(){var $tr=$(this).parent().parent();var index=$tr.index();wonderplugin_gallery_config.slides.splice(index,1);$tr.remove();$("#wonderplugin-gallery-media-table").find("li").each(function(index){$(this).find(".wonderplugin-gallery-media-table-id").text(index+1);$(this).find("img").data("order",index);$(this).find("img").css({top:0,left:0})})});var wonderPluginMediaTableMove=function(i,j){var len=wonderplugin_gallery_config.slides.length;if(j<0)j=0;
if(j>len-1)j=len-1;if(i==j){$("#wonderplugin-gallery-media-table").find("li").eq(i).find("img").css({top:0,left:0});return}var $tr=$("#wonderplugin-gallery-media-table").find("li").eq(i);var data=wonderplugin_gallery_config.slides[i];wonderplugin_gallery_config.slides.splice(i,1);wonderplugin_gallery_config.slides.splice(j,0,data);var $trj=$("#wonderplugin-gallery-media-table").find("li").eq(j);$tr.remove();if(j>i)$trj.after($tr);else $trj.before($tr);$("#wonderplugin-gallery-media-table").find("li").each(function(index){$(this).find(".wonderplugin-gallery-media-table-id").text(index+
1);$(this).find("img").data("order",index);$(this).find("img").css({top:0,left:0})});$tr.find("img").wpdraggable(wonderPluginMediaTableMove)};$(document).on("click",".wonderplugin-gallery-media-table-moveup",function(){var $tr=$(this).parent().parent();var index=$tr.index();var data=wonderplugin_gallery_config.slides[index];wonderplugin_gallery_config.slides.splice(index,1);if(index==0){wonderplugin_gallery_config.slides.push(data);var $last=$tr.parent().find("li:last");$tr.remove();$last.after($tr)}else{wonderplugin_gallery_config.slides.splice(index-
1,0,data);var $prev=$tr.prev();$tr.remove();$prev.before($tr)}$("#wonderplugin-gallery-media-table").find("li").each(function(index){$(this).find(".wonderplugin-gallery-media-table-id").text(index+1);$(this).find("img").data("order",index);$(this).find("img").css({top:0,left:0})});$tr.find("img").wpdraggable(wonderPluginMediaTableMove)});$(document).on("click",".wonderplugin-gallery-media-table-movedown",function(){var $tr=$(this).parent().parent();var index=$tr.index();var len=wonderplugin_gallery_config.slides.length;
var data=wonderplugin_gallery_config.slides[index];wonderplugin_gallery_config.slides.splice(index,1);if(index==len-1){wonderplugin_gallery_config.slides.unshift(data);var $first=$tr.parent().find("li:first");$tr.remove();$first.before($tr)}else{wonderplugin_gallery_config.slides.splice(index+1,0,data);var $next=$tr.next();$tr.remove();$next.after($tr)}$("#wonderplugin-gallery-media-table").find("li").each(function(index){$(this).find(".wonderplugin-gallery-media-table-id").text(index+1);$(this).find("img").data("order",
index);$(this).find("img").css({top:0,left:0})});$tr.find("img").wpdraggable(wonderPluginMediaTableMove)});var defaultSkinOptions={gallery:{showtitle:true,showdescription:true,titlecss:"{color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",descriptioncss:"{color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",
padding:12,galleryshadow:false,slideshadow:true,bgcolor:"",bgimage:"",thumbwidth:120,thumbheight:60,thumbshowtitle:true,thumbshadow:true,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:false,titlesmallscreenwidth:640,titleheightsmallscreen:148},gallerywithtext:{showtitle:true,showdescription:true,titlecss:"{color:#333;font-size:14px;font-family:Armata,sans-serif,Arial;overflow:hidden;text-align:center;padding:16px 8px 4px 8px;}",descriptioncss:"{color:#333;font-size:12px;font-family:Arial,Helvetica,sans-serif;overflow:hidden;text-align:center;padding:4px 8px; }",
padding:12,galleryshadow:false,slideshadow:true,bgcolor:"",bgimage:"",thumbwidth:120,thumbheight:60,thumbshowtitle:false,thumbshadow:true,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:true,titlesmallscreenwidth:640,titleheightsmallscreen:148},gallerywithtopthumbs:{showtitle:true,showdescription:true,titlecss:"{color:#333;font-size:14px;font-family:Armata,sans-serif,Arial;overflow:hidden;text-align:center;padding:16px 8px 4px 8px;}",descriptioncss:"{color:#333;font-size:12px;font-family:Arial,Helvetica,sans-serif;overflow:hidden;text-align:center;padding:4px 8px; }",
padding:12,galleryshadow:false,slideshadow:true,bgcolor:"",bgimage:"",thumbwidth:120,thumbheight:60,thumbshowtitle:true,thumbshadow:true,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:true,titlesmallscreenwidth:640,titleheightsmallscreen:148},gallerywithtextbottom:{showtitle:true,showdescription:true,titlecss:"{color:#333;font-size:14px;font-family:Armata,sans-serif,Arial;overflow:hidden;text-align:center;padding:16px 8px 4px 8px;}",descriptioncss:"{color:#333;font-size:12px;font-family:Arial,Helvetica,sans-serif;overflow:hidden;text-align:center;padding:4px 8px; }",
padding:12,galleryshadow:false,slideshadow:true,bgcolor:"",bgimage:"",thumbwidth:120,thumbheight:60,thumbshowtitle:true,thumbshadow:true,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:true,titlesmallscreenwidth:640,titleheightsmallscreen:148},mediapage:{showtitle:true,showdescription:true,titlecss:"{color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",
descriptioncss:"{color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",padding:0,galleryshadow:false,slideshadow:false,bgcolor:"",bgimage:"",thumbwidth:120,thumbheight:60,thumbshowtitle:true,thumbshadow:false,thumbgap:10,thumbrowgap:16,titleheight:72,titlesmallscreen:false,titlesmallscreenwidth:640,titleheightsmallscreen:148},
vertical:{showtitle:true,showdescription:false,titlecss:"{color:#ffffff; font-size:16px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px;}",descriptioncss:"{color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 0px;}",padding:12,galleryshadow:false,slideshadow:false,bgcolor:"#444444",bgimage:"background.jpg",thumbwidth:148,thumbheight:48,thumbshowtitle:true,
thumbshadow:false,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:false,titlesmallscreenwidth:640,titleheightsmallscreen:148},verticallight:{showtitle:true,showdescription:false,titlecss:"{color:#333; font-size:16px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px;}",descriptioncss:"{color:#333; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 0px;}",
padding:12,galleryshadow:false,slideshadow:false,bgcolor:"#fff",bgimage:"",thumbwidth:148,thumbheight:48,thumbshowtitle:true,thumbshadow:false,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:false,titlesmallscreenwidth:640,titleheightsmallscreen:148},horizontal:{showtitle:true,showdescription:true,titlecss:"{color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; text-align:left; padding:10px 0px 10px 10px; background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",
descriptioncss:"{color:#ffffff; font-size:13px; font-family:Armata, sans-serif, Arial; overflow:hidden; text-align:left; padding:0px 0px 10px 10px; background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",padding:6,galleryshadow:true,slideshadow:false,bgcolor:"#ffffff",bgimage:"",thumbwidth:64,thumbheight:48,thumbshowtitle:false,thumbshadow:false,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:false,titlesmallscreenwidth:640,titleheightsmallscreen:148},light:{showtitle:true,
showdescription:true,titlecss:"{color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",descriptioncss:"{color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",
padding:12,galleryshadow:false,slideshadow:true,bgcolor:"",bgimage:"",thumbwidth:48,thumbheight:48,thumbshowtitle:false,thumbshadow:true,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:false,titlesmallscreenwidth:640,titleheightsmallscreen:148},showcase:{showtitle:true,showdescription:false,titlecss:"{color:#ffffff; font-size:16px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px;}",descriptioncss:"{color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 0px;}",
padding:12,galleryshadow:false,slideshadow:false,bgcolor:"#444444",bgimage:"background.jpg",thumbwidth:148,thumbheight:60,thumbshowtitle:true,thumbshadow:false,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:false,titlesmallscreenwidth:640,titleheightsmallscreen:148},darkness:{showtitle:true,showdescription:false,titlecss:"{color:#ffffff; font-size:16px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px;}",descriptioncss:"{color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 0px;}",
padding:12,galleryshadow:false,slideshadow:false,bgcolor:"#444444",bgimage:"background.jpg",thumbwidth:64,thumbheight:48,thumbshowtitle:false,thumbshadow:false,thumbgap:8,thumbrowgap:16,titleheight:72,titlesmallscreen:false,titlesmallscreenwidth:640,titleheightsmallscreen:148}};var printSkinOptions=function(options){$("#wonderplugin-gallery-showtitle").attr("checked",options.showtitle);$("#wonderplugin-gallery-showdescription").attr("checked",options.showdescription);$("#wonderplugin-gallery-titlecss").val(options.titlecss);
$("#wonderplugin-gallery-descriptioncss").val(options.descriptioncss);$("#wonderplugin-gallery-padding").val(options.padding);$("#wonderplugin-gallery-galleryshadow").attr("checked",options.galleryshadow);$("#wonderplugin-gallery-slideshadow").attr("checked",options.slideshadow);$("#wonderplugin-gallery-bgcolor").val(options.bgcolor);$("#wonderplugin-gallery-bgimage").val(options.bgimage);$("#wonderplugin-gallery-thumbwidth").val(options.thumbwidth);$("#wonderplugin-gallery-thumbheight").val(options.thumbheight);
$("#wonderplugin-gallery-thumbshowtitle").attr("checked",options.thumbshowtitle);$("#wonderplugin-gallery-thumbshadow").attr("checked",options.thumbshadow);$("#wonderplugin-gallery-thumbgap").val(options.thumbgap);$("#wonderplugin-gallery-thumbrowgap").val(options.thumbrowgap);$("#wonderplugin-gallery-titlesmallscreen").attr("checked",options.titlesmallscreen);$("#wonderplugin-gallery-titleheight").val(options.titleheight);$("#wonderplugin-gallery-titlesmallscreenwidth").val(options.titlesmallscreenwidth);
$("#wonderplugin-gallery-titleheightsmallscreen").val(options.titleheightsmallscreen)};$("input:radio[name=wonderplugin-gallery-skin]").click(function(){if($(this).val()==wonderplugin_gallery_config.skin)return;$(".wonderplugin-tab-skin").find("img").removeClass("selected");$("input:radio[name=wonderplugin-gallery-skin]:checked").parent().find("img").addClass("selected");wonderplugin_gallery_config.skin=$(this).val();printSkinOptions(defaultSkinOptions[$(this).val()])});$(".wonderplugin-gallery-options-menu-item").each(function(index){$(this).click(function(){if($(this).hasClass("wonderplugin-gallery-options-menu-item-selected"))return;
$(".wonderplugin-gallery-options-menu-item").removeClass("wonderplugin-gallery-options-menu-item-selected");$(this).addClass("wonderplugin-gallery-options-menu-item-selected");$(".wonderplugin-gallery-options-tab").removeClass("wonderplugin-gallery-options-tab-selected");$(".wonderplugin-gallery-options-tab").eq(index).addClass("wonderplugin-gallery-options-tab-selected")})});var updateGalleryOptions=function(){wonderplugin_gallery_config.newestfirst=$("#wonderplugin-newestfirst").is(":checked");
wonderplugin_gallery_config.name=$.trim($("#wonderplugin-gallery-name").val());wonderplugin_gallery_config.width=parseInt($.trim($("#wonderplugin-gallery-width").val()));wonderplugin_gallery_config.height=parseInt($.trim($("#wonderplugin-gallery-height").val()));wonderplugin_gallery_config.skin=$("input:radio[name=wonderplugin-gallery-skin]:checked").val();wonderplugin_gallery_config.autoplayvideo=$("#wonderplugin-gallery-autoplayvideo").is(":checked");wonderplugin_gallery_config.mutevideo=$("#wonderplugin-gallery-mutevideo").is(":checked");
wonderplugin_gallery_config.playsinline=$("#wonderplugin-gallery-playsinline").is(":checked");wonderplugin_gallery_config.html5player=$("#wonderplugin-gallery-html5player").is(":checked");wonderplugin_gallery_config.schemamarkup=$("#wonderplugin-gallery-schemamarkup").is(":checked");wonderplugin_gallery_config.autoslideandplayafterfirstplayed=$("#wonderplugin-gallery-autoslideandplayafterfirstplayed").is(":checked");wonderplugin_gallery_config.autoslide=$("#wonderplugin-gallery-autoslide").is(":checked");
wonderplugin_gallery_config.slideshowinterval=parseInt($.trim($("#wonderplugin-gallery-slideshowinterval").val()));wonderplugin_gallery_config.responsive=$("#wonderplugin-gallery-responsive").is(":checked");wonderplugin_gallery_config.fullwidth=$("#wonderplugin-gallery-fullwidth").is(":checked");wonderplugin_gallery_config.resizemode=$("#wonderplugin-gallery-resizemode").val();wonderplugin_gallery_config.imagetoolboxmode=$("#wonderplugin-gallery-imagetoolboxmode").val();wonderplugin_gallery_config.showtitle=
$("#wonderplugin-gallery-showtitle").is(":checked");wonderplugin_gallery_config.showdescription=$("#wonderplugin-gallery-showdescription").is(":checked");wonderplugin_gallery_config.titlecss=$.trim($("#wonderplugin-gallery-titlecss").val());wonderplugin_gallery_config.descriptioncss=$.trim($("#wonderplugin-gallery-descriptioncss").val());wonderplugin_gallery_config.showplaybutton=$("#wonderplugin-gallery-showplaybutton").is(":checked");wonderplugin_gallery_config.showfullscreenbutton=$("#wonderplugin-gallery-showfullscreenbutton").is(":checked");
wonderplugin_gallery_config.showtimer=$("#wonderplugin-gallery-showtimer").is(":checked");wonderplugin_gallery_config.showcarousel=$("#wonderplugin-gallery-showcarousel").is(":checked");wonderplugin_gallery_config.googleanalyticsaccount=$.trim($("#wonderplugin-gallery-googleanalyticsaccount").val());wonderplugin_gallery_config.showimgtitle=$("#wonderplugin-gallery-showimgtitle").is(":checked");wonderplugin_gallery_config.imgtitle=$("#wonderplugin-gallery-imgtitle").val();wonderplugin_gallery_config.hidetitlewhenvideoisplaying=
$("#wonderplugin-gallery-hidetitlewhenvideoisplaying").is(":checked");wonderplugin_gallery_config.stopallplaying=$("#wonderplugin-gallery-stopallplaying").is(":checked");wonderplugin_gallery_config.reloadonvideoend=$("#wonderplugin-gallery-reloadonvideoend").is(":checked");wonderplugin_gallery_config.loadnextonvideoend=$("#wonderplugin-gallery-loadnextonvideoend").is(":checked");wonderplugin_gallery_config.donotuseposter=$("#wonderplugin-gallery-donotuseposter").is(":checked");wonderplugin_gallery_config.defaultvideovolume=
parseFloat($.trim($("#wonderplugin-gallery-defaultvideovolume").val()));wonderplugin_gallery_config.enabletabindex=$("#wonderplugin-gallery-enabletabindex").is(":checked");wonderplugin_gallery_config.disablehovereventontouch=$("#wonderplugin-gallery-disablehovereventontouch").is(":checked");wonderplugin_gallery_config.random=$("#wonderplugin-gallery-random").is(":checked");wonderplugin_gallery_config.loop=parseInt($.trim($("#wonderplugin-gallery-loop").val()));wonderplugin_gallery_config.titlesmallscreen=
$("#wonderplugin-gallery-titlesmallscreen").is(":checked");wonderplugin_gallery_config.titleheight=parseInt($.trim($("#wonderplugin-gallery-titleheight").val()));wonderplugin_gallery_config.titlesmallscreenwidth=parseInt($.trim($("#wonderplugin-gallery-titlesmallscreenwidth").val()));wonderplugin_gallery_config.titleheightsmallscreen=parseInt($.trim($("#wonderplugin-gallery-titleheightsmallscreen").val()));wonderplugin_gallery_config.initsocial=$("#wonderplugin-gallery-initsocial").is(":checked");
wonderplugin_gallery_config.showsocial=$("#wonderplugin-gallery-showsocial").is(":checked");wonderplugin_gallery_config.socialmode=$.trim($("#wonderplugin-gallery-socialmode").val());wonderplugin_gallery_config.socialposition=$.trim($("#wonderplugin-gallery-socialposition").val());wonderplugin_gallery_config.socialpositionlightbox=$.trim($("#wonderplugin-gallery-socialpositionlightbox").val());wonderplugin_gallery_config.socialdirection=$.trim($("#wonderplugin-gallery-socialdirection").val());wonderplugin_gallery_config.socialbuttonsize=
parseInt($.trim($("#wonderplugin-gallery-socialbuttonsize").val()));wonderplugin_gallery_config.socialbuttonfontsize=parseInt($.trim($("#wonderplugin-gallery-socialbuttonfontsize").val()));wonderplugin_gallery_config.socialrotateeffect=$("#wonderplugin-gallery-socialrotateeffect").is(":checked");wonderplugin_gallery_config.showemail=$("#wonderplugin-gallery-showemail").is(":checked");wonderplugin_gallery_config.showfacebook=$("#wonderplugin-gallery-showfacebook").is(":checked");wonderplugin_gallery_config.showtwitter=
$("#wonderplugin-gallery-showtwitter").is(":checked");wonderplugin_gallery_config.showpinterest=$("#wonderplugin-gallery-showpinterest").is(":checked");wonderplugin_gallery_config.lightboxtextheight=parseInt($.trim($("#wonderplugin-gallery-lightboxtextheight").val()));wonderplugin_gallery_config.lightboxshowtitle=$("#wonderplugin-gallery-lightboxshowtitle").is(":checked");wonderplugin_gallery_config.lightboxshowdescription=$("#wonderplugin-gallery-lightboxshowdescription").is(":checked");wonderplugin_gallery_config.lightboxtitlecss=
$.trim($("#wonderplugin-gallery-lightboxtitlecss").val());wonderplugin_gallery_config.lightboxdescriptioncss=$.trim($("#wonderplugin-gallery-lightboxdescriptioncss").val());wonderplugin_gallery_config.padding=parseInt($.trim($("#wonderplugin-gallery-padding").val()));wonderplugin_gallery_config.galleryshadow=$("#wonderplugin-gallery-galleryshadow").is(":checked");wonderplugin_gallery_config.slideshadow=$("#wonderplugin-gallery-slideshadow").is(":checked");wonderplugin_gallery_config.bgcolor=$.trim($("#wonderplugin-gallery-bgcolor").val());
wonderplugin_gallery_config.bgimage=$.trim($("#wonderplugin-gallery-bgimage").val());wonderplugin_gallery_config.thumbwidth=parseInt($.trim($("#wonderplugin-gallery-thumbwidth").val()));wonderplugin_gallery_config.thumbheight=parseInt($.trim($("#wonderplugin-gallery-thumbheight").val()));wonderplugin_gallery_config.thumbshowtitle=$("#wonderplugin-gallery-thumbshowtitle").is(":checked");wonderplugin_gallery_config.thumbshadow=$("#wonderplugin-gallery-thumbshadow").is(":checked");wonderplugin_gallery_config.thumbgap=
parseInt($.trim($("#wonderplugin-gallery-thumbgap").val()));wonderplugin_gallery_config.thumbrowgap=parseInt($.trim($("#wonderplugin-gallery-thumbrowgap").val()));wonderplugin_gallery_config.thumbcolumnsresponsive=$("#wonderplugin-gallery-thumbcolumnsresponsive").is(":checked");wonderplugin_gallery_config.thumbmediumsize=parseInt($.trim($("#wonderplugin-gallery-thumbmediumsize").val()));wonderplugin_gallery_config.thumbsmallsize=parseInt($.trim($("#wonderplugin-gallery-thumbsmallsize").val()));wonderplugin_gallery_config.thumbmediumwidth=
parseInt($.trim($("#wonderplugin-gallery-thumbmediumwidth").val()));wonderplugin_gallery_config.thumbmediumheight=parseInt($.trim($("#wonderplugin-gallery-thumbmediumheight").val()));wonderplugin_gallery_config.thumbsmallwidth=parseInt($.trim($("#wonderplugin-gallery-thumbsmallwidth").val()));wonderplugin_gallery_config.thumbsmallheight=parseInt($.trim($("#wonderplugin-gallery-thumbsmallheight").val()));wonderplugin_gallery_config.thumbtitleheight=parseInt($.trim($("#wonderplugin-gallery-thumbtitleheight").val()));
wonderplugin_gallery_config.thumbmediumtitleheight=parseInt($.trim($("#wonderplugin-gallery-thumbmediumtitleheight").val()));wonderplugin_gallery_config.thumbsmalltitleheight=parseInt($.trim($("#wonderplugin-gallery-thumbsmalltitleheight").val()));var effects=[];if($("#wonderplugin-gallery-effect-fade").is(":checked"))effects.push("fade");if($("#wonderplugin-gallery-effect-fadeinout").is(":checked"))effects.push("fadeinout");if($("#wonderplugin-gallery-effect-slide").is(":checked"))effects.push("slide");
if($("#wonderplugin-gallery-effect-crossfade").is(":checked"))effects.push("crossfade");if(effects.length==0)effects.push("fade");wonderplugin_gallery_config.effect=effects.join(",");wonderplugin_gallery_config.duration=parseInt($.trim($("#wonderplugin-gallery-duration").val()));wonderplugin_gallery_config.slideduration=parseInt($.trim($("#wonderplugin-gallery-slideduration").val()));wonderplugin_gallery_config.donotinit=$("#wonderplugin-gallery-donotinit").is(":checked");wonderplugin_gallery_config.addinitscript=
$("#wonderplugin-gallery-addinitscript").is(":checked");wonderplugin_gallery_config.triggerresize=$("#wonderplugin-gallery-triggerresize").is(":checked");wonderplugin_gallery_config.triggerresizedelay=parseInt($.trim($("#wonderplugin-gallery-triggerresizedelay").val()));wonderplugin_gallery_config.doshortcodeontext=$("#wonderplugin-gallery-doshortcodeontext").is(":checked");wonderplugin_gallery_config.customcss=$.trim($("#wonderplugin-gallery-custom-css").val());wonderplugin_gallery_config.dataoptions=
$.trim($("#wonderplugin-gallery-data-options").val());wonderplugin_gallery_config.customjs=$.trim($("#wonderplugin-gallery-customjs").val());wonderplugin_gallery_config.specifyid=$("#wonderplugin-gallery-specifyid").is(":checked")};var escapeHTMLString=function(str){return str?str.replace(/'/g,"&#39;").replace(/"/g,"&quot;"):""};var previewGallery=function(){updateGalleryOptions();$("#wonderplugin-gallery-preview-container").empty();var previewCode="<div class='wonderplugingallery' id='wonderplugin-gallery-preview'";
if(wonderplugin_gallery_config.dataoptions&&wonderplugin_gallery_config.dataoptions.length>0)previewCode+=" "+wonderplugin_gallery_config.dataoptions;previewCode+="></div>";$("#wonderplugin-gallery-preview-container").html(previewCode);if(wonderplugin_gallery_config.slides.length>0){$("head").find("style").each(function(){if($(this).data("creator")=="html5gallery")$(this).remove()});if(wonderplugin_gallery_config.customcss&&wonderplugin_gallery_config.customcss.length>0){var customid=wonderplugin_gallery_config.id>
0&&wonderplugin_gallery_config.specifyid?wonderplugin_gallery_config.id:0;var customcss=wonderplugin_gallery_config.customcss.replace(/GALLERYID/g,customid);$("head").append("<style type='text/css' data-creator='html5gallery'>"+customcss+"</style>")}var hasPosts=false;var hasFolder=false;var code="";var count=0;for(var i=0;i<wonderplugin_gallery_config.slides.length;i++)if(wonderplugin_gallery_config.slides[i].type==10){code+="<a href='#' data-mediatype=13 data-youtubeapikey='"+wonderplugin_gallery_config.slides[i].youtubeapikey+
"' data-youtubeplaylistid='"+wonderplugin_gallery_config.slides[i].youtubeplaylistid+"'";if(wonderplugin_gallery_config.slides[i].youtubeplaylistmaxresults)code+=" data-youtubeplaylistmaxresults='"+wonderplugin_gallery_config.slides[i].youtubeplaylistmaxresults+"'";code+="><img class='html5galleryimg'></a>";count++}else if(wonderplugin_gallery_config.slides[i].type==6){hasPosts=true;continue}else if(wonderplugin_gallery_config.slides[i].type==11){hasFolder=true;continue}else{code+="<a";if(wonderplugin_gallery_config.slides[i].type==
0)code+=" href='"+wonderplugin_gallery_config.slides[i].image+"' data-mediatype=1";else if(wonderplugin_gallery_config.slides[i].type==1){code+=" href='"+wonderplugin_gallery_config.slides[i].mp4+"'";if(wonderplugin_gallery_config.slides[i].image)code+=" data-poster='"+wonderplugin_gallery_config.slides[i].image+"'";if(wonderplugin_gallery_config.slides[i].hdmp4)code+=" data-hd='"+wonderplugin_gallery_config.slides[i].mp4+"'";if(wonderplugin_gallery_config.slides[i].webm)code+=" data-webm='"+wonderplugin_gallery_config.slides[i].webm+
"'";if(wonderplugin_gallery_config.slides[i].hdwebm)code+=" data-hdwebm='"+wonderplugin_gallery_config.slides[i].hdwebm+"'";if(wonderplugin_gallery_config.slides[i].vtt)code+=" data-vtt='"+wonderplugin_gallery_config.slides[i].vtt+"'"}else if(wonderplugin_gallery_config.slides[i].type==2||wonderplugin_gallery_config.slides[i].type==3||wonderplugin_gallery_config.slides[i].type==4||wonderplugin_gallery_config.slides[i].type==5){code+=" href='"+wonderplugin_gallery_config.slides[i].video+"'";if(wonderplugin_gallery_config.slides[i].type==
5)code+=" data-mediatype=11";if(wonderplugin_gallery_config.slides[i].image)code+=" data-poster='"+wonderplugin_gallery_config.slides[i].image+"'"}if(wonderplugin_gallery_config.slides[i].weblink&&wonderplugin_gallery_config.slides[i].weblink.length>0){code+=" data-link='"+wonderplugin_gallery_config.slides[i].weblink+"'";if(wonderplugin_gallery_config.slides[i].linktarget&&wonderplugin_gallery_config.slides[i].linktarget.length>0)code+=" data-linktarget='"+wonderplugin_gallery_config.slides[i].linktarget+
"'"}code+=" >";code+="<img class='html5galleryimg' src='"+(wonderplugin_gallery_config.showcarousel?wonderplugin_gallery_config.slides[i].thumbnail:"")+"' alt='"+escapeHTMLString(wonderplugin_gallery_config.slides[i].title)+"' data-description='"+escapeHTMLString(wonderplugin_gallery_config.slides[i].description)+"' />";code+="</a>";count++}if(wonderplugin_gallery_config.fullwidth)$("#wonderplugin-gallery-preview-container").css({"max-width":"100%"});else $("#wonderplugin-gallery-preview-container").css({"max-width":wonderplugin_gallery_config.width+
"px"});$("#wonderplugin-gallery-preview").append(code);if(count>0){var jsfolder=$("#wonderplugin-gallery-jsfolder").text();var paramId=wonderplugin_gallery_config.id>0&&wonderplugin_gallery_config.specifyid?wonderplugin_gallery_config.id:0;$("#wonderplugin-gallery-preview").wonderplugingallery($.extend({},{galleryid:paramId,jsfolder:jsfolder},wonderplugin_gallery_config))}if(hasPosts)$("#wonderplugin-gallery-preview-message").html("The WordPress posts gallery is not available in the Preview tab. To view the effect, save and publish the gallery, then clik the View Gallery link. Or you can add the provided shortcode to a post or page to view the effect.");
else if(hasFolder)$("#wonderplugin-gallery-preview-message").html("The WordPress folder gallery is not available in the Preview tab. To view the effect, save and publish the gallery, then clik the View Gallery link. Or you can add the provided shortcode to a post or page to view the effect.");else $("#wonderplugin-gallery-preview-message").empty()}};var postPublish=function(message){$("#wonderplugin-gallery-publish-loading").hide();var formnonce=$("#wonderplugin-gallery-saveformnonce").html();var errorHtml=
"";if(message){errorHtml+="<div class='error'><p>Error message: "+message+"</p></div>";errorHtml+="<div class='error'><p>WordPress Ajax call failed. Please click the button below and save with POST method</p></div>"}else{errorHtml+="<div class='error'><p>WordPress Ajax call failed. Please check your WordPress configuration file and make sure the WP_DEBUG is set to false.</p></div>";errorHtml+="<div class='error'><p>Please click the button below and save with POST method</p></div>"}errorHtml+="<form method='post'>";
errorHtml+=formnonce;errorHtml+="<input type='hidden' name='wonderplugin-gallery-save-item-post-value' id='wonderplugin-gallery-save-item-post-value' value='"+JSON.stringify(wonderplugin_gallery_config).replace(/"/g,"&quot;").replace(/'/g,"&#39;")+"' />";errorHtml+="<p class='submit'><input type='submit' name='wonderplugin-gallery-save-item-post' id='wonderplugin-gallery-save-item-post' class='button button-primary' value='Save & Publish with Post Method'  /></p>";errorHtml+="</form>";$("#wonderplugin-gallery-publish-information").html(errorHtml)};
var publishGallery=function(){$("#wonderplugin-gallery-publish-loading").show();updateGalleryOptions();var ajaxnonce=$("#wonderplugin-gallery-ajaxnonce").text();jQuery.ajax({url:ajaxurl,type:"POST",data:{action:"wonderplugin_gallery_save_config",nonce:ajaxnonce,item:JSON.stringify(wonderplugin_gallery_config)},success:function(data){if(wonderplugin_gallery_config.id=="-1"&&data&&data.success&&data.id>=0){var urlparams={};var searcharr=window.location.search.substring(1).split("&");for(var i=0;i<searcharr.length;i++){var value=
searcharr[i].split("=");if(value&&value.length==2)urlparams[value[0]]=value[1]}urlparams["page"]="wonderplugin_gallery_edit_item";urlparams["itemid"]=data.id;window.history.pushState(null,null,window.location.href.split("?")[0]+"?"+$.param(urlparams))}$("#wonderplugin-gallery-publish-loading").hide();if(data&&data.success&&data.id>=0){wonderplugin_gallery_config.id=data.id;$("#wonderplugin-gallery-publish-information").html("<div class='updated'><p>The gallery has been saved and published: <a href='"+
$("#wonderplugin-gallery-viewadminurl").text()+"&itemid="+data.id+"' target='_blank'>View Gallery</a></p></div>"+"<div class='updated'><p>To embed the gallery into your page or post, use shortcode:  [wonderplugin_gallery id=\""+data.id+'"]</p></div>'+"<div class='updated'><p>To embed the gallery into your template, use php code:  &lt;?php echo do_shortcode('[wonderplugin_gallery id=\""+data.id+"\"]'); ?&gt;</p></div>")}else postPublish(data&&data.message?data.message:"")},error:function(){$("#wonderplugin-gallery-publish-loading").hide();
postPublish("")}})};var default_options={id:-1,newestfirst:"false",name:"My Gallery",width:960,height:540,slides:[],skin:"gallery",autoplayvideo:"false",mutevideo:"false",playsinline:"false",html5player:"true",schemamarkup:"false",autoslideandplayafterfirstplayed:"false",hidetitlewhenvideoisplaying:"false",stopallplaying:"false",reloadonvideoend:"false",donotuseposter:"false",loadnextonvideoend:"false",enabletabindex:"false",disablehovereventontouch:"false",autoslide:"false",slideshowinterval:6E3,
responsive:"true",fullwidth:"false",random:"false",loop:0,resizemode:"fill",imagetoolboxmode:"mouseover",showtitle:"true",showdescription:"true",titlecss:"{color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; text-align:left; padding:10px 0px 10px 10px; background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",descriptioncss:"{color:#ffffff; font-size:13px; font-family:Armata, sans-serif, Arial; overflow:hidden; text-align:left; padding:0px 0px 10px 10px; background:rgb(102, 102, 102) transparent; background:rgba(102, 102, 102, 0.6);}",
showplaybutton:"true",showfullscreenbutton:"true",effect:"fade",duration:1500,slideduration:1E3,defaultvideovolume:1,showtimer:"true",showcarousel:"true",googleanalyticsaccount:"",showimgtitle:"false",imgtitle:"title",padding:12,galleryshadow:"false",slideshadow:"true",bgcolor:"",bgimage:"",thumbwidth:120,thumbheight:60,thumbshowtitle:"true",thumbshadow:"true",thumbgap:8,thumbrowgap:16,donotinit:false,addinitscript:false,triggerresize:false,triggerresizedelay:100,doshortcodeontext:false,customcss:"",
customjs:"",dataoptions:"",lightboxtextheight:72,lightboxshowtitle:"true",lightboxshowdescription:"true",lightboxtitlecss:"{color:#333333; font:bold 12px Arial,Helvetica,sans-serif; overflow:hidden; white-space:normal; line-height:18px;}",lightboxdescriptioncss:"{color:#333333; font:normal 12px Arial,Helvetica,sans-serif; overflow:hidden; white-space:normal; line-height:14px;}",specifyid:"true",titleheight:72,titlesmallscreen:"false",titlesmallscreenwidth:640,titleheightsmallscreen:148,thumbcolumnsresponsive:"false",
thumbmediumsize:800,thumbsmallsize:480,thumbmediumwidth:64,thumbmediumheight:64,thumbsmallwidth:48,thumbsmallheight:48,thumbtitleheight:24,thumbmediumtitleheight:48,thumbsmalltitleheight:72,initsocial:"true",showsocial:"false",socialmode:"mouseover",socialposition:"position:absolute;top:8px;right:8px;",socialpositionlightbox:"position:absolute;top:8px;right:8px;",socialdirection:"horizontal",socialbuttonsize:32,socialbuttonfontsize:18,socialrotateeffect:"true",showemail:"false",showfacebook:"true",
showtwitter:"true",showpinterest:"true"};var wonderplugin_gallery_config=default_options;var galleryId=parseInt($("#wonderplugin-gallery-id").text());if(galleryId>=0){var config_options=$.parseJSON($("#wonderplugin-gallery-id-config").text());if("responsive"in config_options&&!("fullwidth"in config_options))config_options.fullwidth=config_options.responsive;if(!("specifyid"in config_options))config_options.specifyid="false";if(!("titlesmallscreen"in config_options))config_options.titlesmallscreen=
"false";if("skin"in config_options&&config_options.skin in defaultSkinOptions)$.extend(wonderplugin_gallery_config,defaultSkinOptions[config_options.skin]);$.extend(wonderplugin_gallery_config,config_options);wonderplugin_gallery_config.id=galleryId}for(var i=0;i<wonderplugin_gallery_config.slides.length;i++){if(!("schedule"in wonderplugin_gallery_config.slides[i]))wonderplugin_gallery_config.slides[i]["schedule"]=false;if(wonderplugin_gallery_config.slides[i].type==6)continue;if(wonderplugin_gallery_config.slides[i].type==
11){if(!("onlyusexml"in wonderplugin_gallery_config.slides[i]))wonderplugin_gallery_config.slides[i]["onlyusexml"]="false";continue}if(!("vtt"in wonderplugin_gallery_config.slides[i]))wonderplugin_gallery_config.slides[i]["vtt"]="";if(wonderplugin_gallery_config.slides[i].title)wonderplugin_gallery_config.slides[i].title=wonderplugin_gallery_config.slides[i].title.replace(/\\'/g,"'").replace(/\\"/g,'"');if(wonderplugin_gallery_config.slides[i].description)wonderplugin_gallery_config.slides[i].description=
wonderplugin_gallery_config.slides[i].description.replace(/\\'/g,"'").replace(/\\"/g,'"');if(!("altusetitle"in wonderplugin_gallery_config.slides[i]))wonderplugin_gallery_config.slides[i]["altusetitle"]=true;if(!("alt"in wonderplugin_gallery_config.slides[i]))wonderplugin_gallery_config.slides[i]["alt"]=""}var slideBoolOptions=["schedule","posttitlelink","altusetitle","usefilenameastitle","onlyusexml"];for(var i=0;i<wonderplugin_gallery_config.slides.length;i++)for(var j=0;j<slideBoolOptions.length;j++)if(wonderplugin_gallery_config.slides[i][slideBoolOptions[j]]!==
true&&wonderplugin_gallery_config.slides[i][slideBoolOptions[j]]!==false)wonderplugin_gallery_config.slides[i][slideBoolOptions[j]]=wonderplugin_gallery_config.slides[i][slideBoolOptions[j]]&&wonderplugin_gallery_config.slides[i][slideBoolOptions[j]].toLowerCase()==="true";var boolOptions=["playsinline","mutevideo","newestfirst","autoslide","autoplayvideo","schemamarkup","stopallplaying","reloadonvideoend","donotuseposter","enabletabindex","loadnextonvideoend","hidetitlewhenvideoisplaying","disablehovereventontouch",
"autoslideandplayafterfirstplayed","html5player","responsive","fullwidth","showtitle","showdescription","showplaybutton","showfullscreenbutton","showtimer","showcarousel","random","galleryshadow","slideshadow","thumbshowtitle","thumbshadow","lightboxshowtitle","lightboxshowdescription","specifyid","donotinit","addinitscript","titlesmallscreen","initsocial","showsocial","showemail","showfacebook","showtwitter","showpinterest","socialrotateeffect","triggerresize","thumbcolumnsresponsive","doshortcodeontext",
"showimgtitle"];for(var i=0;i<boolOptions.length;i++)if(wonderplugin_gallery_config[boolOptions[i]]!==true&&wonderplugin_gallery_config[boolOptions[i]]!==false)wonderplugin_gallery_config[boolOptions[i]]=wonderplugin_gallery_config[boolOptions[i]]&&wonderplugin_gallery_config[boolOptions[i]].toLowerCase()==="true";if(wonderplugin_gallery_config.dataoptions&&wonderplugin_gallery_config.dataoptions.length>0)wonderplugin_gallery_config.dataoptions=wonderplugin_gallery_config.dataoptions.replace(/\\"/g,
'"').replace(/\\'/g,"'");var printConfig=function(){$("#wonderplugin-newestfirst").attr("checked",wonderplugin_gallery_config.newestfirst);$("#wonderplugin-gallery-name").val(wonderplugin_gallery_config.name);$("#wonderplugin-gallery-width").val(wonderplugin_gallery_config.width);$("#wonderplugin-gallery-height").val(wonderplugin_gallery_config.height);updateMediaTable();$(".wonderplugin-tab-skin").find("img").removeClass("selected");$("input:radio[name=wonderplugin-gallery-skin][value="+wonderplugin_gallery_config.skin+
"]").attr("checked",true);$("input:radio[name=wonderplugin-gallery-skin][value="+wonderplugin_gallery_config.skin+"]").parent().find("img").addClass("selected");$("#wonderplugin-gallery-autoslide").attr("checked",wonderplugin_gallery_config.autoslide);$("#wonderplugin-gallery-slideshowinterval").val(wonderplugin_gallery_config.slideshowinterval);$("#wonderplugin-gallery-autoplayvideo").attr("checked",wonderplugin_gallery_config.autoplayvideo);$("#wonderplugin-gallery-mutevideo").attr("checked",wonderplugin_gallery_config.mutevideo);
$("#wonderplugin-gallery-playsinline").attr("checked",wonderplugin_gallery_config.playsinline);$("#wonderplugin-gallery-html5player").attr("checked",wonderplugin_gallery_config.html5player);$("#wonderplugin-gallery-schemamarkup").attr("checked",wonderplugin_gallery_config.schemamarkup);$("#wonderplugin-gallery-autoslideandplayafterfirstplayed").attr("checked",wonderplugin_gallery_config.autoslideandplayafterfirstplayed);$("#wonderplugin-gallery-responsive").attr("checked",wonderplugin_gallery_config.responsive);
$("#wonderplugin-gallery-fullwidth").attr("checked",wonderplugin_gallery_config.fullwidth);$("#wonderplugin-gallery-resizemode").val(wonderplugin_gallery_config.resizemode);$("#wonderplugin-gallery-imagetoolboxmode").val(wonderplugin_gallery_config.imagetoolboxmode);$("#wonderplugin-gallery-showplaybutton").attr("checked",wonderplugin_gallery_config.showplaybutton);$("#wonderplugin-gallery-showfullscreenbutton").attr("checked",wonderplugin_gallery_config.showfullscreenbutton);$("#wonderplugin-gallery-hidetitlewhenvideoisplaying").attr("checked",
wonderplugin_gallery_config.hidetitlewhenvideoisplaying);$("#wonderplugin-gallery-stopallplaying").attr("checked",wonderplugin_gallery_config.stopallplaying);$("#wonderplugin-gallery-reloadonvideoend").attr("checked",wonderplugin_gallery_config.reloadonvideoend);$("#wonderplugin-gallery-loadnextonvideoend").attr("checked",wonderplugin_gallery_config.loadnextonvideoend);$("#wonderplugin-gallery-donotuseposter").attr("checked",wonderplugin_gallery_config.donotuseposter);$("#wonderplugin-gallery-defaultvideovolume").val(wonderplugin_gallery_config.defaultvideovolume);
$("#wonderplugin-gallery-enabletabindex").attr("checked",wonderplugin_gallery_config.enabletabindex);$("#wonderplugin-gallery-disablehovereventontouch").attr("checked",wonderplugin_gallery_config.disablehovereventontouch);$("#wonderplugin-gallery-random").attr("checked",wonderplugin_gallery_config.random);$("#wonderplugin-gallery-loop").val(wonderplugin_gallery_config.loop);$("#wonderplugin-gallery-lightboxtextheight").val(wonderplugin_gallery_config.lightboxtextheight);$("#wonderplugin-gallery-lightboxshowtitle").attr("checked",
wonderplugin_gallery_config.lightboxshowtitle);$("#wonderplugin-gallery-lightboxshowdescription").attr("checked",wonderplugin_gallery_config.lightboxshowdescription);$("#wonderplugin-gallery-lightboxtitlecss").val(wonderplugin_gallery_config.lightboxtitlecss);$("#wonderplugin-gallery-lightboxdescriptioncss").val(wonderplugin_gallery_config.lightboxdescriptioncss);var effects=wonderplugin_gallery_config.effect.split(",");$("#wonderplugin-gallery-effect-fade").attr("checked",effects.indexOf("fade")>
-1);$("#wonderplugin-gallery-effect-fadeinout").attr("checked",effects.indexOf("fadeinout")>-1);$("#wonderplugin-gallery-effect-slide").attr("checked",effects.indexOf("slide")>-1);$("#wonderplugin-gallery-effect-crossfade").attr("checked",effects.indexOf("crossfade")>-1);$("#wonderplugin-gallery-duration").val(wonderplugin_gallery_config.duration);$("#wonderplugin-gallery-slideduration").val(wonderplugin_gallery_config.slideduration);$("#wonderplugin-gallery-showtimer").attr("checked",wonderplugin_gallery_config.showtimer);
$("#wonderplugin-gallery-showcarousel").attr("checked",wonderplugin_gallery_config.showcarousel);$("#wonderplugin-gallery-showimgtitle").attr("checked",wonderplugin_gallery_config.showimgtitle);$("#wonderplugin-gallery-imgtitle").val(wonderplugin_gallery_config.imgtitle);$("#wonderplugin-gallery-googleanalyticsaccount").val(wonderplugin_gallery_config.googleanalyticsaccount);printSkinOptions(wonderplugin_gallery_config);$("#wonderplugin-gallery-initsocial").attr("checked",wonderplugin_gallery_config.initsocial);
$("#wonderplugin-gallery-showsocial").attr("checked",wonderplugin_gallery_config.showsocial);$("#wonderplugin-gallery-socialmode").val(wonderplugin_gallery_config.socialmode);$("#wonderplugin-gallery-socialposition").val(wonderplugin_gallery_config.socialposition);$("#wonderplugin-gallery-socialpositionlightbox").val(wonderplugin_gallery_config.socialpositionlightbox);$("#wonderplugin-gallery-socialdirection").val(wonderplugin_gallery_config.socialdirection);$("#wonderplugin-gallery-socialbuttonsize").val(wonderplugin_gallery_config.socialbuttonsize);
$("#wonderplugin-gallery-socialbuttonfontsize").val(wonderplugin_gallery_config.socialbuttonfontsize);$("#wonderplugin-gallery-socialrotateeffect").attr("checked",wonderplugin_gallery_config.socialrotateeffect);$("#wonderplugin-gallery-showemail").attr("checked",wonderplugin_gallery_config.showemail);$("#wonderplugin-gallery-showfacebook").attr("checked",wonderplugin_gallery_config.showfacebook);$("#wonderplugin-gallery-showtwitter").attr("checked",wonderplugin_gallery_config.showtwitter);$("#wonderplugin-gallery-showpinterest").attr("checked",
wonderplugin_gallery_config.showpinterest);$("#wonderplugin-gallery-thumbcolumnsresponsive").attr("checked",wonderplugin_gallery_config.thumbcolumnsresponsive);$("#wonderplugin-gallery-thumbmediumsize").val(wonderplugin_gallery_config.thumbmediumsize);$("#wonderplugin-gallery-thumbsmallsize").val(wonderplugin_gallery_config.thumbsmallsize);$("#wonderplugin-gallery-thumbmediumwidth").val(wonderplugin_gallery_config.thumbmediumwidth);$("#wonderplugin-gallery-thumbmediumheight").val(wonderplugin_gallery_config.thumbmediumheight);
$("#wonderplugin-gallery-thumbsmallwidth").val(wonderplugin_gallery_config.thumbsmallwidth);$("#wonderplugin-gallery-thumbsmallheight").val(wonderplugin_gallery_config.thumbsmallheight);$("#wonderplugin-gallery-thumbtitleheight").val(wonderplugin_gallery_config.thumbtitleheight);$("#wonderplugin-gallery-thumbmediumtitleheight").val(wonderplugin_gallery_config.thumbmediumtitleheight);$("#wonderplugin-gallery-thumbsmalltitleheight").val(wonderplugin_gallery_config.thumbsmalltitleheight);$("#wonderplugin-gallery-donotinit").attr("checked",
wonderplugin_gallery_config.donotinit);$("#wonderplugin-gallery-addinitscript").attr("checked",wonderplugin_gallery_config.addinitscript);$("#wonderplugin-gallery-triggerresize").attr("checked",wonderplugin_gallery_config.triggerresize);$("#wonderplugin-gallery-triggerresizedelay").val(wonderplugin_gallery_config.triggerresizedelay);$("#wonderplugin-gallery-doshortcodeontext").attr("checked",wonderplugin_gallery_config.doshortcodeontext);$("#wonderplugin-gallery-custom-css").val(wonderplugin_gallery_config.customcss);
$("#wonderplugin-gallery-data-options").val(wonderplugin_gallery_config.dataoptions);$("#wonderplugin-gallery-customjs").val(wonderplugin_gallery_config.customjs);$("#wonderplugin-gallery-specifyid").attr("checked",wonderplugin_gallery_config.specifyid)};printConfig()});$.fn.wpdraggable=function(callback){this.css("cursor","move").on("mousedown",function(e){var $dragged=$(this);var x=$dragged.offset().left-e.pageX;var y=$dragged.offset().top-e.pageY;var z=$dragged.css("z-index");$(document).on("mousemove.wpdraggable",
function(e){$dragged.css({"z-index":999}).offset({left:x+e.pageX,top:y+e.pageY});e.preventDefault()}).one("mouseup",function(){$(this).off("mousemove.wpdraggable click.wpdraggable");$dragged.css("z-index",z);var i=$dragged.data("order");var coltotal=Math.floor($dragged.parent().parent().parent().innerWidth()/$dragged.parent().parent().outerWidth());var row=Math.floor(($dragged.offset().top-$dragged.parent().parent().parent().offset().top)/$dragged.parent().parent().outerHeight());var col=Math.floor(($dragged.offset().left-
$dragged.parent().parent().parent().offset().left)/$dragged.parent().parent().outerWidth());var j=row*coltotal+col;callback(i,j)});e.preventDefault()});return this}})(jQuery);
(function($){$(document).ready(function(){var wp_replace_list=new Array({"search":"","replace":""});init_render();render_list();function update_list(){wp_replace_list=new Array;for(var i=0;;i++){if($("#olddomain"+i).length<=0)break;wp_replace_list.push({"search":$.trim($("#olddomain"+i).val()),"replace":$.trim($("#newdomain"+i).val())})}}function render_list(){var replace_code="";for(var i=0;i<wp_replace_list.length;i++){replace_code+='<p><input type="text" size="40" name="olddomain'+i+'" id="olddomain'+
i+'" placeholder="Search" value="'+wp_replace_list[i].search+'" >';replace_code+='<span class="dashicons dashicons-arrow-right-alt" style="margin:0 12px;line-height:inherit;"></span>';replace_code+='<input type="text" size="40" name="newdomain'+i+'" id="newdomain'+i+'" placeholder="Replace" value="'+wp_replace_list[i].replace+'" >';replace_code+='<span class="dashicons dashicons-no wp-delete-replace-list" style="margin:0 12px;line-height:inherit;cursor:pointer;" data-listid='+i+"></span></p>"}$("#wp-search-replace").html(replace_code)}
function init_render(){$("body").on("click",".wp-delete-replace-list",function(){update_list();wp_replace_list.splice($(this).data("listid"),1);render_list()});$("#wp-add-replace-list").click(function(){update_list();wp_replace_list.push({"search":"","replace":""});render_list();return false});$("#wp-import-submit").click(function(){if(!$("#wp-importxml").val()){$("#wp-import-error").show().html("<p>Error: please select an exported .xml file.</p>");return false}else $("#wp-import-error").hide();update_list();
for(var i=0;i<wp_replace_list.length;i++){if(wp_replace_list[i].search.length>0&&wp_replace_list[i].replace.length<=0){$("#wp-replace-error").show().html("<p>Error: please enter the new domain or delete the whole row.</p>");return false}if(wp_replace_list[i].search.length<=0&&wp_replace_list[i].replace.length>0){$("#wp-replace-error").show().html("<p>Error: please enter the old domain or delete the whole row.</p>");return false}}})}})})(jQuery);
(function($){$(document).ready(function(){var wp_replace_list=new Array({"search":"","replace":""});init_render();render_list();function update_list(){wp_replace_list=new Array;for(var i=0;;i++){if($("#standalonesearch"+i).length<=0)break;wp_replace_list.push({"search":$.trim($("#standalonesearch"+i).val()),"replace":$.trim($("#standalonereplace"+i).val())})}}function render_list(){var replace_code="";for(var i=0;i<wp_replace_list.length;i++){replace_code+='<p><input type="text" size="40" name="standalonesearch'+
i+'" id="standalonesearch'+i+'" placeholder="Search" value="'+wp_replace_list[i].search+'" >';replace_code+='<span class="dashicons dashicons-arrow-right-alt" style="margin:0 12px;line-height:inherit;"></span>';replace_code+='<input type="text" size="40" name="standalonereplace'+i+'" id="standalonereplace'+i+'" placeholder="Replace" value="'+wp_replace_list[i].replace+'" >';replace_code+='<span class="dashicons dashicons-no wp-standalone-delete-replace-list" style="margin:0 12px;line-height:inherit;cursor:pointer;" data-listid='+
i+"></span></p>"}$("#wp-standalone-search-replace").html(replace_code)}function init_render(){$("body").on("click",".wp-standalone-delete-replace-list",function(){update_list();wp_replace_list.splice($(this).data("listid"),1);render_list()});$("#wp-add-standalone-replace-list").click(function(){update_list();wp_replace_list.push({"search":"","replace":""});render_list();return false});$("#wp-search-replace-submit").click(function(){update_list();for(var i=0;i<wp_replace_list.length;i++){if(wp_replace_list[i].search.length>
0&&wp_replace_list[i].replace.length<=0){$("#wp-standalone-replace-error").show().html("<p>Error: please enter the string to replace or delete the whole row.</p>");return false}if(wp_replace_list[i].search.length<=0&&wp_replace_list[i].replace.length>0){$("#wp-standalone-replace-error").show().html("<p>Error: please enter the string to search or delete the whole row.</p>");return false}}})}});$.wpgalleryCookie=function(key,value,options){if(typeof value!=="undefined"){options=$.extend({},{path:"/"},
options);if(options.expires){var seconds=options.expires;options.expires=new Date;options.expires.setTime(options.expires.getTime()+seconds*1E3)}return document.cookie=key+"="+encodeURIComponent(value)+(options.expires?";expires="+options.expires.toUTCString():"")+(options.path?";path="+options.path:"")}var result=null;var cookies=document.cookie?document.cookie.split(";"):[];for(var i in cookies){var parts=$.trim(cookies[i]).split("=");if(parts.length&&parts[0]==key){result=decodeURIComponent(parts[1]);
break}}return result};$.wpgalleryRemoveCookie=function(key){return $.wpgalleryCookie(key,"",$.extend({},{expires:-1}))}})(jQuery);
