From 3e237f164bf033f2d8252a3558091c8792a2b93e Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 2 Mar 2011 03:57:58 +0000 Subject: [PATCH] (follow-up r80554) If person typed max amount in edit summary, backspace didn't work on some versions of opera This still doesn't recognize all special keys on affected versions of opera as keystrokes to ignore. I don't think this is a big issue, since backspace is recognized (which is the only key thats really important), newer versions of Opera should not be affected, and (based on a skim of the jQuery site) it appears that if we ever upgrade our version of jQuery, the issue might go away. (not 100% sure about that last part) Originally when i was testing this code, I tested in all sorts of browsers that it would stop people from putting more text in. I never tested that it would allow backspaces (I now have, opera was the only affected one where it didn't work). Thanks to Alex Smotrov for reporting issue. --- resources/mediawiki.action/mediawiki.action.edit.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/mediawiki.action/mediawiki.action.edit.js b/resources/mediawiki.action/mediawiki.action.edit.js index e5b5095827..8a785e63c2 100644 --- a/resources/mediawiki.action/mediawiki.action.edit.js +++ b/resources/mediawiki.action/mediawiki.action.edit.js @@ -11,7 +11,13 @@ // JQuery should also normalize e.which to be consistent cross-browser, // however the same check is still needed regardless of jQuery. - if ( e.which === 0 || e.charCode === 0 || e.ctrlKey || e.altKey || e.metaKey ) { + // Note: At the moment, for some older opera versions (~< 10.5) + // some special keys won't be recognized (aka left arrow key). + // Backspace will be, so not big issue. + + if ( e.which === 0 || e.charCode === 0 || e.which === 8 || + e.ctrlKey || e.altKey || e.metaKey ) + { return true; //a special key (backspace, etc) so don't interfere. } -- 2.20.1