/* |-------------------------------------------------------------------------- | 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=$('
'+window.tpl_lang.skin_blue+'
');$skinsList.append($skinBlue);var $skinBlack=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_black+'
');$skinsList.append($skinBlack);var $skinPurple=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_purple+'
');$skinsList.append($skinPurple);var $skinGreen=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_green+'
');$skinsList.append($skinGreen);var $skinRed=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_red+'
');$skinsList.append($skinRed);var $skinYellow=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_yellow+'
');$skinsList.append($skinYellow);var $skinBlueLight=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_blue_light+'
');$skinsList.append($skinBlueLight);var $skinBlackLight=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_black_light+'
');$skinsList.append($skinBlackLight);var $skinPurpleLight=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_purple_light+'
');$skinsList.append($skinPurpleLight);var $skinGreenLight=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_green_light+'
');$skinsList.append($skinGreenLight);var $skinRedLight=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_red_light+'
');$skinsList.append($skinRedLight);var $skinYellowLight=$('',{style:'float:left; width: 33.33333%; padding: 5px;'}).append(''+''+window.tpl_lang.skin_yellow_light+'
');$skinsList.append($skinYellowLight);$('#sidebar_skins').html($skinsList);var mySkins=new Array('skin-blue','skin-black','skin-red','skin-yellow','skin-purple','skin-green','skin-blue-light','skin-black-light','skin-red-light','skin-yellow-light','skin-purple-light','skin-green-light');$('#sidebar_skins li a[data-skin]').bind('click',function(){var skin=$(this).attr('data-skin');for(var i in mySkins){$('body').removeClass(mySkins[i])} $('body').addClass(skin);setCookie('admincp_skin',skin,30)})} function cpMatch(toObj,options){if(!options){options={}} var sign=window.tpl_lang.sign_match;var group='(?