≪ ログイン後でもTOPページにゲストページが表示される不具合の修正 | TOP | 文中の円マークについて ≫
2007年01月21日
エントリー投稿欄には簡易タグボタンが付いていますが、
よく使う<font color=""></font>がありません。
そこで色指定ボタンを追加しました。
ボタンの横に
が追加されます。
1.まず上の色ボタンをダウンロードし(右クリック→名前をつけて画像を保存)、
./mt-static/images
の中にアップロードします。
2../mt-static/mt.js の適当な場所(文末にでも)に
function FontColor (e, v) {
を追加
if (!canFormat) return;
var str = getSelected(e);
if (!str) return;
setSelection(e, '<font color="' + v + '">' + str + '</font>');
return false;
}
3../tmpl/cms/bm_entry.tmpl の382行目
write('<a title="<MT_TRANS phrase="Bold">" href="#" onclick="return formatStr(document.entry_form.text, \'strong\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/html-bold.gif" alt="<MT_TRANS phrase="Bold">" width="22" height="16" /></a>');
の上に write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text,\'#ff0000\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/red.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
を追加
write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text,\'#00ff00\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/green.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text,\'#0000ff\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/blue.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
4../tmpl/cms/edit_entry.tmpl の348行目
write('<a title="<MT_TRANS phrase="Italic">" href="#" onclick="return formatStr(document.entry_form.text, \'em\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/html-italic.gif" alt="<MT_TRANS phrase="Italic">" width="22" height="16" /></a>');
の上に
write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text,\'#ff0000\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/red.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
を追加
write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text,\'#00ff00\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/green.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text,\'#0000ff\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/blue.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
5.同じく ./tmpl/cms/edit_entry.tmpl の348行目
write('<a title="<MT_TRANS phrase="Bold">" href="#" onclick="return formatStr(document.entry_form.text_more, \'strong\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/html-bold.gif" alt="<MT_TRANS phrase="Bold">" width="22" height="16" /></a>');
の上に write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text_more,\'#ff0000\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/red.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
を追加
write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text_more,\'#00ff00\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/green.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
write('<a title="<MT_TRANS phrase="FontColor">" href="#" onclick="return FontColor(document.entry_form.text_more,\'#0000ff\')"><img src="<TMPL_VAR NAME=STATIC_URI>images/blue.gif" alt="<MT_TRANS phrase="FontColor">" width="22" height="16" /></a>');
他の色を追加したいときは画像と、3.4.5にその色の行を追加すればOKです。
トラックバック
このエントリーのトラックバックURL:
http://open.free-creator.com/mt-tb.cgi/156