1(function($) { 2 $('#CFP_plugins_setting').on('change','.plugin_swtich',function(){ 3 var _this = $(this), 4 key = _this.attr('key'), 5 isChecked = _this.is(':checked'); 6 7 if (_this.hasClass('load')) return false; 8 _this.addClass('load'); 9 global_obj.auto_alert('Loading','loading',-1); 10 11 $.post(ajax_object.ajax_url,{action:'infility_global_ajax',do_action:'plugin_swtich',key:key,isChecked:(isChecked?1:0)},function(data){ 12 if (data.ret==1) { 13 global_obj.auto_alert(data.msg,'success'); 14 15 // 宿¶æ´æ°UIï¼æ ¹æ®å¼å ³ç¶ææ´æ°å·¦è¾¹æ é¢çæ¾ç¤º 16 var titleCell = _this.closest('tr').find('td:nth-child(2)'); 17 var currentTitle = titleCell.text().trim(); 18 19 if (isChecked) { 20 // å¼å¯ç¶æï¼å¦æå½åæ¯çº¯ææ¬ï¼è½¬æ¢ä¸ºé¾æ¥ 21 if (titleCell.find('a').length === 0) { 22 // æå»ºè®¾ç½®é¡µé¢é¾æ¥ 23 var currentUrl = window.location.href.split('&set_type')[0]; 24 var setType = key + '|' + getPluginHref(key); 25 if (setType.indexOf('|') > 0 && setType.split('|')[1]) { 26 var linkUrl = currentUrl + '&set_type=' + setType; 27 titleCell.html('<a href="' + linkUrl + '">' + currentTitle + '</a>'); 28 } 29 } 30 } else { 31 // å ³éç¶æï¼å¦æå½åæ¯é¾æ¥ï¼è½¬æ¢ä¸ºçº¯ææ¬ 32 if (titleCell.find('a').length > 0) { 33 titleCell.html(currentTitle); 34 } 35 } 36 }else{ 37 global_obj.auto_alert(data.msg,'fail'); 38 } 39 _this.removeClass('load'); 40 },'json') 41 }) 42 43 // è·åæä»¶çhrefé ç½® 44 function getPluginHref(key) { 45 var pluginHrefs = { 46 'CFP': 'CFP_setting_page', 47 '301jump': 'redirect_setting_page', 48 'ChatTool': 'chat_tool_setting_page', 49 'ConsentMode': 'consent_mode_setting_page', 50 'InfilityForm': 'setting_page', 51 'TranslateTool': 'translate_tool_setting_page', 52 'PreventCopying': 'prevent_copying_setting_page', 53 'BlockIp': 'block_ip_setting_page', 54 'InfilityImportData': 'import_data_setting_page', 55 'ShowControlData': 'show_control_data_setting_page', 56 'TranslatepressTools': 'setting_page' 57 }; 58 return pluginHrefs[key] || ''; 59 } 60})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.