Skip to content

Commit 603e0b8

Browse files
committed
Add and use ui-icon short tag.
1 parent 43bd5e3 commit 603e0b8

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

.eleventy.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ module.exports = eleventyConfig => {
2222
}
2323
);
2424

25+
eleventyConfig.addShortcode("ui-icon", (name, text = name, imageFirst = false) => {
26+
let url = `/img/ui/ui-${name}64.png`;
27+
alt = text.replace(/\b_+|_+\b/, '') + " icon";
28+
let clazz = "{.ui-icon}";
29+
if (imageFirst) clazz += "{.first}";
30+
let image = `![${alt}](${url})${clazz}`
31+
return imageFirst ? image + text : text + image;
32+
});
2533
eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);
2634
eleventyConfig.addShortcode("ts", () => `${Date.now()}`);
2735

content/_includes/main.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,10 @@ figcaption {
456456
cursor: zoom-out;
457457
}
458458

459-
img.uibtn {
459+
img.ui-icon {
460460
height: 1.2em;
461461
vertical-align: text-bottom;
462+
margin: 0 .5em 0 .5em;
462463
}
463464

464465
img.nscl-logo {

content/usage.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ After installation, you can quickly access NoScript:
2929
### Trust levels
3030

3131
By using NoScript's popup UI you can assign any website or sub-resource origin (e.g. "cnn.com" or "ads-twitter.com") either one of __4 preset trust levels__ or a __per-site customized level__.
32-
{% screenshot "trust-levels", "Working with trust levels in NoScript's popup UI" %}
33-
- __DEFAULT__, as the name implies, is the fallback low trust level which NoScript automatically enforces on any not yet configured website. This way unknown sites you visit for the first time are unable to perform any harmful action against you.
34-
- __Temp. TRUSTED__ is the high trust level you can assign to sites requiring JavaScript or other active (and potentially harmful) capabilities to be enabled in order to work. **_Temp._** stands for "Temporarily", meaning that the trust level for this site gets reset to __DEFAULT__ as soon as the browser is closed or if you use the _Revoke Temporary Permissions_ ![Revoke Temporary Permissions]( {{ "/img/ui/ui-revoke-temp64.png" | url }}){.uibtn} button. This is the preferred way to tentatively enable sites which you need to work just now but you're unlikely to visit every day.
35-
You can also assign this level to all the sites you _currently_ listed in the popup UI by using the _Set all on this page to Temporarily TRUSTED_ ![Set all on this page to Temporarily TRUSTED]( {{ "/img/ui/ui-temp-all64.png" | url }}){.uibtn} button.
36-
- __TRUSTED__ is the permanent high trust level, enabling JavaScript and other active capabilities and persisting across browser restarts: use it only for sites which you really trust and use frequently.
37-
- __UNTRUSTED__ is the zero-trust level, which blocks every capability (including rendering of plain HTML frames and alternate <noscript> content). It may be useful to flag sites which are definitely not welcome in your browser.
38-
- __CUSTOM__ is a special level which can be tailored specifically for each site by turning on and off individual capabilities, such as _script_, _object_, _media_, _frame_, _font_, _webgl_, _fetch_, _ping_, _noscript_, _unrestricted CSS_, _other_. Capabilities which the site has tried to use, being blocked by NoScript, are highlighted in red. The temporary/permanent behavior of this level is controlled by a tiny clock-shaped toggle.
32+
{% screenshot "trust-levels", "Working with trust levels in NoScript's popup" %}
33+
- {% ui-icon "no", "__DEFAULT__", true %}, as the name implies, is the fallback low trust level which NoScript automatically enforces on any not yet configured website. This way unknown sites you visit for the first time are unable to perform any harmful action against you.
34+
- {% ui-icon "temp", "__Temp. TRUSTED__", true %} is the high trust level you can assign to sites requiring JavaScript or other active (and potentially harmful) capabilities to be enabled in order to work. **_Temp._** stands for "Temporarily", meaning that the trust level for this site gets reset to __DEFAULT__ as soon as the browser is closed or if you use the {% ui-icon "revoke-temp", "_Revoke Temporary Permissions_" %} button. This is the preferred way to tentatively enable sites which you need to work just now but you're unlikely to visit every day.
35+
You can also assign this level to all the sites you _currently_ listed in the popup UI by using
36+
the {% ui-icon "temp-all", "_Set all on this page to Temporarily TRUSTED_" %} button.
37+
- {% ui-icon "yes", "__TRUSTED__" ,true %} is the permanent high trust level, enabling JavaScript and other active capabilities and persisting across browser restarts: use it only for sites which you really trust and use frequently.
38+
- {% ui-icon "black", "__UNTRUSTED__" , true %} is the zero-trust level, which blocks every capability (including rendering of plain HTML frames and alternate <noscript> content). It may be useful to flag sites which are definitely not welcome in your browser.
39+
- {% ui-icon "custom" "__CUSTOM__", true %} is a special level which can be tailored specifically for each site by turning on and off individual capabilities, such as _script_, _object_, _media_, _frame_, _font_, _webgl_, _fetch_, _ping_, _noscript_, _unrestricted CSS_, _other_. Capabilities which the site has tried to use, being blocked by NoScript, are highlighted in red. The temporary/permanent behavior of this level is controlled by a tiny clock-shaped toggle.
3940

4041
#### Contextual Policies
4142
{% screenshot "contextual", "Example: contextual policy for Twitter embedded timeline" %}
@@ -76,9 +77,9 @@ Sometimes you are in a hurry on a complex workflow, spanning multiple redirectio
7677

7778
One example may be a credit card payment, bouncing from an e-commerce site to one or more payment processor web services.
7879

79-
In this case you may want to temporarily relax all the restrictions normally enforced by NoScript for all the sites loaded in the current tab until said tab is closed, by using the __Disable restrictions for this tab__ ![Disable restriction for this tab]( {{ "/img/ui/ui-tab64.png" | url }}){.uibtn} button.
80+
In this case you may want to temporarily relax all the restrictions normally enforced by NoScript for all the sites loaded in the current tab until said tab is closed, by using the {% ui-icon "tab", "__Disable restrictions for this tab__" %} button.
8081

81-
More radical (and __not__ recommended) is the __Disable restrictions globally (dangerous)__ ![Disable restrictions globally (dangerous)]( {{ "/img/ui/ui-global64.png" | url }}){.uibtn} button: using it amounts to disabling NoScripts permanently on any site/tab, keeping enabled the XSS filter only. Don't do it!
82+
More radical (and __not__ recommended) is the {% ui-icon "global", "__Disable restrictions globally (dangerous)__" %} button: using it amounts to disabling NoScripts permanently on any site/tab, keeping enabled the XSS filter only. Don't do it!
8283

8384
### Keyboard Shortcuts
8485
You can open and navigate all the NoScript UI by using the following keyboard shortcuts:

0 commit comments

Comments
 (0)