mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 02:08:00 +01:00
Rename Modes.StackElem and CommandWidgets.addElem to *Element.
--HG-- extra : rebase_source : f52b838e76dde8acc41bb382a505627e9c9f02dd
This commit is contained in:
@@ -12,22 +12,22 @@ const CommandWidgets = Class("CommandWidgets", {
|
||||
init: function () {
|
||||
const self = this;
|
||||
this.elements = {};
|
||||
this.addElem({
|
||||
this.addElement({
|
||||
name: "container",
|
||||
noValue: true
|
||||
});
|
||||
this.addElem({
|
||||
this.addElement({
|
||||
name: "commandline",
|
||||
getGroup: function () options.get("guioptions").has("C") ? this.commandbar : this.statusbar,
|
||||
getValue: function () this.command
|
||||
});
|
||||
this.addElem({
|
||||
this.addElement({
|
||||
name: "strut",
|
||||
defaultGroup: "Normal",
|
||||
getGroup: function () this.commandbar,
|
||||
getValue: function () options.get("guioptions").has("c")
|
||||
});
|
||||
this.addElem({
|
||||
this.addElement({
|
||||
name: "command",
|
||||
id: "commandline-command",
|
||||
get: function (elem) {
|
||||
@@ -55,13 +55,13 @@ const CommandWidgets = Class("CommandWidgets", {
|
||||
},
|
||||
onVisibility: function (elem, visible) visible && elem.focus()
|
||||
});
|
||||
this.addElem({
|
||||
this.addElement({
|
||||
name: "prompt",
|
||||
id: "commandline-prompt",
|
||||
defaultGroup: "CmdPrompt",
|
||||
getGroup: function () this.activeGroup.commandline
|
||||
});
|
||||
this.addElem({
|
||||
this.addElement({
|
||||
name: "message",
|
||||
defaultGroup: "Normal",
|
||||
getElement: CommandWidgets.getEditor,
|
||||
@@ -74,7 +74,7 @@ const CommandWidgets = Class("CommandWidgets", {
|
||||
return this.activeGroup.mode;
|
||||
}
|
||||
});
|
||||
this.addElem({
|
||||
this.addElement({
|
||||
name: "mode",
|
||||
defaultGroup: "ModeMsg",
|
||||
getGroup: function (value) {
|
||||
@@ -86,7 +86,7 @@ const CommandWidgets = Class("CommandWidgets", {
|
||||
}
|
||||
});
|
||||
},
|
||||
addElem: function (obj) {
|
||||
addElement: function (obj) {
|
||||
const self = this;
|
||||
this.elements[obj.name] = obj;
|
||||
function get(id) obj.getElement ? obj.getElement(id) : document.getElementById(id);
|
||||
|
||||
@@ -227,7 +227,7 @@ const Modes = Module("modes", {
|
||||
stack.pop.params.leave(stack, this.topOfStack);
|
||||
|
||||
let push = mainMode != null && !(stack && stack.pop) &&
|
||||
Modes.StackElem(this._main, this._extended, params, {});
|
||||
Modes.StackElement(this._main, this._extended, params, {});
|
||||
if (push && this.topOfStack) {
|
||||
if (this.topOfStack.params.leave)
|
||||
this.topOfStack.params.leave({ push: push }, push);
|
||||
@@ -315,7 +315,7 @@ const Modes = Module("modes", {
|
||||
get extended() this._extended,
|
||||
set extended(value) { this.set(null, value); }
|
||||
}, {
|
||||
StackElem: (function () {
|
||||
StackElement: (function () {
|
||||
let struct = Struct("main", "extended", "params", "saved");
|
||||
struct.prototype.__defineGetter__("mainMode", function () modes.getMode(this.main));
|
||||
struct.prototype.toString = function () !loaded.modes ? this.main : "[mode " +
|
||||
|
||||
Reference in New Issue
Block a user