From 0391cee8a5b7516396f04c448e21b4e59338379b Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Tue, 4 Sep 2012 14:23:57 -0400 Subject: [PATCH] in fact, remove shortcuts altogether - we're not using formatting yet, and it's borking firefox --- lib/app/index.js | 30 +----------------------------- src/app/index.coffee | 21 --------------------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/lib/app/index.js b/lib/app/index.js index 73eea1bee6..3afcfbb5a6 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -328,35 +328,7 @@ ready(function(model) { exports.endOfDayTally = function(e, el) { return scoring.tally(model); }; - exports.updateSchema = function(e, el) { + return exports.updateSchema = function(e, el) { return schema.updateSchema(model); }; - return exports.shortcuts = function(e) { - var code, command; - if (!(e.metaKey || e.ctrlKey)) { - return; - } - code = e.which; - if (!(command = ((function() { - switch (code) { - case 66: - return 'bold'; - case 73: - return 'italic'; - case 32: - return 'removeFormat'; - case 220: - return 'removeFormat'; - default: - return null; - } - })()))) { - return; - } - document.execCommand(command, false, null); - if (e.preventDefault) { - e.preventDefault(); - } - return false; - }; }); diff --git a/src/app/index.coffee b/src/app/index.coffee index 655a76ed6d..ad4883c7fd 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -278,24 +278,3 @@ ready (model) -> exports.updateSchema = (e, el) -> schema.updateSchema(model) - # ========== SHORTCUTS ========== - - exports.shortcuts = (e) -> - return unless e.metaKey || e.ctrlKey - code = e.which - return unless command = (switch code - when 66 then 'bold' # Bold: Ctrl/Cmd + B - when 73 then 'italic' # Italic: Ctrl/Cmd + I - when 32 then 'removeFormat' # Clear formatting: Ctrl/Cmd + Space - when 220 then 'removeFormat' # Clear formatting: Ctrl/Cmd + \ - else null - ) - document.execCommand command, false, null - e.preventDefault() if e.preventDefault - return false - - # Tell Firefox to use elements for styles instead of CSS - # See: https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla - # FIXME, removing for now - seems to break our app in FireFox - # document.execCommand 'useCSS', false, true - # document.execCommand 'styleWithCSS', false, false