Sync A World You Want To Explore

関 信浩が2002年から書き続けるブログ。ソーシャルメディア黎明期の日本や米国の話題を、元・記者という視点と、スタートアップ企業の経営者というインサイダーの立場を駆使して、さまざまな切り口で執筆しています

toolbars.gif
エントリー画面では太字にしたりURLを埋め込んだりするボタンがついていますが、コメントには標準ではありません。

そこで、mt-plugins.orgにあるような、コメントにはURLなどを埋め込めるモジュールを作ってみました。一部よけない部分がはいっていますが、自分のテンプレートに埋め込む場所を探るために使ってください(<MTEntryIfAllowComments>などで探ってみてください)。

あ、mt-plugins.orgを参考にしたので太字やイタリックはつけませんでしたが、必要なら追加します。

<style type="text/css"><!--
#toolbar {
width: 400px;
margin: 0px;
padding: 0px;
background: buttonface;
text-align:right;
border-top: 1px solid buttonhighlight;
border-left: 1px solid buttonhighlight;
border-bottom: 1px solid buttonshadow;
border-right: 1px solid buttonshadow;
}
.button {
background: buttonface;
border: 1px solid buttonface;
margin: 1;
}
.raised {
border-top: 1px solid buttonhighlight;
border-left: 1px solid buttonhighlight;
border-bottom: 1px solid buttonshadow;
border-right: 1px solid buttonshadow;
background: buttonface;
margin:1;
}
.pressed {
border-top: 1px solid buttonshadow;
border-left: 1px solid buttonshadow;
border-bottom: 1px solid buttonhighlight;
border-right: 1px solid buttonhighlight;
background: buttonface;
margin:1;
}
--></style>
<MTEntryIfAllowComments>
<MTEntryIfCommentsOpen>

<div class="comments-head">
Post a comment
</div>

<div class="comments-body">
<form method="post" action="<$MTCGIPath$><$MTCommentScript$>" name="comments_form" onsubmit="if (this.bakecookie[0].checked) rememberMe(this)">
<input type="hidden" name="static" value="1" />
<input type="hidden" name="entry_id" value="<$MTEntryID$>" />
<div style="width:180px; padding-right:15px; margin-right:15px; float:left; text-align:left; border-right:1px dotted #bbb;">
<label for="author">Name:</label><br />
<input tabindex="1" id="author" name="author" /><br /><br />

<label for="email">Email Address:</label><br />
<input tabindex="2" id="email" name="email" /><br /><br />

<label for="url">URL:</label><br />
<input tabindex="3" id="url" name="url" /><br /><br />
</div>

Remember personal info?<br />
<input type="radio" id="bakecookie" name="bakecookie" /><label for="bakecookie">Yes</label><input type="radio" id="forget" name="bakecookie" onclick="forgetMe(this.form)" value="Forget Info" style="margin-left: 15px;" /><label for="forget">No</label><br style="clear: both;" />
<label for="text">Comments:</label><br />
<div id="toolbar">
<img class="button" onmouseover="mouseover(this);" onmouseout="mouseout(this);" onmousedown="mousedown(this);" onmouseup="mouseup(this);" onclick="format_quote()" src="http://www.syncworld.net/mttrial-statics/images/quote.gif" width="20" height="16" align="middle" alt="引用形式にします" /><img class="button" onmouseover="mouseover(this);" onmouseout="mouseout(this);" onmousedown="mousedown(this);" onmouseup="mouseup(this);" onclick="deCode()" src="http://www.syncworld.net/mttrial-statics/images/decode.gif" width="20" height="16" align="middle" alt="プログラム・コード形式にします" /><img class="button" onmouseover="mouseover(this);" onmouseout="mouseout(this);" onmousedown="mousedown(this);" onmouseup="mouseup(this);" onclick="format_code()" src="http://www.syncworld.net/mttrial-statics/images/code.gif" width="20" height="16" align="middle" alt="タグ文字をHTML形式に変換します" /><img class="button" onmouseover="mouseover(this);" onmouseout="mouseout(this);" onmousedown="mousedown(this);" onmouseup="mouseup(this);" onclick="format_me('b');" src="http://www.syncworld.net/mttrial-statics/images/bold.gif" width="16" height="16" align="middle" alt="太字にします" /><img class="button" onmouseover="mouseover(this);" onmouseout="mouseout(this);" onmousedown="mousedown(this);" onmouseup="mouseup(this);" onclick="format_me('i');" src="http://www.syncworld.net/mttrial-statics/images/italic.gif" width="16" height="16" align="middle" alt="イタリック体にします" /><img class="button" onmouseover="mouseover(this);" onmouseout="mouseout(this);" onmousedown="mousedown(this);" onmouseup="mouseup(this);" onclick="insert_link();" src="http://www.syncworld.net/mttrial-statics/images/link.gif" width="32" height="16" align="middle" alt="リンクを作成します" />
</div>

<textarea tabindex="4" id="text" name="text" rows="10" cols="50"></textarea><br /><br />

<input type="submit" name="preview" value=" Preview " />
<input style="font-weight: bold;" type="submit" name="post" value=" Post " /><br /><br />

</form>

<script type="text/javascript" language="javascript">
<!--
document.comments_form.email.value = getCookie("mtcmtmail");
document.comments_form.author.value = getCookie("mtcmtauth");
document.comments_form.url.value = getCookie("mtcmthome");
if (getCookie("mtcmtauth")) {
document.comments_form.bakecookie[0].checked = true;
} else {
document.comments_form.bakecookie[1].checked = true;
}
//-->
</script>
</div>
</MTEntryIfCommentsOpen>
</MTEntryIfAllowComments>