阅读:3100回复:10
[求助]不能用Ctrl+Enter 提交贴子,有办法解决吗?
很多论坛里用的都是Ctrl+Enter 的快捷键,但是firefox好像用不了了
|
|
1楼#
发布于:2008-04-18 13:22
怎么不行?我的回复一直都是用C+E快捷键的啊。这个也是。除非论坛设置的快捷键不是C+E
|
|
2楼#
发布于:2008-04-18 13:22
|
|
3楼#
发布于:2008-04-18 13:22
本论坛我可以用CTLR+ENTER
但其他的就用不了 |
|
4楼#
发布于:2008-04-18 13:22
可能是其他论坛用了ie-only的方法
|
|
5楼#
发布于:2008-04-18 13:22
|
|
|
6楼#
发布于:2008-04-18 13:22
我习惯alt+s,比如我们的坛子。。。
|
|
|
7楼#
发布于:2008-04-18 13:22
|
|
|
8楼#
发布于:2008-04-18 13:22
// Ctrl+Enter Submits // version 0.4 // 2005-09-26 // home: http://clear.com.ua/projects/firefox/ctrl_enter // Copyright (c) 2005, Tim Babych // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html // // -------------------------------------------------------------------- // // This is a Greasemonkey user script. // // To install, you need Greasemonkey: http://greasemonkey.mozdev.org/ // Then restart Firefox and revisit this script. // Under Tools, there will be a new menu item to "Install User Script". // Accept the default configuration and install. // // To uninstall, go to Tools/Manage User Scripts, // select "Ctrl+Enter Submits", and click Uninstall. // // -------------------------------------------------------------------- // // Opera 8 compartible. // // To install, download it to some folder and chose this folder in // Tools > Preferences > Advanced > Content > Javascript Options // "My Javascript files" // Restart Opera // // To uninstall, remove the file from that folder. // // --------------------------------------------------------------------- // // ==UserScript== // @name Ctrl+Enter Submits // @description Allows submitting on Ctrl+Enter in any input and textarea // @include * // ==/UserScript== function zakavych(text) { replacements = [ // cyrillic quotes // [/(\s+|^)"([^\"]+?)"(\s+|$|\.|\,)/g, '$1\u00ab$2\u00bb$3'], // latin quotes "test" becomes smart quotes [/(\s+|^)"([^\"]+?)"(\s+|$|\.|\,)/g, '$1\u201c$2\u201d$3'], // ukrainian apostrophe [/([\u0406-\u0491])\*([\u0406-\u0491])/g, '$1\u2019$2'], // trademark (TM) and such [/\((tm|TM|\u0422\u041C|\u0442\u043C)\)/g, '\u2122'], // copyright (C) and such [/\([cC\u0421\u0441]\)/g, '\u00a9'], // registered (R) and such [/\([rR\u0420\u0440]\)/g, '\u00ae'], // mdash -- one or two minuses surrounded by spaces [/(\s+|^)--?(\s+)/g, '$1\u2014$2'], // **bold** [/\*{2}(.*)\*{2}/g, '<b>$1</b>'], // //italic// [/([^\:]|^)\/{2}(.*?)\/{2}/g, '$1<i>$2</i>'], // --strikeout-- [/([^\!]|^)-{2}(.*)-{2}/g, '$1<s>$2</s>'], // __underlined__ [/_{2}(.*)_{2}/g, '<u>$1</u>'], // ndash for number ranges: 1995-2005 [/(\d+)-(\d+)/g, '$1\u2013$2'], // ellipsis [/\.\.\./g, '\u2026'] ]; s = text for( i=0; i < replacements.length; i++) { s = s.replace(replacements[i][0], replacements[i][1]) } return s } function trigger_submit_on_ctrl_enter(e) { if ((e.keyCode==13) && (e.ctrlKey)) { p = this.parentNode i = 0 if (this.nodeName == 'TEXTAREA') this.value = zakavych(this.value) while (p.nodeName != 'FORM' && i++ < 100) p = p.parentNode if (p.nodeName == 'FORM') p.submit() } } if (document.evaluate) { // Firefox allInps = document.evaluate("//textarea | //select | //unput", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allInps.snapshotLength; i++) { t = allInps.snapshotItem(i); t.addEventListener("keydown", trigger_submit_on_ctrl_enter, 0); } } else { // Opera does not support XPath elemTags = ['textarea', 'select', 'input'] for(j = 0; j< elemTags.length; j++) { inps = document.getElementsByTagName(elemTags[j]) for (var i = 0; i < inps.length; i++) inps[i].addEventListener("keydown", trigger_submit_on_ctrl_enter, 0); } } 有些论坛还是不行,例如 http://hall.sociz.com/ |
|
9楼#
发布于:2008-04-18 13:22
|
|
|
10楼#
发布于:2008-04-18 13:22
是不是把JS禁用了所以這樣
|
|