mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 15:45:48 +01:00
Restore most of :style list filtering and clarify docs.
Closes issue #540.
This commit is contained in:
@@ -282,7 +282,11 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:sty :style</tags>
|
<tags>:sty :style</tags>
|
||||||
<spec>:sty<oa>le</oa> <oa>-name=<a>name</a></oa> <oa>-append</oa> <a>filter</a> <oa>css</oa></spec>
|
<strut/>
|
||||||
|
<spec>:sty<oa>le</oa> <oa>-name=<a>name</a></oa> <oa>-group=<a>name</a></oa> <oa>-agent</oa> <a>filter</a> <a>css</a></spec>
|
||||||
|
<spec>:sty<oa>le</oa> -name=<a>name</a> -append <a>filter</a> <a>css</a></spec>
|
||||||
|
<spec>:sty<oa>le</oa> <oa>-name=<a>name</a></oa> <oa>-group=<a>name</a></oa> <oa>filter</oa></spec>
|
||||||
|
<strut/>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Add CSS styles to the browser or to web pages. <a>filter</a> is a
|
Add CSS styles to the browser or to web pages. <a>filter</a> is a
|
||||||
@@ -295,8 +299,9 @@
|
|||||||
<p>The following options are available:</p>
|
<p>The following options are available:</p>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>-append</dt>
|
<dt>-append</dt>
|
||||||
<dd>If provided along with <em>-name</em>, <oa>css</oa> and
|
<dd>If provided along with <em>-name</em>, <a>css</a> and
|
||||||
<a>filter</a> are appended to its current value. (short name <em>-a</em>)</dd>
|
<a>filter</a> are appended to its current value. (short name
|
||||||
|
<em>-a</em>)</dd>
|
||||||
|
|
||||||
<dt>-agent</dt>
|
<dt>-agent</dt>
|
||||||
<dd>If provided, the style is installed as an Agent sheet, which
|
<dd>If provided, the style is installed as an Agent sheet, which
|
||||||
|
|||||||
@@ -299,13 +299,15 @@ var Styles = Module("Styles", {
|
|||||||
systemNames: Class.Property({ get: deprecated("Styles#system.names", function systemNames() this.system.names) }),
|
systemNames: Class.Property({ get: deprecated("Styles#system.names", function systemNames() this.system.names) }),
|
||||||
sites: Class.Property({ get: deprecated("Styles#user.sites", function sites() this.user.sites) }),
|
sites: Class.Property({ get: deprecated("Styles#user.sites", function sites() this.user.sites) }),
|
||||||
|
|
||||||
list: function list(content, filter, name, hives) {
|
list: function list(content, sites, name, hives) {
|
||||||
const { commandline, dactyl } = this.modules;
|
const { commandline, dactyl } = this.modules;
|
||||||
|
|
||||||
hives = hives || styles.hives.filter(function (h) h.modifiable && h.sheets.length);
|
hives = hives || styles.hives.filter(function (h) h.modifiable && h.sheets.length);
|
||||||
|
|
||||||
function sheets(group)
|
function sheets(group)
|
||||||
group.sheets.slice()
|
group.sheets.slice()
|
||||||
|
.filter(function (sheet) (!name || sheet.name === name) &&
|
||||||
|
(!sites || sites.every(function (s) sheet.sites.indexOf(s) >= 0)))
|
||||||
.sort(function (a, b) a.name && b.name ? String.localeCompare(a.name, b.name)
|
.sort(function (a, b) a.name && b.name ? String.localeCompare(a.name, b.name)
|
||||||
: !!b.name - !!a.name || a.id - b.id);
|
: !!b.name - !!a.name || a.id - b.id);
|
||||||
|
|
||||||
@@ -560,7 +562,7 @@ var Styles = Module("Styles", {
|
|||||||
let [filter, css] = args;
|
let [filter, css] = args;
|
||||||
|
|
||||||
if (!css)
|
if (!css)
|
||||||
styles.list(window.content, filter, args["-name"], args.explicitOpts["-group"] ? [args["-group"]] : null);
|
styles.list(window.content, filter ? filter.split(",") : null, args["-name"], args.explicitOpts["-group"] ? [args["-group"]] : null);
|
||||||
else {
|
else {
|
||||||
util.assert(args["-group"].modifiable && args["-group"].hive.modifiable,
|
util.assert(args["-group"].modifiable && args["-group"].hive.modifiable,
|
||||||
_("group.cantChangeBuiltin", _("style.styles")));
|
_("group.cantChangeBuiltin", _("style.styles")));
|
||||||
|
|||||||
Reference in New Issue
Block a user