diff --git a/common/content/buffer.js b/common/content/buffer.js index 755f4fda..5d5f4c61 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1680,7 +1680,7 @@ var Buffer = Module("buffer", { { count: true }); mappings.add([modes.NORMAL], ["i", ""], - "Start CARET mode", + "Start Caret mode", function () { modes.push(modes.CARET); }); mappings.add([modes.NORMAL], ["", ""], diff --git a/common/content/dactyl.js b/common/content/dactyl.js index fd2aa6d5..294e8a4a 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1860,7 +1860,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }); commands.add(["norm[al]"], - "Execute NORMAL mode commands", + "Execute Normal mode commands", function (args) { events.feedkeys(args[0], args.bang, false, modes.NORMAL); }, { argCount: "1", diff --git a/common/content/editor.js b/common/content/editor.js index be2eb739..6067c760 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -729,15 +729,15 @@ var Editor = Module("editor", { // visual mode mappings.add([modes.CARET, modes.TEXT_EDIT], - ["v"], "Start VISUAL mode", + ["v"], "Start Visual mode", function () { modes.push(modes.VISUAL); }); mappings.add([modes.VISUAL], - ["v", "V"], "End VISUAL mode", + ["v", "V"], "End Visual mode", function () { modes.pop(); }); mappings.add([modes.TEXT_EDIT], - ["V"], "Start VISUAL LINE mode", + ["V"], "Start Visual Line mode", function () { modes.push(modes.VISUAL, modes.LINE); editor.executeCommand("cmd_beginLine", 1); @@ -843,10 +843,10 @@ var Editor = Module("editor", { function bind() mappings.add.apply(mappings, [[modes.AUTOCOMPLETE]].concat(Array.slice(arguments))) - bind([""], "Return to INSERT mode", + bind([""], "Return to Insert mode", function () Events.PASS_THROUGH); - bind([""], "Return to INSERT mode", + bind([""], "Return to Insert mode", function () { events.feedkeys("", { skipmap: true }); }); bind([""], "Select the previous autocomplete result", @@ -882,7 +882,7 @@ var Editor = Module("editor", { }); options.add(["insertmode", "im"], - "Enter INSERT mode rather than TEXT_EDIT mode when focusing text areas", + "Enter Insert mode rather than Text Edit mode when focusing text areas", "boolean", true); } }); diff --git a/common/content/hints.js b/common/content/hints.js index 95ba9214..f6cf97cc 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -1182,11 +1182,11 @@ var Hints = Module("hints", { mappings: function () { var myModes = config.browserModes.concat(modes.OUTPUT_MULTILINE); mappings.add(myModes, ["f"], - "Start HINTS mode", + "Start Hints mode", function () { hints.show("o"); }); mappings.add(myModes, ["F"], - "Start HINTS mode, but open link in a new tab", + "Start Hints mode, but open link in a new tab", function () { hints.show(options.get("activate").has("links") ? "t" : "b"); }); mappings.add(myModes, [";"], diff --git a/common/content/modes.js b/common/content/modes.js index c54dded9..6f1d7dbd 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -227,9 +227,10 @@ var Modes = Module("modes", { XML.ignoreWhitespace = XML.prettyPrinting = false; let res =
    ; - Object.keys(obj).sort().forEach(function (mode) { - res.* +=
  • {mode}: {modes.getMode(mode).description}{ - rec(obj[mode]) + Object.keys(obj).sort().forEach(function (name) { + let mode = modes.getMode(name); + res.* +=
  • {mode.displayName}: {mode.description}{ + rec(obj[name]) }
  • ; }); @@ -500,6 +501,8 @@ var Modes = Module("modes", { description: Messages.Localized(""), + displayName: Class.memoize(function () this.name.split("_").map(util.capitalize).join(" ")), + isinstance: function isinstance(obj) this === obj || this.allBases.indexOf(obj) >= 0 || callable(obj) && this instanceof obj, @@ -584,7 +587,7 @@ var Modes = Module("modes", { mappings: function initMappings() { mappings.add([modes.BASE, modes.NORMAL], ["", ""], - "Return to NORMAL mode", + "Return to Normal mode", function () { modes.reset(); }); mappings.add([modes.INPUT, modes.COMMAND, modes.PASS_THROUGH, modes.QUOTE], @@ -592,12 +595,13 @@ var Modes = Module("modes", { "Return to the previous mode", function () { modes.pop(); }); + mappings.add([modes.MENU], [""], + "Leave Menu mode", + function () { modes.pop(); }); + mappings.add([modes.MENU], [""], "Close the current popup", - function () { - modes.pop(); - return Events.PASS_THROUGH; - }); + function () { return Events.PASS_THROUGH; }); mappings.add([modes.MENU], [""], "Close the current popup", diff --git a/common/modules/util.jsm b/common/modules/util.jsm index 194f66a0..6f86d5a3 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -166,7 +166,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), * @param {string} str The string to capitalize * @returns {string} */ - capitalize: function capitalize(str) str && str[0].toUpperCase() + str.slice(1), + capitalize: function capitalize(str) str && str[0].toUpperCase() + str.slice(1).toLowerCase(), /** * Returns a RegExp object that matches characters specified in the range