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