mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 12:42:26 +01:00
only complete :pagestyle with style sheets of media type "all" or "screen"
This commit is contained in:
@@ -456,6 +456,12 @@ liberator.Buffer = function () //{{{
|
|||||||
"Select the author style sheet to apply",
|
"Select the author style sheet to apply",
|
||||||
function (args)
|
function (args)
|
||||||
{
|
{
|
||||||
|
if (!args)
|
||||||
|
{
|
||||||
|
liberator.echoerr("E471: Argument required");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (liberator.options["usermode"])
|
if (liberator.options["usermode"])
|
||||||
liberator.options["usermode"] = false;
|
liberator.options["usermode"] = false;
|
||||||
|
|
||||||
|
|||||||
@@ -287,7 +287,15 @@ liberator.Completion = function () //{{{
|
|||||||
|
|
||||||
stylesheet: function (filter)
|
stylesheet: function (filter)
|
||||||
{
|
{
|
||||||
var stylesheets = getAllStyleSheets(window.content).map(function (stylesheet) { return [stylesheet.title, ""]; });
|
var stylesheets = getAllStyleSheets(window.content);
|
||||||
|
|
||||||
|
// TODO: how should we handle duplicate titles?
|
||||||
|
stylesheets = stylesheets.filter(function(stylesheet) {
|
||||||
|
return !(!/^(screen|all|)$/i.test(stylesheet.media.mediaText) || /^\s*$/.test(stylesheet.title))
|
||||||
|
}).map(function (stylesheet) {
|
||||||
|
return [stylesheet.title, stylesheet.href || "inline"];
|
||||||
|
});
|
||||||
|
|
||||||
return [0, this.filter(stylesheets, filter)];
|
return [0, this.filter(stylesheets, filter)];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user