1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 06:17:58 +01:00

use lambda notation for setter and getter definitions where appropriate

This commit is contained in:
Doug Kearns
2008-09-24 06:03:42 +00:00
parent 804b1fd62f
commit f478f57c57
6 changed files with 16 additions and 21 deletions

View File

@@ -560,8 +560,8 @@ const liberator = (function () //{{{
return { return {
get mode() { return liberator.modes.main; }, get mode() liberator.modes.main,
set mode(value) { liberator.modes.main = value; }, set mode(value) liberator.modes.main = value,
// Global constants // Global constants
CURRENT_TAB: 1, CURRENT_TAB: 1,

View File

@@ -747,7 +747,7 @@ liberator.Mail = function () //{{{
return { return {
get currentAccount() { return this.currentFolder.rootFolder; }, get currentAccount() this.currentFolder.rootFolder,
get currentFolder() { get currentFolder() {
var tree = GetFolderTree(); var tree = GetFolderTree();

View File

@@ -191,9 +191,9 @@ liberator.modes = (function () //{{{
yield modes[i]; yield modes[i];
}, },
get all() { return [this.NONE, this.NORMAL, this.INSERT, this.VISUAL, get all() [this.NONE, this.NORMAL, this.INSERT, this.VISUAL,
this.HINTS, this.COMMAND_LINE, this.CARET, this.HINTS, this.COMMAND_LINE, this.CARET,
this.TEXTAREA, this.MESSAGE, this.COMPOSE, this.CUSTOM]; }, this.TEXTAREA, this.MESSAGE, this.COMPOSE, this.CUSTOM],
// show the current mode string in the command line // show the current mode string in the command line
show: function () show: function ()
@@ -301,9 +301,7 @@ liberator.modes = (function () //{{{
}, },
get extended() extended, get extended() extended,
set extended(value) { set extended(value) { extended = value; this.show(); }
extended = value; this.show();
}
}; };
//}}} //}}}

View File

@@ -36,15 +36,12 @@ liberator.config = { //{{{
defaults: { guioptions: "f" }, defaults: { guioptions: "f" },
guioptions: { m: ["mail-toolbar-menubar2"], T: ["mail-bar2"], f: ["folderPaneBox", "folderpane_splitter"], F: ["folderPaneHeader"] }, guioptions: { m: ["mail-toolbar-menubar2"], T: ["mail-bar2"], f: ["folderPaneBox", "folderpane_splitter"], F: ["folderPaneHeader"] },
get isComposeWindow() { return window.wintype == "msgcompose"; }, get isComposeWindow() window.wintype == "msgcompose",
get browserModes() { return [liberator.modes.MESSAGE]; }, get browserModes() [liberator.modes.MESSAGE],
get mainWidget() { // focusContent() focuses this widget // focusContent() focuses this widget
return this.isComposeWindow ? get mainWidget() this.isComposeWindow ? document.getElementById("content-frame") : GetThreadTree(),
document.getElementById("content-frame") : get mainWindowID() this.isComposeWindow ? "msgcomposeWindow" : "messengerWindow",
GetThreadTree(); get visualbellWindow() document.getElementById(this.mainWindowID),
},
get mainWindowID() { return this.isComposeWindow ? "msgcomposeWindow" : "messengerWindow"; },
get visualbellWindow() { return document.getElementById(this.mainWindowID); },
autocommands: [["FolderLoaded", "Triggered after switching folders in Thunderbird"], autocommands: [["FolderLoaded", "Triggered after switching folders in Thunderbird"],
["PageLoadPre", "Triggered after a page load is initiated"], ["PageLoadPre", "Triggered after a page load is initiated"],

View File

@@ -643,9 +643,9 @@ liberator.Tabs = function () //{{{
return { return {
get alternate() { return alternates[1]; }, get alternate() alternates[1],
get count() { return getBrowser().mTabs.length; }, get count() getBrowser().mTabs.length,
// used for :setlocal // used for :setlocal
get options() get options()

View File

@@ -36,7 +36,7 @@ liberator.config = { //{{{
defaults: { guioptions: "" }, defaults: { guioptions: "" },
guioptions: { m: ["toolbar-menubar"], T: ["nav-bar"], b: ["PersonalToolbar"] }, guioptions: { m: ["toolbar-menubar"], T: ["nav-bar"], b: ["PersonalToolbar"] },
get visualbellWindow() { return getBrowser().mPanelContainer; }, get visualbellWindow() getBrowser().mPanelContainer,
autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"], autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"],
["LocationChange", "Triggered when changing tabs or when naviagtion to a new location"], ["LocationChange", "Triggered when changing tabs or when naviagtion to a new location"],