diff options
author | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-05-19 11:19:57 +0300 |
---|---|---|
committer | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-05-19 11:19:57 +0300 |
commit | a2a6357fd5acd2d3cd647601dad08dc08341ad93 (patch) | |
tree | c24caafdf5812d144b77e3cbeae02289179681e5 /phpBB/styles | |
parent | b8afef5df032ea06239798898112e5f79d823772 (diff) | |
download | forums-a2a6357fd5acd2d3cd647601dad08dc08341ad93.tar forums-a2a6357fd5acd2d3cd647601dad08dc08341ad93.tar.gz forums-a2a6357fd5acd2d3cd647601dad08dc08341ad93.tar.bz2 forums-a2a6357fd5acd2d3cd647601dad08dc08341ad93.tar.xz forums-a2a6357fd5acd2d3cd647601dad08dc08341ad93.zip |
[ticket/11556] Remove fallback JS
PHPBB3-11556
Diffstat (limited to 'phpBB/styles')
-rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 23450d910b..781c2ed31f 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -364,41 +364,22 @@ function submit_default_button(event, selector, class_name) { * The non-jQuery code is a mimick of the jQuery code ;) */ function apply_onkeypress_event() { - // jQuery code in case jQuery is used - if (jquery_present) { - jQuery('form input[type=text], form input[type=password]').live('keypress', function (e) { - var default_button = jQuery(this).parents('form').find('input[type=submit].default-submit-action'); - - if (!default_button || default_button.length <= 0) { - return true; - } - - if (phpbb_check_key(e)) { - return true; - } - - if ((e.which && e.which === 13) || (e.keyCode && e.keyCode === 13)) { - default_button.click(); - return false; - } + jQuery('form input[type=text], form input[type=password]').live('keypress', function (e) { + var default_button = jQuery(this).parents('form').find('input[type=submit].default-submit-action'); + if (!default_button || default_button.length <= 0) { return true; - }); - - return; - } + } - var input_tags = document.getElementsByTagName('input'); + if (phpbb_check_key(e)) { + return true; + } - for (var i = 0, element = input_tags[0]; i < input_tags.length ; element = input_tags[++i]) { - if (element.type === 'text' || element.type === 'password') { - // onkeydown is possible too - element.onkeypress = function (evt) { submit_default_button((evt || window.event), this, 'default-submit-action'); }; + if ((e.which && e.which === 13) || (e.keyCode && e.keyCode === 13)) { + default_button.click(); + return false; } - } -} -/** -* Detect JQuery existance. We currently do not deliver it, but some styles do, so why not benefit from it. ;) -*/ -var jquery_present = typeof jQuery === 'function'; + return true; + }); +} |