{include file='include/colorbox.inc.tpl'} {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} {combine_script id='jquery.confirm' load='footer' require='jquery' path='themes/default/js/plugins/jquery-confirm.min.js'} {combine_css path="themes/default/js/plugins/jquery-confirm.min.css"} {footer_script} const title_msg = '{'Are you sure you want to delete this theme?'|@translate|@escape:'javascript'}'; const confirm_msg = '{"Yes, I am sure"|@translate}'; const cancel_msg = "{"No, I have changed my mind"|@translate}"; $(".delete-theme-button").each(function() { let theme_name = $(this).closest(".themeBox").find(".themeName").attr("title"); let title = '{'Are you sure you want to delete the theme "%s"?'|@translate|@escape:'javascript'}'; $(this).pwg_jconfirm_follow_href({ alert_title: title.replace("%s", theme_name), alert_confirm: confirm_msg, alert_cancel: cancel_msg }); }); {/footer_script} {footer_script}{literal} jQuery(document).ready(function() { $("a.preview-box").colorbox(); $(document).mouseup(function (e) { e.stopPropagation(); if (!$(event.target).hasClass('showInfo')) { $('.showInfo-dropdown').fadeOut(); } }); }); $(window).bind("load", function() { $('.themeBox').each(function() { let box = $(this); box.find('.showInfo').on('click', function() { let dropdown = box.find('.showInfo-dropdown'); $('.showInfo-dropdown').each(function() { if ($(this) !== dropdown) { $(this).fadeOut(); } }) box.find('.showInfo-dropdown').fadeToggle(); }); let screenImage = $(this).find(".preview-box img"); let imageW = screenImage.innerWidth(); let imageH = screenImage.innerHeight(); let size = $(this).find(".preview-box").innerWidth(); if (imageW > imageH) { screenImage.css('height', size+'px'); screenImage.css('width', (imageW * size / imageH)+'px'); } else { screenImage.css('width', size+'px'); screenImage.css('heigth', (imageH * size / imageW)+'px'); } }) }) {/literal}{/footer_script}