| No | タイトル | ステータス | 重要度 | 担当 | 完了予定日 | 更新日時 | 記事数 |
|---|---|---|---|---|---|---|---|
| 40 | #Plugin [Lunascape 正式版] ダミープラグ(イン) | 進行中 | 高 | AO | 未定 | 2010-03-07 12:54 | 11 |
|
|---|
| //ダミープラグ(イン)用ユーザスクリプト //検索バーに入力されている文字列(言葉)をハイライト表示する //フレームの処理をしていないので、フレームを使ったページではエラーになります // ==UserScript== // @include * // @type outer_script // ==/UserScript== function dummy_main(doc,win){ document = doc; window = win; if(document != null && document.readyState == 'complete'){ // //ここからユーザースクリプト本体。無名関数によってくくられている。 (function () { var strSearchBar; var strWord; var colors = new Array('#FFFF00','#00FFFF','#00FF00','#FF00FF','#FF69B4','#A52A2A','#B8860B','#0000CD'); var n = 0; strSearchBar = Lunascape.SearchBarString; strSearchBar = replace_space(strSearchBar); strWord = strSearchBar.split(" "); for(i = 0; i < strWord.length; i = i +1){ strWord[i] = trim(strWord[i]); if(strWord[i] != ""){ var seleRng = document.body.createTextRange(); while(seleRng.findText(strWord[i])){ var retStr = seleRng.text; var paste_HTML = '<span style=background-color:' + colors[n] + '>' + retStr + '</span>'; seleRng.pasteHTML(paste_HTML); } n = n + 1; if(n > 7){n = 0;} } } function replace_space(strSearchBar){ temp = strSearchBar.replace(" "," "); if(temp.indexOf(" ",0) > -1){ replace_space(temp); } return temp; } function trim(temp){ temp = temp.replace(" ",""); if(temp.indexOf(" ",0) > -1){ replace_space(temp); } return temp } })(); //ここまで // } } |
|