/** Wonderplugin Carousel Plugin Pro Version
 * Copyright 2019 Magic Hills Pty Ltd All Rights Reserved
 * Website: http://www.wonderplugin.com
 * Version 18.3 
 */
(function($){$(document).ready(function(){$(".wonderplugin-engine").css({display:"none"});$("#wonderplugin-carousel-imagehoverovereffect").change(function(){var effect=$(this).val();if(effect in WONDERPLUGIN_CAROUSEL_IMAGE_HOVEROVER_TEMPLATE)$("#wonderplugin-carousel-imagehoverovercss").val(WONDERPLUGIN_CAROUSEL_IMAGE_HOVEROVER_TEMPLATE[effect])});$(".wonderplugin-select-mediaimage").click(function(){var textId=$(this).data("textid");var displayId=$(this).data("displayid");var inputName=$(this).data("inputname");
var media_uploader=wp.media.frames.file_frame=wp.media({title:"Select Image",library:{type:"image"},button:{text:"Select Image"},multiple:false});media_uploader.on("select",function(event){var selection=media_uploader.state().get("selection");var attachment=selection.first().toJSON();if(attachment.type=="image"){$("#"+textId).val(attachment.url);if($("input:radio[name="+inputName+"]:checked").val()=="custom")$("#"+displayId).attr("src",attachment.url)}});media_uploader.open()});var applyImageactionOptions=
function(ischecked){if(ischecked)$(".imageaction-options").removeClass("wonderplugin-disabled");else $(".imageaction-options").addClass("wonderplugin-disabled")};(function(){$(document).on("click","#wonderplugin-dialog-imageaction",function(){applyImageactionOptions($(this).is(":checked"))})})();$(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-tab-buttons-horizontal").each(function(){var index=$.wpcarouselCookie($(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");$.wpcarouselCookie($(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-carousel-ajaxnonce").text();var folderseperator=$("#wonderplugin-carousel-folderseperator").text();var folder=$(this).data("foldername");var inst=$(this);$("#wonderplugin-folder-selected").html(folder);jQuery.ajax({url:ajaxurl,type:"POST",data:{action:"wonderplugin_carousel_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});$("#wonderplugin-carousel-fixaspectratio").click(function(){if($(this).is(":checked")){$("#wonderplugin-carousel-sameheight").prop("checked",
false);$("#wonderplugin-carousel-fitimage").prop("checked",false)}});$("#wonderplugin-carousel-sameheight").click(function(){if($(this).is(":checked")){$("#wonderplugin-carousel-fixaspectratio").prop("checked",false);$("#wonderplugin-carousel-fitimage").prop("checked",false)}});$("#wonderplugin-carousel-fitimage").click(function(){if($(this).is(":checked")){$("#wonderplugin-carousel-fixaspectratio").prop("checked",false);$("#wonderplugin-carousel-sameheight").prop("checked",false)}});$("#wonderplugin-carousel-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-carousel-tabs").children("li").removeClass("wonderplugin-tab-selected");$("#wonderplugin-carousel-tabs").children("li").eq(index).addClass("wonderplugin-tab-selected");$("#wonderplugin-carousel-tabs").removeClass("wonderplugin-tabs-grey");if(index==3){previewCarousel();$("#wonderplugin-carousel-tabs").addClass("wonderplugin-tabs-grey")}else if(index==
4)publishCarousel()})});var socialbgcolor={"facebook":"#3b5998","dribbble":"#d94a8b","dropbox":"#477ff2","mail":"#4d83ff","flickr":"#3c58e6","git":"#4174ba","gplus":"#e45104","instagram":"#d400c8","linkedin":"#458bb7","pinterest":"#c92228","reddit":"#ee5300","skype":"#53adf5","tumblr":"#415878","twitter":"#03b3ee","link":"#517dd9","whatsapp":"#72be44","youtube":"#c7221b"};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_carousel_config.slides.unshift(data);else wonderplugin_carousel_config.slides.push(data)};var slideDialog=function(dialogType,onSuccess,data,dataIndex){var dialogTitle=["image","video","Youtube Video","Vimeo Video","",
"","","","","","","PDF","","","Text"];var langlist=null;try{langlist=JSON.parse($("#wonderplugin-carousel-langlist").text())}catch(err){}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)dialogCode+="<tr>"+"<th>Enter video URL</th>"+"<td><input name='wonderplugin-dialog-video' type='text' id='wonderplugin-dialog-video' value='' class='regular-text' /> <input type='button' class='button' id='wonderplugin-dialog-select-video' value='Enter' /></td>"+"</tr>"+"<tr>";if(dialogType!=14)dialogCode+="<tr>"+"<th>Enter"+(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' />"+"<p><label><input name='wonderplugin-dialog-displaythumbnail' type='checkbox' id='wonderplugin-dialog-displaythumbnail' value='' />Use thumbnail in carousel</label></p>"+
"</td>"+"</tr>";if(dialogType==0)dialogCode+="<tr>"+"<th>Hover over image (optional)</th>"+"<td><input name='wonderplugin-dialog-hoverimage' type='text' id='wonderplugin-dialog-hoverimage' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-hoverimage' id='wonderplugin-dialog-select-hoverimage' value='Upload' /></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>"+"<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>";if(dialogType==11)dialogCode+="<tr>"+"<th>PDF URL</th>"+"<td><input name='wonderplugin-dialog-pdf' type='text' id='wonderplugin-dialog-pdf' value='' class='regular-text' /> or <input type='button' class='button' data-textid='wonderplugin-dialog-pdf' id='wonderplugin-dialog-select-pdf' value='Upload' />"+
"<ul style='list-style-type:square;margin-left:24px;'><li>To support PDF files, please install the free plugin <a href='https://www.wonderplugin.com/wordpress-pdf-embed/' target='_blank'>Wonder PDF Embed</a> first.</li><li>The PDF file must be hosted at the same domain as the WordPrss website</li></ul>"+"</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!=14)dialogCode+='<li class="wonderplugin-dialog-tab-button">'+(dialogType==0?"Lightbox and Weblink":"Lightbox")+"</li>";dialogCode+='<li class="wonderplugin-dialog-tab-button">Social Media</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 (HTML code supported)</th>"+
"<td><input name='wonderplugin-dialog-image-title' type='text' id='wonderplugin-dialog-image-title' value='' class='large-text' /></td>"+"</tr>"+"<tr>"+"<th>Description (<i>HTML code supported</i>)</th>"+"<td><textarea name='wonderplugin-dialog-image-description' type='' id='wonderplugin-dialog-image-description' value='' class='large-text' rows='3'></textarea></td>"+"</tr>";if(dialogType!=14)dialogCode+="<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. To use 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>";dialogCode+="<tr>"+"<th>Button text</th>"+"<td><div style='float:left;'><input name='wonderplugin-dialog-image-button' type='text' id='wonderplugin-dialog-image-button' value='' class='regular-text' style='width:240px;'/> CSS:    </div>"+"<div class='select-editable'><select onchange='this.nextElementSibling.value=this.value'>"+"<option value=''></option>"+"<option value='wpp-btn-blue-small'>wpp-btn-blue-small</option>"+"<option value='wpp-btn-blue-medium'>wpp-btn-blue-medium</option>"+
"<option value='wpp-btn-blue-large'>wpp-btn-blue-large</option>"+"<option value='wpp-btn-blueborder-small'>wpp-btn-blueborder-small</option>"+"<option value='wpp-btn-blueborder-medium'>wpp-btn-blueborder-medium</option>"+"<option value='wpp-btn-blueborder-large'>wpp-btn-blueborder-large</option>"+"<option value='wpp-btn-orange-small'>wpp-btn-orange-small</option>"+"<option value='wpp-btn-orange-medium'>wpp-btn-orange-medium</option>"+"<option value='wpp-btn-orange-large'>wpp-btn-orange-large</option>"+
"<option value='wpp-btn-orangeborder-small'>wpp-btn-orangeborder-small</option>"+"<option value='wpp-btn-orangeborder-medium'>wpp-btn-orangeborder-medium</option>"+"<option value='wpp-btn-orangeborder-large'>wpp-btn-orangeborder-large</option>"+"<option value='wpp-btn-navy-small'>wpp-btn-navy-small</option>"+"<option value='wpp-btn-navy-medium'>wpp-btn-navy-medium</option>"+"<option value='wpp-btn-navy-large'>wpp-btn-navy-large</option>"+"<option value='wpp-btn-navyborder-small'>wpp-btn-navyborder-small</option>"+
"<option value='wpp-btn-navyborder-medium'>wpp-btn-navyborder-medium</option>"+"<option value='wpp-btn-navyborder-large'>wpp-btn-navyborder-large</option>"+"<option value='wpp-btn-white-small'>wpp-btn-white-small</option>"+"<option value='wpp-btn-white-medium'>wpp-btn-white-medium</option>"+"<option value='wpp-btn-white-large'>wpp-btn-white-large</option>"+"<option value='wpp-btn-whiteborder-small'>wpp-btn-whiteborder-small</option>"+"<option value='wpp-btn-whiteborder-medium'>wpp-btn-whiteborder-medium</option>"+
"<option value='wpp-btn-whiteborder-large'>wpp-btn-whiteborder-large</option>"+"<option value='wpp-btn-grey-small'>wpp-btn-grey-small</option>"+"<option value='wpp-btn-grey-medium'>wpp-btn-grey-medium</option>"+"<option value='wpp-btn-grey-large'>wpp-btn-grey-large</option>"+"<option value='wpp-btn-greyborder-small'>wpp-btn-greyborder-small</option>"+"<option value='wpp-btn-greyborder-medium'>wpp-btn-greyborder-medium</option>"+"<option value='wpp-btn-greyborder-large'>wpp-btn-greyborder-large</option>"+
"</select><input type='text' name='wonderplugin-dialog-image-buttoncss' id='wonderplugin-dialog-image-buttoncss' value='wpp-btn-blue-medium' /></div>"+"</td>"+"</tr>";if(dialogType!=14)dialogCode+="<tr><th></th><td><label><input name='wonderplugin-dialog-image-buttonlightbox' type='checkbox' id='wonderplugin-dialog-image-buttonlightbox' value='' />Open current "+dialogTitle[dialogType]+" in lightbox when clicking the button</label></td></tr>"+"<tr>";dialogCode+="<th>Button link</th>"+"<td><div style='float:left;'><input name='wonderplugin-dialog-image-buttonlink' type='text' id='wonderplugin-dialog-image-buttonlink' value='' class='regular-text' style='width:240px;'/> Target: </div>"+
"<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 name='wonderplugin-dialog-image-buttonlinktarget' type='text' id='wonderplugin-dialog-image-buttonlinktarget' value='' /></div></td>"+"</tr>";if(langlist&&langlist.length>1)dialogCode+='<tr colspan="2"><td><input type="button" class="button button-primary" id="wonderplugin-dialog-multilingual" value="Multilingual Translation"></td></tr>';
dialogCode+="</table>";dialogCode+="</li>";if(dialogType!=14){dialogCode+='<li class="wonderplugin-dialog-tab-panel">';dialogCode+="<table class='wonderplugin-dialog-form'>";var lightboxWidth=960;var lightboxHeight=540;if(dialogType==0||dialogType==11){lightboxWidth=1024;lightboxHeight=768}dialogCode+="<tr>"+"<th>Lightbox popup</th>"+"<td><label><input name='wonderplugin-dialog-lightbox' type='checkbox' id='wonderplugin-dialog-lightbox' value='' checked /> Open current "+dialogTitle[dialogType]+" in Lightbox</label>"+
"</tr>";if(dialogType==0)dialogCode+="<tr><th>OR web link</th>"+"<td>"+"<input name='wonderplugin-dialog-weblink' type='text' id='wonderplugin-dialog-weblink' value='' class='large-text' disabled /><p style='font-size:0.9em;font-style:italic;'>* Uncheck the option \"Open current image in Lightbox\" to enable weblink</p>"+"</td>"+"</tr>"+"<tr><th>Web link onclick code</th>"+"<td>"+"<input name='wonderplugin-dialog-clickhandler' type='text' id='wonderplugin-dialog-clickhandler' value='' class='large-text' disabled />"+
"</td>"+"</tr>"+"<tr><th>Web link target</th>"+"<td>"+"<div class='select-editable'><select onchange='this.nextElementSibling.value=this.value' id='wonderplugin-dialog-linktarget-select' disabled>"+"<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 name='wonderplugin-dialog-linktarget' type='text' id='wonderplugin-dialog-linktarget' value='' class='regular-text' disabled /></div>"+
"<label style='display:inline-block;margin:4px 0 0 8px;'><input name='wonderplugin-dialog-weblinklightbox' type='checkbox' id='wonderplugin-dialog-weblinklightbox' value='' disabled /> Open web link in Lightbox</label>"+"</td>"+"</tr>";dialogCode+="<tr><th>Lightbox size</th>"+"<td><label><input name='wonderplugin-dialog-lightbox-size' type='checkbox' id='wonderplugin-dialog-lightbox-size' value='' /> Set Lightbox size (px) </label>"+" <input name='wonderplugin-dialog-lightbox-width' type='text' id='wonderplugin-dialog-lightbox-width' value='"+
lightboxWidth+"' class='small-text' /> / <input name='wonderplugin-dialog-lightbox-height' type='text' id='wonderplugin-dialog-lightbox-height' value='"+lightboxHeight+"' class='small-text' />"+"</td>"+"</tr>";dialogCode+="</table>";dialogCode+="</li>"}dialogCode+='<li class="wonderplugin-dialog-tab-panel">';dialogCode+="<table class='wonderplugin-dialog-form'>";dialogCode+="<tr><th>Add Social Media</th><td>"+"<div class='wonderplugin-dialog-socialmedia-container'><div><select class='wonderplugin-dialog-socialmedia'>"+
"<option value='facebook'>Facebook</option>"+"<option value='dribbble'>Dribbble</option>"+"<option value='dropbox'>Dropbox</option>"+"<option value='mail'>Email</option>"+"<option value='flickr'>Flickr</option>"+"<option value='git'>Git</option>"+"<option value='gplus'>Google+</option>"+"<option value='instagram'>Instagram</option>"+"<option value='linkedin'>Linkedin</option>"+"<option value='pinterest'>Pinterest</option>"+"<option value='reddit'>Reddit</option>"+"<option value='skype'>Skype</option>"+
"<option value='tumblr'>Tumblr</option>"+"<option value='twitter'>Twitter</option>"+"<option value='link'>Website</option>"+"<option value='whatsapp'>Whatsapp</option>"+"<option value='youtube'>Youtube</option>"+"</select><span class='dashicons dashicons-plus-alt wonderplugin-dialog-addsocialmedia'></span></div></div>"+"</td></tr><tr><th></th><td>"+"<table class='wonderplugin-dialog-socialmedia-table'></table>"+"</td></tr>"+"<tr><th>Options</th><td>"+"<div style='display:inline-block;margin-right:8px;'>Target:</div><div style='display:inline-block;'><div class='select-editable'><select onchange='this.nextElementSibling.value=this.value' id='wonderplugin-dialog-socialmediatarget-select'>"+
"<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 name='wonderplugin-dialog-socialmediatarget' type='text' id='wonderplugin-dialog-socialmediatarget' value='' class='regular-text' /></div></div>"+"<p><label><input name='wonderplugin-dialog-socialmediarotate' type='checkbox' id='wonderplugin-dialog-socialmediarotate' value='' checked />Enable button rotating effect on mouse hover</label></p>"+
"</tr></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 $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-lightbox").click(function(){var is_checked=$(this).is(":checked");if($("#wonderplugin-dialog-weblink").length)$("#wonderplugin-dialog-weblink").prop("disabled",is_checked);if($("#wonderplugin-dialog-clickhandler").length)$("#wonderplugin-dialog-clickhandler").prop("disabled",is_checked);if($("#wonderplugin-dialog-linktarget").length)$("#wonderplugin-dialog-linktarget").prop("disabled",is_checked);if($("#wonderplugin-dialog-linktarget-select").length)$("#wonderplugin-dialog-linktarget-select").prop("disabled",
is_checked);if($("#wonderplugin-dialog-weblinklightbox").length)$("#wonderplugin-dialog-weblinklightbox").prop("disabled",is_checked)});$(".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").prop("disabled",$(this).is(":checked"))});$(".wonderplugin-dialog-addsocialmedia").click(function(){var item=
$(".wonderplugin-dialog-socialmedia").val();var itemtext=$(".wonderplugin-dialog-socialmedia option:selected").text();$(".wonderplugin-dialog-socialmedia-table").append('<tr class="wonderplugin-dialog-socialmedia-row" data-item="'+item+'"><td><div class="wonderplugin-dialog-socialmedia-button-container"><div class="mh-icon-'+item+' wonderplugin-dialog-socialmedia-button" style="background-color:'+socialbgcolor[item]+';"></div></div></td>'+'<td><span class="wonderplugin-dialog-socialmedia-title">'+
itemtext+"</span></td>"+'<td><input class="wonderplugin-dialog-socialmedia-url" type="text" placeholder="Enter '+itemtext+" "+(item=="mail"?"Address":"URL")+'"></span></td>'+'<td><span class="dashicons dashicons-dismiss wonderplugin-dialog-removesocialmedia"></span></td></tr>')});$(".wonderplugin-dialog-socialmedia-table").on("click",".wonderplugin-dialog-removesocialmedia",function(){$(this).closest(".wonderplugin-dialog-socialmedia-row").remove()});if(langlist&&langlist.length>1)$("#wonderplugin-dialog-multilingual").click(function(){var defaultlang=
$("#wonderplugin-carousel-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><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=JSON.parse($("#wonderplugin-dialog-langs").text())}catch(err){}var defaultlang=
$("#wonderplugin-carousel-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-carousel-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()}}})});var getSocialMedia=function(){var sociallist=[];$(".wonderplugin-dialog-socialmedia-row").each(function(){sociallist.push({"name":$(this).data("item"),"url":$.trim($(".wonderplugin-dialog-socialmedia-url",this).val())})});return JSON.stringify(sociallist)};var drawSocialMedia=function(socialmedia){var sociallist={};try{sociallist=JSON.parse(socialmedia)}catch(err){}for(var i=
0;i<sociallist.length;i++){var item=sociallist[i].name;var itemtext=$('.wonderplugin-dialog-socialmedia option[value="'+item+'"]').text();$(".wonderplugin-dialog-socialmedia-table").append('<tr class="wonderplugin-dialog-socialmedia-row" data-item="'+item+'"><td><div class="wonderplugin-dialog-socialmedia-button-container"><div class="mh-icon-'+item+' wonderplugin-dialog-socialmedia-button" style="background-color:'+socialbgcolor[item]+';"></div></div></td>'+'<td><span class="wonderplugin-dialog-socialmedia-title">'+
itemtext+"</span></td>"+'<td><input class="wonderplugin-dialog-socialmedia-url" type="text" value="'+sociallist[i].url+'"placeholder="Enter '+itemtext+" "+(item=="mail"?"Address":"URL")+'"></span></td>'+'<td><span class="dashicons dashicons-dismiss wonderplugin-dialog-removesocialmedia"></span></td></tr>')}};if(data){if(data.langs)$("#wonderplugin-dialog-langs").text(data.langs);if(dialogType==2||dialogType==3)$("#wonderplugin-dialog-video").val(data.video);if(dialogType!=14){$("#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);if(data.displaythumbnail)$("#wonderplugin-dialog-displaythumbnail").prop("checked",true);else $("#wonderplugin-dialog-displaythumbnail").prop("checked",false)}$("#wonderplugin-dialog-image-title").val(data.title);$("#wonderplugin-dialog-image-description").val(data.description);$("#wonderplugin-dialog-image-button").val(data.button);
$("#wonderplugin-dialog-image-buttoncss").val(data.buttoncss);$("#wonderplugin-dialog-image-buttonlink").val(data.buttonlink);$("#wonderplugin-dialog-image-buttonlinktarget").val(data.buttonlinktarget);if(dialogType!=14)$("#wonderplugin-dialog-image-buttonlightbox").prop("checked",data.buttonlightbox);if(data.socialmedia){drawSocialMedia(data.socialmedia);$("#wonderplugin-dialog-socialmediatarget").val(data.socialmediatarget);$("#wonderplugin-dialog-socialmediarotate").prop("checked",data.socialmediarotate)}if(dialogType!=
14){$("#wonderplugin-dialog-image-altusetitle").prop("checked",data.altusetitle);$("#wonderplugin-dialog-image-alt").val(data.alt);$("#wonderplugin-dialog-image-alt").prop("disabled",data.altusetitle)}if(dialogType==11)$("#wonderplugin-dialog-pdf").val(data.pdf);if(dialogType==1){$("#wonderplugin-dialog-mp4").val(data.mp4);$("#wonderplugin-dialog-webm").val(data.webm)}if(dialogType==0){if(data.hoverimage)$("#wonderplugin-dialog-hoverimage").val(data.hoverimage);$("#wonderplugin-dialog-weblink").val(data.weblink);
$("#wonderplugin-dialog-clickhandler").val(data.clickhandler);$("#wonderplugin-dialog-linktarget").val(data.linktarget);$("#wonderplugin-dialog-weblink").prop("disabled",data.lightbox);$("#wonderplugin-dialog-clickhandler").prop("disabled",data.lightbox);$("#wonderplugin-dialog-linktarget").prop("disabled",data.lightbox);$("#wonderplugin-dialog-linktarget-select").prop("disabled",data.lightbox);if(data.weblinklightbox)$("#wonderplugin-dialog-weblinklightbox").prop("checked",true);else $("#wonderplugin-dialog-weblinklightbox").prop("checked",
false);$("#wonderplugin-dialog-weblinklightbox").prop("disabled",data.lightbox)}if("lightbox"in data)$("#wonderplugin-dialog-lightbox").prop("checked",data.lightbox);if("lightboxsize"in data)$("#wonderplugin-dialog-lightbox-size").prop("checked",data.lightboxsize);if(data.lightboxwidth)$("#wonderplugin-dialog-lightbox-width").val(data.lightboxwidth);if(data.lightboxheight)$("#wonderplugin-dialog-lightbox-height").val(data.lightboxheight)}if(dialogType==2||dialogType==3)$("#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()),socialmedia:getSocialMedia(),socialmediatarget:$.trim($("#wonderplugin-dialog-socialmediatarget").val()),socialmediarotate:$("#wonderplugin-dialog-socialmediarotate").is(":checked"),altusetitle:$("#wonderplugin-dialog-image-altusetitle").is(":checked"),
alt:$.trim($("#wonderplugin-dialog-image-alt").val()),button:$.trim($("#wonderplugin-dialog-image-button").val()),buttoncss:$.trim($("#wonderplugin-dialog-image-buttoncss").val()),buttonlink:$.trim($("#wonderplugin-dialog-image-buttonlink").val()),buttonlinktarget:$.trim($("#wonderplugin-dialog-image-buttonlinktarget").val()),buttonlightbox:$("#wonderplugin-dialog-image-buttonlightbox").is(":checked")};$slideDialog.remove();onlineVideoDialog(dialogType,function(items){items.map(function(data){addMediaToList({type:dialogType,
image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,displaythumbnail:data.displaythumbnail,video:data.video,mp4:data.mp4,webm:data.webm,title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,socialmediatarget:data.socialmediatarget,socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,
clickhandler:data.clickhandler,linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs})});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-carousel-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_carousel_get_media_langs",nonce:ajaxnonce,item:JSON.stringify(media)},success:function(data){if(data){var defaultlang=$("#wonderplugin-carousel-defaultlang").text();var currentlang=$("#wonderplugin-carousel-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"||buttonId=="wonderplugin-dialog-select-hoverimage"){library_title="Add Image";library_type="image"}else if(buttonId=="wonderplugin-dialog-select-pdf"){library_title="Add PDF";library_type="application"}else{library_title="Add Video";library_type="video"}var media_options={title:library_title,library:{type:library_type},
button:{text:library_title},multiple:dialogType==0&&buttonId=="wonderplugin-dialog-select-image"};if(buttonId=="wonderplugin-dialog-select-pdf")media_options.library.subtype="pdf";var media_uploader=wp.media.frames.file_frame=wp.media(media_options);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-carousel-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.medium&&attachment.sizes.medium.url)thumbnail=attachment.sizes.medium.url;else if(attachment.sizes&&attachment.sizes.thumbnail&&attachment.sizes.thumbnail.url)thumbnail=
attachment.sizes.thumbnail.url;else thumbnail=attachment.url;var titlefield=$("#wonderplugin-carousel-titlefield").text();var selectedtitle=titlefield=="caption"?attachment.caption:attachment.title;items.push({id:attachment.id,image:attachment.url,thumbnail:thumbnail,displaythumbnail:$("#wonderplugin-dialog-displaythumbnail").is(":checked"),title:selectedtitle,description:attachment.description,button:"",buttoncss:"wpp-btn-blue-medium",buttonlink:"",buttonlinktarget:"",buttonlightbox:false,socialmedia:"",
socialmediatarget:"",socialmediarotate:true,altusetitle:attachment.alt&&attachment.alt.length>0?false:true,alt:attachment.alt&&attachment.alt.length>0?attachment.alt:"",weblink:"",clickhandler:"",weblinklightbox:false,linktarget:"",lightbox:$("#wonderplugin-dialog-lightbox").is(":checked"),lightboxsize:$("#wonderplugin-dialog-lightbox-size").is(":checked"),lightboxwidth:parseInt($.trim($("#wonderplugin-dialog-lightbox-width").val())),lightboxheight:parseInt($.trim($("#wonderplugin-dialog-lightbox-height").val()))})});
$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-carousel-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.medium&&attachment.sizes.medium.url)thumbnail=attachment.sizes.medium.url;else if(attachment.sizes&&attachment.sizes.thumbnail&&attachment.sizes.thumbnail.url)thumbnail=attachment.sizes.thumbnail.url;else thumbnail=attachment.url;var titlefield=$("#wonderplugin-carousel-titlefield").text();var selectedtitle=titlefield=="caption"?attachment.caption:attachment.title;$("#wonderplugin-dialog-image-display-tr").css({display:"table-row"});
$("#wonderplugin-dialog-image-display").attr("src",attachment.url);$("#wonderplugin-dialog-image").val(attachment.url);$("#wonderplugin-dialog-thumbnail").val(thumbnail);if($.trim($("#wonderplugin-dialog-image-title").val()).length<=0)$("#wonderplugin-dialog-image-title").val(selectedtitle);if($.trim($("#wonderplugin-dialog-image-description").val()).length<=0)$("#wonderplugin-dialog-image-description").val(attachment.description);$("#wonderplugin-dialog-image").removeClass("wonderplugin-dialog-inputbox-warning");
if(attachment.alt&&attachment.alt.length>0){$("#wonderplugin-dialog-image-altusetitle").prop("checked",false);$("#wonderplugin-dialog-image-alt").val(attachment.alt);$("#wonderplugin-dialog-image-alt").prop("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-carousel-defaultlang").text();var currentlang=$("#wonderplugin-carousel-currentlang").text();if(currentlang!=defaultlang&&
data[0].langs){var langs=null;try{langs=JSON.parse(data[0].langs)}catch(err){}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-hoverimage"){if(attachment.type!="image"){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select an image file</p>");return}$("#wonderplugin-dialog-hoverimage").val(attachment.url)}else if(buttonId=="wonderplugin-dialog-select-pdf"){if(attachment.type!="application"&&attachment.subtype!="pdf"){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select a pdf file</p>");
return}$("#"+textId).val(attachment.url);$("#wonderplugin-dialog-pdf").removeClass("wonderplugin-dialog-inputbox-warning")}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-mp4").removeClass("wonderplugin-dialog-inputbox-warning")}}$("#wonderplugin-dialog-error").css({display:"none"}).empty()});media_uploader.open()};if(parseInt($("#wonderplugin-carousel-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"||buttonId=="wonderplugin-dialog-select-hoverimage"?"image":"video";tb_show("Upload "+mediaType,"media-upload.php?referer=wonderplugin-carousel&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);if($.trim($("#wonderplugin-dialog-image-title").val()).length<=
0)$("#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 src=$(html).is("a")?$(html).attr("href"):$img.attr("src");$("#wonderplugin-dialog-thumbnail").val(src)}else if(buttonId=="wonderplugin-dialog-select-hoverimage"){var $img=$("img",html);if(!$img.length){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select an image file</p>");
return}var src=$(html).is("a")?$(html).attr("href"):$img.attr("src");$("#wonderplugin-dialog-hoverimage").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==0)$("#wonderplugin-dialog-select-hoverimage").click(history_media_upload_onclick);if(dialogType==1){$("#wonderplugin-dialog-select-mp4").click(history_media_upload_onclick);$("#wonderplugin-dialog-select-webm").click(history_media_upload_onclick)}}else{$("#wonderplugin-dialog-select-image").click(media_upload_onclick);$("#wonderplugin-dialog-select-thumbnail").click(media_upload_onclick);if(dialogType==0)$("#wonderplugin-dialog-select-hoverimage").click(media_upload_onclick);if(dialogType==
1){$("#wonderplugin-dialog-select-mp4").click(media_upload_onclick);$("#wonderplugin-dialog-select-webm").click(media_upload_onclick)}if(dialogType==11)$("#wonderplugin-dialog-select-pdf").click(media_upload_onclick)}$("#wonderplugin-dialog-ok").click(function(){if(dialogType!=14)if($.trim($("#wonderplugin-dialog-image").val()).length<=0){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select an image file</p>");$("#wonderplugin-dialog-image").addClass("wonderplugin-dialog-inputbox-warning");
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").addClass("wonderplugin-dialog-inputbox-warning");return}if(dialogType==11&&$.trim($("#wonderplugin-dialog-pdf").val()).length<=0){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select a PDF file</p>");$("#wonderplugin-dialog-pdf").addClass("wonderplugin-dialog-inputbox-warning");
return}var langs=null;try{langs=JSON.parse($("#wonderplugin-dialog-langs").text())}catch(err){}var defaultlang=$("#wonderplugin-carousel-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 item={image:"",thumbnail:"",displaythumbnail:false,
video:"",mp4:"",webm:"",title:$.trim($("#wonderplugin-dialog-image-title").val()),description:$.trim($("#wonderplugin-dialog-image-description").val()),button:$.trim($("#wonderplugin-dialog-image-button").val()),buttoncss:$.trim($("#wonderplugin-dialog-image-buttoncss").val()),buttonlink:$.trim($("#wonderplugin-dialog-image-buttonlink").val()),buttonlinktarget:$.trim($("#wonderplugin-dialog-image-buttonlinktarget").val()),buttonlightbox:false,socialmedia:getSocialMedia(),socialmediatarget:$.trim($("#wonderplugin-dialog-socialmediatarget").val()),
socialmediarotate:$("#wonderplugin-dialog-socialmediarotate").is(":checked"),altusetitle:true,alt:"",weblink:"",clickhandler:"",linktarget:"",weblinklightbox:false,lightbox:false,lightboxsize:false,lightboxwidth:960,lightboxheight:540,langs:langs?JSON.stringify(langs):"",hoverimage:""};if(dialogType!=14)$.extend(item,{image:$.trim($("#wonderplugin-dialog-image").val()),thumbnail:$.trim($("#wonderplugin-dialog-thumbnail").val()),displaythumbnail:$("#wonderplugin-dialog-displaythumbnail").is(":checked"),
video:$.trim($("#wonderplugin-dialog-video").val()),mp4:$.trim($("#wonderplugin-dialog-mp4").val()),webm:$.trim($("#wonderplugin-dialog-webm").val()),buttonlightbox:$("#wonderplugin-dialog-image-buttonlightbox").is(":checked"),altusetitle:$("#wonderplugin-dialog-image-altusetitle").is(":checked"),alt:$.trim($("#wonderplugin-dialog-image-alt").val()),weblink:$.trim($("#wonderplugin-dialog-weblink").val()),clickhandler:$.trim($("#wonderplugin-dialog-clickhandler").val()),linktarget:$.trim($("#wonderplugin-dialog-linktarget").val()),
weblinklightbox:$("#wonderplugin-dialog-weblinklightbox").is(":checked"),lightbox:$("#wonderplugin-dialog-lightbox").is(":checked"),lightboxsize:$("#wonderplugin-dialog-lightbox-size").is(":checked"),lightboxwidth:parseInt($.trim($("#wonderplugin-dialog-lightbox-width").val())),lightboxheight:parseInt($.trim($("#wonderplugin-dialog-lightbox-height").val()))});if(dialogType==11)item.pdf=$.trim($("#wonderplugin-dialog-pdf").val());if(dialogType==0)item.hoverimage=$.trim($("#wonderplugin-dialog-hoverimage").val());
$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>"+"<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>"+"<tr>"+"<th></th>"+"<td><label><input name='wonderplugin-dialog-youtubestatic' type='checkbox' id='wonderplugin-dialog-youtubestatic' value='' /> Do not create a dynamic YouTube playlist carousel, instead, retrieve videos in the playlist and add them to the carousel.</label>"+"</tr>"+"<tr>"+"<th>Click to open Lightbox popup</th>"+"<td><label><input name='wonderplugin-dialog-lightbox' type='checkbox' id='wonderplugin-dialog-lightbox' value='' checked /> Open YouTube video in Lightbox</label>"+
"</tr>"+"<tr><th>Lightbox size</th>"+"<td><label><input name='wonderplugin-dialog-lightbox-size' type='checkbox' id='wonderplugin-dialog-lightbox-size' value='' /> Set Lightbox size (px) </label>"+" <input name='wonderplugin-dialog-lightbox-width' type='text' id='wonderplugin-dialog-lightbox-width' value='960' class='small-text' /> / <input name='wonderplugin-dialog-lightbox-height' type='text' id='wonderplugin-dialog-lightbox-height' value='540' 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>"+"<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"});if(data){$("#wonderplugin-dialog-youtubeapikey").val(data.youtubeapikey);$("#wonderplugin-dialog-youtubeplaylistid").val(data.youtubeplaylistid);$("#wonderplugin-dialog-youtubeplaylistmaxresults").val(data.youtubeplaylistmaxresults);if("lightbox"in data)$("#wonderplugin-dialog-lightbox").prop("checked",
data.lightbox);if("lightboxsize"in data)$("#wonderplugin-dialog-lightbox-size").prop("checked",data.lightboxsize);if(data.lightboxwidth)$("#wonderplugin-dialog-lightbox-width").val(data.lightboxwidth);if(data.lightboxheight)$("#wonderplugin-dialog-lightbox-height").val(data.lightboxheight)}$("#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 item={youtubeapikey:$.trim($("#wonderplugin-dialog-youtubeapikey").val()),youtubeplaylistid:$.trim($("#wonderplugin-dialog-youtubeplaylistid").val()),youtubeplaylistmaxresults:$.trim($("#wonderplugin-dialog-youtubeplaylistmaxresults").val()),
lightbox:$("#wonderplugin-dialog-lightbox").is(":checked"),lightboxsize:$("#wonderplugin-dialog-lightbox-size").is(":checked"),lightboxwidth:parseInt($.trim($("#wonderplugin-dialog-lightbox-width").val())),lightboxheight:parseInt($.trim($("#wonderplugin-dialog-lightbox-height").val())),displaythumbnail:false,mp4:"",webm:"",weblink:"",clickhandler:"",linktarget:"",weblinklightbox:false};if($("#wonderplugin-dialog-youtubestatic").is(":checked")){for(var i=0;i<wonderplugin_carousel_config.slides.length;i++)if(wonderplugin_carousel_config.slides[i].type==
10&&wonderplugin_carousel_config.slides[i].youtubeplaylistid==item.youtubeplaylistid)wonderplugin_carousel_config.slides.splice(i,1);getYouTubePlaylist(item,null)}else{$playlistDialog.remove();onSuccess([item])}});$("#wonderplugin-dialog-cancel").click(function(){$playlistDialog.remove()})};var getYouTubePlaylist=function(item,pagetoken){var youtube_url="https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId="+item.youtubeplaylistid+"&key="+item.youtubeapikey;if(item.youtubeplaylistmaxresults)if(item.youtubeplaylistmaxresults>
50)youtube_url+="&maxResults=50";else youtube_url+="&maxResults="+item.youtubeplaylistmaxresults;if(pagetoken)youtube_url+="&pageToken="+pagetoken;var all_done=true;$.getJSON(youtube_url,function(data){if(data&&data.items)for(var i=0;i<data.items.length;i++){var video_id=data.items[i]["snippet"]["resourceId"]["videoId"];var thumbnail="https://img.youtube.com/vi/"+video_id+"/0.jpg";var image="https://img.youtube.com/vi/"+video_id+"/0.jpg";if(data.items[i]["snippet"]["thumbnails"]){if(data.items[i]["snippet"]["thumbnails"]["standard"])thumbnail=
data.items[i]["snippet"]["thumbnails"]["standard"]["url"];if(data.items[i]["snippet"]["thumbnails"]["maxres"])image=data.items[i]["snippet"]["thumbnails"]["maxres"]["url"]}var video="https://www.youtube.com/embed/"+video_id;var title=data.items[i]["snippet"]["title"];var description=data.items[i]["snippet"]["description"];var youtubeItem={type:2,image:image,thumbnail:thumbnail,displaythumbnail:true,video:video,mp4:"",webm:"",title:title,description:description,button:"",buttoncss:"",buttonlink:"",
buttonlinktarget:"",buttonlightbox:false,socialmedia:"",socialmediatarget:"",socialmediarotate:true,altusetitle:true,alt:title,weblink:"",clickhandler:"",linktarget:"",weblinklightbox:false,lightbox:item.lightbox,lightboxsize:item.lightboxsize,lightboxwidth:item.lightboxwidth,lightboxheight:item.lightboxheight,langs:""};var bFound=false;for(var j=0;j<wonderplugin_carousel_config.slides.length;j++)if(wonderplugin_carousel_config.slides[j].type==2&&wonderplugin_carousel_config.slides[j].video==youtubeItem.video){bFound=
true;break}if(!bFound)addMediaToList(youtubeItem)}if(data&&data.nextPageToken&&item.youtubeplaylistmaxresults&&item.youtubeplaylistmaxresults>50){all_done=false;getYouTubePlaylist(item,data.nextPageToken)}}).always(function(){if(all_done){$(".wonderplugin-dialog-container").remove();updateMediaTable()}})};var onlineVideoDialog=function(dialogType,onSuccess,videoData,invokeFromSlideDialog,dataIndex){var dialogTitle=["Image","Video","Youtube Video","Vimeo Video"];var dialogExample=["","","https://www.youtube.com/watch?v=wswxQ3mhwqQ",
"https://vimeo.com/147079122"];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>Enter "+dialogTitle[dialogType]+" URL</th>"+"<td><input name='wonderplugin-dialog-video' type='text' id='wonderplugin-dialog-video' value='' class='regular-text' />"+
"<p>URL Example: <b><i>"+dialogExample[dialogType]+"</i></b><p>"+"</td>"+"</tr>";dialogCode+="</table>"+"<div id='wonderplugin-carousel-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_carousel_config.slides.splice(dataIndex,1);items.map(function(data){var result={type:dialogType,image:data.image,thumbnail:data.thumbnail?
data.thumbnail:data.image,displaythumbnail:data.displaythumbnail,video:data.video,mp4:data.mp4,webm:data.webm,title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,socialmediatarget:data.socialmediatarget,socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,clickhandler:data.clickhandler,
linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs};if(typeof dataIndex!=="undefined"&&dataIndex>=0)wonderplugin_carousel_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 regExp=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;var match=href.match(regExp);if(match&&match[7]&&match[7].length==11)youtubeId=match[7];else{$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please enter a valid Youtube URL</p>");return}var youtubeDomain=href.indexOf("youtube-nocookie")>=
0?"youtube-nocookie":"youtube";var result=protocol+"//www."+youtubeDomain+".com/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-carousel-video-dialog-loading").css({display:"block"});$.ajax({url:protocol+"//vimeo.com/api/v2/video/"+
vimeoId+".json",dataType:"json",timeout:3E3,data:{format:"json"},success:function(data){videoData.title=data[0].title;videoData.description=data[0].description;videoData.image=data[0].thumbnail_large;videoData.thumbnail=data[0].thumbnail_medium;videoDataReturn()},error:function(){videoDataReturn()}})}});$("#wonderplugin-dialog-cancel").click(function(){$videoDialog.remove();if(invokeFromSlideDialog)videoDataReturn()})};var wonderCarouselEscapeHTML=function(str){if(!str)return"";else return str.replace(/&/g,
"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")};var updateMediaTable=function(){var mediaType=["Image","Video","YouTube","Vimeo","","","WordPress Posts","WooCommerce / Custom Posts","WordPress Page","","YouTube Playlist","PDF","Import Folder","HTML","Text"];$("#wonderplugin-carousel-media-table").empty();for(var i=0;i<wonderplugin_carousel_config.slides.length;i++){var thumbnail="";if(wonderplugin_carousel_config.slides[i].type==6)thumbnail=$("#wonderplugin-carousel-pluginfolder").text()+
"images/wordpressposts.png";else if(wonderplugin_carousel_config.slides[i].type==7)thumbnail=$("#wonderplugin-carousel-pluginfolder").text()+"images/wordpresscustompost.png";else if(wonderplugin_carousel_config.slides[i].type==8)thumbnail=$("#wonderplugin-carousel-pluginfolder").text()+"images/wordpresspage.png";else if(wonderplugin_carousel_config.slides[i].type==10)thumbnail=$("#wonderplugin-carousel-pluginfolder").text()+"images/youtubeplaylist.png";else if(wonderplugin_carousel_config.slides[i].type==
12)thumbnail=$("#wonderplugin-carousel-pluginfolder").text()+"images/importfolder.png";else if(wonderplugin_carousel_config.slides[i].type==13)thumbnail=$("#wonderplugin-carousel-pluginfolder").text()+"images/htmlcode.png";else if(wonderplugin_carousel_config.slides[i].type==14)thumbnail=$("#wonderplugin-carousel-pluginfolder").text()+"images/text.png";else thumbnail=wonderplugin_carousel_config.slides[i].thumbnail;$("#wonderplugin-carousel-media-table").append("<li>"+"<div class='wonderplugin-carousel-media-table-id'>"+
(i+1)+"</div>"+"<div class='wonderplugin-carousel-media-table-img'>"+"<img class='wonderplugin-carousel-media-table-image' data-order='"+i+"' src='"+thumbnail+"' />"+"</div>"+"<div class='wonderplugin-carousel-media-table-type'>"+mediaType[wonderplugin_carousel_config.slides[i].type]+"</div>"+"<div class='wonderplugin-carousel-media-table-title'>"+wonderCarouselEscapeHTML(wonderplugin_carousel_config.slides[i].title)+"</div>"+"<div class='wonderplugin-carousel-media-table-buttons-edit'>"+"<a class='wonderplugin-carousel-media-table-button wonderplugin-carousel-media-table-edit'>Edit</a> | "+
"<a class='wonderplugin-carousel-media-table-button wonderplugin-carousel-media-table-delete'>Delete</a>"+"</div>"+"<div class='wonderplugin-carousel-media-table-buttons-move'>"+"<a class='wonderplugin-carousel-media-table-button wonderplugin-carousel-media-table-moveup'>Move Up</a> | "+"<a class='wonderplugin-carousel-media-table-button wonderplugin-carousel-media-table-movedown'>Move Down</a>"+"</div>"+"<div style='clear:both;'></div>"+"</li>")}$(".wonderplugin-carousel-media-table-image").wpdraggable(wonderPluginMediaTableMove);
$(".wonderplugin-carousel-media-table-help").css({display:wonderplugin_carousel_config.slides.length>0?"none":"block"})};$("#wonderplugin-add-pdf").click(function(){slideDialog(11,function(items){items.map(function(data){addMediaToList({type:11,image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,displaythumbnail:data.displaythumbnail,pdf:data.pdf,video:data.video,mp4:data.mp4,webm:data.webm,title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,
buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,socialmediatarget:data.socialmediatarget,socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,clickhandler:data.clickhandler,linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs})});updateMediaTable()})});
$("#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,displaythumbnail:data.displaythumbnail,video:data.video,mp4:data.mp4,webm:data.webm,title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,socialmediatarget:data.socialmediatarget,
socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,clickhandler:data.clickhandler,linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs})});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,displaythumbnail:data.displaythumbnail,video:data.video,mp4:data.mp4,webm:data.webm,title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,socialmediatarget:data.socialmediatarget,socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,clickhandler:data.clickhandler,
linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs})});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,displaythumbnail:data.displaythumbnail,video:data.video,mp4:data.mp4,webm:data.webm,
title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,socialmediatarget:data.socialmediatarget,socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,clickhandler:data.clickhandler,linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,
lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs})});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,displaythumbnail:data.displaythumbnail,video:data.video,mp4:data.mp4,webm:data.webm,title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,
buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,socialmediatarget:data.socialmediatarget,socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,clickhandler:data.clickhandler,linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs})});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,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,displaythumbnail:false,mp4:"",webm:"",weblink:"",clickhandler:"",linktarget:"",weblinklightbox:false})});
updateMediaTable()})});$("#wonderplugin-add-text").click(function(){slideDialog(14,function(items){items.map(function(data){addMediaToList({type:14,image:data.image,thumbnail:data.thumbnail?data.thumbnail:data.image,displaythumbnail:data.displaythumbnail,video:data.video,mp4:data.mp4,webm:data.webm,title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,
socialmediatarget:data.socialmediatarget,socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,clickhandler:data.clickhandler,linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs})});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=null;try{catlist=JSON.parse($("#wonderplugin-carousel-catlist").text())}catch(err){}dialogCode+="<option value='-1'>Recent Posts</option>";
dialogCode+="<option value='-2'>All Categories</option>";for(var key in catlist)dialogCode+="<option value='"+catlist[key].ID+"'>Category: "+catlist[key].cat_name+"</option>";dialogCode+="</select>"+"<label style='margin-left:18px;'>Order by: <select name='wonderplugin-dialog-postorderby' id='wonderplugin-dialog-postorderby'></label>"+"<option value='date'>Date</option>"+"<option value='rand'>Random Order</option>"+"<option value='none'>No order</option>"+"<option value='ID'>ID</option>"+"<option value='author'>Author</option>"+
"<option value='title'>Title</option>"+"<option value='modified'>Modified Date</option>"+"<option value='comment_count'>Number of Comments</option>"+"</select></td></tr>";dialogCode+="<tr><th>Posts Tags</th><td><label><input name='wonderplugin-dialog-selectpostbytags' type='checkbox' id='wonderplugin-dialog-selectpostbytags' /> Select posts by tags: <input name='wonderplugin-dialog-posttags' id='wonderplugin-dialog-posttags' type='text' class='medium-text' /></label>  <a href='https://www.wonderplugin.com/wordpress-carousel-plugin/wordpress-posts-carousel-by-tags/' target='_blank'>Tutorial: How to get posts by tags</a></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 and Image</li>'+'<li class="wonderplugin-dialog-tab-button">Order and Range</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-posttitlefield' id='wonderplugin-dialog-posttitlefield' type='text' value='%post_title%' class='large-text' /><p><label><input name='wonderplugin-dialog-titlelink' type='checkbox' id='wonderplugin-dialog-titlelink' value='' /> Link title to the post page</label></p></td></tr>";dialogCode+="<tr><th>Description</th><td><textarea name='wonderplugin-dialog-postdescriptionfield' id='wonderplugin-dialog-postdescriptionfield' class='large-text'>%post_excerpt%</textarea><br><label>Maximum Excerpt Word Length: <input name='wonderplugin-dialog-excerptlength' id='wonderplugin-dialog-excerptlength' type='number' value='25' class='small-text' /></label></td></tr>";
dialogCode+="<tr><th>Featured 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' selected>Large</option><option value='full'>Full</option></select></td>";dialogCode+="<tr><th>When clicking on the image</th><td>";dialogCode+="<label><input name='wonderplugin-dialog-imageaction' type='checkbox' id='wonderplugin-dialog-imageaction' checked /> Open post page or featured image in lightbox when clicking image in carousel</label>";
dialogCode+="<div style='margin-left:24px;' class='imageaction-options'><p><label><input type='radio' name='wonderplugin-dialog-postlightbox' value='1' >Open the featured image in lightbox</label><label style='margin-left:12px;'><input name='wonderplugin-dialog-postlightbox-size' type='checkbox' id='wonderplugin-dialog-postlightbox-size' value='' /> Set Lightbox size </label><input name='wonderplugin-dialog-postlightbox-width' type='number' id='wonderplugin-dialog-postlightbox-width' value='960' class='small-text' /> / <input name='wonderplugin-dialog-postlightbox-height' type='number' id='wonderplugin-dialog-postlightbox-height' value='540' class='small-text' /></p>";
dialogCode+="<p><label><input type='radio' name='wonderplugin-dialog-postlightbox' value='0' checked>Open the post page</label></p></div></td>";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+="</table>";dialogCode+="<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 carousel 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 carousel item.</li>"+"<li>The excerpt of a post will be used as the description property of the carousel item. For how to add excerpts for posts, please view <a href='https://codex.wordpress.org/Excerpt' target='_blank'>WordPress Excerpts</a>.</li></ul>";
dialogCode+="</li>";dialogCode+='<li class="wonderplugin-dialog-tab-panel">';dialogCode+="<table class='wonderplugin-dialog-form'>";dialogCode+="<tr><th>Maximum Posts</th><td><input style='vertical-align:middle;' name='wonderplugin-dialog-postnumber' id='wonderplugin-dialog-postnumber' type='number' value='10' class='small-text' /><select name='wonderplugin-dialog-postorder' id='wonderplugin-dialog-postorder'><option value='DESC'>Order</option><option value='ASC'>Reverse Order</option></select></td></tr>";
dialogCode+="<tr><th>Date Range</th><td><label><input name='wonderplugin-dialog-postdaterange' type='checkbox' id='wonderplugin-dialog-postdaterange' /> Only get posts from the past <input name='wonderplugin-dialog-postdaterangeafter' id='wonderplugin-dialog-postdaterangeafter' type='number' value='30' class='small-text' /> days</label></td></tr>";dialogCode+="<tr><th></th><td>";dialogCode+="<label><input name='wonderplugin-dialog-postdatefromto' type='checkbox' id='wonderplugin-dialog-postdatefromto' /> Select date range - from ";
dialogCode+="<input name='wonderplugin-dialog-postdatefromyear' id='wonderplugin-dialog-postdatefromyear' type='number' value='"+((new Date).getFullYear()-1)+"' class='small-text' />";dialogCode+="<select name='wonderplugin-dialog-postdatefrommonth' id='wonderplugin-dialog-postdatefrommonth'>";for(var i=1;i<=12;i++)dialogCode+="<option value='"+i+"'>"+i+"</option>";dialogCode+="</select>";dialogCode+="<select name='wonderplugin-dialog-postdatefromday' id='wonderplugin-dialog-postdatefromday'>";for(var i=
1;i<=31;i++)dialogCode+="<option value='"+i+"'>"+i+"</option>";dialogCode+="</select>";dialogCode+=" to ";dialogCode+="<input name='wonderplugin-dialog-postdatetoyear' id='wonderplugin-dialog-postdatetoyear' type='number' value='"+((new Date).getFullYear()+1)+"' class='small-text' />";dialogCode+="<select name='wonderplugin-dialog-postdatetomonth' id='wonderplugin-dialog-postdatetomonth'>";for(var i=1;i<=12;i++)dialogCode+="<option value='"+i+"'>"+i+"</option>";dialogCode+="</select>";dialogCode+=
"<select name='wonderplugin-dialog-postdatetoday' id='wonderplugin-dialog-postdatetoday'>";for(var i=1;i<=31;i++)dialogCode+="<option value='"+i+"'>"+i+"</option>";dialogCode+="</select>";dialogCode+="</td>";dialogCode+="</table>";dialogCode+="</li>";dialogCode+="</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 $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-posttitlefield").val(data.posttitlefield);$("#wonderplugin-dialog-postdescriptionfield").val(data.postdescriptionfield);$("#wonderplugin-dialog-postcategory").val(data.postcategory);$("#wonderplugin-dialog-postorderby").val(data.postorderby);
$("#wonderplugin-dialog-postorder").val(data.postorder);$("#wonderplugin-dialog-selectpostbytags").prop("checked",data.selectpostbytags);$("#wonderplugin-dialog-posttags").val(data.posttags);$("#wonderplugin-dialog-postdaterange").prop("checked",data.postdaterange);$("#wonderplugin-dialog-postdaterangeafter").val(data.postdaterangeafter);$("#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("postdatefromto"in data){$("#wonderplugin-dialog-postdatefromto").prop("checked",data.postdatefromto);$("#wonderplugin-dialog-postdatefromyear").val(data.postdatefromyear);$("#wonderplugin-dialog-postdatefrommonth").val(data.postdatefrommonth);$("#wonderplugin-dialog-postdatefromday").val(data.postdatefromday);$("#wonderplugin-dialog-postdatetoyear").val(data.postdatetoyear);$("#wonderplugin-dialog-postdatetomonth").val(data.postdatetomonth);
$("#wonderplugin-dialog-postdatetoday").val(data.postdatetoday)}if("postlightbox"in data){$("#wonderplugin-dialog-imageaction").prop("checked",data.imageaction);applyImageactionOptions(data.imageaction);$("input[name=wonderplugin-dialog-postlightbox][value="+(data.postlightbox?1:0)+"]").prop("checked",true);$("#wonderplugin-dialog-postlightbox-size").prop("checked",data.postlightboxsize);$("#wonderplugin-dialog-postlightbox-width").val(data.postlightboxwidth);$("#wonderplugin-dialog-postlightbox-height").val(data.postlightboxheight);
$("#wonderplugin-dialog-titlelink").prop("checked",data.posttitlelink)}}$("#wonderplugin-dialog-ok").click(function(){var item={type:dialogType,posttitlefield:$("#wonderplugin-dialog-posttitlefield").val(),postdescriptionfield:$("#wonderplugin-dialog-postdescriptionfield").val(),postcategory:$("#wonderplugin-dialog-postcategory").val(),postorderby:$("#wonderplugin-dialog-postorderby").val(),postorder:$("#wonderplugin-dialog-postorder").val(),selectpostbytags:$("#wonderplugin-dialog-selectpostbytags").is(":checked"),
posttags:$("#wonderplugin-dialog-posttags").val(),postdaterange:$("#wonderplugin-dialog-postdaterange").is(":checked"),postdaterangeafter:$("#wonderplugin-dialog-postdaterangeafter").val(),postnumber:$("#wonderplugin-dialog-postnumber").val(),featuredimagesize:$("#wonderplugin-dialog-featuredimagesize").val(),excerptlength:$("#wonderplugin-dialog-excerptlength").val(),imageaction:$("#wonderplugin-dialog-imageaction").is(":checked"),postlinktarget:$("#wonderplugin-dialog-postlinktarget").val(),postlightbox:$("input[name=wonderplugin-dialog-postlightbox]:checked").val()==
1?true:false,postlightboxsize:$("#wonderplugin-dialog-postlightbox-size").is(":checked"),postlightboxwidth:parseInt($.trim($("#wonderplugin-dialog-postlightbox-width").val())),postlightboxheight:parseInt($.trim($("#wonderplugin-dialog-postlightbox-height").val())),posttitlelink:$("#wonderplugin-dialog-titlelink").is(":checked"),postdatefromto:$("#wonderplugin-dialog-postdatefromto").is(":checked"),postdatefromyear:$("#wonderplugin-dialog-postdatefromyear").val(),postdatefrommonth:$("#wonderplugin-dialog-postdatefrommonth").val(),
postdatefromday:$("#wonderplugin-dialog-postdatefromday").val(),postdatetoyear:$("#wonderplugin-dialog-postdatetoyear").val(),postdatetomonth:$("#wonderplugin-dialog-postdatetomonth").val(),postdatetoday:$("#wonderplugin-dialog-postdatetoday").val()};$postsDialog.remove();onSuccess(item)});$("#wonderplugin-dialog-cancel").click(function(){$postsDialog.remove()})};$("#wonderplugin-add-posts").click(function(){addPostsDialog(6,function(data){addMediaToList(data);updateMediaTable()})});var addCustomPostDialog=
function(dialogType,onSuccess,data,dataIndex){var custompostlist={};try{custompostlist=JSON.parse($("#wonderplugin-carousel-custompostlist").text())}catch(err){}var dialogCode="<div class='wonderplugin-dialog-container'>"+"<div class='wonderplugin-dialog-bg'></div>"+"<div class='wonderplugin-dialog wonderplugin-dialog-large'>"+"<h3 id='wonderplugin-dialog-title'>Add WooCommerce / Custom Posts</h3>"+"<div class='error' id='wonderplugin-dialog-error' style='display:none;'></div>"+"<table class='wonderplugin-dialog-form longhead'>";
dialogCode+="<tr><th>Select Custom Post Type</th><td><select name='wonderplugin-dialog-customposttype' id='wonderplugin-dialog-customposttype'>";dialogCode+="<option value='-1'>Select A Custom Post Type</option>";for(var i=0;i<custompostlist.length;i++)dialogCode+="<option value='"+custompostlist[i].name+"'>Custom Post Type: "+custompostlist[i].name+"</option>";dialogCode+="</select></td></tr>";dialogCode+="<tr><th>Query by Taxonomy and Terms</th><td><div id='wonderplugin-dialog-taxonomy-container' data-taxonomytotal=1><div class='wonderplugin-dialog-taxonomy-row wonderplugin-dialog-taxonomy-row-first' ><select class='wonderplugin-dialog-taxonomy'>";
dialogCode+="<option value='-1'>Select A Taxonomy</option>";dialogCode+="</select>";dialogCode+="<select class='wonderplugin-dialog-term'>";dialogCode+="<option value='-1'>Select A Term</option>";dialogCode+="</select><span class='dashicons dashicons-plus-alt wonderplugin-dialog-addtaxonomy'></span></div></div></td></tr>";dialogCode+="<tr class='wonderplugin-dialog-taxonomyrelation-container' style='display:none;'><th>Multiple taxonomy logical relationship</th><td><select name='wonderplugin-dialog-taxonomyrelation' id='wonderplugin-dialog-taxonomyrelation'><option value='OR'>OR</option><option value='AND'>AND</option></select></td></tr>";
dialogCode+="<tr><th></th><td><a href='https://www.wonderplugin.com/wordpress-carousel-plugin/how-to-create-a-woocommerce-product-carousel/' target='_blank'>Tutorial: How to create a WooCommerce products carousel</a></td>";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 and Image</li>'+'<li class="wonderplugin-dialog-tab-button">Order and Range</li>'+
'<li class="wonderplugin-dialog-tab-button">WooCommerce</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>Field for Title</th><td><input style='vertical-align:middle;' name='wonderplugin-dialog-titlefield' id='wonderplugin-dialog-titlefield' type='text' class='large-text' value='%post_title%' /></td></tr>";
dialogCode+="<tr><th>Field for Description</th><td><textarea name='wonderplugin-dialog-descriptionfield' id='wonderplugin-dialog-descriptionfield' type='text' rows='4' class='large-text'>%post_content%</textarea><p><a href='https://www.wonderplugin.com/wordpress-carousel-plugin/how-to-create-a-woocommerce-product-carousel/#step4' target='_blank'>Tutorial: How to add product price, star ratings, total sales and Add to Cart button to the carousel</a></p></td></tr>";dialogCode+="<tr><th>Maximum Post Content/Excerpt Word Length</th><td><input name='wonderplugin-dialog-textlength' id='wonderplugin-dialog-textlength' type='number' value='25' class='small-text' />";
dialogCode+="<label style='margin-left:24px;'><input name='wonderplugin-dialog-titlelink' type='checkbox' id='wonderplugin-dialog-titlelink' value='' /> Link title to the post page</label></td></tr>";dialogCode+="<tr><th>Field for Image</th><td><input style='vertical-align:middle;' name='wonderplugin-dialog-imagefield' id='wonderplugin-dialog-imagefield' type='text' class='medium-text' value='%featured_image%' /><span style='margin-left:18px;'>Size: </span><select name='wonderplugin-dialog-customfeaturedimagesize' id='wonderplugin-dialog-customfeaturedimagesize'><option value='full'>Full</option><option value='large'>Large</option><option value='medium'>Medium</option><option value='thumbnail'>Thumbnail</option></select>";
dialogCode+="<tr><th>Image options</th><td><label><input name='wonderplugin-dialog-imageaction' type='checkbox' id='wonderplugin-dialog-imageaction' checked /> Open the post page or image lightbox on clicking the image</label>";dialogCode+="<div style='margin-left:20px;margin-top:8px;'><label><input type='radio' name='wonderplugin-dialog-imageactionlightbox' value='1' >Open the image in lightbox</label><br>";dialogCode+="<label><input type='radio' name='wonderplugin-dialog-imageactionlightbox' value='0' checked>Click to open the post page</label><label style='margin-left:24px;'><input name='wonderplugin-dialog-openpostinlightbox' type='checkbox' id='wonderplugin-dialog-openpostinlightbox' value='' /> Open in lightbox</label></div></td>";
dialogCode+="<tr><th></th><td><label><input name='wonderplugin-dialog-postlightboxsize' type='checkbox' id='wonderplugin-dialog-postlightboxsize' value='' /> Set Lightbox size </label><input name='wonderplugin-dialog-postlightboxwidth' type='number' id='wonderplugin-dialog-postlightboxwidth' value='960' class='small-text' /> / <input name='wonderplugin-dialog-postlightboxheight' type='number' id='wonderplugin-dialog-postlightboxheight' value='540' 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+="</table>";dialogCode+="</li>";dialogCode+='<li class="wonderplugin-dialog-tab-panel">';dialogCode+="<table class='wonderplugin-dialog-form'>";dialogCode+="<tr><th>Order by</th><td><select name='wonderplugin-dialog-postorderby' id='wonderplugin-dialog-postorderby'>"+"<option value='date'>Date</option>"+"<option value='menu_order'>menu_order</option>"+"<option value='rand'>Random Order</option>"+"<option value='none'>No order</option>"+"<option value='ID'>ID</option>"+"<option value='author'>Author</option>"+
"<option value='title'>Title</option>"+"<option value='modified'>Modified Date</option>"+"<option value='comment_count'>Number of Comments</option>"+"</select>"+"<select name='wonderplugin-dialog-postorderbyorder' id='wonderplugin-dialog-postorderbyorder'><option value='DESC'>Descending</option><option value='ASC'>Ascending</option></select>"+"</td></tr>";dialogCode+="<tr><th>Maximum Posts</th><td><input style='vertical-align:middle;' name='wonderplugin-dialog-postnumber' id='wonderplugin-dialog-postnumber' type='number' value='10' class='small-text' /><select name='wonderplugin-dialog-postorder' id='wonderplugin-dialog-postorder'><option value='DESC'>Order</option><option value='ASC'>Reverse Order</option></select></td></tr>";
dialogCode+="<tr><th>Date Range</th><td><label><input name='wonderplugin-dialog-postdaterange' type='checkbox' id='wonderplugin-dialog-postdaterange' /> Only get posts from the past <input name='wonderplugin-dialog-postdaterangeafter' id='wonderplugin-dialog-postdaterangeafter' type='number' value='30' class='small-text' /> days</label></td></tr>";dialogCode+="<tr><th></th><td>";dialogCode+="<label><input name='wonderplugin-dialog-postdatefromto' type='checkbox' id='wonderplugin-dialog-postdatefromto' /> Select date range - from ";
dialogCode+="<input name='wonderplugin-dialog-postdatefromyear' id='wonderplugin-dialog-postdatefromyear' type='number' value='"+((new Date).getFullYear()-1)+"' class='small-text' />";dialogCode+="<select name='wonderplugin-dialog-postdatefrommonth' id='wonderplugin-dialog-postdatefrommonth'>";for(var i=1;i<=12;i++)dialogCode+="<option value='"+i+"'>"+i+"</option>";dialogCode+="</select>";dialogCode+="<select name='wonderplugin-dialog-postdatefromday' id='wonderplugin-dialog-postdatefromday'>";for(var i=
1;i<=31;i++)dialogCode+="<option value='"+i+"'>"+i+"</option>";dialogCode+="</select>";dialogCode+=" to ";dialogCode+="<input name='wonderplugin-dialog-postdatetoyear' id='wonderplugin-dialog-postdatetoyear' type='number' value='"+((new Date).getFullYear()+1)+"' class='small-text' />";dialogCode+="<select name='wonderplugin-dialog-postdatetomonth' id='wonderplugin-dialog-postdatetomonth'>";for(var i=1;i<=12;i++)dialogCode+="<option value='"+i+"'>"+i+"</option>";dialogCode+="</select>";dialogCode+=
"<select name='wonderplugin-dialog-postdatetoday' id='wonderplugin-dialog-postdatetoday'>";for(var i=1;i<=31;i++)dialogCode+="<option value='"+i+"'>"+i+"</option>";dialogCode+="</select>";dialogCode+="</td>";dialogCode+="</table>";dialogCode+="</li>";dialogCode+='<li class="wonderplugin-dialog-tab-panel">';dialogCode+="<table class='wonderplugin-dialog-form'>";dialogCode+="<tr><th>Query by WooCommerce Meta</th><td>";dialogCode+="<p><label><input name='wonderplugin-dialog-metaonsale' type='checkbox' id='wonderplugin-dialog-metaonsale' /> Select products on sale</label></p>";
dialogCode+="<p><label><input name='wonderplugin-dialog-metatotalsales' type='checkbox' id='wonderplugin-dialog-metatotalsales' /> Select best selling products</label></p>";dialogCode+="<p><label><input name='wonderplugin-dialog-metafeatured' type='checkbox' id='wonderplugin-dialog-metafeatured' /> Featured products for WooCommerce Version 1 and 2. For WooCommerce Version 3, do NOT check this option, please view the following tutorial instead:</label></p>";dialogCode+="<p><a href='https://www.wonderplugin.com/wordpress-carousel-plugin/how-to-create-a-woocommerce-product-carousel/#step6' target='_blank'>Tutorial: How to create featured products carousel for WooCommerce 3 and above</a></p>";
dialogCode+="</td></tr>";dialogCode+="<tr class='wonderplugin-dialog-metarelation-container' style='display:none;'><th>Meta Keys Logical Relationship</th><td><select name='wonderplugin-dialog-metarelation' id='wonderplugin-dialog-metarelation'><option value='OR'>OR</option><option value='AND'>AND</option></select></td></tr>";dialogCode+="</table>";dialogCode+="</li>";dialogCode+="</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 $postsDialog=$(dialogCode);$("body").append($postsDialog);$(".wonderplugin-dialog").css({"margin-top":String($(document).scrollTop()+60)+"px"});$(".wonderplugin-dialog-bg").css({height:$(document).height()+"px"});var onCustomPostTypeChange=function(customposttype){$(".wonderplugin-dialog-taxonomy").empty().append('<option value="-1">Select A Taxonomy</option>').val("-1");$(".wonderplugin-dialog-term").empty().append('<option value="-1">Select A Term</option>').val("-1");
if(customposttype!="-1")for(var i=0;i<custompostlist.length;i++)if(customposttype==custompostlist[i].name){if(custompostlist[i].taxonomies)for(var j=0;j<custompostlist[i].taxonomies.length;j++)$(".wonderplugin-dialog-taxonomy").append('<option value="'+custompostlist[i].taxonomies[j].name+'">Taxonomy: '+custompostlist[i].taxonomies[j].name+"</option>");break}};var onTaxonomyChange=function(taxonomyid,customposttype,taxonomy){var termElem=$(".wonderplugin-dialog-taxonomy-row").eq(taxonomyid).find(".wonderplugin-dialog-term");
if(!termElem)return;termElem.empty().append('<option value="-1">Select A Term</option>').val("-1");if(customposttype!="-1"&&taxonomy!="-1")for(var i=0;i<custompostlist.length;i++)if(customposttype==custompostlist[i].name){if(custompostlist[i].taxonomies)for(var j=0;j<custompostlist[i].taxonomies.length;j++)if(taxonomy==custompostlist[i].taxonomies[j].name){if(custompostlist[i].taxonomies[j].terms)for(var k=0;k<custompostlist[i].taxonomies[j].terms.length;k++)termElem.append('<option value="'+custompostlist[i].taxonomies[j].terms[k].slug+
'">Term: '+custompostlist[i].taxonomies[j].terms[k].slug+"</option>");break}break}};$("#wonderplugin-dialog-taxonomy-container").on("click",".wonderplugin-dialog-addtaxonomy",function(){var total=$("#wonderplugin-dialog-taxonomy-container").data("taxonomytotal");var taxonomyCode=$("<div class='wonderplugin-dialog-taxonomy-row' ></div>");var taxonomySelect=$(".wonderplugin-dialog-taxonomy-row-first .wonderplugin-dialog-taxonomy").clone().val("-1");var termSelect=$(".wonderplugin-dialog-taxonomy-row-first .wonderplugin-dialog-term").clone().val("-1");
var removeTaxonomy="<span class='dashicons dashicons-dismiss wonderplugin-dialog-removetaxonomy'></span>";taxonomyCode.append(taxonomySelect).append(termSelect).append(removeTaxonomy);$("#wonderplugin-dialog-taxonomy-container").append(taxonomyCode);$("#wonderplugin-dialog-taxonomy-container").data("taxonomytotal",total+1);$(".wonderplugin-dialog-taxonomyrelation-container").css({"display":total>0?"table-row":"none"})});$("#wonderplugin-dialog-taxonomy-container").on("click",".wonderplugin-dialog-removetaxonomy",
function(){$(this).closest(".wonderplugin-dialog-taxonomy-row").remove();var total=$("#wonderplugin-dialog-taxonomy-container").data("taxonomytotal");$("#wonderplugin-dialog-taxonomy-container").data("taxonomytotal",total-1);$(".wonderplugin-dialog-taxonomyrelation-container").css({"display":total>2?"table-row":"none"})});$("#wonderplugin-dialog-customposttype").on("change",function(){onCustomPostTypeChange($(this).val())});$("#wonderplugin-dialog-taxonomy-container").on("change",".wonderplugin-dialog-taxonomy",
function(){var taxonomyid=$(this).closest(".wonderplugin-dialog-taxonomy-row").index();onTaxonomyChange(taxonomyid,$("#wonderplugin-dialog-customposttype").val(),$(this).val())});$("#wonderplugin-dialog-metatotalsales,#wonderplugin-dialog-metafeatured").on("click",function(){if($("#wonderplugin-dialog-metatotalsales").is(":checked")&&$("#wonderplugin-dialog-metafeatured").is(":checked"))$(".wonderplugin-dialog-metarelation-container").css({display:"table-row"});else $(".wonderplugin-dialog-metarelation-container").css({display:"none"})});
if(data){$("#wonderplugin-dialog-customposttype").val(data.customposttype);var total=1;for(total=1;;total++)if("taxonomy"+total in data&&"term"+total in data){$("#wonderplugin-dialog-taxonomy-container").data("taxonomytotal",total+1);var taxonomyCode=$("<div class='wonderplugin-dialog-taxonomy-row' ></div>");var taxonomySelect=$(".wonderplugin-dialog-taxonomy-row-first .wonderplugin-dialog-taxonomy").clone().val("-1");var termSelect=$(".wonderplugin-dialog-taxonomy-row-first .wonderplugin-dialog-term").clone().val("-1");
var removeTaxonomy="<span class='dashicons dashicons-dismiss wonderplugin-dialog-removetaxonomy'></span>";taxonomyCode.append(taxonomySelect).append(termSelect).append(removeTaxonomy);$("#wonderplugin-dialog-taxonomy-container").append(taxonomyCode)}else break;$(".wonderplugin-dialog-taxonomyrelation-container").css({"display":total>1?"table-row":"none"});if(data.customposttype!="-1"){onCustomPostTypeChange(data.customposttype);for(var i=0;i<total;i++){$(".wonderplugin-dialog-taxonomy-row").eq(i).find(".wonderplugin-dialog-taxonomy").val(data["taxonomy"+
i]);onTaxonomyChange(i,data.customposttype,data["taxonomy"+i]);if(data["taxonomy"+i]!="-1")$(".wonderplugin-dialog-taxonomy-row").eq(i).find(".wonderplugin-dialog-term").val(data["term"+i])}}$("#wonderplugin-dialog-taxonomyrelation").val(data.taxonomyrelation);$("#wonderplugin-dialog-metaonsale").prop("checked",data.metaonsale);$("#wonderplugin-dialog-metatotalsales").prop("checked",data.metatotalsales);$("#wonderplugin-dialog-metafeatured").prop("checked",data.metafeatured);$("#wonderplugin-dialog-metarelation").val(data.metarelation);
if(data.metatotalsales&&data.metafeatured)$(".wonderplugin-dialog-metarelation-container").css({display:"table-row"});else $(".wonderplugin-dialog-metarelation-container").css({display:"none"});$("#wonderplugin-dialog-postorderby").val(data.postorderby);$("#wonderplugin-dialog-postorderbyorder").val(data.postorderbyorder);$("#wonderplugin-dialog-postnumber").val(data.postnumber);$("#wonderplugin-dialog-postorder").val(data.postorder);$("#wonderplugin-dialog-postdaterange").prop("checked",data.postdaterange);
$("#wonderplugin-dialog-postdaterangeafter").val(data.postdaterangeafter);if("postdatefromto"in data){$("#wonderplugin-dialog-postdatefromto").prop("checked",data.postdatefromto);$("#wonderplugin-dialog-postdatefromyear").val(data.postdatefromyear);$("#wonderplugin-dialog-postdatefrommonth").val(data.postdatefrommonth);$("#wonderplugin-dialog-postdatefromday").val(data.postdatefromday);$("#wonderplugin-dialog-postdatetoyear").val(data.postdatetoyear);$("#wonderplugin-dialog-postdatetomonth").val(data.postdatetomonth);
$("#wonderplugin-dialog-postdatetoday").val(data.postdatetoday)}$("#wonderplugin-dialog-titlefield").val(data.titlefield);$("#wonderplugin-dialog-descriptionfield").val(data.descriptionfield);$("#wonderplugin-dialog-textlength").val(data.textlength);$("#wonderplugin-dialog-titlelink").prop("checked",data.titlelink);$("#wonderplugin-dialog-imagefield").val(data.imagefield);$("#wonderplugin-dialog-customfeaturedimagesize").val(data.customfeaturedimagesize);$("#wonderplugin-dialog-imageaction").prop("checked",
data.imageaction);$("input[name=wonderplugin-dialog-imageactionlightbox][value="+(data.imageactionlightbox?1:0)+"]").prop("checked",true);$("#wonderplugin-dialog-openpostinlightbox").prop("checked",data.openpostinlightbox);$("#wonderplugin-dialog-postlightboxsize").prop("checked",data.postlightboxsize);$("#wonderplugin-dialog-postlightboxwidth").val(data.postlightboxwidth);$("#wonderplugin-dialog-postlightboxheight").val(data.postlightboxheight);$("#wonderplugin-dialog-postlinktarget").val(data.postlinktarget)}$("#wonderplugin-dialog-ok").click(function(){if($("#wonderplugin-dialog-customposttype").val()==
"-1"){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select a custom post type</p>");return}var item={type:dialogType,customposttype:$("#wonderplugin-dialog-customposttype").val(),taxonomyrelation:$("#wonderplugin-dialog-taxonomyrelation").val(),metaonsale:$("#wonderplugin-dialog-metaonsale").is(":checked"),metatotalsales:$("#wonderplugin-dialog-metatotalsales").is(":checked"),metafeatured:$("#wonderplugin-dialog-metafeatured").is(":checked"),metarelation:$("#wonderplugin-dialog-metarelation").val(),
postorderby:$("#wonderplugin-dialog-postorderby").val(),postorderbyorder:$("#wonderplugin-dialog-postorderbyorder").val(),postnumber:$("#wonderplugin-dialog-postnumber").val(),postorder:$("#wonderplugin-dialog-postorder").val(),postdaterange:$("#wonderplugin-dialog-postdaterange").is(":checked"),postdaterangeafter:$("#wonderplugin-dialog-postdaterangeafter").val(),postdatefromto:$("#wonderplugin-dialog-postdatefromto").is(":checked"),postdatefromyear:$("#wonderplugin-dialog-postdatefromyear").val(),
postdatefrommonth:$("#wonderplugin-dialog-postdatefrommonth").val(),postdatefromday:$("#wonderplugin-dialog-postdatefromday").val(),postdatetoyear:$("#wonderplugin-dialog-postdatetoyear").val(),postdatetomonth:$("#wonderplugin-dialog-postdatetomonth").val(),postdatetoday:$("#wonderplugin-dialog-postdatetoday").val(),titlefield:$("#wonderplugin-dialog-titlefield").val(),descriptionfield:$("#wonderplugin-dialog-descriptionfield").val(),textlength:parseInt($.trim($("#wonderplugin-dialog-textlength").val())),
titlelink:$("#wonderplugin-dialog-titlelink").is(":checked"),imagefield:$("#wonderplugin-dialog-imagefield").val(),customfeaturedimagesize:$("#wonderplugin-dialog-customfeaturedimagesize").val(),imageaction:$("#wonderplugin-dialog-imageaction").is(":checked"),imageactionlightbox:$("input[name=wonderplugin-dialog-imageactionlightbox]:checked").val()==1?true:false,openpostinlightbox:$("#wonderplugin-dialog-openpostinlightbox").is(":checked"),postlightboxsize:$("#wonderplugin-dialog-postlightboxsize").is(":checked"),
postlightboxwidth:parseInt($.trim($("#wonderplugin-dialog-postlightboxwidth").val())),postlightboxheight:parseInt($.trim($("#wonderplugin-dialog-postlightboxheight").val())),postlinktarget:$.trim($("#wonderplugin-dialog-postlinktarget").val())};for(var i=0;i<$(".wonderplugin-dialog-taxonomy-row").length;i++){item["taxonomy"+i]=$(".wonderplugin-dialog-taxonomy-row").eq(i).find(".wonderplugin-dialog-taxonomy").val();item["term"+i]=$(".wonderplugin-dialog-taxonomy-row").eq(i).find(".wonderplugin-dialog-term").val()}$postsDialog.remove();
onSuccess(item)});$("#wonderplugin-dialog-cancel").click(function(){$postsDialog.remove()})};$("#wonderplugin-add-custompost").click(function(){addCustomPostDialog(7,function(data){addMediaToList(data);updateMediaTable()})});var addPageDialog=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 WordPress Page</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 Page</li>'+'<li class="wonderplugin-dialog-tab-button">Page 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><label><input name='wonderplugin-dialog-pagelistsearchtext' type='text' id='wonderplugin-dialog-pagelistsearchtext' value='' style='width:300px;' placeholder='Search'/>  <input type='button' class='button' id='wonderplugin-dialog-pagelistsearch' value='Search'></label></p>"+
"<p id='wonderplugin-dialog-pagelistselected' style='font-weight:bold;'></p><div id='wonderplugin-dialog-pagelist'></div>";dialogCode+="<div style='text-align:left;'><p><label>Child Page Mode: <select name='wonderplugin-dialog-pagechildmode' id='wonderplugin-dialog-pagechildmode'><option value='1'>Selected Page Only</option><option value='2'>Selected Page and first level child page(s)</option><option value='3'>Selected Page and all child page(s)</option><option value='4'>First level child page(s) only</option><option value='5'>All child page(s) only</option></select></label></p>";
dialogCode+="<p><label>Order Child Pages by: <select name='wonderplugin-dialog-pageorderby' id='wonderplugin-dialog-pageorderby'></label>"+"<option value='post_title'>post_title</option>"+"<option value='menu_order'>menu_order</option>"+"<option value='post_date'>post_date</option>"+"<option value='post_modified'>post_modified</option>"+"<option value='ID'>ID</option>"+"<option value='post_author'>post_author</option>"+"<option value='post_name'>post_name</option>"+"</select>"+"<select name='wonderplugin-dialog-pageorder' id='wonderplugin-dialog-pageorder'><option value='ASC'>Ascending</option><option value='DESC'>Descending</option></select></p></div>";
dialogCode+='</li><li class="wonderplugin-dialog-tab-panel">';dialogCode+="<table class='wonderplugin-dialog-form'>";dialogCode+="<tr><th>Featured 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>On clicking the image</th><td><label><input type='radio' name='wonderplugin-dialog-postlightbox' value='1' >Open the featured image in lightbox</label><br>";dialogCode+="<label style='margin-left:24px;'><input name='wonderplugin-dialog-postlightbox-size' type='checkbox' id='wonderplugin-dialog-postlightbox-size' value='' /> Set Lightbox size </label><input name='wonderplugin-dialog-postlightbox-width' type='number' id='wonderplugin-dialog-postlightbox-width' value='960' class='small-text' /> / <input name='wonderplugin-dialog-postlightbox-height' type='number' id='wonderplugin-dialog-postlightbox-height' value='540' class='small-text' /><br>";
dialogCode+="<label><input type='radio' name='wonderplugin-dialog-postlightbox' value='0' checked>Open the WordPress page</label></td>";dialogCode+="<tr><th>Title</th><td><label><input name='wonderplugin-dialog-titlelink' type='checkbox' id='wonderplugin-dialog-titlelink' value='' /> Link title to the WordPress page</label></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+="</table>"+"<ul style='margin-left:24px;list-style-position:outside;list-style-type:square;text-align:left;'><li>The featured image of the page will be used as the image of the carousel item. For how to define featured images for pages, please view <a href='https://codex.wordpress.org/Post_Thumbnails' target='_blank'>WordPress Featured Images</a>.</li>"+"<li>The title of the page will be used as the title property of the carousel item.</li>"+"<li>The excerpt of a page will be used as the description property of the carousel item. For how to add excerpts for posts, please view <a href='https://codex.wordpress.org/Excerpt' target='_blank'>WordPress Excerpts</a>.</li></ul>";
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 $postsDialog=$(dialogCode);$("body").append($postsDialog);$(".wonderplugin-dialog").css({"margin-top":String($(document).scrollTop()+60)+"px"});$(".wonderplugin-dialog-bg").css({height:$(document).height()+
"px"});var display_pagelist=function(searchtext){var selectedid=$("#wonderplugin-dialog-pagelist").data("selectedpageid");$("#wonderplugin-dialog-pagelist").empty();var pagelist={};try{pagelist=JSON.parse($("#wonderplugin-carousel-pagelist").text())}catch(err){}for(var i=0;i<pagelist.length;i++){if(searchtext){var id=String(pagelist[i].ID).toLowerCase();var author=String(pagelist[i].post_author).toLowerCase();var title=String(pagelist[i].post_title).toLowerCase();searchtext=searchtext.toLowerCase();
if(id.indexOf(searchtext)==-1&&author.indexOf(searchtext)==-1&&title.indexOf(searchtext)==-1)continue}var selectedclass=selectedid&&pagelist[i].ID==selectedid?" wonderplugin-dialog-pagelist-item-selected":"";var checked=selectedid&&pagelist[i].ID==selectedid?" checked":"";var paddinglevel=Number(pagelist[i].post_level)*24;var pageitem='<div class="wonderplugin-dialog-pagelist-item'+selectedclass+'">'+'<div class="wonderplugin-dialog-pagelist-item-radio">'+'<input type="radio" name="wonderplugin-dialog-pagelist-item-radioinput"'+
checked+' value="'+pagelist[i].ID+'" />'+"</div>"+'<div class="wonderplugin-dialog-pagelist-item-id">'+pagelist[i].ID+"</div>"+'<div class="wonderplugin-dialog-pagelist-item-author">'+pagelist[i].post_author+"</div>"+'<div class="wonderplugin-dialog-pagelist-item-title" style="padding-left:'+paddinglevel+'px;">'+pagelist[i].post_title+"</div>"+'<div style="clear:both;"></div><div>';$("#wonderplugin-dialog-pagelist").append(pageitem)}$(".wonderplugin-dialog-pagelist-item").click(function(){$(".wonderplugin-dialog-pagelist-item").removeClass("wonderplugin-dialog-pagelist-item-selected");
$(this).addClass("wonderplugin-dialog-pagelist-item-selected");var selected=$(this).find("input:radio[name=wonderplugin-dialog-pagelist-item-radioinput]");selected.prop("checked",true);$("#wonderplugin-dialog-pagelist").data("selectedpageid",selected.val());var selectedhtml="Select Page ID: "+$(this).find(".wonderplugin-dialog-pagelist-item-id").text()+", Author: "+$(this).find(".wonderplugin-dialog-pagelist-item-author").text()+", Title: "+$(this).find(".wonderplugin-dialog-pagelist-item-title").text();
$("#wonderplugin-dialog-pagelistselected").html(selectedhtml)})};$("#wonderplugin-dialog-pagelistsearch").click(function(){var searchtext=$.trim($("#wonderplugin-dialog-pagelistsearchtext").val());display_pagelist(searchtext)});$("#wonderplugin-dialog-pagelistsearchtext").on("keyup",function(e){var searchtext=$.trim($("#wonderplugin-dialog-pagelistsearchtext").val());display_pagelist(searchtext)});display_pagelist();if(data){if(data.pageid>0){$("input:radio[name=wonderplugin-dialog-pagelist-item-radioinput][value="+
data.pageid+"]").prop("checked",true);if($("input[name=wonderplugin-dialog-pagelist-item-radioinput]:checked").length>0){var item=$("input[name=wonderplugin-dialog-pagelist-item-radioinput]:checked").closest(".wonderplugin-dialog-pagelist-item");$(".wonderplugin-dialog-pagelist-item").removeClass("wonderplugin-dialog-pagelist-item-selected");item.addClass("wonderplugin-dialog-pagelist-item-selected");var t=item.position().top;$("#wonderplugin-dialog-pagelist").scrollTop(t);$("#wonderplugin-dialog-pagelist").data("selectedpageid",
data.pageid);var selectedhtml="Select Page ID: "+item.find(".wonderplugin-dialog-pagelist-item-id").text()+", Author: "+item.find(".wonderplugin-dialog-pagelist-item-author").text()+", Title: "+item.find(".wonderplugin-dialog-pagelist-item-title").text();$("#wonderplugin-dialog-pagelistselected").html(selectedhtml)}}$("#wonderplugin-dialog-pagechildmode").val(data.pagechildmode);$("#wonderplugin-dialog-pageorderby").val(data.pageorderby);$("#wonderplugin-dialog-pageorder").val(data.pageorder);$("#wonderplugin-dialog-featuredimagesize").val(data.featuredimagesize);
$("#wonderplugin-dialog-excerptlength").val(data.excerptlength);$("#wonderplugin-dialog-postlinktarget").val(data.postlinktarget);if("postlightbox"in data){$("input[name=wonderplugin-dialog-postlightbox][value="+(data.postlightbox?1:0)+"]").prop("checked",true);$("#wonderplugin-dialog-postlightbox-size").prop("checked",data.postlightboxsize);$("#wonderplugin-dialog-postlightbox-width").val(data.postlightboxwidth);$("#wonderplugin-dialog-postlightbox-height").val(data.postlightboxheight);$("#wonderplugin-dialog-titlelink").prop("checked",
data.posttitlelink)}}$("#wonderplugin-dialog-ok").click(function(){var selectedid=$("#wonderplugin-dialog-pagelist").data("selectedpageid");if(!selectedid){$("#wonderplugin-dialog-error").css({display:"block"}).html("<p>Please select a page</p>");return}var selectedpageid=$("#wonderplugin-dialog-pagelist").data("selectedpageid");selectedpageid=selectedpageid?selectedpageid:-1;var item={type:dialogType,pageid:selectedpageid,pagechildmode:$("#wonderplugin-dialog-pagechildmode").val(),pageorderby:$("#wonderplugin-dialog-pageorderby").val(),
pageorder:$("#wonderplugin-dialog-pageorder").val(),featuredimagesize:$("#wonderplugin-dialog-featuredimagesize").val(),excerptlength:$("#wonderplugin-dialog-excerptlength").val(),postlinktarget:$("#wonderplugin-dialog-postlinktarget").val(),postlightbox:$("input[name=wonderplugin-dialog-postlightbox]:checked").val()==1?true:false,postlightboxsize:$("#wonderplugin-dialog-postlightbox-size").is(":checked"),postlightboxwidth:parseInt($.trim($("#wonderplugin-dialog-postlightbox-width").val())),postlightboxheight:parseInt($.trim($("#wonderplugin-dialog-postlightbox-height").val())),
posttitlelink:$("#wonderplugin-dialog-titlelink").is(":checked")};$postsDialog.remove();onSuccess(item)});$("#wonderplugin-dialog-cancel").click(function(){$postsDialog.remove()})};$("#wonderplugin-add-page").click(function(){addPageDialog(8,function(data){addMediaToList(data);updateMediaTable()})});var addHTMLDialog=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 Text / HTML / Shortcode / Soundcloud Embed Code</h3>"+"<div class='error' id='wonderplugin-dialog-error' style='display:none;'></div>"+"<table class='wonderplugin-dialog-form'>"+"<tr>"+"<th>Text / HTML / Shortcode</th><td><textarea name='wonderplugin-dialog-htmlcode' type='' id='wonderplugin-dialog-htmlcode' value='' class='large-text' rows=10 ></textarea></td></th>"+"</tr>";dialogCode+="</table>";dialogCode+="<ul style='margin-left:24px;list-style-position:outside;list-style-type:square;text-align:left;'>"+
"<li>Shortcodes may not work in the plugin preview. Please add the carousel to a post or page to test the shortcode.</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 $htmlDialog=$(dialogCode);$("body").append($htmlDialog);$(".wonderplugin-dialog").css({"margin-top":String($(document).scrollTop()+
60)+"px"});$(".wonderplugin-dialog-bg").css({height:$(document).height()+"px"});if(data){$("#wonderplugin-dialog-htmlcode").val(data.htmlcode);if(data.category){var categories=data.category.split(":");for(var i=0;;i++){if($("#wonderplugin-dialog-category-"+i).length<=0)break;if(jQuery.inArray($("#wonderplugin-dialog-category-"+i).val(),categories)!==-1)$("#wonderplugin-dialog-category-"+i).prop("checked",true)}}}$("#wonderplugin-dialog-ok").click(function(){var item={type:dialogType,htmlcode:$("#wonderplugin-dialog-htmlcode").val()};
$htmlDialog.remove();onSuccess(item)});$("#wonderplugin-dialog-cancel").click(function(){$htmlDialog.remove()})};$("#wonderplugin-add-html").click(function(){addHTMLDialog(13,function(data){addMediaToList(data);updateMediaTable()})});$("#wonderplugin-sortlist").click(function(){sortDialog(function(){updateMediaTable()})});var sortDialog=function(onSuccess){var dialogCode="<div class='wonderplugin-dialog-container'>"+"<div class='wonderplugin-dialog-bg'></div>"+"<div class='wonderplugin-dialog wonderplugin-dialog-small'>"+
"<h3 id='wonderplugin-dialog-title'>Sort List</h3>"+"<div class='error' id='wonderplugin-dialog-error' style='display:none;'></div>"+"<p id='wonderplugin-dialog-sortmessage' style='display:none;'>It may take a while, please wait ......</p>"+"<p id='wonderplugin-dialog-sortoptions'>Sort By: ";dialogCode+="<select name='wonderplugin-dialog-sortby' id='wonderplugin-dialog-sortby'>"+"<option value='url'>URL</option>"+"<option value='file'>Filename</option>"+"<option value='title'>Title</option>"+"</select>";
dialogCode+="<select name='wonderplugin-dialog-sortorder' id='wonderplugin-dialog-sortorder'>"+"<option value='asc'>Ascending</option>"+"<option value='desc'>Descending</option>"+"</select>";dialogCode+="</p>"+"<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' />"+"<input type='button' class='button button-primary' id='wonderplugin-dialog-sortok' value='Close' style='display:none;' />"+
"</div>"+"</div>"+"</div>";var $sortDialog=$(dialogCode);$("body").append($sortDialog);$(".wonderplugin-dialog").css({"margin-top":String($(document).scrollTop()+120)+"px"});$(".wonderplugin-dialog-bg").css({height:$(document).height()+"px"});$("#wonderplugin-dialog-ok").click(function(){$("#wonderplugin-dialog-sortoptions").hide();$("#wonderplugin-dialog-sortmessage").show();$("#wonderplugin-dialog-ok").hide();$("#wonderplugin-dialog-cancel").hide();$("#wonderplugin-dialog-sortok").hide();$sortby=
$("#wonderplugin-dialog-sortby").val();$sortorder=$("#wonderplugin-dialog-sortorder").val();wonderplugin_carousel_config.slides.sort(function(a,b){if(a.type<0||a.type>3||b.type<0||b.type>3)return 0;var ret=0;if($sortby=="url")ret=a.image.localeCompare(b.image);else if($sortby=="title")ret=a.title.localeCompare(b.title);else if($sortby=="file"){var filea=a.image.substring(a.image.lastIndexOf("/")+1);var fileb=b.image.substring(b.image.lastIndexOf("/")+1);ret=filea.localeCompare(fileb)}if($sortorder==
"desc")ret=-ret;return ret});$("#wonderplugin-dialog-sortmessage").html("Sorting finished!");$("#wonderplugin-dialog-sortok").show()});$("#wonderplugin-dialog-cancel").click(function(){$sortDialog.remove()});$("#wonderplugin-dialog-sortok").click(function(){$sortDialog.remove();onSuccess()})};$("#wonderplugin-reverselist").click(function(){wonderplugin_carousel_config.slides.reverse();updateMediaTable()});$("#wonderplugin-deleteall").click(function(){$("<div></div>").html("Are you sure to remove all items?").dialog({title:"Wonder Carousel",
resizable:false,modal:true,buttons:{"Yes":function(){$(this).dialog("close");wonderplugin_carousel_config.slides.length=0;updateMediaTable()},"No":function(){$(this).dialog("close")},"Cancel":function(){$(this).dialog("close")}}})});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">File Options</li>'+'<li class="wonderplugin-dialog-tab-button">Lightbox</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 id="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+="</table>";dialogCode+="</li>";dialogCode+='<li class="wonderplugin-dialog-tab-panel">';dialogCode+="<table class='wonderplugin-dialog-form longhead'>";dialogCode+="<tr><th>Lightbox</th><td>";dialogCode+="<label><input name='wonderplugin-dialog-lightbox' type='checkbox' id='wonderplugin-dialog-lightbox' value='' checked /> Open in Lightbox</label>";
dialogCode+="<label style='margin-left:24px;'><input name='wonderplugin-dialog-lightboxsize' type='checkbox' id='wonderplugin-dialog-lightboxsize' value='' /> Set Lightbox size (px): </label>"+"<input name='wonderplugin-dialog-lightboxwidth' type='number' id='wonderplugin-dialog-lightboxwidth' value='960' class='small-text' /> / <input name='wonderplugin-dialog-lightboxheight' type='number' id='wonderplugin-dialog-lightboxheight' value='540' class='small-text' />";dialogCode+="</td></tr>";dialogCode+=
"</table>";dialogCode+="</li>";dialogCode+="</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=null;try{folderlist=JSON.parse($("#wonderplugin-carousel-folderlist").text())}catch(err){}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").prop("checked",data.usefilenameastitle);
$("#wonderplugin-dialog-lightbox").prop("checked",data.lightbox);$("#wonderplugin-dialog-lightboxsize").prop("checked",data.lightboxsize);$("#wonderplugin-dialog-lightboxwidth").val(data.lightboxwidth);$("#wonderplugin-dialog-lightboxheight").val(data.lightboxheight)}$("#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"),lightbox:$("#wonderplugin-dialog-lightbox").is(":checked"),lightboxsize:$("#wonderplugin-dialog-lightboxsize").is(":checked"),
lightboxwidth:parseInt($.trim($("#wonderplugin-dialog-lightboxwidth").val())),lightboxheight:parseInt($.trim($("#wonderplugin-dialog-lightboxheight").val()))};$folderDialog.remove();onSuccess(item)});$("#wonderplugin-dialog-cancel").click(function(){$folderDialog.remove()})};$("#wonderplugin-add-folder").click(function(){addFolderDialog(12,function(data){addMediaToList(data);updateMediaTable()})});$(document).on("click",".wonderplugin-carousel-media-table-edit",function(){var index=$(this).parent().parent().index();
var mediaType=wonderplugin_carousel_config.slides[index].type;if(mediaType==10)youtubePlaylistDialog(function(items){if(items&&items.length>0){wonderplugin_carousel_config.slides.splice(index,1);items.map(function(data){wonderplugin_carousel_config.slides.splice(index,0,{type:10,youtubeapikey:data.youtubeapikey,youtubeplaylistid:data.youtubeplaylistid,youtubeplaylistmaxresults:data.youtubeplaylistmaxresults,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,
displaythumbnail:false,mp4:"",webm:"",weblink:"",clickhandler:"",linktarget:"",weblinklightbox:false})});updateMediaTable()}},wonderplugin_carousel_config.slides[index],index);else if(mediaType==6)addPostsDialog(6,function(data){wonderplugin_carousel_config.slides.splice(index,1);wonderplugin_carousel_config.slides.splice(index,0,data);updateMediaTable()},wonderplugin_carousel_config.slides[index],index);else if(mediaType==7)addCustomPostDialog(7,function(data){wonderplugin_carousel_config.slides.splice(index,
1);wonderplugin_carousel_config.slides.splice(index,0,data);updateMediaTable()},wonderplugin_carousel_config.slides[index],index);else if(mediaType==8)addPageDialog(8,function(data){wonderplugin_carousel_config.slides.splice(index,1);wonderplugin_carousel_config.slides.splice(index,0,data);updateMediaTable()},wonderplugin_carousel_config.slides[index],index);else if(mediaType==12)addFolderDialog(12,function(data){wonderplugin_carousel_config.slides.splice(index,1);wonderplugin_carousel_config.slides.splice(index,
0,data);updateMediaTable()},wonderplugin_carousel_config.slides[index],index);else if(mediaType==13)addHTMLDialog(13,function(data){wonderplugin_carousel_config.slides.splice(index,1);wonderplugin_carousel_config.slides.splice(index,0,data);updateMediaTable()},wonderplugin_carousel_config.slides[index],index);else slideDialog(mediaType,function(items){if(items&&items.length>0){wonderplugin_carousel_config.slides.splice(index,1);items.map(function(data){var itemdata={type:mediaType,image:data.image,
thumbnail:data.thumbnail?data.thumbnail:data.image,displaythumbnail:data.displaythumbnail,video:data.video,mp4:data.mp4,webm:data.webm,title:data.title,description:data.description,button:data.button,buttoncss:data.buttoncss,buttonlink:data.buttonlink,buttonlinktarget:data.buttonlinktarget,buttonlightbox:data.buttonlightbox,socialmedia:data.socialmedia,socialmediatarget:data.socialmediatarget,socialmediarotate:data.socialmediarotate,altusetitle:data.altusetitle,alt:data.alt,weblink:data.weblink,clickhandler:data.clickhandler,
linktarget:data.linktarget,weblinklightbox:data.weblinklightbox,lightbox:data.lightbox,lightboxsize:data.lightboxsize,lightboxwidth:data.lightboxwidth,lightboxheight:data.lightboxheight,langs:data.langs};if(mediaType==11)itemdata.pdf=data.pdf;if(mediaType==0)itemdata.hoverimage=data.hoverimage;wonderplugin_carousel_config.slides.splice(index,0,itemdata)});updateMediaTable()}},wonderplugin_carousel_config.slides[index],index)});$(document).on("click",".wonderplugin-carousel-media-table-delete",function(){var $tr=
$(this).parent().parent();var index=$tr.index();wonderplugin_carousel_config.slides.splice(index,1);$tr.remove();$("#wonderplugin-carousel-media-table").find("li").each(function(index){$(this).find(".wonderplugin-carousel-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_carousel_config.slides.length;if(j<0)j=0;if(j>len-1)j=len-1;if(i==j){$("#wonderplugin-carousel-media-table").find("li").eq(i).find("img").css({top:0,
left:0});return}var $tr=$("#wonderplugin-carousel-media-table").find("li").eq(i);var data=wonderplugin_carousel_config.slides[i];wonderplugin_carousel_config.slides.splice(i,1);wonderplugin_carousel_config.slides.splice(j,0,data);var $trj=$("#wonderplugin-carousel-media-table").find("li").eq(j);$tr.remove();if(j>i)$trj.after($tr);else $trj.before($tr);$("#wonderplugin-carousel-media-table").find("li").each(function(index){$(this).find(".wonderplugin-carousel-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-carousel-media-table-moveup",function(){var $tr=$(this).parent().parent();var index=$tr.index();var data=wonderplugin_carousel_config.slides[index];wonderplugin_carousel_config.slides.splice(index,1);if(index==0){wonderplugin_carousel_config.slides.push(data);var $last=$tr.parent().find("li:last");$tr.remove();$last.after($tr)}else{wonderplugin_carousel_config.slides.splice(index-
1,0,data);var $prev=$tr.prev();$tr.remove();$prev.before($tr)}$("#wonderplugin-carousel-media-table").find("li").each(function(index){$(this).find(".wonderplugin-carousel-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-carousel-media-table-movedown",function(){var $tr=$(this).parent().parent();var index=$tr.index();var len=wonderplugin_carousel_config.slides.length;
var data=wonderplugin_carousel_config.slides[index];wonderplugin_carousel_config.slides.splice(index,1);if(index==len-1){wonderplugin_carousel_config.slides.unshift(data);var $first=$tr.parent().find("li:first");$tr.remove();$first.before($tr)}else{wonderplugin_carousel_config.slides.splice(index+1,0,data);var $next=$tr.next();$tr.remove();$next.after($tr)}$("#wonderplugin-carousel-media-table").find("li").each(function(index){$(this).find(".wonderplugin-carousel-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 default_options={id:-1,newestfirst:false,name:"My Carousel",slides:[],skin:"classic",autoplaydir:"left",paddingtop:0,paddingbottom:30,paddingleft:0,paddingright:0,donotcircularforless:false,circularlimit:3,fixaspectratio:true,centerimage:true,fitimage:false,fitcenterimage:true,donotzoomin:false,sameheight:false,sameheightresponsive:false,sameheightmediumscreen:769,sameheightmediumheight:200,
sameheightsmallscreen:415,sameheightsmallheight:150,showfirstlasthalf:false,firstlasthalfsmallscreen:640,limitvisibleitemstolength:true,hidearrowsandbulletsforonepage:true,verticalflexheight:false,showimagehoverovereffect:false,imagehoverovereffect:"zoomin",imagehoverovercss:WONDERPLUGIN_CAROUSEL_IMAGE_HOVEROVER_TEMPLATE["zoomin"],fullwidth:false,hidecontaineroninit:true,hidecontainerbeforeloaded:false,deferloading:false,deferloadingdelay:0,enablelazyload:false,usebase64:true,addpreloading:false,
preloadingimage:"loading-0.gif",preloadingimagemode:"defined",multiplebyrow:false,hidebulletssmallscreen:false,hidebulletssmallscreensize:480,spacing:8,imgextraprops:"",aextraprops:"",showimgtitle:false,addwoocommerceclass:true,imgtitle:"title",addvideomediatype:true,customcss:"",dataoptions:"",customjs:"",movemode:"carousel",moveduration:500,lightboxresponsive:true,lightboxshownavigation:false,lightboxnogroup:false,lightboxshowtitle:true,lightboxshowdescription:false,lightboxaddsocialmedia:false,
lightboxfullscreenmode:false,lightboxcloseonoverlay:true,lightboxvideohidecontrols:false,lightboxinityoutube:true,lightboxinitvimeo:true,lightboxtitlestyle:"bottom",lightboximagepercentage:75,lightboxdefaultvideovolume:1,lightboxoverlaybgcolor:"#000",lightboxoverlayopacity:0.9,lightboxbgcolor:"#fff",lightboxtitleprefix:"%NUM / %TOTAL",lightboxtitleinsidecss:"color:#fff; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left;",lightboxdescriptioninsidecss:"color:#fff; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",
lightboxautoslide:false,lightboxslideinterval:5E3,lightboxshowtimer:true,lightboxtimerposition:"bottom",lightboxtimerheight:2,lightboxtimercolor:"#dc572e",lightboxtimeropacity:1,lightboxshowplaybutton:false,lightboxalwaysshownavarrows:false,lightboxbordersize:8,lightboxshowtitleprefix:false,lightboxborderradius:0,lightboximagekeepratio:true,lightboxadvancedoptions:"",lightboxshowsocial:false,lightboxsocialposition:"position:absolute;top:100%;right:0;",lightboxsocialpositionsmallscreen:"position:absolute;top:100%;right:0;left:0;",
lightboxsocialdirection:"horizontal",lightboxsocialbuttonsize:32,lightboxsocialbuttonfontsize:18,lightboxsocialrotateeffect:true,lightboxshowemail:true,lightboxshowfacebook:true,lightboxshowtwitter:true,lightboxshowpinterest:true,donotinit:false,removeinlinecss:true,addinitscript:false,doshortcodeontext:false,triggerresize:false,triggerresizedelay:100,lightboxthumbwidth:90,lightboxthumbheight:60,lightboxthumbtopmargin:12,lightboxthumbbottommargin:4,lightboxbarheight:64,lightboxtitlebottomcss:"{color:#333; font-size:14px; font-family:Armata,sans-serif,Arial; overflow:hidden; text-align:left;}",
lightboxdescriptionbottomcss:"{color:#333; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;}"};var configSkinOptions=["donotzoomin","width","height","spacing","rownumber","centerimage","fitimage","fitcenterimage","fixaspectratio","autoplay","random","circular","direction","responsive","visibleitems","autoplaydir","pauseonmouseover","scrollmode","interval","transitionduration","continuous","continuousduration","arrowstyle",
"arrowimage","arrowwidth","arrowheight","donotcircularforless","circularlimit","navstyle","navimage","navwidth","navheight","navspacing","hidecontainerbeforeloaded","hidecontaineroninit","fullwidth","sameheight","sameheightresponsive","sameheightmediumscreen","sameheightmediumheight","sameheightsmallscreen","sameheightsmallheight","showhoveroverlay","hoveroverlayimage","screenquery","showfirstlasthalf","firstlasthalfsmallscreen","verticalflexheight","hidebulletssmallscreen","hidebulletssmallscreensize",
"movemode","moveduration","showimagehoverovereffect","imagehoverovereffect","imagehoverovercss","paddingtop","paddingbottom","paddingleft","paddingright"];WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["scrollerjump"]=WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["scroller"];WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["scrollerjump"]=$.extend({},WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["scroller"],{showimagehoverovereffect:true,imagehoverovereffect:"jump",imagehoverovercss:WONDERPLUGIN_CAROUSEL_IMAGE_HOVEROVER_TEMPLATE["jump"]});WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["verticalscroller"]=
WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["vertical"];WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["verticalscroller"]=$.extend({},WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["vertical"],{visibleitems:3,continuous:true,arrowstyle:"none"});WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["firstlasthalf"]=WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["hoverover"];WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["firstlasthalf"]=$.extend({},WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["hoverover"],{height:180,showfirstlasthalf:true,scrollmode:"item"});WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["textlist"]=
{};WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["textlist"]["skintemplate"]='<div class="amazingcarousel-text">\n\t<div class="amazingcarousel-title">__TITLE__</div>\n\t<div class="amazingcarousel-description">__DESCRIPTION__</div>\n\t<div class="amazingcarousel-button">__BUTTON__</div>\n</div>\n<div style="clear:both;"></div>';WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["textlist"]["skincss"]="@import url(https://fonts.googleapis.com/css?family=Open+Sans);\n\n#amazingcarousel-CAROUSELID .amazingcarousel-text {\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-title {\n\tposition:relative;\n\tfont: bold 14px Open Sans, sans-serif;\n\tcolor:#333333;\n\tmargin:6px;\n\ttext-align:left;\n\tline-height: 16px;\n\theight: auto;\n\toverflow: hidden;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-description {\n\tposition:relative;\n\tfont: 12px Open Sans, sans-serif;\n\tcolor:#333333;\n\tmargin:6px;\n\ttext-align:left;\n\tline-height: 16px;\t\t\n\theight: auto;\n\toverflow: hidden;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-button {\n\tposition:relative;\n\tpadding:0;\n\ttext-align:left;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-list-container { \n\tpadding: 0;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-item-container {\n\ttext-align: center;\n\tpadding: 4px;\n\tbackground-color: #fff;\n\tborder: 1px solid #ddd;\n\t-moz-box-shadow: 0px 0px 5px 1px rgba(96, 96, 96, 0.1);\n\t-webkit-box-shadow: 0px 0px 5px 1px rgba(96, 96, 96, 0.1);\n\tbox-shadow: 0px 0px 5px 1px rgba(96, 96, 96, 0.1);\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-prev {\n\tright: 0%;\n\ttop: 100%;\n\tmargin-right: 32px;\n\tmargin-top: 8px;\n\tz-index: 1;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-next {\n\tright: 0%;\n\ttop: 100%;\n\tmargin-right: 0px;\n\tmargin-top: 8px;\n\tz-index: 1;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-nav {\n\tposition: absolute;\n\ttop: 100%;\n\tright: 0%;\n\tpadding-right: 64px;\n\tpadding-top: 14px;\n\tmax-width: 100%;\n\tbox-sizing: border-box;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-bullet-wrapper {\n\tmargin: 0;\n}\n\n.amazingcarousel-socialmedia-button {\n\tdisplay: inline-block;\n\tmargin: 4px;\n}\n\n.amazingcarousel-socialmedia-button a {\n\tbox-shadow: none;\n}\n\n.amazingcarousel-socialmedia-icon {\n\tdisplay:table-cell;\n\twidth:32px;\n\theight:32px;\n\tfont-size:18px;\n\tborder-radius:50%;\n\tcolor:#fff;\n\tvertical-align:middle;\n\ttext-align:center;\n\tcursor:pointer;\n\tpadding:0;\n}\n\n.amazingcarousel-socialmedia-rotate {\n\ttransition: transform .4s ease-in; \n} \n\n.amazingcarousel-socialmedia-rotate:hover { \n\ttransform: rotate(360deg); \n}\n#amazingcarousel-CAROUSELID .star-rating {\n\tdisplay: inline-block;\n}";
WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["textlist"]=$.extend({},WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["list"],{width:300,height:120,verticalflexheight:true});WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["textlistarrowstop"]=$.extend({},WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE["textlist"],{skincss:"@import url(https://fonts.googleapis.com/css?family=Open+Sans);\n\n#amazingcarousel-CAROUSELID .amazingcarousel-text {\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-title {\n\tposition:relative;\n\tfont: bold 14px Open Sans, sans-serif;\n\tcolor:#333333;\n\tmargin:6px;\n\ttext-align:left;\n\tline-height: 16px;\n\theight: auto;\n\toverflow: hidden;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-description {\n\tposition:relative;\n\tfont: 12px Open Sans, sans-serif;\n\tcolor:#333333;\n\tmargin:6px;\n\ttext-align:left;\n\tline-height: 16px;\t\t\n\theight: auto;\n\toverflow: hidden;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-button {\n\tposition:relative;\n\tpadding:0;\n\ttext-align:left;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-list-container { \n\tpadding: 0;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-item-container {\n\ttext-align: center;\n\tpadding: 4px;\n\tbackground-color: #fff;\n\tborder: 1px solid #ddd;\n\t-moz-box-shadow: 0px 0px 5px 1px rgba(96, 96, 96, 0.1);\n\t-webkit-box-shadow: 0px 0px 5px 1px rgba(96, 96, 96, 0.1);\n\tbox-shadow: 0px 0px 5px 1px rgba(96, 96, 96, 0.1);\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-prev {\n\tright: 0%;\n\ttop: 0%;\n\tmargin-right: 32px;\n\tmargin-top: -40px;\n\tz-index: 1;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-next {\n\tright: 0%;\n\ttop: 0%;\n\tmargin-right: 0px;\n\tmargin-top: -40px;\n\tz-index: 1;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-nav {\n\tposition: absolute;\n\ttop: 0%;\n\tright: 0%;\n\tpadding-right: 72px;\n\tmargin-top: -32px;\n\tmax-width: 100%;\n\tbox-sizing: border-box;\n}\n\n#amazingcarousel-CAROUSELID .amazingcarousel-bullet-wrapper {\n\tmargin: 0;\n}\n\n.amazingcarousel-socialmedia-button {\n\tdisplay: inline-block;\n\tmargin: 4px;\n}\n\n.amazingcarousel-socialmedia-button a {\n\tbox-shadow: none;\n}\n\n.amazingcarousel-socialmedia-icon {\n\tdisplay:table-cell;\n\twidth:32px;\n\theight:32px;\n\tfont-size:18px;\n\tborder-radius:50%;\n\tcolor:#fff;\n\tvertical-align:middle;\n\ttext-align:center;\n\tcursor:pointer;\n\tpadding:0;\n}\n\n.amazingcarousel-socialmedia-rotate {\n\ttransition: transform .4s ease-in; \n} \n\n.amazingcarousel-socialmedia-rotate:hover { \n\ttransform: rotate(360deg); \n}\n#amazingcarousel-CAROUSELID .star-rating {\n\tdisplay: inline-block;\n}"});
WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["textlistarrowstop"]=$.extend({},WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS["textlist"],{paddingtop:60});var defaultSkinOptions={};for(var key in WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS){defaultSkinOptions[key]={};for(var i=0;i<configSkinOptions.length;i++)if(configSkinOptions[i]in WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS[key])defaultSkinOptions[key][configSkinOptions[i]]=WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS[key][configSkinOptions[i]];else if(configSkinOptions[i]in default_options)defaultSkinOptions[key][configSkinOptions[i]]=
default_options[configSkinOptions[i]];defaultSkinOptions[key]["skintemplate"]=WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE[key]["skintemplate"];defaultSkinOptions[key]["skincss"]=WONDERPLUGIN_CAROUSEL_SKIN_TEMPLATE[key]["skincss"];defaultSkinOptions[key]["arrowimagemode"]="defined";defaultSkinOptions[key]["navimagemode"]="defined";defaultSkinOptions[key]["hoveroverlayimagemode"]="defined";defaultSkinOptions[key]["showhoveroverlayalways"]=false;defaultSkinOptions[key]["hidehoveroverlayontouch"]=false;defaultSkinOptions[key]["usescreenquery"]=
false;defaultSkinOptions[key]["showplayvideo"]=true;defaultSkinOptions[key]["playvideoimage"]="playvideo-64-64-0.png";defaultSkinOptions[key]["playvideoimagepos"]="center";defaultSkinOptions[key]["playvideoimagemode"]="defined"}var printSkinOptions=function(options){$("#wonderplugin-carousel-width").val(options.width);$("#wonderplugin-carousel-height").val(options.height);$("#wonderplugin-carousel-paddingtop").val(options.paddingtop);$("#wonderplugin-carousel-paddingbottom").val(options.paddingbottom);
$("#wonderplugin-carousel-paddingleft").val(options.paddingleft);$("#wonderplugin-carousel-paddingright").val(options.paddingright);$("#wonderplugin-carousel-showfirstlasthalf").prop("checked",options.showfirstlasthalf);$("#wonderplugin-carousel-firstlasthalfsmallscreen").val(options.firstlasthalfsmallscreen);$("#wonderplugin-carousel-verticalflexheight").prop("checked",options.verticalflexheight);$("#wonderplugin-carousel-showimagehoverovereffect").prop("checked",options.showimagehoverovereffect);
$("#wonderplugin-carousel-imagehoverovereffect").val(options.imagehoverovereffect);$("#wonderplugin-carousel-imagehoverovercss").val(options.imagehoverovercss);$("#wonderplugin-carousel-spacing").val(options.spacing);$("#wonderplugin-carousel-rownumber").val(options.rownumber);$("#wonderplugin-carousel-fixaspectratio").prop("checked",options.fixaspectratio);$("#wonderplugin-carousel-centerimage").prop("checked",options.centerimage);$("#wonderplugin-carousel-fitimage").prop("checked",options.fitimage);
$("#wonderplugin-carousel-fitcenterimage").prop("checked",options.fitcenterimage);$("#wonderplugin-carousel-donotzoomin").prop("checked",options.donotzoomin);$("#wonderplugin-carousel-sameheight").prop("checked",options.sameheight);$("#wonderplugin-carousel-sameheightresponsive").prop("checked",options.sameheightresponsive);$("#wonderplugin-carousel-sameheightmediumscreen").val(options.sameheightmediumscreen);$("#wonderplugin-carousel-sameheightmediumheight").val(options.sameheightmediumheight);$("#wonderplugin-carousel-sameheightsmallscreen").val(options.sameheightsmallscreen);
$("#wonderplugin-carousel-sameheightsmallheight").val(options.sameheightsmallheight);$("#wonderplugin-carousel-fullwidth").prop("checked",options.fullwidth);$("#wonderplugin-carousel-hidecontaineroninit").prop("checked",options.hidecontaineroninit);$("#wonderplugin-carousel-hidecontainerbeforeloaded").prop("checked",options.hidecontainerbeforeloaded);$("#wonderplugin-carousel-autoplay").prop("checked",options.autoplay);$("#wonderplugin-carousel-random").prop("checked",options.random);$("#wonderplugin-carousel-circular").prop("checked",
options.circular);$("#wonderplugin-carousel-responsive").prop("checked",options.responsive);$("#wonderplugin-carousel-visibleitems").val(options.visibleitems);$("#wonderplugin-carousel-donotcircularforless").prop("checked",options.donotcircularforless);$("#wonderplugin-carousel-circularlimit").val(options.circularlimit);$("#wonderplugin-carousel-autoplaydir").val(options.autoplaydir);$("#wonderplugin-carousel-pauseonmouseover").prop("checked",options.pauseonmouseover);$("#wonderplugin-carousel-scrollmode").val(options.scrollmode);
$("#wonderplugin-carousel-interval").val(options.interval);$("#wonderplugin-carousel-transitionduration").val(options.transitionduration);$("#wonderplugin-carousel-continuous").prop("checked",options.continuous);$("#wonderplugin-carousel-continuousduration").val(options.continuousduration);$("#wonderplugin-carousel-movemode").val(options.movemode);$("#wonderplugin-carousel-moveduration").val(options.moveduration);$("#wonderplugin-carousel-hidebulletssmallscreen").prop("checked",options.hidebulletssmallscreen);
$("#wonderplugin-carousel-hidebulletssmallscreensize").val(options.hidebulletssmallscreensize);if(options.usescreenquery)$("input:radio[name=wonderplugin-carousel-usescreenquery][value=screensize]").prop("checked",true);else $("input:radio[name=wonderplugin-carousel-usescreenquery][value=fixedsize]").prop("checked",true);$("#wonderplugin-carousel-screenquery").val(options.screenquery);$("#wonderplugin-carousel-arrowstyle").val(options.arrowstyle);$("input:radio[name=wonderplugin-carousel-arrowimagemode][value="+
options.arrowimagemode+"]").prop("checked",true);if(wonderplugin_carousel_config.arrowimagemode=="custom"){$("#wonderplugin-carousel-customarrowimage").val(options.arrowimage);$("#wonderplugin-carousel-displayarrowimage").attr("src",options.arrowimage)}else{$("#wonderplugin-carousel-arrowimage").val(options.arrowimage);$("#wonderplugin-carousel-displayarrowimage").attr("src",$("#wonderplugin-carousel-jsfolder").text()+options.arrowimage)}$("#wonderplugin-carousel-arrowwidth").val(options.arrowwidth);
$("#wonderplugin-carousel-arrowheight").val(options.arrowheight);$("#wonderplugin-carousel-showhoveroverlay").prop("checked",options.showhoveroverlay);$("#wonderplugin-carousel-showhoveroverlayalways").prop("checked",options.showhoveroverlayalways);$("#wonderplugin-carousel-hidehoveroverlayontouch").prop("checked",options.hidehoveroverlayontouch);$("input:radio[name=wonderplugin-carousel-hoveroverlayimagemode][value="+options.hoveroverlayimagemode+"]").prop("checked",true);if(wonderplugin_carousel_config.hoveroverlayimagemode==
"custom"){$("#wonderplugin-carousel-customhoveroverlayimage").val(options.hoveroverlayimage);$("#wonderplugin-carousel-displayhoveroverlayimage").attr("src",options.hoveroverlayimage)}else{$("#wonderplugin-carousel-hoveroverlayimage").val(options.hoveroverlayimage);$("#wonderplugin-carousel-displayhoveroverlayimage").attr("src",$("#wonderplugin-carousel-jsfolder").text()+options.hoveroverlayimage)}$("#wonderplugin-carousel-navstyle").val(options.navstyle);$("input:radio[name=wonderplugin-carousel-navimagemode][value="+
options.navimagemode+"]").prop("checked",true);if(wonderplugin_carousel_config.navimagemode=="custom"){$("#wonderplugin-carousel-customnavimage").val(options.navimage);$("#wonderplugin-carousel-displaynavimage").attr("src",options.navimage)}else{$("#wonderplugin-carousel-navimage").val(options.navimage);$("#wonderplugin-carousel-displaynavimage").attr("src",$("#wonderplugin-carousel-jsfolder").text()+options.navimage)}$("#wonderplugin-carousel-navwidth").val(options.navwidth);$("#wonderplugin-carousel-navheight").val(options.navheight);
$("#wonderplugin-carousel-navspacing").val(options.navspacing);$("#wonderplugin-carousel-skintemplate").val(options.skintemplate);$("#wonderplugin-carousel-skincss").val(options.skincss)};$("input:radio[name=wonderplugin-carousel-skin]").click(function(){if($(this).val()==wonderplugin_carousel_config.skin)return;$(".wonderplugin-tab-skin").find("img").removeClass("selected");$("input:radio[name=wonderplugin-carousel-skin]:checked").parent().find("img").addClass("selected");wonderplugin_carousel_config.skin=
$(this).val();printSkinOptions(defaultSkinOptions[$(this).val()])});$(".wonderplugin-carousel-options-menu-item").each(function(index){$(this).click(function(){if($(this).hasClass("wonderplugin-carousel-options-menu-item-selected"))return;$(".wonderplugin-carousel-options-menu-item").removeClass("wonderplugin-carousel-options-menu-item-selected");$(this).addClass("wonderplugin-carousel-options-menu-item-selected");$(".wonderplugin-carousel-options-tab").removeClass("wonderplugin-carousel-options-tab-selected");
$(".wonderplugin-carousel-options-tab").eq(index).addClass("wonderplugin-carousel-options-tab-selected")})});var updateCarouselOptions=function(){wonderplugin_carousel_config.newestfirst=$("#wonderplugin-newestfirst").is(":checked");wonderplugin_carousel_config.name=$.trim($("#wonderplugin-carousel-name").val());wonderplugin_carousel_config.skin=$("input:radio[name=wonderplugin-carousel-skin]:checked").val();wonderplugin_carousel_config.width=parseInt($.trim($("#wonderplugin-carousel-width").val()));
wonderplugin_carousel_config.height=parseInt($.trim($("#wonderplugin-carousel-height").val()));wonderplugin_carousel_config.paddingtop=parseInt($.trim($("#wonderplugin-carousel-paddingtop").val()));wonderplugin_carousel_config.paddingbottom=parseInt($.trim($("#wonderplugin-carousel-paddingbottom").val()));wonderplugin_carousel_config.paddingleft=parseInt($.trim($("#wonderplugin-carousel-paddingleft").val()));wonderplugin_carousel_config.paddingright=parseInt($.trim($("#wonderplugin-carousel-paddingright").val()));
wonderplugin_carousel_config.showfirstlasthalf=$("#wonderplugin-carousel-showfirstlasthalf").is(":checked");wonderplugin_carousel_config.firstlasthalfsmallscreen=parseInt($.trim($("#wonderplugin-carousel-firstlasthalfsmallscreen").val()));wonderplugin_carousel_config.showimagehoverovereffect=$("#wonderplugin-carousel-showimagehoverovereffect").is(":checked");wonderplugin_carousel_config.imagehoverovereffect=$("#wonderplugin-carousel-imagehoverovereffect").val();wonderplugin_carousel_config.imagehoverovercss=
$("#wonderplugin-carousel-imagehoverovercss").val();wonderplugin_carousel_config.spacing=parseInt($.trim($("#wonderplugin-carousel-spacing").val()));wonderplugin_carousel_config.rownumber=parseInt($.trim($("#wonderplugin-carousel-rownumber").val()));wonderplugin_carousel_config.fixaspectratio=$("#wonderplugin-carousel-fixaspectratio").is(":checked");wonderplugin_carousel_config.centerimage=$("#wonderplugin-carousel-centerimage").is(":checked");wonderplugin_carousel_config.fitimage=$("#wonderplugin-carousel-fitimage").is(":checked");
wonderplugin_carousel_config.fitcenterimage=$("#wonderplugin-carousel-fitcenterimage").is(":checked");wonderplugin_carousel_config.donotzoomin=$("#wonderplugin-carousel-donotzoomin").is(":checked");wonderplugin_carousel_config.sameheight=$("#wonderplugin-carousel-sameheight").is(":checked");wonderplugin_carousel_config.sameheightresponsive=$("#wonderplugin-carousel-sameheightresponsive").is(":checked");wonderplugin_carousel_config.sameheightmediumscreen=parseInt($.trim($("#wonderplugin-carousel-sameheightmediumscreen").val()));
wonderplugin_carousel_config.sameheightmediumheight=parseInt($.trim($("#wonderplugin-carousel-sameheightmediumheight").val()));wonderplugin_carousel_config.sameheightsmallscreen=parseInt($.trim($("#wonderplugin-carousel-sameheightsmallscreen").val()));wonderplugin_carousel_config.sameheightsmallheight=parseInt($.trim($("#wonderplugin-carousel-sameheightsmallheight").val()));wonderplugin_carousel_config.fullwidth=$("#wonderplugin-carousel-fullwidth").is(":checked");wonderplugin_carousel_config.hidecontaineroninit=
$("#wonderplugin-carousel-hidecontaineroninit").is(":checked");wonderplugin_carousel_config.hidecontainerbeforeloaded=$("#wonderplugin-carousel-hidecontainerbeforeloaded").is(":checked");wonderplugin_carousel_config.deferloading=$("#wonderplugin-carousel-deferloading").is(":checked");wonderplugin_carousel_config.deferloadingdelay=parseInt($.trim($("#wonderplugin-carousel-deferloadingdelay").val()));wonderplugin_carousel_config.enablelazyload=$("#wonderplugin-carousel-enablelazyload").is(":checked");
wonderplugin_carousel_config.usebase64=$("#wonderplugin-carousel-usebase64").is(":checked");wonderplugin_carousel_config.addpreloading=$("#wonderplugin-carousel-addpreloading").is(":checked");wonderplugin_carousel_config.preloadingimagemode=$("input[name=wonderplugin-carousel-preloadingimagemode]:checked").val();if(wonderplugin_carousel_config.preloadingimagemode=="custom")wonderplugin_carousel_config.preloadingimage=$.trim($("#wonderplugin-carousel-custompreloadingimage").val());else wonderplugin_carousel_config.preloadingimage=
$.trim($("#wonderplugin-carousel-preloadingimage").val());wonderplugin_carousel_config.multiplebyrow=$("#wonderplugin-carousel-multiplebyrow").is(":checked");wonderplugin_carousel_config.hidebulletssmallscreen=$("#wonderplugin-carousel-hidebulletssmallscreen").is(":checked");wonderplugin_carousel_config.hidebulletssmallscreensize=parseInt($.trim($("#wonderplugin-carousel-hidebulletssmallscreensize").val()));wonderplugin_carousel_config.autoplay=$("#wonderplugin-carousel-autoplay").is(":checked");
wonderplugin_carousel_config.random=$("#wonderplugin-carousel-random").is(":checked");wonderplugin_carousel_config.circular=$("#wonderplugin-carousel-circular").is(":checked");wonderplugin_carousel_config.responsive=$("#wonderplugin-carousel-responsive").is(":checked");wonderplugin_carousel_config.visibleitems=parseInt($.trim($("#wonderplugin-carousel-visibleitems").val()));if(isNaN(wonderplugin_carousel_config.visibleitems)||wonderplugin_carousel_config.visibleitems<1)wonderplugin_carousel_config.visibleitems=
3;wonderplugin_carousel_config.donotcircularforless=$("#wonderplugin-carousel-donotcircularforless").is(":checked");wonderplugin_carousel_config.circularlimit=parseInt($.trim($("#wonderplugin-carousel-circularlimit").val()));wonderplugin_carousel_config.autoplaydir=$("#wonderplugin-carousel-autoplaydir").val();wonderplugin_carousel_config.pauseonmouseover=$("#wonderplugin-carousel-pauseonmouseover").is(":checked");wonderplugin_carousel_config.scrollmode=$("#wonderplugin-carousel-scrollmode").val();
wonderplugin_carousel_config.interval=parseInt($.trim($("#wonderplugin-carousel-interval").val()));wonderplugin_carousel_config.transitionduration=parseInt($.trim($("#wonderplugin-carousel-transitionduration").val()));wonderplugin_carousel_config.continuous=$("#wonderplugin-carousel-continuous").is(":checked");wonderplugin_carousel_config.continuousduration=parseInt($.trim($("#wonderplugin-carousel-continuousduration").val()));wonderplugin_carousel_config.movemode=$("#wonderplugin-carousel-movemode").val();
wonderplugin_carousel_config.moveduration=parseInt($.trim($("#wonderplugin-carousel-moveduration").val()));wonderplugin_carousel_config.aextraprops=$.trim($("#wonderplugin-carousel-aextraprops").val());wonderplugin_carousel_config.imgextraprops=$.trim($("#wonderplugin-carousel-imgextraprops").val());wonderplugin_carousel_config.showimgtitle=$("#wonderplugin-carousel-showimgtitle").is(":checked");wonderplugin_carousel_config.imgtitle=$("#wonderplugin-carousel-imgtitle").val();wonderplugin_carousel_config.addwoocommerceclass=
$("#wonderplugin-carousel-addwoocommerceclass").is(":checked");wonderplugin_carousel_config.addvideomediatype=$("#wonderplugin-carousel-addvideomediatype").is(":checked");if($("input[name=wonderplugin-carousel-usescreenquery]:checked").val()=="screensize")wonderplugin_carousel_config.usescreenquery=true;else wonderplugin_carousel_config.usescreenquery=false;wonderplugin_carousel_config.screenquery=$.trim($("#wonderplugin-carousel-screenquery").val());wonderplugin_carousel_config.limitvisibleitemstolength=
$("#wonderplugin-carousel-limitvisibleitemstolength").is(":checked");wonderplugin_carousel_config.hidearrowsandbulletsforonepage=$("#wonderplugin-carousel-hidearrowsandbulletsforonepage").is(":checked");wonderplugin_carousel_config.verticalflexheight=$("#wonderplugin-carousel-verticalflexheight").is(":checked");wonderplugin_carousel_config.arrowstyle=$("#wonderplugin-carousel-arrowstyle").val();wonderplugin_carousel_config.arrowimagemode=$("input[name=wonderplugin-carousel-arrowimagemode]:checked").val();
if(wonderplugin_carousel_config.arrowimagemode=="custom")wonderplugin_carousel_config.arrowimage=$.trim($("#wonderplugin-carousel-customarrowimage").val());else wonderplugin_carousel_config.arrowimage=$.trim($("#wonderplugin-carousel-arrowimage").val());wonderplugin_carousel_config.arrowwidth=parseInt($.trim($("#wonderplugin-carousel-arrowwidth").val()));if(isNaN(wonderplugin_carousel_config.arrowwidth)||wonderplugin_carousel_config.arrowwidth<0)wonderplugin_carousel_config.arrowwidth=defaultSkinOptions[wonderplugin_carousel_config.skin]["arrowwidth"];
wonderplugin_carousel_config.arrowheight=parseInt($.trim($("#wonderplugin-carousel-arrowheight").val()));if(isNaN(wonderplugin_carousel_config.arrowheight)||wonderplugin_carousel_config.arrowheight<0)wonderplugin_carousel_config.arrowheight=defaultSkinOptions[wonderplugin_carousel_config.skin]["arrowheight"];wonderplugin_carousel_config.showhoveroverlay=$("#wonderplugin-carousel-showhoveroverlay").is(":checked");wonderplugin_carousel_config.showhoveroverlayalways=$("#wonderplugin-carousel-showhoveroverlayalways").is(":checked");
wonderplugin_carousel_config.hidehoveroverlayontouch=$("#wonderplugin-carousel-hidehoveroverlayontouch").is(":checked");wonderplugin_carousel_config.hoveroverlayimagemode=$("input[name=wonderplugin-carousel-hoveroverlayimagemode]:checked").val();if(wonderplugin_carousel_config.hoveroverlayimagemode=="custom")wonderplugin_carousel_config.hoveroverlayimage=$.trim($("#wonderplugin-carousel-customhoveroverlayimage").val());else wonderplugin_carousel_config.hoveroverlayimage=$.trim($("#wonderplugin-carousel-hoveroverlayimage").val());
wonderplugin_carousel_config.showplayvideo=$("#wonderplugin-carousel-showplayvideo").is(":checked");wonderplugin_carousel_config.playvideoimagemode=$("input[name=wonderplugin-carousel-playvideoimagemode]:checked").val();if(wonderplugin_carousel_config.playvideoimagemode=="custom")wonderplugin_carousel_config.playvideoimage=$.trim($("#wonderplugin-carousel-customplayvideoimage").val());else wonderplugin_carousel_config.playvideoimage=$.trim($("#wonderplugin-carousel-playvideoimage").val());wonderplugin_carousel_config.playvideoimagepos=
$("#wonderplugin-carousel-playvideoimagepos").val();wonderplugin_carousel_config.navstyle=$("#wonderplugin-carousel-navstyle").val();wonderplugin_carousel_config.navimagemode=$("input[name=wonderplugin-carousel-navimagemode]:checked").val();if(wonderplugin_carousel_config.navimagemode=="custom")wonderplugin_carousel_config.navimage=$.trim($("#wonderplugin-carousel-customnavimage").val());else wonderplugin_carousel_config.navimage=$.trim($("#wonderplugin-carousel-navimage").val());wonderplugin_carousel_config.navwidth=
parseInt($.trim($("#wonderplugin-carousel-navwidth").val()));if(isNaN(wonderplugin_carousel_config.navwidth)||wonderplugin_carousel_config.navwidth<0)wonderplugin_carousel_config.navwidth=defaultSkinOptions[wonderplugin_carousel_config.skin]["navwidth"];wonderplugin_carousel_config.navheight=parseInt($.trim($("#wonderplugin-carousel-navheight").val()));if(isNaN(wonderplugin_carousel_config.navheight)||wonderplugin_carousel_config.navheight<0)wonderplugin_carousel_config.navheight=defaultSkinOptions[wonderplugin_carousel_config.skin]["navheight"];
wonderplugin_carousel_config.navspacing=parseInt($.trim($("#wonderplugin-carousel-navspacing").val()));if(isNaN(wonderplugin_carousel_config.navspacing))wonderplugin_carousel_config.navspacing=defaultSkinOptions[wonderplugin_carousel_config.skin]["navspacing"];wonderplugin_carousel_config.direction=defaultSkinOptions[wonderplugin_carousel_config.skin]["direction"];wonderplugin_carousel_config.skintemplate=$.trim($("#wonderplugin-carousel-skintemplate").val()).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,
">");wonderplugin_carousel_config.skincss=$.trim($("#wonderplugin-carousel-skincss").val());wonderplugin_carousel_config.customcss=$.trim($("#wonderplugin-carousel-custom-css").val());wonderplugin_carousel_config.dataoptions=$.trim($("#wonderplugin-carousel-data-options").val());wonderplugin_carousel_config.customjs=$.trim($("#wonderplugin-carousel-customjs").val());wonderplugin_carousel_config.lightboxresponsive=$("#wonderplugin-carousel-lightboxresponsive").is(":checked");wonderplugin_carousel_config.lightboxshownavigation=
$("#wonderplugin-carousel-lightboxshownavigation").is(":checked");wonderplugin_carousel_config.lightboxnogroup=$("#wonderplugin-carousel-lightboxnogroup").is(":checked");wonderplugin_carousel_config.lightboxshowtitle=$("#wonderplugin-carousel-lightboxshowtitle").is(":checked");wonderplugin_carousel_config.lightboxshowdescription=$("#wonderplugin-carousel-lightboxshowdescription").is(":checked");wonderplugin_carousel_config.lightboxaddsocialmedia=$("#wonderplugin-carousel-lightboxaddsocialmedia").is(":checked");
wonderplugin_carousel_config.lightboxvideohidecontrols=$("#wonderplugin-carousel-lightboxvideohidecontrols").is(":checked");wonderplugin_carousel_config.lightboxinityoutube=$("#wonderplugin-carousel-lightboxinityoutube").is(":checked");wonderplugin_carousel_config.lightboxinitvimeo=$("#wonderplugin-carousel-lightboxinitvimeo").is(":checked");wonderplugin_carousel_config.lightboxfullscreenmode=$("#wonderplugin-carousel-lightboxfullscreenmode").is(":checked");wonderplugin_carousel_config.lightboxcloseonoverlay=
$("#wonderplugin-carousel-lightboxcloseonoverlay").is(":checked");wonderplugin_carousel_config.lightboxtitlestyle=$.trim($("#wonderplugin-carousel-lightboxtitlestyle").val());wonderplugin_carousel_config.lightboxdefaultvideovolume=parseFloat($.trim($("#wonderplugin-carousel-lightboxdefaultvideovolume").val()));wonderplugin_carousel_config.lightboximagepercentage=parseInt($.trim($("#wonderplugin-carousel-lightboximagepercentage").val()));wonderplugin_carousel_config.lightboxoverlayopacity=parseFloat($.trim($("#wonderplugin-carousel-lightboxoverlayopacity").val()));
wonderplugin_carousel_config.lightboxoverlaybgcolor=$.trim($("#wonderplugin-carousel-lightboxoverlaybgcolor").val());wonderplugin_carousel_config.lightboxbgcolor=$.trim($("#wonderplugin-carousel-lightboxbgcolor").val());wonderplugin_carousel_config.lightboxtitleprefix=$("#wonderplugin-carousel-lightboxtitleprefix").val();wonderplugin_carousel_config.lightboxtitleinsidecss=$.trim($("#wonderplugin-carousel-lightboxtitleinsidecss").val());wonderplugin_carousel_config.lightboxdescriptioninsidecss=$.trim($("#wonderplugin-carousel-lightboxdescriptioninsidecss").val());
wonderplugin_carousel_config.lightboxadvancedoptions=$.trim($("#wonderplugin-carousel-lightboxadvancedoptions").val());wonderplugin_carousel_config.lightboxautoslide=$("#wonderplugin-carousel-lightboxautoslide").is(":checked");wonderplugin_carousel_config.lightboxshowtimer=$("#wonderplugin-carousel-lightboxshowtimer").is(":checked");wonderplugin_carousel_config.lightboxshowplaybutton=$("#wonderplugin-carousel-lightboxshowplaybutton").is(":checked");wonderplugin_carousel_config.lightboxalwaysshownavarrows=
$("#wonderplugin-carousel-lightboxalwaysshownavarrows").is(":checked");wonderplugin_carousel_config.lightboxshowtitleprefix=$("#wonderplugin-carousel-lightboxshowtitleprefix").is(":checked");wonderplugin_carousel_config.lightboxslideinterval=parseInt($.trim($("#wonderplugin-carousel-lightboxslideinterval").val()));wonderplugin_carousel_config.lightboxtimerheight=parseInt($.trim($("#wonderplugin-carousel-lightboxtimerheight").val()));wonderplugin_carousel_config.lightboxbordersize=parseInt($.trim($("#wonderplugin-carousel-lightboxbordersize").val()));
wonderplugin_carousel_config.lightboxborderradius=parseInt($.trim($("#wonderplugin-carousel-lightboxborderradius").val()));wonderplugin_carousel_config.lightboxtimeropacity=parseFloat($.trim($("#wonderplugin-carousel-lightboxtimeropacity").val()));wonderplugin_carousel_config.lightboxtimerposition=$.trim($("#wonderplugin-carousel-lightboxtimerposition").val());wonderplugin_carousel_config.lightboxtimercolor=$.trim($("#wonderplugin-carousel-lightboxtimercolor").val());wonderplugin_carousel_config.lightboxshowsocial=
$("#wonderplugin-carousel-lightboxshowsocial").is(":checked");wonderplugin_carousel_config.lightboxsocialposition=$.trim($("#wonderplugin-carousel-lightboxsocialposition").val());wonderplugin_carousel_config.lightboxsocialpositionsmallscreen=$.trim($("#wonderplugin-carousel-lightboxsocialpositionsmallscreen").val());wonderplugin_carousel_config.lightboxsocialdirection=$.trim($("#wonderplugin-carousel-lightboxsocialdirection").val());wonderplugin_carousel_config.lightboxsocialbuttonsize=parseInt($.trim($("#wonderplugin-carousel-lightboxsocialbuttonsize").val()));
wonderplugin_carousel_config.lightboxsocialbuttonfontsize=parseInt($.trim($("#wonderplugin-carousel-lightboxsocialbuttonfontsize").val()));wonderplugin_carousel_config.lightboxsocialrotateeffect=$("#wonderplugin-carousel-lightboxsocialrotateeffect").is(":checked");wonderplugin_carousel_config.lightboxshowfacebook=$("#wonderplugin-carousel-lightboxshowfacebook").is(":checked");wonderplugin_carousel_config.lightboxshowtwitter=$("#wonderplugin-carousel-lightboxshowtwitter").is(":checked");wonderplugin_carousel_config.lightboxshowpinterest=
$("#wonderplugin-carousel-lightboxshowpinterest").is(":checked");wonderplugin_carousel_config.lightboxshowemail=$("#wonderplugin-carousel-lightboxshowemail").is(":checked");wonderplugin_carousel_config.lightboximagekeepratio=$("#wonderplugin-carousel-lightboximagekeepratio").is(":checked");wonderplugin_carousel_config.donotinit=$("#wonderplugin-carousel-donotinit").is(":checked");wonderplugin_carousel_config.addinitscript=$("#wonderplugin-carousel-addinitscript").is(":checked");wonderplugin_carousel_config.doshortcodeontext=
$("#wonderplugin-carousel-doshortcodeontext").is(":checked");wonderplugin_carousel_config.removeinlinecss=$("#wonderplugin-carousel-removeinlinecss").is(":checked");wonderplugin_carousel_config.triggerresize=$("#wonderplugin-carousel-triggerresize").is(":checked");wonderplugin_carousel_config.triggerresizedelay=parseInt($.trim($("#wonderplugin-carousel-triggerresizedelay").val()));var val=parseInt($.trim($("#wonderplugin-carousel-lightboxthumbwidth").val()));wonderplugin_carousel_config.lightboxthumbwidth=
isNaN(val)?default_options.lightboxthumbwidth:val;val=parseInt($.trim($("#wonderplugin-carousel-lightboxthumbheight").val()));wonderplugin_carousel_config.lightboxthumbheight=isNaN(val)?default_options.lightboxthumbheight:val;val=parseInt($.trim($("#wonderplugin-carousel-lightboxthumbtopmargin").val()));wonderplugin_carousel_config.lightboxthumbtopmargin=isNaN(val)?default_options.lightboxthumbtopmargin:val;val=parseInt($.trim($("#wonderplugin-carousel-lightboxthumbbottommargin").val()));wonderplugin_carousel_config.lightboxthumbbottommargin=
isNaN(val)?default_options.lightboxthumbbottommargin:val;val=parseInt($.trim($("#wonderplugin-carousel-lightboxbarheight").val()));wonderplugin_carousel_config.lightboxbarheight=isNaN(val)?default_options.lightboxbarheight:val;wonderplugin_carousel_config.lightboxtitlebottomcss=$.trim($("#wonderplugin-carousel-lightboxtitlebottomcss").val());wonderplugin_carousel_config.lightboxdescriptionbottomcss=$.trim($("#wonderplugin-carousel-lightboxdescriptionbottomcss").val())};function generate_socialmedia_code(slide){socialmedia=
"";sociallist=null;try{sociallist=JSON.parse(slide.socialmedia)}catch(err){}socialtarget=slide.socialmediatarget?' target="'+slide.socialmediatarget+'"':"";socialrotate=slide.socialmediarotate?" amazingcarousel-socialmedia-rotate":"";if(sociallist)$.each(sociallist,function(index,social){socialurl=social.name=="mail"&&social.url&&social.url.substring(0,7)!=="mailto:"?"mailto:"+social.url:social.url;socialmedia+='<div class="amazingcarousel-socialmedia-button"><a'+socialtarget+' href="'+socialurl+
'">'+'<div class="amazingcarousel-socialmedia-icon'+socialrotate+" mh-icon-"+social.name+'" style="background-color:'+socialbgcolor[social.name]+';"></div>'+"</a></div>"});return socialmedia}var generate_button_code=function(slides,i,carouselid,socialmedia){var button_code="";if(slides[i].button&&slides[i].button.length>0){if(slides[i].buttonlightbox){button_code+='<a class="wondercarousellightbox wondercarousellightbox-'+carouselid+'" data-thumbnail="'+slides[i].thumbnail+'"';if(!wonderplugin_carousel_config.lightboxnogroup)button_code+=
' data-group="wondercarousellightbox-'+carouselid+'"';if(slides[i].type==0)button_code+=' href="'+slides[i].image+'"';else if(slides[i].type==1){button_code+=' href="'+slides[i].mp4+'"';if(slides[i].webm)button_code+=' data-webm="'+slides[i].webm+'"'}else if(slides[i].type==2||slides[i].type==3||slides[i].type==4||slides[i].type==5){button_code+=' href="'+slides[i].video+'"';if(slides[i].type==5)button_code+=" data-mediatype=12"}if(slides[i].lightboxsize)button_code+=' data-width="'+slides[i].lightboxwidth+
'" data-height="'+slides[i].lightboxheight+'"'}else if(slides[i].buttonlink&&slides[i].buttonlink.length>0){button_code+='<a href="'+slides[i].buttonlink+'"';if(slides[i].buttonlinktarget&&slides[i].buttonlinktarget.length>0)button_code+=' target="'+slides[i].buttonlinktarget+'"'}if(slides[i].buttonlightbox||slides[i].buttonlink&&slides[i].buttonlink.length>0){if(slides[i].title&&slides[i].title.length>0)button_code+=' data-title="'+slides[i].title.replace(/"/g,""")+'"';if(slides[i].description&&
slides[i].description.length>0)button_code+=' data-description="'+slides[i].description.replace(/"/g,""")+'"';if(wonderplugin_carousel_config.lightboxaddsocialmedia&&slides[i].socialmedia&&slides[i].socialmedia.length>0)button_code+='" data-socialmedia="'+socialmedia.replace(/"/g,""")+'"';button_code+=">"}button_code+='<button class="'+slides[i].buttoncss+'">'+slides[i].button+"</button>";if(slides[i].buttonlightbox||slides[i].buttonlink&&slides[i].buttonlink.length>0)button_code+="</a>"}return button_code};
var previewCarousel=function(){updateCarouselOptions();$("#wonderplugin-carousel-preview-container").empty();var previewCode="<div id='wonderplugin-carousel-preview'";if(wonderplugin_carousel_config.dataoptions&&wonderplugin_carousel_config.dataoptions.length>0)previewCode+=" "+wonderplugin_carousel_config.dataoptions;previewCode+="></div>";$("#wonderplugin-carousel-preview-container").html(previewCode);if(wonderplugin_carousel_config.slides.length>0){$("head").find("style").each(function(){if($(this).data("creator")==
"wonderplugincarouselcreator"||$(this).data("creator")=="wonderplugin-carousel-preview")$(this).remove()});var carouselid=wonderplugin_carousel_config.id>0?wonderplugin_carousel_config.id:0;if(wonderplugin_carousel_config.customcss&&wonderplugin_carousel_config.customcss.length>0){var customcss=wonderplugin_carousel_config.customcss.replace(/wonderplugincarousel-container-CAROUSELID/g,"wonderplugin-carousel-preview-container").replace(/wonderplugincarousel-CAROUSELID/g,"wonderplugin-carousel-preview").replace(/CAROUSELID/g,
carouselid);$("head").append("<style type='text/css' data-creator='wonderplugincarouselcreator'>"+customcss+"</style>")}if(wonderplugin_carousel_config.showimagehoverovereffect&&wonderplugin_carousel_config.imagehoverovercss&&wonderplugin_carousel_config.imagehoverovercss.length>0){var imagehoverovercss=wonderplugin_carousel_config.imagehoverovercss.replace(/wonderplugincarousel-container-CAROUSELID/g,"wonderplugin-carousel-preview-container").replace(/wonderplugincarousel-CAROUSELID/g,"wonderplugin-carousel-preview").replace(/CAROUSELID/g,
carouselid);$("head").append("<style type='text/css' data-creator='wonderplugincarouselcreator'>"+imagehoverovercss+"</style>")}if(wonderplugin_carousel_config.skincss&&wonderplugin_carousel_config.skincss.length>0)$("head").append("<style type='text/css' data-creator='wonderplugincarouselcreator'>"+wonderplugin_carousel_config.skincss.replace(/#amazingcarousel-CAROUSELID/g,"#wonderplugin-carousel-preview")+"</style>");$("#wpcarousellightbox_advanced_options").remove();var code="";if(wonderplugin_carousel_config.lightboxadvancedoptions&&
wonderplugin_carousel_config.lightboxadvancedoptions.length>0){code+="<div id='wpcarousellightbox_advanced_options'";code+=" "+wonderplugin_carousel_config.lightboxadvancedoptions;code+="></div>"}var i;code+='<div class="amazingcarousel-list-container" style="overflow:hidden;">';code+='<ul class="amazingcarousel-list">';if(isNaN(wonderplugin_carousel_config.rownumber)||wonderplugin_carousel_config.rownumber<1)wonderplugin_carousel_config.rownumber=1;var hasPosts=false;var hasFolder=false;var count=
0;for(i=0;i<wonderplugin_carousel_config.slides.length;i++){if(wonderplugin_carousel_config.slides[i].type==6||wonderplugin_carousel_config.slides[i].type==7||wonderplugin_carousel_config.slides[i].type==8){hasPosts=true;continue}else if(wonderplugin_carousel_config.slides[i].type==12){hasFolder=true;continue}else if(wonderplugin_carousel_config.slides[i].type==13){if(count==0)code+='<li class="amazingcarousel-item">';else if(count%wonderplugin_carousel_config.rownumber==0)code+='</li><li class="amazingcarousel-item">';
count++;code+='<div class="amazingcarousel-item-container">';code+=wonderplugin_carousel_config.slides[i].htmlcode;code+="</div>";continue}if(wonderplugin_carousel_config.slides[i].type==10){if(count>0)code+="</li>";code+='<li class="amazingcarousel-item"';wonderplugin_carousel_config.slides[i].image="__IMAGE__";wonderplugin_carousel_config.slides[i].thumbnail="__THUMBNAIL__";wonderplugin_carousel_config.slides[i].video="__VIDEO__";wonderplugin_carousel_config.slides[i].title="__TITLE__";wonderplugin_carousel_config.slides[i].description=
"__DESCRIPTION__";code+=' data-youtubeapikey="'+wonderplugin_carousel_config.slides[i].youtubeapikey+'" data-youtubeplaylistid="'+wonderplugin_carousel_config.slides[i].youtubeplaylistid+'" data-youtubeplaylistmaxresults="'+wonderplugin_carousel_config.slides[i].youtubeplaylistmaxresults+'"';code+=">"}else if(count==0)code+='<li class="amazingcarousel-item">';else if(count%wonderplugin_carousel_config.rownumber==0)code+='</li><li class="amazingcarousel-item">';count++;code+='<div class="amazingcarousel-item-container">';
var socialmedia=wonderplugin_carousel_config.slides[i].socialmedia&&wonderplugin_carousel_config.slides[i].socialmedia.length>0?generate_socialmedia_code(wonderplugin_carousel_config.slides[i]):"";var image_code="";if(wonderplugin_carousel_config.slides[i].lightbox){image_code+="<a";if(wonderplugin_carousel_config.aextraprops)image_code+=wonderplugin_carousel_config.aextraprops;image_code+=' href="';if(wonderplugin_carousel_config.slides[i].type==0)image_code+=wonderplugin_carousel_config.slides[i].image;
if(wonderplugin_carousel_config.slides[i].type==11)image_code+=wonderplugin_carousel_config.slides[i].pdf;else if(wonderplugin_carousel_config.slides[i].type==1){image_code+=wonderplugin_carousel_config.slides[i].mp4;if(wonderplugin_carousel_config.slides[i].webm)image_code+='" data-webm="'+wonderplugin_carousel_config.slides[i].webm}else if(wonderplugin_carousel_config.slides[i].type==2||wonderplugin_carousel_config.slides[i].type==3||wonderplugin_carousel_config.slides[i].type==10)image_code+=wonderplugin_carousel_config.slides[i].video;
if(wonderplugin_carousel_config.slides[i].title&&wonderplugin_carousel_config.slides[i].title.length>0)image_code+='" title="'+wonderplugin_carousel_config.slides[i].title.replace(/"/g,""");if(wonderplugin_carousel_config.slides[i].description&&wonderplugin_carousel_config.slides[i].description.length>0)image_code+='" data-description="'+wonderplugin_carousel_config.slides[i].description.replace(/"/g,""");if(wonderplugin_carousel_config.lightboxaddsocialmedia&&wonderplugin_carousel_config.slides[i].socialmedia&&
wonderplugin_carousel_config.slides[i].socialmedia.length>0)image_code+='" data-socialmedia="'+socialmedia.replace(/"/g,""");if(wonderplugin_carousel_config.slides[i].lightboxsize)image_code+='" data-width="'+wonderplugin_carousel_config.slides[i].lightboxwidth+'" data-height="'+wonderplugin_carousel_config.slides[i].lightboxheight;image_code+='" data-thumbnail="'+wonderplugin_carousel_config.slides[i].thumbnail;image_code+='" class="wondercarousellightbox wondercarousellightbox-'+carouselid+
'"';if(!wonderplugin_carousel_config.lightboxnogroup)image_code+=' data-group="wondercarousellightbox-'+carouselid+'"';if(wonderplugin_carousel_config.slides[i].type==10)image_code+=" data-ytplaylist=1";switch(wonderplugin_carousel_config.slides[i].type){case 0:image_code+=" data-mediatype=0";break;case 1:image_code+=" data-mediatype=2";break;case 2:image_code+=" data-mediatype=3";break;case 3:image_code+=" data-mediatype=4";break}image_code+=">"}else if(wonderplugin_carousel_config.slides[i].weblink&&
wonderplugin_carousel_config.slides[i].weblink.length>0){image_code+="<a";if(wonderplugin_carousel_config.aextraprops)image_code+=wonderplugin_carousel_config.aextraprops;image_code+=' href="'+wonderplugin_carousel_config.slides[i].weblink+'"';if(wonderplugin_carousel_config.slides[i].clickhandler&&wonderplugin_carousel_config.slides[i].clickhandler.length>0)image_code+=' onclick="'+wonderplugin_carousel_config.slides[i].clickhandler.replace(/"/g,""")+'"';if(wonderplugin_carousel_config.slides[i].linktarget&&
wonderplugin_carousel_config.slides[i].linktarget.length>0)image_code+=' target="'+wonderplugin_carousel_config.slides[i].linktarget+'"';if(wonderplugin_carousel_config.slides[i].weblinklightbox){image_code+='" class="wondercarousellightbox wondercarousellightbox-'+carouselid+'"';if(!wonderplugin_carousel_config.lightboxnogroup)image_code+=' data-group="wondercarousellightbox-'+carouselid+'"';if(wonderplugin_carousel_config.slides[i].lightboxsize)image_code+=' data-width="'+wonderplugin_carousel_config.slides[i].lightboxwidth+
'" data-height="'+wonderplugin_carousel_config.slides[i].lightboxheight+'"'}image_code+=">"}image_code+='<img class="amazingcarousel-image-img"';if(wonderplugin_carousel_config.imgextraprops)image_code+=" "+wonderplugin_carousel_config.imgextraprops;if(wonderplugin_carousel_config.slides[i].type==10)image_code+=' data-srcyt="';else image_code+=' src="';if(wonderplugin_carousel_config.slides[i].displaythumbnail)image_code+=wonderplugin_carousel_config.slides[i].thumbnail+'"';else image_code+=wonderplugin_carousel_config.slides[i].image+
'"';image_code+=' alt="'+(wonderplugin_carousel_config.slides[i].title?wonderplugin_carousel_config.slides[i].title.replace(/"/g,"""):"")+'"';image_code+=' data-description="'+(wonderplugin_carousel_config.slides[i].description?wonderplugin_carousel_config.slides[i].description.replace(/"/g,"""):"")+'"';if(!wonderplugin_carousel_config.slides[i].lightbox){if(wonderplugin_carousel_config.slides[i].type==1){image_code+=' data-video="'+wonderplugin_carousel_config.slides[i].mp4+'"';if(wonderplugin_carousel_config.slides[i].webm)image_code+=
' data-videowebm="'+wonderplugin_carousel_config.slides[i].webm+'"'}else if(wonderplugin_carousel_config.slides[i].type==2||wonderplugin_carousel_config.slides[i].type==3||wonderplugin_carousel_config.slides[i].type==10)image_code+=' data-video="'+wonderplugin_carousel_config.slides[i].video+'"';switch(wonderplugin_carousel_config.slides[i].type){case 1:image_code+=" data-videotype=6";break;case 2:image_code+=" data-videotype=9";break;case 3:image_code+=" data-videotype=10";break}}if(wonderplugin_carousel_config.slides[i].type==
0&&wonderplugin_carousel_config.slides[i].hoverimage)image_code+=' data-hoverimage="'+wonderplugin_carousel_config.slides[i].hoverimage+'"';image_code+=" />";if(wonderplugin_carousel_config.slides[i].lightbox||!wonderplugin_carousel_config.slides[i].lightbox&&wonderplugin_carousel_config.slides[i].weblink&&wonderplugin_carousel_config.slides[i].weblink.length>0)image_code+="</a>";var title_code="";if(wonderplugin_carousel_config.slides[i].title&&wonderplugin_carousel_config.slides[i].title.length>
0)title_code=wonderplugin_carousel_config.slides[i].title;var description_code="";if(wonderplugin_carousel_config.slides[i].description&&wonderplugin_carousel_config.slides[i].description.length>0)description_code=wonderplugin_carousel_config.slides[i].description;var skin_template=wonderplugin_carousel_config.skintemplate.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/__IMAGE__/g,image_code).replace(/__TITLE__/g,title_code).replace(/__DESCRIPTION__/g,description_code).replace(/__ID__/g,
count);skin_template=skin_template.replace(/__HREF__/g,wonderplugin_carousel_config.slides[i].weblink);skin_template=skin_template.replace(/__CLICKHANDLER__/g,wonderplugin_carousel_config.slides[i].clickhandler);skin_template=skin_template.replace(/__TARGET__/g,wonderplugin_carousel_config.slides[i].linktarget);skin_template=skin_template.replace(/__SOCIALMEDIA__/g,socialmedia);var buttoncode=generate_button_code(wonderplugin_carousel_config.slides,i,carouselid,socialmedia);skin_template=skin_template.replace(/__BUTTON__/g,
buttoncode);code+=skin_template;code+="</div>"}if(count>0)code+="</li>";code+="</ul>";code+='<div class="amazingcarousel-prev"></div><div class="amazingcarousel-next"></div>';code+="</div>";code+='<div class="amazingcarousel-nav"></div>';var jsfolder=$("#wonderplugin-carousel-jsfolder").text();var carouselOptions=$.extend({},WONDERPLUGIN_CAROUSEL_SKIN_OPTIONS[wonderplugin_carousel_config["skin"]],{carouselid:carouselid,jsfolder:jsfolder},wonderplugin_carousel_config);var totalwidth;if(carouselOptions.direction==
"vertical")totalwidth=carouselOptions.width;else totalwidth=carouselOptions.width*carouselOptions.visibleitems;if(carouselOptions.responsive)$("#wonderplugin-carousel-preview").css({display:"none",position:"relative",width:"100%","max-width":totalwidth+"px"});else $("#wonderplugin-carousel-preview").css({display:"none",position:"relative",width:totalwidth+"px"});$("#wonderplugin-carousel-preview").html(code);carouselOptions.screenquery={};try{carouselOptions.screenquery=JSON.parse(carouselOptions.screenquery)}catch(err){}$("#wonderplugin-carousel-preview").wonderplugincarouselslider(carouselOptions);
$(window).trigger("resize");if(hasPosts)$("#wonderplugin-carousel-preview-message").html("The WordPress page/post carousel is not available in the Preview tab. To view the effect, save and publish the carousel, then clik the View Carousel link. Or you can add the provided shortcode to a post or page to view the effect.");else if(hasFolder)$("#wonderplugin-carousel-preview-message").html("The WordPress folder carousel is not available in the Preview tab. To view the effect, save and publish the carousel, then clik the View Carousel link. Or you can add the provided shortcode to a post or page to view the effect.");
else $("#wonderplugin-carousel-preview-message").empty()}};var postPublish=function(message){$("#wonderplugin-carousel-publish-loading").hide();var formnonce=$("#wonderplugin-carousel-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;var postcontent=JSON.stringify(wonderplugin_carousel_config).replace(/"/g,""").replace(/'/g,"'");if($("#wonderplugin-carousel-doublebackslash").text()=="1")postcontent=postcontent.replace(/\\/g,"\\\\");errorHtml+="<input type='hidden' name='wonderplugin-carousel-save-item-post-value' id='wonderplugin-carousel-save-item-post-value' value='"+
postcontent+"' />";errorHtml+="<p class='submit'><input type='submit' name='wonderplugin-carousel-save-item-post' id='wonderplugin-carousel-save-item-post' class='button button-primary' value='Save & Publish with Post Method'  /></p>";errorHtml+="</form>";$("#wonderplugin-carousel-publish-information").html(errorHtml)};var displayCheck=function(days){var code=days<30?"<p>The trial version will expire in "+String(30-days)+' days. To continue using the plugin after expiration, please <a href="https://www.wonderplugin.com/wordpress-carousel/order/" target="_blank">Upgrade to the Pro Version</a>.</p>':
'<p>The 30-day trial period has expired. To continue using the plugin, please <a href="https://www.wonderplugin.com/wordpress-carousel/order/" target="_blank">Upgrade to the Pro Version</a>.</p>';$("<div></div>").html(code).dialog({title:"Wonder Carousel Trial Version",resizable:false,modal:true,width:480,open:function(){$(this).siblings(".ui-dialog-buttonpane").find("button:eq(1)").focus()},buttons:{"Close":function(){$(this).dialog("close")},"Upgrade to the Pro Version":function(){window.open("https://www.wonderplugin.com/wordpress-carousel/order/",
"_blank")}}})};var checkDays=function(){var checkOptions={check:0};if(!checkOptions.check||$("#wonderplugin_carousel_initd").length<0)return-1;var initTime=parseInt($("#wonderplugin_carousel_initd").text());if(isNaN(initTime)||initTime<=0)return-1;return Math.floor((Math.floor((new Date).getTime()/1E3)-initTime)/86400)};var initCheck=function(){var days=checkDays();if(days<15)return;displayCheck(days)};initCheck();var publishCarousel=function(){var days=checkDays();if(days>=30){$("#wonderplugin-carousel-publish-information").html('<p>The 30-day trial period has expired. To continue using the plugin, please <a href="https://www.wonderplugin.com/wordpress-carousel/order/" target="_blank">Upgrade to the Pro Version</a>.</p>');
displayCheck(days);return}$("#wonderplugin-carousel-publish-loading").show();updateCarouselOptions();var ajaxnonce=$("#wonderplugin-carousel-ajaxnonce").text();var postcontent=JSON.stringify(wonderplugin_carousel_config);if($("#wonderplugin-carousel-doublebackslash").text()=="1")postcontent=postcontent.replace(/\\/g,"\\\\");jQuery.ajax({url:ajaxurl,type:"POST",data:{action:"wonderplugin_carousel_save_config",nonce:ajaxnonce,item:postcontent},success:function(data){if(wonderplugin_carousel_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_carousel_edit_item";urlparams["itemid"]=data.id;window.history.pushState(null,null,window.location.href.split("?")[0]+"?"+$.param(urlparams))}$("#wonderplugin-carousel-publish-loading").hide();if(data&&data.success&&data.id>=0){wonderplugin_carousel_config.id=
data.id;$("#wonderplugin-carousel-publish-information").html("<div class='updated'><p>The carousel has been saved and published: <a href='"+$("#wonderplugin-carousel-viewadminurl").text()+"&itemid="+data.id+"' target='_blank'>View Carousel</a></p></div>"+"<div class='updated'><p>To embed the carousel into your page or post, use shortcode:  [wonderplugin_carousel id=\""+data.id+'"]</p></div>'+"<div class='updated'><p>To embed the carousel into your template, use php code:  <?php echo do_shortcode('[wonderplugin_carousel id=\""+
data.id+"\"]'); ?></p></div>")}else postPublish(data&&data.message?data.message:"")},error:function(){$("#wonderplugin-carousel-publish-loading").hide();postPublish("")}})};var wonderplugin_carousel_config=$.extend({},default_options,defaultSkinOptions[default_options["skin"]]);var carouselId=parseInt($("#wonderplugin-carousel-id").text());if(carouselId>=0){var saved_config={};try{saved_config=JSON.parse($("#wonderplugin-carousel-id-config").text())}catch(err){}if(!("fixaspectratio"in saved_config))saved_config.fixaspectratio=
false;if(!("centerimage"in saved_config))saved_config.centerimage=false;if(!("fitimage"in saved_config))saved_config.fitimage=false;if(!("fitcenterimage"in saved_config))saved_config.fitcenterimage=false;if(!("donotzoomin"in saved_config))saved_config.donotzoomin=false;if(!("limitvisibleitemstolength"in saved_config))saved_config.limitvisibleitemstolength=false;if(!("hidearrowsandbulletsforonepage"in saved_config))saved_config.hidearrowsandbulletsforonepage=false;if("skin"in saved_config&&saved_config["skin"]in
defaultSkinOptions)$.extend(wonderplugin_carousel_config,defaultSkinOptions[saved_config["skin"]]);$.extend(wonderplugin_carousel_config,saved_config);wonderplugin_carousel_config.id=carouselId}var i;var j;for(i=0;i<wonderplugin_carousel_config.slides.length;i++){if(!("altusetitle"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i]["altusetitle"]=true;if(!("alt"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i]["alt"]="";if(!("socialmedia"in
wonderplugin_carousel_config.slides[i])){wonderplugin_carousel_config.slides[i]["socialmedia"]="";wonderplugin_carousel_config.slides[i]["socialmediatarget"]="";wonderplugin_carousel_config.slides[i]["socialmediarotate"]=true}if(!("button"in wonderplugin_carousel_config.slides[i])){wonderplugin_carousel_config.slides[i]["button"]="";wonderplugin_carousel_config.slides[i]["buttoncss"]="wpp-btn-blue-medium";wonderplugin_carousel_config.slides[i]["buttonlink"]="";wonderplugin_carousel_config.slides[i]["buttonlinktarget"]=
"";wonderplugin_carousel_config.slides[i]["buttonlightbox"]=false}if(!("lightboxsize"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i]["lightboxsize"]=false;if(!("lightboxwidth"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i]["lightboxwidth"]=960;if(!("lightboxheight"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i]["lightboxheight"]=540;if(!("clickhandler"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i]["clickhandler"]=
"";if("postlightbox"in wonderplugin_carousel_config.slides[i]){if(wonderplugin_carousel_config.slides[i].postlightbox!==true&&wonderplugin_carousel_config.slides[i].postlightbox!==false)wonderplugin_carousel_config.slides[i].postlightbox=wonderplugin_carousel_config.slides[i].postlightbox&&wonderplugin_carousel_config.slides[i].postlightbox.toLowerCase()==="true";if(wonderplugin_carousel_config.slides[i].postlightboxsize!==true&&wonderplugin_carousel_config.slides[i].postlightboxsize!==false)wonderplugin_carousel_config.slides[i].postlightboxsize=
wonderplugin_carousel_config.slides[i].postlightboxsize&&wonderplugin_carousel_config.slides[i].postlightboxsize.toLowerCase()==="true";if(wonderplugin_carousel_config.slides[i].posttitlelink!==true&&wonderplugin_carousel_config.slides[i].posttitlelink!==false)wonderplugin_carousel_config.slides[i].posttitlelink=wonderplugin_carousel_config.slides[i].posttitlelink&&wonderplugin_carousel_config.slides[i].posttitlelink.toLowerCase()==="true"}if(wonderplugin_carousel_config.slides[i].type==6){if(!("imageaction"in
wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].imageaction=true;if(!("postorder"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].postorder="DESC";if(!("postdaterange"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].postdaterange=false;else if(wonderplugin_carousel_config.slides[i].postdaterange!==true&&wonderplugin_carousel_config.slides[i].postdaterange!==false)wonderplugin_carousel_config.slides[i].postdaterange=
wonderplugin_carousel_config.slides[i].postdaterange&&wonderplugin_carousel_config.slides[i].postdaterange.toLowerCase()==="true";if(!("postdaterangeafter"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].postdaterangeafter=30;if(!("selectpostbytags"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].selectpostbytags=false;else if(wonderplugin_carousel_config.slides[i].selectpostbytags!==true&&wonderplugin_carousel_config.slides[i].selectpostbytags!==
false)wonderplugin_carousel_config.slides[i].selectpostbytags=wonderplugin_carousel_config.slides[i].selectpostbytags&&wonderplugin_carousel_config.slides[i].selectpostbytags.toLowerCase()==="true";if(!("posttags"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].posttags="";if(!("postorderby"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].postorderby="date";if(!("posttitlefield"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].posttitlefield=
"%post_title%";if(!("postdescriptionfield"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].postdescriptionfield="%post_excerpt%"}if(wonderplugin_carousel_config.slides[i].type==7){if(!("metaonsale"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].metaonsale=false;if(!("metatotalsales"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].metatotalsales=false;if(!("metafeatured"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].metafeatured=
false;if(!("metarelation"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].metarelation="OR";if(!("customfeaturedimagesize"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].customfeaturedimagesize="full";if(!("postorderby"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].postorderby="date";if(!("postorderbyorder"in wonderplugin_carousel_config.slides[i]))wonderplugin_carousel_config.slides[i].postorderbyorder=
"DESC"}}var slideBoolOptions=["imageaction","buttonlightbox","lightbox","lightboxsize","displaythumbnail","weblinklightbox","selectpostbytags","postdaterange","postdatefromto","titlelink","imageaction","imageactionlightbox","openpostinlightbox","postlightboxsize","altusetitle","metaonsale","metatotalsales","metafeatured","usefilenameastitle"];for(i=0;i<wonderplugin_carousel_config.slides.length;i++)for(j=0;j<slideBoolOptions.length;j++)if(slideBoolOptions[j]in wonderplugin_carousel_config.slides[i]){if(wonderplugin_carousel_config.slides[i][slideBoolOptions[j]]!==
true&&wonderplugin_carousel_config.slides[i][slideBoolOptions[j]]!==false)wonderplugin_carousel_config.slides[i][slideBoolOptions[j]]=wonderplugin_carousel_config.slides[i][slideBoolOptions[j]]&&wonderplugin_carousel_config.slides[i][slideBoolOptions[j]].toLowerCase()==="true"}else wonderplugin_carousel_config.slides[i][slideBoolOptions[j]]=false;var boolOptions=["donotzoomin","usebase64","addpreloading","enablelazyload","multiplebyrow","deferloading","addvideomediatype","hidecontainerbeforeloaded",
"hidecontaineroninit","fullwidth","sameheight","sameheightresponsive","newestfirst","centerimage","fitimage","fitcenterimage","fixaspectratio","autoplay","random","circular","pauseonmouseover","continuous","responsive","showhoveroverlay","showhoveroverlayalways","hidehoveroverlayontouch","lightboxresponsive","lightboxshownavigation","lightboxnogroup","lightboxshowtitle","lightboxshowdescription","lightboxaddsocialmedia","usescreenquery","donotinit","addinitscript","lightboxshowsocial","lightboxshowemail",
"lightboxshowfacebook","lightboxshowtwitter","lightboxshowpinterest","lightboxsocialrotateeffect","showimgtitle","addwoocommerceclass","donotcircularforless","removeinlinecss","limitvisibleitemstolength","hidearrowsandbulletsforonepage","showfirstlasthalf","showimagehoverovereffect","verticalflexheight","hidebulletssmallscreen","lightboxinityoutube","lightboxinitvimeo","lightboximagekeepratio","showplayvideo","triggerresize","doshortcodeontext","lightboxfullscreenmode","lightboxcloseonoverlay","lightboxvideohidecontrols",
"lightboxautoslide","lightboxshowtimer","lightboxshowplaybutton","lightboxalwaysshownavarrows","lightboxshowtitleprefix"];for(i=0;i<boolOptions.length;i++)if(wonderplugin_carousel_config[boolOptions[i]]!==true&&wonderplugin_carousel_config[boolOptions[i]]!==false)wonderplugin_carousel_config[boolOptions[i]]=wonderplugin_carousel_config[boolOptions[i]]&&wonderplugin_carousel_config[boolOptions[i]].toLowerCase()==="true";if(wonderplugin_carousel_config.dataoptions&&wonderplugin_carousel_config.dataoptions.length>
0)wonderplugin_carousel_config.dataoptions=wonderplugin_carousel_config.dataoptions.replace(/\\"/g,'"').replace(/\\'/g,"'");var printConfig=function(){$("#wonderplugin-newestfirst").prop("checked",wonderplugin_carousel_config.newestfirst);$("#wonderplugin-carousel-name").val(wonderplugin_carousel_config.name);updateMediaTable();$(".wonderplugin-tab-skin").find("img").removeClass("selected");$("input:radio[name=wonderplugin-carousel-skin][value="+wonderplugin_carousel_config.skin+"]").prop("checked",
true);$("input:radio[name=wonderplugin-carousel-skin][value="+wonderplugin_carousel_config.skin+"]").parent().find("img").addClass("selected");printSkinOptions(wonderplugin_carousel_config);$("#wonderplugin-carousel-deferloading").prop("checked",wonderplugin_carousel_config.deferloading);$("#wonderplugin-carousel-deferloadingdelay").val(wonderplugin_carousel_config.deferloadingdelay);$("#wonderplugin-carousel-enablelazyload").prop("checked",wonderplugin_carousel_config.enablelazyload);$("#wonderplugin-carousel-usebase64").prop("checked",
wonderplugin_carousel_config.usebase64);$("#wonderplugin-carousel-limitvisibleitemstolength").prop("checked",wonderplugin_carousel_config.limitvisibleitemstolength);$("#wonderplugin-carousel-hidearrowsandbulletsforonepage").prop("checked",wonderplugin_carousel_config.hidearrowsandbulletsforonepage);$("#wonderplugin-carousel-addpreloading").prop("checked",wonderplugin_carousel_config.addpreloading);$("input:radio[name=wonderplugin-carousel-preloadingimagemode][value="+wonderplugin_carousel_config.preloadingimagemode+
"]").prop("checked",true);if(wonderplugin_carousel_config.preloadingimagemode=="custom"){$("#wonderplugin-carousel-custompreloadingimage").val(wonderplugin_carousel_config.preloadingimage);$("#wonderplugin-carousel-displaypreloadingimage").attr("src",wonderplugin_carousel_config.preloadingimage)}else{$("#wonderplugin-carousel-preloadingimage").val(wonderplugin_carousel_config.preloadingimage);$("#wonderplugin-carousel-displaypreloadingimage").attr("src",$("#wonderplugin-carousel-jsfolder").text()+
wonderplugin_carousel_config.preloadingimage)}$("#wonderplugin-carousel-multiplebyrow").prop("checked",wonderplugin_carousel_config.multiplebyrow);$("#wonderplugin-carousel-aextraprops").val(wonderplugin_carousel_config.aextraprops);$("#wonderplugin-carousel-imgextraprops").val(wonderplugin_carousel_config.imgextraprops);$("#wonderplugin-carousel-showimgtitle").prop("checked",wonderplugin_carousel_config.showimgtitle);$("#wonderplugin-carousel-imgtitle").val(wonderplugin_carousel_config.imgtitle);
$("#wonderplugin-carousel-addwoocommerceclass").prop("checked",wonderplugin_carousel_config.addwoocommerceclass);$("#wonderplugin-carousel-addvideomediatype").prop("checked",wonderplugin_carousel_config.addvideomediatype);$("#wonderplugin-carousel-showplayvideo").prop("checked",wonderplugin_carousel_config.showplayvideo);$("input:radio[name=wonderplugin-carousel-playvideoimagemode][value="+wonderplugin_carousel_config.playvideoimagemode+"]").prop("checked",true);if(wonderplugin_carousel_config.playvideoimagemode==
"custom"){$("#wonderplugin-carousel-customplayvideoimage").val(wonderplugin_carousel_config.playvideoimage);$("#wonderplugin-carousel-displayplayvideoimage").attr("src",wonderplugin_carousel_config.playvideoimage)}else{$("#wonderplugin-carousel-playvideoimage").val(wonderplugin_carousel_config.playvideoimage);$("#wonderplugin-carousel-displayplayvideoimage").attr("src",$("#wonderplugin-carousel-jsfolder").text()+wonderplugin_carousel_config.playvideoimage)}$("#wonderplugin-carousel-playvideoimagepos").val(wonderplugin_carousel_config.playvideoimagepos);
$("#wonderplugin-carousel-custom-css").val(wonderplugin_carousel_config.customcss);$("#wonderplugin-carousel-data-options").val(wonderplugin_carousel_config.dataoptions);$("#wonderplugin-carousel-customjs").val(wonderplugin_carousel_config.customjs);$("#wonderplugin-carousel-lightboxresponsive").prop("checked",wonderplugin_carousel_config.lightboxresponsive);$("#wonderplugin-carousel-lightboxshownavigation").prop("checked",wonderplugin_carousel_config.lightboxshownavigation);$("#wonderplugin-carousel-lightboxnogroup").prop("checked",
wonderplugin_carousel_config.lightboxnogroup);$("#wonderplugin-carousel-lightboxshowtitle").prop("checked",wonderplugin_carousel_config.lightboxshowtitle);$("#wonderplugin-carousel-lightboxshowdescription").prop("checked",wonderplugin_carousel_config.lightboxshowdescription);$("#wonderplugin-carousel-lightboxaddsocialmedia").prop("checked",wonderplugin_carousel_config.lightboxaddsocialmedia);$("#wonderplugin-carousel-lightboxthumbwidth").val(wonderplugin_carousel_config.lightboxthumbwidth);$("#wonderplugin-carousel-lightboxthumbheight").val(wonderplugin_carousel_config.lightboxthumbheight);
$("#wonderplugin-carousel-lightboxthumbtopmargin").val(wonderplugin_carousel_config.lightboxthumbtopmargin);$("#wonderplugin-carousel-lightboxthumbbottommargin").val(wonderplugin_carousel_config.lightboxthumbbottommargin);$("#wonderplugin-carousel-lightboxbarheight").val(wonderplugin_carousel_config.lightboxbarheight);$("#wonderplugin-carousel-lightboxtitlebottomcss").val(wonderplugin_carousel_config.lightboxtitlebottomcss);$("#wonderplugin-carousel-lightboxdescriptionbottomcss").val(wonderplugin_carousel_config.lightboxdescriptionbottomcss);
$("#wonderplugin-carousel-lightboxvideohidecontrols").prop("checked",wonderplugin_carousel_config.lightboxvideohidecontrols);$("#wonderplugin-carousel-lightboxinityoutube").prop("checked",wonderplugin_carousel_config.lightboxinityoutube);$("#wonderplugin-carousel-lightboxinitvimeo").prop("checked",wonderplugin_carousel_config.lightboxinitvimeo);$("#wonderplugin-carousel-lightboxfullscreenmode").prop("checked",wonderplugin_carousel_config.lightboxfullscreenmode);$("#wonderplugin-carousel-lightboxcloseonoverlay").prop("checked",
wonderplugin_carousel_config.lightboxcloseonoverlay);$("#wonderplugin-carousel-lightboxtitlestyle").val(wonderplugin_carousel_config.lightboxtitlestyle);$("#wonderplugin-carousel-lightboximagepercentage").val(wonderplugin_carousel_config.lightboximagepercentage);$("#wonderplugin-carousel-lightboxdefaultvideovolume").val(wonderplugin_carousel_config.lightboxdefaultvideovolume);$("#wonderplugin-carousel-lightboxoverlaybgcolor").val(wonderplugin_carousel_config.lightboxoverlaybgcolor);$("#wonderplugin-carousel-lightboxoverlayopacity").val(wonderplugin_carousel_config.lightboxoverlayopacity);
$("#wonderplugin-carousel-lightboxbgcolor").val(wonderplugin_carousel_config.lightboxbgcolor);$("#wonderplugin-carousel-lightboxtitleprefix").val(wonderplugin_carousel_config.lightboxtitleprefix);$("#wonderplugin-carousel-lightboxtitleinsidecss").val(wonderplugin_carousel_config.lightboxtitleinsidecss);$("#wonderplugin-carousel-lightboxdescriptioninsidecss").val(wonderplugin_carousel_config.lightboxdescriptioninsidecss);$("#wonderplugin-carousel-lightboxadvancedoptions").val(wonderplugin_carousel_config.lightboxadvancedoptions);
$("#wonderplugin-carousel-lightboxautoslide").prop("checked",wonderplugin_carousel_config.lightboxautoslide);$("#wonderplugin-carousel-lightboxshowtimer").prop("checked",wonderplugin_carousel_config.lightboxshowtimer);$("#wonderplugin-carousel-lightboxshowplaybutton").prop("checked",wonderplugin_carousel_config.lightboxshowplaybutton);$("#wonderplugin-carousel-lightboxalwaysshownavarrows").prop("checked",wonderplugin_carousel_config.lightboxalwaysshownavarrows);$("#wonderplugin-carousel-lightboxshowtitleprefix").prop("checked",
wonderplugin_carousel_config.lightboxshowtitleprefix);$("#wonderplugin-carousel-lightboxslideinterval").val(wonderplugin_carousel_config.lightboxslideinterval);$("#wonderplugin-carousel-lightboxtimerposition").val(wonderplugin_carousel_config.lightboxtimerposition);$("#wonderplugin-carousel-lightboxtimerheight").val(wonderplugin_carousel_config.lightboxtimerheight);$("#wonderplugin-carousel-lightboxtimercolor").val(wonderplugin_carousel_config.lightboxtimercolor);$("#wonderplugin-carousel-lightboxtimeropacity").val(wonderplugin_carousel_config.lightboxtimeropacity);
$("#wonderplugin-carousel-lightboxbordersize").val(wonderplugin_carousel_config.lightboxbordersize);$("#wonderplugin-carousel-lightboxborderradius").val(wonderplugin_carousel_config.lightboxborderradius);$("#wonderplugin-carousel-lightboximagekeepratio").prop("checked",wonderplugin_carousel_config.lightboximagekeepratio);$("#wonderplugin-carousel-lightboxshowsocial").prop("checked",wonderplugin_carousel_config.lightboxshowsocial);$("#wonderplugin-carousel-lightboxsocialposition").val(wonderplugin_carousel_config.lightboxsocialposition);
$("#wonderplugin-carousel-lightboxsocialpositionsmallscreen").val(wonderplugin_carousel_config.lightboxsocialpositionsmallscreen);$("#wonderplugin-carousel-lightboxsocialdirection").val(wonderplugin_carousel_config.lightboxsocialdirection);$("#wonderplugin-carousel-lightboxsocialbuttonsize").val(wonderplugin_carousel_config.lightboxsocialbuttonsize);$("#wonderplugin-carousel-lightboxsocialbuttonfontsize").val(wonderplugin_carousel_config.lightboxsocialbuttonfontsize);$("#wonderplugin-carousel-lightboxsocialrotateeffect").prop("checked",
wonderplugin_carousel_config.lightboxsocialrotateeffect);$("#wonderplugin-carousel-lightboxshowfacebook").prop("checked",wonderplugin_carousel_config.lightboxshowfacebook);$("#wonderplugin-carousel-lightboxshowtwitter").prop("checked",wonderplugin_carousel_config.lightboxshowtwitter);$("#wonderplugin-carousel-lightboxshowpinterest").prop("checked",wonderplugin_carousel_config.lightboxshowpinterest);$("#wonderplugin-carousel-lightboxshowemail").prop("checked",wonderplugin_carousel_config.lightboxshowemail);
$("#wonderplugin-carousel-donotinit").prop("checked",wonderplugin_carousel_config.donotinit);$("#wonderplugin-carousel-addinitscript").prop("checked",wonderplugin_carousel_config.addinitscript);$("#wonderplugin-carousel-doshortcodeontext").prop("checked",wonderplugin_carousel_config.doshortcodeontext);$("#wonderplugin-carousel-removeinlinecss").prop("checked",wonderplugin_carousel_config.removeinlinecss);$("#wonderplugin-carousel-triggerresize").prop("checked",wonderplugin_carousel_config.triggerresize);
$("#wonderplugin-carousel-triggerresizedelay").val(wonderplugin_carousel_config.triggerresizedelay)};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}}})}});$.wpcarouselCookie=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};$.wpcarouselRemoveCookie=function(key){return $.wpcarouselCookie(key,"",$.extend({},{expires:-1}))}})(jQuery);