1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 18:54:12 +01:00

add :pagestyle command to allow for switching between alternate style sheets

This commit is contained in:
Doug Kearns
2008-07-29 21:13:13 +00:00
parent 32dc7b8483
commit a2a82973e4
4 changed files with 32 additions and 0 deletions

View File

@@ -452,6 +452,19 @@ liberator.Buffer = function () //{{{
"Show various page information",
function () { liberator.buffer.showPageInfo(true); });
liberator.commands.add(["pagest[yle]"],
"Select the author style sheet to apply",
function (args)
{
if (liberator.options["usermode"])
liberator.options["usermode"] = false;
stylesheetSwitchAll(window.content, args);
},
{
completer: function (filter) { return liberator.completion.stylesheet(filter); }
});
liberator.commands.add(["re[load]"],
"Reload current page",
function (args, special) { liberator.tabs.reload(getBrowser().mCurrentTab, special); });

View File

@@ -285,6 +285,12 @@ liberator.Completion = function () //{{{
return [0, this.filter(engines, filter)];
},
stylesheet: function (filter)
{
var stylesheets = getAllStyleSheets(window.content).map(function (stylesheet) { return [stylesheet.title, ""]; });
return [0, this.filter(stylesheets, filter)];
},
// TODO: support file:// and \ or / path separators on both platforms
// TODO: sort directories first
// if "tail" is true, only return names without any directory components