/*** Created by A.J on 2019/9/12.*/$(document).ready(function(){$("#iconinput").val($("#iconid").html());$("#parentdrop a").each(function(){if($(this).data("val") == $("#parentid").val()){$("#parentbtn").text($(this).text());}});$("#delimage").on("click", function(){var obj = $(this);$.confirm({title: $("#quedingshanchu").text(),content: $("#bukehuifu").text(),buttons: {confirm: {text: $('#jixu').text(),btnClass: 'btn-info',keys: ['enter'],action: function () {obj.children("i:last").removeClass("d-none");$.post("delimage", { id: obj.data("id"), verification:$("#verification").text()},function(data){obj.children("i:last").addClass("d-none");if(data == 'ok'){obj.parent().remove();}else{$.alert({title: $('#chucuo').text(),content: data,buttons: {confirm: {text: $('#queding').text(),btnClass: 'btn-info',keys: ['enter']}}});}});}},cancel: {text: $('#quxiao').text(),btnClass: 'btn-default',keys: ['esc']}}});});if($('#islink').prop("checked")){$('#linkurl').removeClass("d-none");$('#modulediv').addClass("d-none");}else{$('#modulediv').removeClass("d-none");$('#linkurl').addClass("d-none");}if($("#selectedicon").html() != ""){var icon = $("#selectedicon").html(), size = 32, name = "";var wind = icon.indexOf(' width="') + 8;icon = icon.substr(wind);wind =icon.indexOf('"');if(wind > -1){size = icon.substr(0, wind);}wind =icon.indexOf(".svg#") + 5;icon = icon.substr(wind);wind =icon.indexOf('"');if(wind > -1){name = icon.substr(0, wind);}$("#icons").val($("#selectedicon").html());$("#iconsize").text(size);$("#iconinputdiv").addClass("d-none");$("#iconselect").removeClass("d-none");$("#changeicon").val(size);$("#currenticon").text(name);}});