mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-07 18:14:11 +01:00
Add -agent flag to :style.
This commit is contained in:
@@ -154,12 +154,22 @@
|
||||
CSS rule set (e.g., <tt>body { color: blue; }</tt>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If <a>name</a> (short option: <em>-n</em>) is provided, any existing style with the same
|
||||
name is overridden, and the style may later be deleted using <a>name</a>. If
|
||||
<em>-append</em> (short option: <em>-a</em>) is provided along with <em>-name</em>, <oa>css</oa> and
|
||||
<a>filter</a> are appended to its current value.
|
||||
</p>
|
||||
<p>The following options are available:</p>
|
||||
<dl>
|
||||
<dt>-append</dt>
|
||||
<dd>If provided along with <em>-name</em>, <oa>css</oa> and
|
||||
<a>filter</a> are appended to its current value. (short name: <em>-a</em>)</dd>
|
||||
|
||||
<dt>-agent</dt>
|
||||
<dd>If provided, the style is installed as an Agent sheet, which
|
||||
applies to contents user interface widgets as well as normal
|
||||
elements. (short name <em>-A</em>)</dd>
|
||||
|
||||
<dt>-name=<a>name</a></dt>
|
||||
<dd>If provided, any existing style with the same name is overridden, and the style may later be deleted using <a>name</a>.
|
||||
(short name <em>-n</em>)</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
<p>If <oa>css</oa> isn't provided, matching styles are listed.</p>
|
||||
</description>
|
||||
|
||||
@@ -104,8 +104,9 @@ const Styles = Module("Styles", {
|
||||
filter = filter.split(",");
|
||||
if (name && name in names) {
|
||||
var sheet = names[name];
|
||||
sheet.sites = filter;
|
||||
sheet.agent = agent;
|
||||
sheet.css = String(css);
|
||||
sheet.sites = filter;
|
||||
}
|
||||
else {
|
||||
sheet = Sheet(name, this._id++, filter.filter(util.identity), String(css), system, agent);
|
||||
@@ -127,7 +128,7 @@ const Styles = Module("Styles", {
|
||||
* @param {string or number} sheet The sheet to retrieve. Strings indicate
|
||||
* sheet names, while numbers indicate indices.
|
||||
*/
|
||||
get: function getget(system, sheet) {
|
||||
get: function get(system, sheet) {
|
||||
let sheets = system ? this.systemSheets : this.userSheets;
|
||||
let names = system ? this.systemNames : this.userNames;
|
||||
if (typeof sheet === "number")
|
||||
@@ -288,7 +289,7 @@ const Styles = Module("Styles", {
|
||||
css = sheet.css + " " + css;
|
||||
}
|
||||
}
|
||||
styles.addSheet(false, name, filter, css);
|
||||
styles.addSheet(false, name, filter, css, args["-agent"]);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -307,13 +308,14 @@ const Styles = Module("Styles", {
|
||||
hereDoc: true,
|
||||
literal: 1,
|
||||
options: [
|
||||
{ names: ["-agent", "-A"], description: "Apply style as an Agent sheet" },
|
||||
{ names: ["-append", "-a"], description: "Append site filter and css to an existing, matching sheet" },
|
||||
{
|
||||
names: ["-name", "-n"],
|
||||
description: "The name of this stylesheet",
|
||||
completer: function () [[k, v.css] for ([k, v] in Iterator(styles.userNames))],
|
||||
type: modules.CommandOption.STRING
|
||||
},
|
||||
{ names: ["-append", "-a"], description: "Append site filter and css to an existing, matching sheet" }
|
||||
}
|
||||
],
|
||||
serialize: function () [
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
* Added "transliterated" option to 'hintmatching'.
|
||||
* Added -javascript option to :abbrev and :map.
|
||||
* Added several new options to :map.
|
||||
* Added -agent flag to :style
|
||||
* Removed the :source line at the end of files generated by
|
||||
:mkpentadactylrc.
|
||||
* gf now toggles between source and content view.
|
||||
|
||||
Reference in New Issue
Block a user