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

Show the default styles in :highlight, etc.

This commit is contained in:
Kris Maglione
2008-10-31 22:46:34 +00:00
parent d7c5e79cd7
commit f0d258c8fc
7 changed files with 522 additions and 405 deletions

View File

@@ -37,6 +37,10 @@ const liberator = (function () //{{{
var callbacks = [];
var observers = [];
function registerObserver(type, callback)
{
observers.push([type, callback]);
}
function loadModule(name, func)
{
@@ -46,6 +50,7 @@ const liberator = (function () //{{{
liberator.log(message, 0);
liberator.dump(message);
modules[name] = func();
liberator.triggerObserver("load_" + name, name);
}
catch (e)
{
@@ -57,7 +62,7 @@ const liberator = (function () //{{{
}
// Only general options are added here, which are valid for all vimperator like extensions
function addOptions()
registerObserver("load_options", function ()
{
options.add(["errorbells", "eb"],
"Ring the bell when an error message is displayed",
@@ -140,9 +145,9 @@ const liberator = (function () //{{{
return value;
}
});
}
})
function addMappings()
registerObserver("load_mappings", function ()
{
mappings.add(modes.all, ["<F1>"],
"Open help window",
@@ -158,9 +163,9 @@ const liberator = (function () //{{{
mappings.add([modes.NORMAL], ["ZZ"],
"Quit and save the session",
function () { liberator.quit(true); });
}
})
function addCommands()
registerObserver("load_commands", function ()
{
commands.add(["addo[ns]"],
"Manage available Extensions and Themes",
@@ -529,7 +534,7 @@ const liberator = (function () //{{{
argCount: "0",
bang: true
});
}
})
// initially hide all GUI, it is later restored unless the user has :set go= or something
// similar in his config
@@ -603,10 +608,7 @@ const liberator = (function () //{{{
return false;
},
registerObserver: function (type, callback)
{
observers.push([type, callback]);
},
registerObserver: registerObserver,
triggerObserver: function (type, data)
{
@@ -1145,9 +1147,9 @@ const liberator = (function () //{{{
config.features.push(navigator.platform);
// commands must always be the first module to be initialized
loadModule("commands", Commands); addCommands();
loadModule("options", Options); addOptions();
loadModule("mappings", Mappings); addMappings();
loadModule("commands", Commands);
loadModule("options", Options);
loadModule("mappings", Mappings);
loadModule("buffer", Buffer);
loadModule("events", Events);
loadModule("commandline", CommandLine);