mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
in fact, remove shortcuts altogether - we're not using formatting yet,
and it's borking firefox
This commit is contained in:
parent
8930be1356
commit
0391cee8a5
2 changed files with 1 additions and 50 deletions
|
|
@ -328,35 +328,7 @@ ready(function(model) {
|
||||||
exports.endOfDayTally = function(e, el) {
|
exports.endOfDayTally = function(e, el) {
|
||||||
return scoring.tally(model);
|
return scoring.tally(model);
|
||||||
};
|
};
|
||||||
exports.updateSchema = function(e, el) {
|
return exports.updateSchema = function(e, el) {
|
||||||
return schema.updateSchema(model);
|
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;
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -278,24 +278,3 @@ ready (model) ->
|
||||||
exports.updateSchema = (e, el) ->
|
exports.updateSchema = (e, el) ->
|
||||||
schema.updateSchema(model)
|
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
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue