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 ////////////////////////////////////////////////
|
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.mailModes || [modes.NORMAL];
|
var myModes = config.mailModes;
|
||||||
|
|
||||||
mappings.add(myModes, ["a"],
|
mappings.add(myModes, ["a"],
|
||||||
"Open a prompt to save a new addressbook entry for the sender of the selected message",
|
"Open a prompt to save a new addressbook entry for the sender of the selected message",
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ function Bookmarks() //{{{
|
|||||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.browserModes || [modes.NORMAL];
|
var myModes = config.browserModes;
|
||||||
|
|
||||||
mappings.add(myModes, ["a"],
|
mappings.add(myModes, ["a"],
|
||||||
"Open a prompt to bookmark the current URL",
|
"Open a prompt to bookmark the current URL",
|
||||||
@@ -595,7 +595,7 @@ function History() //{{{
|
|||||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.browserModes || [modes.NORMAL];
|
var myModes = config.browserModes;
|
||||||
|
|
||||||
mappings.add(myModes,
|
mappings.add(myModes,
|
||||||
["<C-o>"], "Go to an older position in the jump list",
|
["<C-o>"], "Go to an older position in the jump list",
|
||||||
@@ -855,7 +855,7 @@ function QuickMarks() //{{{
|
|||||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.browserModes || [modes.NORMAL];
|
var myModes = config.browserModes;
|
||||||
|
|
||||||
mappings.add(myModes,
|
mappings.add(myModes,
|
||||||
["go"], "Jump to a QuickMark",
|
["go"], "Jump to a QuickMark",
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ function Buffer() //{{{
|
|||||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.browserModes || [modes.NORMAL];
|
var myModes = config.browserModes;
|
||||||
|
|
||||||
mappings.add(myModes, ["."],
|
mappings.add(myModes, ["."],
|
||||||
"Repeat the last key event",
|
"Repeat the last key event",
|
||||||
@@ -1454,7 +1454,7 @@ function Marks() //{{{
|
|||||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.browserModes || [modes.NORMAL];
|
var myModes = config.browserModes;
|
||||||
|
|
||||||
mappings.add(myModes,
|
mappings.add(myModes,
|
||||||
["m"], "Set mark at the cursor position",
|
["m"], "Set mark at the cursor position",
|
||||||
|
|||||||
@@ -867,7 +867,7 @@ function Completion() //{{{
|
|||||||
return [0, buildLongestStartingSubstring(completions, filter)];
|
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)
|
environment: function environment(filter)
|
||||||
{
|
{
|
||||||
@@ -970,7 +970,7 @@ function Completion() //{{{
|
|||||||
|
|
||||||
help: function help(filter)
|
help: function help(filter)
|
||||||
{
|
{
|
||||||
var files = config.helpFiles || [];
|
var files = config.helpFiles;
|
||||||
var res = [];
|
var res = [];
|
||||||
|
|
||||||
for (let i = 0; i < files.length; i++)
|
for (let i = 0; i < files.length; i++)
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ function Search() //{{{
|
|||||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.browserModes || [modes.NORMAL];
|
var myModes = config.browserModes;
|
||||||
myModes = myModes.concat([modes.CARET]);
|
myModes = myModes.concat([modes.CARET]);
|
||||||
|
|
||||||
mappings.add(myModes,
|
mappings.add(myModes,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ function Hints() //{{{
|
|||||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.browserModes || [modes.NORMAL];
|
var myModes = config.browserModes;
|
||||||
|
|
||||||
var hintMode;
|
var hintMode;
|
||||||
var submode = ""; // used for extended mode, can be "o", "t", "y", etc.
|
var submode = ""; // used for extended mode, can be "o", "t", "y", etc.
|
||||||
|
|||||||
@@ -40,7 +40,9 @@
|
|||||||
"options.js",
|
"options.js",
|
||||||
"template.js",
|
"template.js",
|
||||||
"ui.js"].forEach(load);
|
"ui.js"].forEach(load);
|
||||||
modules.config.scripts.forEach(load);
|
|
||||||
|
if (modules.config.scripts)
|
||||||
|
modules.config.scripts.forEach(load);
|
||||||
|
|
||||||
})()
|
})()
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
setter: function (value)
|
setter: function (value)
|
||||||
{
|
{
|
||||||
for (let [opt, ids] in Iterator(config.guioptions || {}))
|
for (let [opt, ids] in Iterator(config.guioptions))
|
||||||
{
|
{
|
||||||
ids.forEach(function (id)
|
ids.forEach(function (id)
|
||||||
{
|
{
|
||||||
@@ -186,7 +186,7 @@ const liberator = (function () //{{{
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var dialogs = config.dialogs || [];
|
var dialogs = config.dialogs;
|
||||||
for (let i = 0; i < dialogs.length; i++)
|
for (let i = 0; i < dialogs.length; i++)
|
||||||
{
|
{
|
||||||
if (dialogs[i][0] == args)
|
if (dialogs[i][0] == args)
|
||||||
@@ -536,7 +536,7 @@ const liberator = (function () //{{{
|
|||||||
// similar in his config
|
// similar in his config
|
||||||
function hideGUI()
|
function hideGUI()
|
||||||
{
|
{
|
||||||
var guioptions = config.guioptions || {};
|
var guioptions = config.guioptions;
|
||||||
for (let option in guioptions)
|
for (let option in guioptions)
|
||||||
{
|
{
|
||||||
guioptions[option].forEach(function (elem) {
|
guioptions[option].forEach(function (elem) {
|
||||||
@@ -864,12 +864,8 @@ const liberator = (function () //{{{
|
|||||||
commandline.echo(str, commandline.HL_INFOMSG, flags);
|
commandline.echo(str, commandline.HL_INFOMSG, flags);
|
||||||
},
|
},
|
||||||
|
|
||||||
// return true, if this liberator extension has a certain feature
|
// does this liberator extension have a certain feature?
|
||||||
has: function (feature)
|
has: function (feature) config.features.indexOf(feature) >= 0,
|
||||||
{
|
|
||||||
let features = config.features || [];
|
|
||||||
return features.indexOf(feature) >= 0;
|
|
||||||
},
|
|
||||||
|
|
||||||
hasExtension: function (name)
|
hasExtension: function (name)
|
||||||
{
|
{
|
||||||
@@ -1146,9 +1142,20 @@ const liberator = (function () //{{{
|
|||||||
let start = Date.now();
|
let start = Date.now();
|
||||||
liberator.log("Initializing liberator object...", 0);
|
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.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
|
// commands must always be the first module to be initialized
|
||||||
loadModule("commands", Commands);
|
loadModule("commands", Commands);
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ function Mail() //{{{
|
|||||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
var myModes = config.mailModes || [modes.NORMAL];
|
var myModes = config.mailModes;
|
||||||
|
|
||||||
mappings.add(myModes, ["<Return>", "i"],
|
mappings.add(myModes, ["<Return>", "i"],
|
||||||
"Inspect (focus) message",
|
"Inspect (focus) message",
|
||||||
|
|||||||
Reference in New Issue
Block a user