芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/rigato.ycreate.site/wp-content/themes/swell/build/js/admin/ad_tag.min.js
!function(t){const{swellText:n}=window;console.log("SWELL: Loaded ad_tag.js."),t((function(){const a=t(".swl-meta--ad"),e=a.find(".p-adBox");t('input[name="ad_type"]').change((function(){const n=t(this).val();a.attr("data-adtype",n),e.attr("data-ad",n)})),t('[name="ad_name"]').on("input",(function(){let n=t(this).val();n||(n=t('[name="post_title"]').val()),e.find(".p-adBox__name").text(n),e.find(".p-adBox__title").text(n)})),t('[name="ad_price"]').on("input",(function(){const n=t(this).val();e.find(".p-adBox__price").text(n)})),t('[name="ad_desc"]').on("input",(function(){const n=t(this).val();e.find(".p-adBox__desc").text(n)})),t('[name="ad_border"]').change((function(){"on"===t(this).val()?(e.removeClass("-border-off"),e.addClass("-border-on")):(e.addClass("-border-off"),e.removeClass("-border-on"))})),t('[name="ad_rank"]').change((function(){const n=t(this).val();t(".p-adBox__title").attr("class","p-adBox__title -"+n)})),t('[name="ad_star"]').change((function(){const n=t(this).val();let a=parseFloat(n)||0;if(0===a)return void t(".p-adBox__star").html("");let e="";for(let t=0;5>t;t++)a-=1,e+=-.5===a?'
':0<=a?'
':'
';t(".p-adBox__star").html(e)})),t('[name="ad_btn1_text"]').on("input",(function(){const a=t(this).val()||n.enterText;e.find(".-btn1").text(a)})),t('[name="ad_btn2_text"]').on("input",(function(){const a=t(this).val()||n.enterText;e.find(".-btn2").text(a)})),t('[name="ad_btn1_url"]').on("input",(function(){t(this).val()?e.find(".-btn1").removeClass("u-none"):e.find(".-btn1").addClass("u-none")})),t('[name="ad_btn2_url"]').on("input",(function(){t(this).val()?e.find(".-btn2").removeClass("u-none"):e.find(".-btn2").addClass("u-none")})),t(".swl-adDataResetBtn").on("click",(function(){if(window.confirm(n.resetConfirm)){const a=t(this).attr("data-id"),e=window.swlApiSettings.nonce;t.ajax({type:"POST",url:window.swellVars.restUrl+"swell-reset-ad-data",beforeSend(t){t.setRequestHeader("X-WP-Nonce",e)},data:{id:a}}).done((function(t){alert(t),location.reload()})).fail((function(){alert(n.resetFailed)}))}}))}))}(window.jQuery);