<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>木木木木木 &#187; 快捷留言</title>
	<atom:link href="http://immmmm.com/tag/%e5%bf%ab%e6%8d%b7%e7%95%99%e8%a8%80/feed" rel="self" type="application/rss+xml" />
	<link>http://immmmm.com</link>
	<description>不问明天，悠然浪费</description>
	<lastBuildDate>Mon, 21 May 2012 12:03:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>实现 Ctrl+Enter 快捷发表留言功能</title>
		<link>http://immmmm.com/add-quick-messages-published.html</link>
		<comments>http://immmmm.com/add-quick-messages-published.html#comments</comments>
		<pubDate>Mon, 15 Dec 2008 08:08:16 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[WordPress技巧]]></category>
		<category><![CDATA[快捷留言]]></category>
		<category><![CDATA[评论]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=997</guid>
		<description><![CDATA[    以前逛论坛逛多了，发表帖子写完后很熟练地按下 Ctrl+Enter ，就把帖子发出去了！迅速转向别的“战场”！现在喜欢到别人的博客上去踩踩，遇到自己感兴趣的就想写几句，写完后竟也不自觉地按下了 Ctrl+Enter ，当然 WP 不是 Discuz ，并没有默认这个小快捷键。于是不得不再去用鼠标点下 submit 。——实现 Ctrl+Enter 快捷发表留言功能   By 酋 长       今天介绍个个人认为最傻瓜最简单的方法，就是在comments.php的&#60;/form&#62;后面添加以下代码： &#60;script type=&#34;text/javascript&#34; language=&#34;javascript&#34;&#62; document.getElementById&#40;&#34;comment&#34;&#41;.onkeydown = function &#40;moz_ev&#41; &#123; var ev = null; if &#40;window.event&#41;&#123; ev = window.event; &#125;else&#123; ev = moz_ev; &#125; if &#40;ev != null &#38;&#38; ev.ctrlKey &#38;&#38; ev.keyCode == 13&#41; &#123; document.getElementById&#40;&#34;submit&#34;&#41;.click&#40;&#41;; &#125; &#125; &#60;/script&#62; [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>    以前逛论坛逛多了，发表帖子写完后很熟练地按下 Ctrl+Enter ，就把帖子发出去了！迅速转向别的“战场”！现在喜欢到别人的博客上去踩踩，遇到自己感兴趣的就想写几句，写完后竟也不自觉地按下了 Ctrl+Enter ，当然 WP 不是 Discuz ，并没有默认这个小快捷键。于是不得不再去用鼠标点下 submit 。——<a title="实现 Ctrl+Enter 快捷发表留言功能" href="http://www.wopus.org/using-ctrlenter-comments.html">实现 Ctrl+Enter 快捷发表留言功能</a>   By 酋 长</p></blockquote>
<p>      今天介绍个个人认为最傻瓜最简单的方法，就是在comments.php的<span style="color: #3366ff;">&lt;/form&gt;</span>后面添加以下代码：<br />
<span id="more-997"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span> language<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span>
document<span style="color: #339933;">.</span>getElementById<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;comment&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>onkeydown <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>moz_ev<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">var</span> ev <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>window<span style="color: #339933;">.</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        ev <span style="color: #339933;">=</span> window<span style="color: #339933;">.</span>event<span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
                        ev <span style="color: #339933;">=</span> moz_ev<span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>ev <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> ev<span style="color: #339933;">.</span>ctrlKey <span style="color: #339933;">&amp;&amp;</span> ev<span style="color: #339933;">.</span>keyCode <span style="color: #339933;">==</span> <span style="color: #cc66cc;">13</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                        document<span style="color: #339933;">.</span>getElementById<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;submit&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>click<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></pre></div></div>

<p>2009年3月28日补充：发现这里比我写的更详细，想对代码详细了解的请看这：<a href="http://bingu.net/512/wordpress-hack-use-ctrl-enter-submit-comment/">《WordPress中用Ctrl+Enter提交留言》</a></p>
<p>2009年7月9日补充：如果上述效果无效可尝试以下方法，找到comments.php文件中代码：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;"><span style="color: #339933;">&lt;</span>textarea name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment&quot;</span>  tabindex<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;4&quot;</span> <span style="color: #339933;">&gt;&lt;/</span>textarea<span style="color: #339933;">&gt;</span></pre></div></div>

<p>改成：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;"><span style="color: #339933;">&lt;</span>textarea name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment&quot;</span>  tabindex<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;4&quot;</span> onkeydown<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;if(event.ctrlKey&amp;&amp;event.keyCode==13){document.getElementById('submit').click();return false};&quot;</span><span style="color: #339933;">&gt;&lt;/</span>textarea<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/add-quick-messages-published.html/feed</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
	</channel>
</rss>

