mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 05:57:58 +01:00
provide defaults for some optional config properties
This commit is contained in:
@@ -71,7 +71,7 @@ function Addressbook() //{{{
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.mailModes || [modes.NORMAL];
|
||||
var myModes = config.mailModes;
|
||||
|
||||
mappings.add(myModes, ["a"],
|
||||
"Open a prompt to save a new addressbook entry for the sender of the selected message",
|
||||
|
||||
@@ -240,7 +240,7 @@ function Bookmarks() //{{{
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.browserModes || [modes.NORMAL];
|
||||
var myModes = config.browserModes;
|
||||
|
||||
mappings.add(myModes, ["a"],
|
||||
"Open a prompt to bookmark the current URL",
|
||||
@@ -595,7 +595,7 @@ function History() //{{{
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.browserModes || [modes.NORMAL];
|
||||
var myModes = config.browserModes;
|
||||
|
||||
mappings.add(myModes,
|
||||
["<C-o>"], "Go to an older position in the jump list",
|
||||
@@ -855,7 +855,7 @@ function QuickMarks() //{{{
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.browserModes || [modes.NORMAL];
|
||||
var myModes = config.browserModes;
|
||||
|
||||
mappings.add(myModes,
|
||||
["go"], "Jump to a QuickMark",
|
||||
|
||||
@@ -193,7 +193,7 @@ function Buffer() //{{{
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.browserModes || [modes.NORMAL];
|
||||
var myModes = config.browserModes;
|
||||
|
||||
mappings.add(myModes, ["."],
|
||||
"Repeat the last key event",
|
||||
@@ -1454,7 +1454,7 @@ function Marks() //{{{
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.browserModes || [modes.NORMAL];
|
||||
var myModes = config.browserModes;
|
||||
|
||||
mappings.add(myModes,
|
||||
["m"], "Set mark at the cursor position",
|
||||
|
||||
@@ -867,7 +867,7 @@ function Completion() //{{{
|
||||
return [0, buildLongestStartingSubstring(completions, filter)];
|
||||
},
|
||||
|
||||
dialog: function dialog(filter) [0, this.filter(config.dialogs || [], filter)],
|
||||
dialog: function dialog(filter) [0, this.filter(config.dialogs, filter)],
|
||||
|
||||
environment: function environment(filter)
|
||||
{
|
||||
@@ -970,7 +970,7 @@ function Completion() //{{{
|
||||
|
||||
help: function help(filter)
|
||||
{
|
||||
var files = config.helpFiles || [];
|
||||
var files = config.helpFiles;
|
||||
var res = [];
|
||||
|
||||
for (let i = 0; i < files.length; i++)
|
||||
|
||||
@@ -390,7 +390,7 @@ function Search() //{{{
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.browserModes || [modes.NORMAL];
|
||||
var myModes = config.browserModes;
|
||||
myModes = myModes.concat([modes.CARET]);
|
||||
|
||||
mappings.add(myModes,
|
||||
|
||||
@@ -32,7 +32,7 @@ function Hints() //{{{
|
||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.browserModes || [modes.NORMAL];
|
||||
var myModes = config.browserModes;
|
||||
|
||||
var hintMode;
|
||||
var submode = ""; // used for extended mode, can be "o", "t", "y", etc.
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
"options.js",
|
||||
"template.js",
|
||||
"ui.js"].forEach(load);
|
||||
|
||||
if (modules.config.scripts)
|
||||
modules.config.scripts.forEach(load);
|
||||
|
||||
})()
|
||||
|
||||
@@ -82,7 +82,7 @@ const liberator = (function () //{{{
|
||||
{
|
||||
setter: function (value)
|
||||
{
|
||||
for (let [opt, ids] in Iterator(config.guioptions || {}))
|
||||
for (let [opt, ids] in Iterator(config.guioptions))
|
||||
{
|
||||
ids.forEach(function (id)
|
||||
{
|
||||
@@ -186,7 +186,7 @@ const liberator = (function () //{{{
|
||||
|
||||
try
|
||||
{
|
||||
var dialogs = config.dialogs || [];
|
||||
var dialogs = config.dialogs;
|
||||
for (let i = 0; i < dialogs.length; i++)
|
||||
{
|
||||
if (dialogs[i][0] == args)
|
||||
@@ -536,7 +536,7 @@ const liberator = (function () //{{{
|
||||
// similar in his config
|
||||
function hideGUI()
|
||||
{
|
||||
var guioptions = config.guioptions || {};
|
||||
var guioptions = config.guioptions;
|
||||
for (let option in guioptions)
|
||||
{
|
||||
guioptions[option].forEach(function (elem) {
|
||||
@@ -864,12 +864,8 @@ const liberator = (function () //{{{
|
||||
commandline.echo(str, commandline.HL_INFOMSG, flags);
|
||||
},
|
||||
|
||||
// return true, if this liberator extension has a certain feature
|
||||
has: function (feature)
|
||||
{
|
||||
let features = config.features || [];
|
||||
return features.indexOf(feature) >= 0;
|
||||
},
|
||||
// does this liberator extension have a certain feature?
|
||||
has: function (feature) config.features.indexOf(feature) >= 0,
|
||||
|
||||
hasExtension: function (name)
|
||||
{
|
||||
@@ -1146,9 +1142,20 @@ const liberator = (function () //{{{
|
||||
let start = Date.now();
|
||||
liberator.log("Initializing liberator object...", 0);
|
||||
|
||||
// TODO: only checked for "Win32" currently, other values should be normalised
|
||||
|
||||
config.features = config.features || [];
|
||||
config.features.push(getPlatformFeature());
|
||||
config.defaults = config.defaults || {};
|
||||
config.guioptions = config.guioptions || {};
|
||||
config.browserModes = config.browserModes || [modes.NORMAL];
|
||||
config.mailModes = config.mailModes || [modes.NORMAL];
|
||||
// TODO: suitable defaults?
|
||||
//config.mainWidget
|
||||
//config.mainWindowID
|
||||
//config.visualbellWindow
|
||||
//config.styleableChrome
|
||||
config.autocommands = config.autocommands || [];
|
||||
config.dialogs = config.dialogs || [];
|
||||
config.helpFiles = config.helpFiles || [];
|
||||
|
||||
// commands must always be the first module to be initialized
|
||||
loadModule("commands", Commands);
|
||||
|
||||
@@ -241,7 +241,7 @@ function Mail() //{{{
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var myModes = config.mailModes || [modes.NORMAL];
|
||||
var myModes = config.mailModes;
|
||||
|
||||
mappings.add(myModes, ["<Return>", "i"],
|
||||
"Inspect (focus) message",
|
||||
|
||||
Reference in New Issue
Block a user