/* |-------------------------------------------------------------------------- | SkyCaiji (蓝天采集器) |-------------------------------------------------------------------------- | Copyright (c) 2018 https://www.skycaiji.com All rights reserved. |-------------------------------------------------------------------------- | 使用协议 https://www.skycaiji.com/licenses |-------------------------------------------------------------------------- */ 'use strict';function admincpInit(){var bodyWidth=$(document.body).width();var admincp_skin=getCookie('admincp_skin');if(admincp_skin){$('body').removeClass('skin-blue').addClass(admincp_skin)} if(bodyWidth>767){var admincp_sd_mini=getCookie('admincp_sd_mini');if(admincp_sd_mini==1){$('body').addClass('sidebar-collapse').addClass('sidebar-mini')}} $(document).ready(function(){$('#treeview_skins').bind('click',function(){if($('#sidebar_skins').html().length<=0){initSkins()}});if(bodyWidth>767){if(admincp_sd_mini==1){$('#chk_sidebar_mini').attr('checked','checked')} $('#chk_sidebar_mini').bind('click',function(){var setMini=0;if($(this).is(':checked')){$('body').addClass('sidebar-collapse').addClass('sidebar-mini');setMini=1}else{$('body').removeClass('sidebar-collapse').removeClass('sidebar-mini')} setCookie('admincp_sd_mini',setMini,30)});$('.sidebar-toggle[data-toggle="push-menu"]').bind('click',function(){$('body').addClass('sidebar-mini')})}else{$('#chk_sidebar_mini').parents('li').eq(0).hide()} if($('#menu_backstage_task')){$('#menu_backstage_task').bind('click',function(){windowModal('后台任务',ulink('admin/backstage/backstageTask'),{lg:1})});backstageTask()}})} function insertAtCaret(myField,myValue){var curObj=myField[0];if(document.selection){myField.focus();var sel=document.selection.createRange();sel.text=myValue;sel.select()}else if(curObj.selectionStart||curObj.selectionStart=='0'){var startPos=curObj.selectionStart;var endPos=curObj.selectionEnd;var restoreTop=curObj.scrollTop;var value=myField.val();value=value.substring(0,startPos)+myValue+value.substring(endPos,value.length);myField.val(value);myField.focus();curObj.selectionStart=startPos+myValue.length;curObj.selectionEnd=startPos+myValue.length}else{myField.val(myField.val()+myValue);myField.focus()}} function initSkins(){var $skinsList=$('