Merge branch 'master' into USw-Integration
This commit is contained in:
commit
f6fa9fe50a
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -7,7 +7,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14'
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
html#stylus #header *:not(#\0) {
|
html#stylus #header *:not(#\0transition-suppressor) {
|
||||||
/* This suppresses transitions on page open.
|
/* This suppresses a bug in all? browsers: they apply transitions during page load.
|
||||||
* WARNING! Must be the first rule here so dom.js can simply call deleteRule for index 0.
|
* Using an increased specificity to override sane selectors in user styles. */
|
||||||
* Using an increased specificity to override sane selectors in user styles */
|
|
||||||
transition: none !important;
|
transition: none !important;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
|
|
|
@ -19,7 +19,7 @@ const preinit = (() => {
|
||||||
.catch(getData);
|
.catch(getData);
|
||||||
} else {
|
} else {
|
||||||
getData = PortDownloader();
|
getData = PortDownloader();
|
||||||
firstGet = getData({timer: false});
|
firstGet = getData({force: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
function DirectDownloader() {
|
function DirectDownloader() {
|
||||||
|
|
|
@ -585,7 +585,22 @@
|
||||||
if (palette.size > 1 || nums && nums.length > 1) {
|
if (palette.size > 1 || nums && nums.length > 1) {
|
||||||
const old = new Map((options.popup.palette || []).map(el => [el.__color, el]));
|
const old = new Map((options.popup.palette || []).map(el => [el.__color, el]));
|
||||||
for (const [color, data] of palette) {
|
for (const [color, data] of palette) {
|
||||||
res.push(old.get(color) || makePaletteSwatch(color, data, options.popup.paletteLine));
|
const str = data.join(', ');
|
||||||
|
let el = old.get(color);
|
||||||
|
if (!el) {
|
||||||
|
el = document.createElement('div');
|
||||||
|
el.__color = color; // also used in color-picker.js
|
||||||
|
el.className = COLORVIEW_SWATCH_CLASS;
|
||||||
|
el.style.setProperty(`--${COLORVIEW_SWATCH_CLASS}`, color);
|
||||||
|
}
|
||||||
|
if (el.__str !== str) {
|
||||||
|
el.__str = str;
|
||||||
|
// break down long lists: 10 per line
|
||||||
|
el.title = `${color}\n${options.popup.paletteLine} ${
|
||||||
|
str.length > 50 ? str.replace(/([^,]+,\s){10}/g, '$&\n') : str
|
||||||
|
}`;
|
||||||
|
}
|
||||||
|
res.push(el);
|
||||||
}
|
}
|
||||||
res.push(Object.assign(document.createElement('span'), {
|
res.push(Object.assign(document.createElement('span'), {
|
||||||
className: 'colorpicker-palette-hint',
|
className: 'colorpicker-palette-hint',
|
||||||
|
@ -596,17 +611,6 @@
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
function makePaletteSwatch(color, nums, label) {
|
|
||||||
const s = nums.join(', ');
|
|
||||||
const el = document.createElement('div');
|
|
||||||
el.className = COLORVIEW_SWATCH_CLASS;
|
|
||||||
el.style.cssText = COLORVIEW_SWATCH_CSS + color;
|
|
||||||
// break down long lists: 10 per line
|
|
||||||
el.title = `${color}\n${label} ${s.length > 50 ? s.replace(/([^,]+,\s){10}/g, '$&\n') : s}`;
|
|
||||||
el.__color = color;
|
|
||||||
return el;
|
|
||||||
}
|
|
||||||
|
|
||||||
function paletteCallback(el) {
|
function paletteCallback(el) {
|
||||||
const {cm} = this;
|
const {cm} = this;
|
||||||
const lines = el.title.split('\n')[1].match(/\d+/g).map(Number);
|
const lines = el.title.split('\n')[1].match(/\d+/g).map(Number);
|
||||||
|
|
12
js/dom.js
12
js/dom.js
|
@ -437,8 +437,16 @@ async function waitForSheet({
|
||||||
window.on('resize', () => debounce(addTooltipsToEllipsized, 100));
|
window.on('resize', () => debounce(addTooltipsToEllipsized, 100));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Using `load` event as we need transition bug suppressor active until everything loads
|
window.on('load', () => {
|
||||||
window.on('load', () => $('link[href^="global.css"]').sheet.deleteRule(0), {once: true});
|
const {sheet} = $('link[href^="global.css"]');
|
||||||
|
for (let i = 0, rule; (rule = sheet.cssRules[i]); i++) {
|
||||||
|
// Not using \0 in the id as it's converted to \xFFFD, probably a bug
|
||||||
|
if (/#.transition-suppressor/.test(rule.selectorText)) {
|
||||||
|
sheet.deleteRule(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {once: true});
|
||||||
|
|
||||||
function addFaviconFF() {
|
function addFaviconFF() {
|
||||||
const iconset = ['', 'light/'][prefs.get('iconset')] || '';
|
const iconset = ['', 'light/'][prefs.get('iconset')] || '';
|
||||||
|
|
9
privacy-policy.md
Normal file
9
privacy-policy.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# Privacy Policy
|
||||||
|
|
||||||
|
Unlike other similar extensions, we don't find you to be all that interesting. Your questionable browsing history should remain between you and the NSA. Stylus collects nothing. Period.
|
||||||
|
|
||||||
|
Again, **no data or personal information is collected by Stylus**.
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|
||||||
|
If you have any questions or suggestions regarding this privacy policy, do not hesitate to [contact us](stylus.openstyles@gmail.com).
|
|
@ -6,8 +6,8 @@ testGlobalCss();
|
||||||
|
|
||||||
function testGlobalCss() {
|
function testGlobalCss() {
|
||||||
const css = fs.readFileSync('global.css', {encoding: 'utf8'});
|
const css = fs.readFileSync('global.css', {encoding: 'utf8'});
|
||||||
const ERR = 'global.css: the first rule must be the transition suppressor';
|
const ERR = 'global.css: missing the transition suppressor rule';
|
||||||
const RX_SUPPRESSOR = /^[^{}]+{\s*transition:\s*none\s*!\s*important/i;
|
const RX_SUPPRESSOR = /[^{}]+#\\0transition-suppressor[^{}]+{\s*transition:\s*none\s*!\s*important/i;
|
||||||
const RX_COMMENT = /\/\*([^*]|\*(?!\/))*(\*\/|$)/g;
|
const RX_COMMENT = /\/\*([^*]|\*(?!\/))*(\*\/|$)/g;
|
||||||
if (!RX_SUPPRESSOR.test(css.replace(RX_COMMENT, ''))) {
|
if (!RX_SUPPRESSOR.test(css.replace(RX_COMMENT, ''))) {
|
||||||
console.error(ERR);
|
console.error(ERR);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user