コメント装飾 load.js をカスタマイズ

※白背景部分の ソース等は ここ(Web上) で直接編集できます。 (IE,Firefox,Opera,Google Chrome 等 対応)

arinogotokuatumarite/ari_r_load.js

// * 仮タグ挿入スクリプト // * 深月@FC2 // * 改変: paruparu (ありのごとくあつまりて) // * http://arinogotokuatumarite.blog19.fc2.com/ // * http://arinogotokuatumarite.blog19.fc2.com/blog-entry-74.html // 実際の変数を挿入する function Tag(tag1,tag2,str){ var target = (document.getElementById('comment_form'))? document.getElementById('comment_form').comment : document.comment_form.comment; target.focus(); if (document.selection != null){ var sSel = document.selection.createRange().text; if (sSel) document.selection.createRange().text = tag1 + sSel + tag2; else document.selection.createRange().text = tag1 + str + tag2; }else if(target.selectionStart || target.selectionStart == '0'){ var s = target.selectionStart; var e = target.selectionEnd; var str2 = target.value.substring(s,e); if (str2) target.value = target.value.substring(0,s) + tag1 + str2 + tag2 + target.value.substring(e,target.value.length); else target.value = target.value.substring(0,s) + tag1 + str + tag2 + target.value.substring(e,target.value.length); target.focus(); }else{ target.value += tag1 + str + tag2; } return; } // 書き出す function Wrt(){ document.open(); document.write('<label title="太字の文が入ります"><input type="radio" name="moji" onClick="Tag(¥'[太字]¥',¥'[/太字]¥',¥'太字の文¥');" />[太字]</label>&nbsp;&nbsp;'); document.write('<label title="打ち消しの文が入ります"><input type="radio" name="moji" onClick="Tag(¥'[打消]¥',¥'[/打消]¥',¥'打ち消しの文¥');" />[打消]</label>&nbsp;&nbsp;'); document.write('<label title="色付きの文が入ります"><input type="radio" name="moji" onClick="Tag(¥'[色:cc3366]¥',¥'[/色]¥',¥'色付きの文¥');" />[色:<span style="color:#cc3366">赤</span>]</label>'); document.write('<label title="色付きの文が入ります"><input type="radio" name="moji" onClick="Tag(¥'[色:339966]¥',¥'[/色]¥',¥'色付きの文¥');" />[色:<span style="color:#339966">緑</span>]</label>'); document.close(); } // width,heightの設定 function Set(e,e2){ var bobj = (document.all)? document.all(e): document.getElementById(e); var lp = 0; var tp = 0; while(bobj){ lp += bobj.offsetLeft; tp += bobj.offsetTop; bobj = bobj.offsetParent; } } // 読み込んだ時に書き出し Wrt();

© ありのごとくあつまりて http://arinogotokuatumarite.blog19.fc2.com/