您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
HaloTracker 網站中文化
当前为
// ==UserScript== // @name HaloTracker中文化 // @namespace http://snake570.pixnet.net // @description HaloTracker 網站中文化 // @include http://www.residentevil.net/* // @exclude http://account.capcom.com/sc/terms_of_service.html // @copyright JoeSimmons(code), Wu Ting Yu(translate) // @version 151201 // @license http://creativecommons.org/licenses/by-nc-nd/3.0/us/ // ==/UserScript== var words = { /////////////////////////////////////////////////////// //範例:'被替換的字' : '要顯示的字', ' /////////////////////////////////////////////////////// "":""}; ////////////////////////////////////////////////////////////////////////////// // This is where the real code is // Don't edit below this ////////////////////////////////////////////////////////////////////////////// // prepareRegex by JoeSimmons // Used to take a string and ready it for use in new RegExp() String.prototype.prepareRegex = function() { return this.replace(/([\[\]\^\&\$\.\(\)\?\/\\\+\{\}\|])/g, "\\$1"); }; function isOkTag(tag) { return (",pre,blockquote,code,input,button,textarea".indexOf(","+tag) == -1); } var regexs=new Array(), replacements=new Array(); for(var word in words) { if(word != "") { regexs.push(new RegExp("\\b"+word.prepareRegex().replace(/\*/g,'[^ ]*')+"\\b", 'gi')); replacements.push(words[word]); } } var texts = document.evaluate(".//text()[normalize-space(.)!='']",document.body,null,6,null), text=""; for(var i=0,l=texts.snapshotLength; (this_text=texts.snapshotItem(i)); i++) { if(isOkTag(this_text.parentNode.tagName.toLowerCase()) && (text=this_text.textContent)) { for(var x=0,l=regexs.length; x<l; x++) { text = text.replace(regexs[x], replacements[x]); this_text.textContent = text; } } } $('#domain').change(function() { if (!this.sendToServer) { // some expando property I made up var that = this; this.sendToServer = setTimeout(function(that) { // use "that" as a reference to your element that fired the onchange. // Do your AJAX call here that.sendToServer = undefined; }, yourTimeoutTimeInMillis) } else { clearTimeout(this.sendToServer); } });