From bfe18e74a42f20a874a4cbc3cc615354c1b6d014 Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 24 Aug 2018 21:12:22 +0300 Subject: [PATCH 1/6] FF bug workaround: set style element code in page context fixes #461 --- content/apply.js | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/content/apply.js b/content/apply.js index addd5d17..4778a0e0 100644 --- a/content/apply.js +++ b/content/apply.js @@ -299,13 +299,19 @@ // HTML document style; also works on HTML-embedded SVG el = document.createElement('style'); } - Object.assign(el, { - id, - type: 'text/css', - textContent: code, - }); + el.id = id; + el.type = 'text/css'; // SVG className is not a string, but an instance of SVGAnimatedString el.classList.add('stylus'); + if (!CHROME && ( + // FF bug workaround, see https://github.com/openstyles/stylus/issues/461 + location.hostname === 'www.barclaycardus.com' || + location.hostname === 'www.icloud.com' + )) { + setContentsInPageContext(el, code); + } else { + el.textContent = code; + } addStyleElement(el); } styleElements.set(id, el); @@ -313,6 +319,18 @@ return el; } + function setContentsInPageContext(el, code) { + const originalId = el.id; + el.id += performance.now(); + // when adding to ROOT we don't want our observer to pop up so we use a DIV wrapper + (document.head || ROOT.appendChild(document.createElement('div'))).appendChild(el); + (document.head || ROOT).appendChild(document.createElement('script')).text = ` + document.currentScript.remove(); + document.getElementById('${el.id}').textContent = ${JSON.stringify(code)};`; + if (!document.head) el.parentNode.remove(); + el.id = originalId; + } + function addStyleElement(newElement) { if (!ROOT) { return; @@ -443,7 +461,6 @@ function initDocRootObserver() { let lastRestorationTime = 0; let restorationCounter = 0; - let scheduledSort = false; let observing = false; let sorting = false; let observer; @@ -504,24 +521,13 @@ return true; } } - function sortStyleElements({force} = {}) { - if (!observing || - !force && scheduledSort) { - return; - } - scheduledSort = false; + function sortStyleElements() { + if (!observing) return; let prevExpected = document.documentElement.lastElementChild; while (prevExpected && isSkippable(prevExpected, true)) { prevExpected = prevExpected.previousElementSibling; } - if (!prevExpected) { - return; - } - if (!CHROME && !force && window !== top) { - requestAnimationFrame(() => sortStyleElements({force: true})); - scheduledSort = true; - return; - } + if (!prevExpected) return; for (const el of styleElements.values()) { if (!isMovable(el)) { continue; From 0dbb55cc0c1cc8021b6adef2bc124e291f6e7e85 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 25 Aug 2018 15:10:14 +0300 Subject: [PATCH 2/6] actually copy codemirror.js before patching --- tools/update-libraries.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/update-libraries.js b/tools/update-libraries.js index b67c576f..13c4b126 100644 --- a/tools/update-libraries.js +++ b/tools/update-libraries.js @@ -60,10 +60,7 @@ function updateExisting(lib) { const folderRoot = `${vendorRoot}${folder}`; const entries = fs.readdirSync(folderRoot); entries.forEach(entry => { - // Remove $1 from "CodeMirror$1" in codemirror.js - if (entry === 'codemirror.js') { - renameCodeMirrorVariable(`${folderRoot}/${entry}`); - } else if (entry !== 'README.md' && entry !== 'LICENSE') { + if (entry !== 'README.md' && entry !== 'LICENSE') { // Ignore README.md & LICENSE files const entryPath = `${folderRoot}/${entry}`; try { @@ -72,6 +69,10 @@ function updateExisting(lib) { folders.push(`${folder}/${entry}`); } else { fs.copySync(`${libRoot}${folder}/${entry}`, entryPath); + // Remove $1 from "CodeMirror$1" in codemirror.js + if (entry === 'codemirror.js') { + renameCodeMirrorVariable(entryPath); + } } } } catch (err) { From ea594550a9b38621e5c37d8db9f9b27bf4f73581 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 25 Aug 2018 15:11:03 +0300 Subject: [PATCH 3/6] CodeMirror v5.40.0 --- vendor/codemirror/README.md | 2 +- vendor/codemirror/addon/comment/comment.js | 2 +- vendor/codemirror/addon/dialog/dialog.js | 2 +- vendor/codemirror/addon/edit/closebrackets.js | 11 ++--------- vendor/codemirror/addon/edit/matchbrackets.js | 2 +- vendor/codemirror/addon/fold/brace-fold.js | 2 +- vendor/codemirror/addon/fold/comment-fold.js | 2 +- vendor/codemirror/addon/fold/foldcode.js | 2 +- vendor/codemirror/addon/fold/foldgutter.js | 2 +- vendor/codemirror/addon/fold/indent-fold.js | 2 +- vendor/codemirror/addon/hint/css-hint.js | 2 +- vendor/codemirror/addon/hint/show-hint.js | 2 +- vendor/codemirror/addon/lint/css-lint.js | 2 +- vendor/codemirror/addon/lint/json-lint.js | 2 +- vendor/codemirror/addon/lint/lint.js | 2 +- vendor/codemirror/addon/scroll/annotatescrollbar.js | 2 +- vendor/codemirror/addon/search/match-highlighter.js | 2 +- vendor/codemirror/addon/search/matchesonscrollbar.js | 2 +- vendor/codemirror/addon/search/searchcursor.js | 2 +- vendor/codemirror/addon/selection/active-line.js | 2 +- vendor/codemirror/keymap/emacs.js | 2 +- vendor/codemirror/keymap/sublime.js | 2 +- vendor/codemirror/keymap/vim.js | 2 +- vendor/codemirror/lib/codemirror.js | 12 +++++++++--- vendor/codemirror/mode/css/css.js | 2 +- vendor/codemirror/mode/javascript/javascript.js | 2 +- vendor/codemirror/mode/stylus/stylus.js | 2 +- 27 files changed, 36 insertions(+), 37 deletions(-) diff --git a/vendor/codemirror/README.md b/vendor/codemirror/README.md index fa8c98cf..f526c657 100644 --- a/vendor/codemirror/README.md +++ b/vendor/codemirror/README.md @@ -1,3 +1,3 @@ -## CodeMirror v5.39.2 +## CodeMirror v5.40.0 Only files & folders that exist in the `vendor/codemirror` folder are copied from the `node_modules/codemirror` folder. Except all theme files are copied, in case new themes have been added. diff --git a/vendor/codemirror/addon/comment/comment.js b/vendor/codemirror/addon/comment/comment.js index 84c67edf..8394e85a 100644 --- a/vendor/codemirror/addon/comment/comment.js +++ b/vendor/codemirror/addon/comment/comment.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/dialog/dialog.js b/vendor/codemirror/addon/dialog/dialog.js index f61e4476..23b06a83 100644 --- a/vendor/codemirror/addon/dialog/dialog.js +++ b/vendor/codemirror/addon/dialog/dialog.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE // Open simple dialogs on top of an editor. Relies on dialog.css. diff --git a/vendor/codemirror/addon/edit/closebrackets.js b/vendor/codemirror/addon/edit/closebrackets.js index 86b2fe1c..ce1a4ac6 100644 --- a/vendor/codemirror/addon/edit/closebrackets.js +++ b/vendor/codemirror/addon/edit/closebrackets.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS @@ -136,9 +136,7 @@ var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur) if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both"; else return CodeMirror.Pass; - } else if (opening && (cm.getLine(cur.line).length == cur.ch || - isClosingBracket(next, pairs) || - /\s/.test(next))) { + } else if (opening) { curType = "both"; } else { return CodeMirror.Pass; @@ -175,11 +173,6 @@ }); } - function isClosingBracket(ch, pairs) { - var pos = pairs.lastIndexOf(ch); - return pos > -1 && pos % 2 == 1; - } - function charsAround(cm, pos) { var str = cm.getRange(Pos(pos.line, pos.ch - 1), Pos(pos.line, pos.ch + 1)); diff --git a/vendor/codemirror/addon/edit/matchbrackets.js b/vendor/codemirror/addon/edit/matchbrackets.js index c9851bda..c918c3f9 100644 --- a/vendor/codemirror/addon/edit/matchbrackets.js +++ b/vendor/codemirror/addon/edit/matchbrackets.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/fold/brace-fold.js b/vendor/codemirror/addon/fold/brace-fold.js index 13c0f0cd..c420c02a 100644 --- a/vendor/codemirror/addon/fold/brace-fold.js +++ b/vendor/codemirror/addon/fold/brace-fold.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/fold/comment-fold.js b/vendor/codemirror/addon/fold/comment-fold.js index e8d800eb..836101d8 100644 --- a/vendor/codemirror/addon/fold/comment-fold.js +++ b/vendor/codemirror/addon/fold/comment-fold.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/fold/foldcode.js b/vendor/codemirror/addon/fold/foldcode.js index 826766b6..e146fb9f 100644 --- a/vendor/codemirror/addon/fold/foldcode.js +++ b/vendor/codemirror/addon/fold/foldcode.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/fold/foldgutter.js b/vendor/codemirror/addon/fold/foldgutter.js index 9d323265..988c67c4 100644 --- a/vendor/codemirror/addon/fold/foldgutter.js +++ b/vendor/codemirror/addon/fold/foldgutter.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/fold/indent-fold.js b/vendor/codemirror/addon/fold/indent-fold.js index f93edec2..0cc11264 100644 --- a/vendor/codemirror/addon/fold/indent-fold.js +++ b/vendor/codemirror/addon/fold/indent-fold.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/hint/css-hint.js b/vendor/codemirror/addon/hint/css-hint.js index 22642727..6cdf7281 100644 --- a/vendor/codemirror/addon/hint/css-hint.js +++ b/vendor/codemirror/addon/hint/css-hint.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/hint/show-hint.js b/vendor/codemirror/addon/hint/show-hint.js index 26dc0f00..5f6664b3 100644 --- a/vendor/codemirror/addon/hint/show-hint.js +++ b/vendor/codemirror/addon/hint/show-hint.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/lint/css-lint.js b/vendor/codemirror/addon/lint/css-lint.js index 135d031a..6058a73e 100644 --- a/vendor/codemirror/addon/lint/css-lint.js +++ b/vendor/codemirror/addon/lint/css-lint.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE // Depends on csslint.js from https://github.com/stubbornella/csslint diff --git a/vendor/codemirror/addon/lint/json-lint.js b/vendor/codemirror/addon/lint/json-lint.js index 63e70c45..ac1d6ec2 100644 --- a/vendor/codemirror/addon/lint/json-lint.js +++ b/vendor/codemirror/addon/lint/json-lint.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE // Depends on jsonlint.js from https://github.com/zaach/jsonlint diff --git a/vendor/codemirror/addon/lint/lint.js b/vendor/codemirror/addon/lint/lint.js index e00e77a2..aa75ba0e 100644 --- a/vendor/codemirror/addon/lint/lint.js +++ b/vendor/codemirror/addon/lint/lint.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/scroll/annotatescrollbar.js b/vendor/codemirror/addon/scroll/annotatescrollbar.js index f2276fc7..35662581 100644 --- a/vendor/codemirror/addon/scroll/annotatescrollbar.js +++ b/vendor/codemirror/addon/scroll/annotatescrollbar.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/search/match-highlighter.js b/vendor/codemirror/addon/search/match-highlighter.js index 260cdeb2..b344ac79 100644 --- a/vendor/codemirror/addon/search/match-highlighter.js +++ b/vendor/codemirror/addon/search/match-highlighter.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE // Highlighting text that matches the selection // diff --git a/vendor/codemirror/addon/search/matchesonscrollbar.js b/vendor/codemirror/addon/search/matchesonscrollbar.js index 8d192289..4645f5eb 100644 --- a/vendor/codemirror/addon/search/matchesonscrollbar.js +++ b/vendor/codemirror/addon/search/matchesonscrollbar.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/search/searchcursor.js b/vendor/codemirror/addon/search/searchcursor.js index e606c5e7..aae36dfe 100644 --- a/vendor/codemirror/addon/search/searchcursor.js +++ b/vendor/codemirror/addon/search/searchcursor.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/addon/selection/active-line.js b/vendor/codemirror/addon/selection/active-line.js index aa295d0d..c7b14ce0 100644 --- a/vendor/codemirror/addon/selection/active-line.js +++ b/vendor/codemirror/addon/selection/active-line.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/keymap/emacs.js b/vendor/codemirror/keymap/emacs.js index f7c51b81..d96a6fbe 100644 --- a/vendor/codemirror/keymap/emacs.js +++ b/vendor/codemirror/keymap/emacs.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/keymap/sublime.js b/vendor/codemirror/keymap/sublime.js index aa9b65e3..b4799fd6 100644 --- a/vendor/codemirror/keymap/sublime.js +++ b/vendor/codemirror/keymap/sublime.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE // A rough approximation of Sublime Text's keybindings // Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js diff --git a/vendor/codemirror/keymap/vim.js b/vendor/codemirror/keymap/vim.js index ef79585f..b03c1393 100644 --- a/vendor/codemirror/keymap/vim.js +++ b/vendor/codemirror/keymap/vim.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE /** * Supported keybindings: diff --git a/vendor/codemirror/lib/codemirror.js b/vendor/codemirror/lib/codemirror.js index c36613fb..96ec6c5f 100644 --- a/vendor/codemirror/lib/codemirror.js +++ b/vendor/codemirror/lib/codemirror.js @@ -1,7 +1,7 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE -// This is CodeMirror (http://codemirror.net), a code editor +// This is CodeMirror (https://codemirror.net), a code editor // implemented in JavaScript on top of the browser's DOM. // // You can find some technical background for some of the code below @@ -7734,6 +7734,7 @@ function defineOptions(CodeMirror) { option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }); option("autofocus", null); option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true); + option("phrases", null); } function guttersChanged(cm) { @@ -8572,6 +8573,11 @@ var addEditorMethods = function(CodeMirror) { return old }), + phrase: function(phraseText) { + var phrases = this.options.phrases; + return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText + }, + getInputField: function(){return this.display.input.getField()}, getWrapperElement: function(){return this.display.wrapper}, getScrollerElement: function(){return this.display.scroller}, @@ -9689,7 +9695,7 @@ CodeMirror.fromTextArea = fromTextArea; addLegacyProps(CodeMirror); -CodeMirror.version = "5.39.2"; +CodeMirror.version = "5.40.0"; return CodeMirror; diff --git a/vendor/codemirror/mode/css/css.js b/vendor/codemirror/mode/css/css.js index f5f3a41b..8b572290 100644 --- a/vendor/codemirror/mode/css/css.js +++ b/vendor/codemirror/mode/css/css.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/mode/javascript/javascript.js b/vendor/codemirror/mode/javascript/javascript.js index ba27c5d0..a31ffff8 100644 --- a/vendor/codemirror/mode/javascript/javascript.js +++ b/vendor/codemirror/mode/javascript/javascript.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/vendor/codemirror/mode/stylus/stylus.js b/vendor/codemirror/mode/stylus/stylus.js index a9f50c05..dbe241d6 100644 --- a/vendor/codemirror/mode/stylus/stylus.js +++ b/vendor/codemirror/mode/stylus/stylus.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE // Stylus mode created by Dmitry Kiselyov http://git.io/AaRB From 6f53d20491b1765faf409c6be60759b65a63bed9 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 25 Aug 2018 15:11:14 +0300 Subject: [PATCH 4/6] update package.json --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 086870d2..e4b9cc8d 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "repository": "openstyles/stylus", "author": "Stylus Team", "devDependencies": { - "archiver": "^2.1.1", - "codemirror": "^5.39.2", - "eslint": "^5.3.0", + "archiver": "^3.0.0", + "codemirror": "^5.40.0", + "eslint": "^5.4.0", "fs-extra": "^7.0.0", "jsonlint": "^1.6.3", "less": "^3.8.1", @@ -17,7 +17,7 @@ "semver-bundle": "^0.1.1", "stylelint-bundle": "^8.0.0", "stylus-lang-bundle": "^0.54.5", - "updates": "^4.1.2" + "updates": "^4.2.1" }, "scripts": { "lint": "eslint **/*.js || true", From 687dba8adbdf5b3e4a1630cff787990eff945834 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 25 Aug 2018 19:50:45 +0300 Subject: [PATCH 5/6] typo --- _locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index a7ea1fb4..0e9e5938 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1185,7 +1185,7 @@ "description": "Note in the popup when opened on addons.mozilla.org in Firefox >= 59" }, "unreachableAMOHintNewFF": { - "message": "In Firefox 60 and newer you'll also have to to remove AMO domain from in .", + "message": "In Firefox 60 and newer you'll also have to remove AMO domain from in .", "description": "Note in the popup when opened on addons.mozilla.org in Firefox >= 59" }, "unreachableAMOHintOldFF": { From f09380af769c37b0d08d5540a5c73a46751874d9 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 25 Aug 2018 20:25:15 +0300 Subject: [PATCH 6/6] update locales --- _locales/en_GB/messages.json | 12 ------ _locales/et/messages.json | 9 +++++ _locales/fr/messages.json | 3 ++ _locales/ja/messages.json | 6 +++ _locales/pl/messages.json | 3 ++ _locales/pt_PT/messages.json | 3 ++ _locales/ro/messages.json | 45 ++++++++++++++++++++++ _locales/sv/messages.json | 72 ++++++++++++++++++++++++++++++++++++ _locales/zh_CN/messages.json | 3 ++ 9 files changed, 144 insertions(+), 12 deletions(-) diff --git a/_locales/en_GB/messages.json b/_locales/en_GB/messages.json index e9463d20..9765b9cc 100644 --- a/_locales/en_GB/messages.json +++ b/_locales/en_GB/messages.json @@ -2,9 +2,6 @@ "appliesRemoveError": { "message": "Cannot remove last 'applies to' entry" }, - "applyAllUpdates": { - "message": "Apply all updates" - }, "checkAllUpdatesForce": { "message": "Check again—I didn't edit any styles!" }, @@ -20,18 +17,9 @@ "colorpickerTooltip": { "message": "Open colour picker" }, - "confirmDiscardChanges": { - "message": "Discard the changes?" - }, - "deleteStyleConfirm": { - "message": "Are you sure you want to delete this style?" - }, "description": { "message": "Redesign the web with Stylus, a user-style manager. Stylus allows you to easily install themes and skins for many popular sites." }, - "dragDropMessage": { - "message": "Drop your backup file anywhere on this page to import." - }, "editGotoLine": { "message": "Go to line (or line:col)" }, diff --git a/_locales/et/messages.json b/_locales/et/messages.json index 8ea5e8db..2dcc4f3a 100644 --- a/_locales/et/messages.json +++ b/_locales/et/messages.json @@ -394,6 +394,9 @@ "installUpdateFromLabel": { "message": "Kontrolli uuendusi" }, + "installUpdateUnavailable": { + "message": "Uuenduste kontrollimise lubamiseks lohista failid kaartide ribale või määratle stiili metaandmetes @updateURL." + }, "license": { "message": "Litsents" }, @@ -406,6 +409,9 @@ "linkStylusWiki": { "message": "Viki" }, + "linkTranslate": { + "message": "Tõlgi" + }, "linterCSSLintIncompatible": { "message": "CSSLint ei toeta eeltöötlejat $preprocessorname$", "placeholders": { @@ -968,6 +974,9 @@ "updatesCurrentlyInstalled": { "message": "Uuendused paigaldatud:" }, + "usercssAvoidOverwriting": { + "message": "Olemasoleva stiili ülekirjutamise vältimiseks palun muuda @name või @namespace väärtused." + }, "usercssConfigIncomplete": { "message": "Stiili uuendati või eemaldati pärast seadistusdialoogi kuvamist. Neid muutujaid ei salvestatud, et vältida stiili metaandmete korrumpeerumist:" }, diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 98f00654..af1f43dd 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -962,6 +962,9 @@ "updatesCurrentlyInstalled": { "message": "Mises à jour installées :" }, + "usercssAvoidOverwriting": { + "message": "Veuillez changer la valeur de @name ou @namespace afin d'éviter d'écraser un style pré-existant." + }, "usercssConfigIncomplete": { "message": "Le style a été mis à jour ou supprimer après l’apparition du dialogue de confirmation. Ces variables n’ont pas été sauvegardées pour éviter de corrompre les métadonnées du style :" }, diff --git a/_locales/ja/messages.json b/_locales/ja/messages.json index 06b66b69..f371bd53 100644 --- a/_locales/ja/messages.json +++ b/_locales/ja/messages.json @@ -406,6 +406,9 @@ "linkGetStyles": { "message": "スタイルを取得" }, + "linkStylusWiki": { + "message": "ウィキ" + }, "linkTranslate": { "message": "翻訳" }, @@ -971,6 +974,9 @@ "updatesCurrentlyInstalled": { "message": "更新がインストールされました:" }, + "usercssAvoidOverwriting": { + "message": "既存のスタイルの上書きを避けるために、@name または @namespace の値を変更してください。" + }, "usercssConfigIncomplete": { "message": "設定ダイアログの表示後に、スタイルが更新または削除されました。スタイルのメタデータの破損を避けるため、これらの変数は保存されませんでした:" }, diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json index c28f44ae..867f11d2 100644 --- a/_locales/pl/messages.json +++ b/_locales/pl/messages.json @@ -980,6 +980,9 @@ "updatesCurrentlyInstalled": { "message": "Zainstalowane aktualizacje:" }, + "usercssAvoidOverwriting": { + "message": "Proszę zmienić wartość @name lub @namespace, aby uniknąć nadpisania istniejącego stylu." + }, "usercssConfigIncomplete": { "message": "Styl został zaktualizowany lub usunięty po wyświetleniu okna dialogowego konfiguracji. Te zmienne nie zostały zapisane, aby uniknąć uszkodzenia metadanych stylu:" }, diff --git a/_locales/pt_PT/messages.json b/_locales/pt_PT/messages.json index 784a2d36..bd6ef471 100644 --- a/_locales/pt_PT/messages.json +++ b/_locales/pt_PT/messages.json @@ -962,6 +962,9 @@ "updatesCurrentlyInstalled": { "message": "Atualizações instaladas:" }, + "usercssAvoidOverwriting": { + "message": "Por favor modifique o valor de @name ou @namespace para evitar sobrescrever um estilo existente." + }, "usercssConfigIncomplete": { "message": "O estilo foi atualizado ou eliminado após a exibição do diálogo de configuração. Essas variáveis não foram guardadas para evitar corromper os metadados do estilo:" }, diff --git a/_locales/ro/messages.json b/_locales/ro/messages.json index e28cfda9..25923945 100644 --- a/_locales/ro/messages.json +++ b/_locales/ro/messages.json @@ -106,6 +106,12 @@ "cm_resizeGripHint": { "message": "Dublu click pentru a maximiza sau restaura înălțimea" }, + "cm_selectByTokens": { + "message": "Dublu-click pentru a selecta simbolurile" + }, + "cm_selectByTokensTooltip": { + "message": "Exemple de simboluri: .foo-bar-2 #aabbcc 0.32 !important\nCand inactiv: cuvinte delimitate cu punctuatie sunt selectate." + }, "cm_smartIndent": { "message": "Folosiți indentare inteligentă" }, @@ -236,6 +242,12 @@ "findStylesInlineTooltip": { "message": "Arătați rezultatele căutării în această pagină." }, + "genericAdd": { + "message": "Adaugă" + }, + "genericClone": { + "message": "Clonează" + }, "genericDisabledLabel": { "message": "Dezactivat" }, @@ -340,6 +352,9 @@ "installUpdateFromLabel": { "message": "Verificați update-urile" }, + "installUpdateUnavailable": { + "message": "Pentru a activa verificarea de updates. trage fișierul pe taburi (zona cu titluri) sau specifica @updateURL în metadata temei." + }, "license": { "message": "Licență" }, @@ -349,6 +364,9 @@ "linkGetStyles": { "message": "Căutați teme" }, + "linkTranslate": { + "message": "Traduce" + }, "linterCSSLintIncompatible": { "message": "CSSLint nu suportă preprocesorul $preprocessorname$ ", "placeholders": { @@ -394,6 +412,12 @@ "liveReloadError": { "message": "A avut loc o eroare în timpul monitorizării acestui fișier" }, + "liveReloadInstallHint": { + "message": "Reload automat este activat deci tema instalată va fi updatată automat când acest tab si fișierul surca sunt deschise." + }, + "liveReloadUnavailable": { + "message": "Pentru a activa live reload (refresh automat), trage fișierul pe taburi (zona unde titlurile temelor sunt afișate) " + }, "manageFavicons": { "message": "Favicons în coloana 'se aplică la'" }, @@ -469,6 +493,9 @@ "optionsAdvancedExposeIframes": { "message": "Expuneți iframes via HTML[stylus-iframe]" }, + "optionsAdvancedExposeIframesNote": { + "message": "Expune domain-ul site-ului in fiecare iframe.\nActivează scrierea de CSS specific pentru iframe precum:\nhtml[stylus-iframe$=\"twitter.com\"] h1 { display:none }" + }, "optionsAdvancedNewStyleAsUsercss": { "message": "Scrieți temă nouă în formatul usercss" }, @@ -568,6 +595,9 @@ "prefShowBadge": { "message": "Numărul de teme active pentru site-ul curent" }, + "previewTooltip": { + "message": "Aplică temporar modificările fără a salva.\nSalvează tema pentru a face schimbările permanente." + }, "replace": { "message": "Înlocuiți" }, @@ -622,6 +652,9 @@ "sectionRemove": { "message": "Ștergeți secțiunea" }, + "sectionRestore": { + "message": "Restaurează o secțiune ștearsă" + }, "shortcutsNote": { "message": "Creeați keyboard shortcuts" }, @@ -655,6 +688,9 @@ "styleBeautifyIndentConditional": { "message": "Indentare @media, @supports" }, + "styleBeautifyPreserveNewlines": { + "message": "Menține linii noi" + }, "styleCancelEditLabel": { "message": "Înapoi la manager" }, @@ -810,6 +846,9 @@ "unreachableAMOHint": { "message": "Pentru a permite accesul deschideți , right-click pe listă, click 'New', apoi 'Boolean', paste și click OK, , OK, reâncărcați pagina ." }, + "unreachableAMOHintNewFF": { + "message": "În Firefox 60+ va trebui sa fie șters domain-ul AMO din din ." + }, "unreachableAMOHintOldFF": { "message": "Doar Firefox 59 sau mai nou poate fi configurat să permită WebExtension-urilor să adauge elemente la site-uri CSP-protected precum acesta." }, @@ -860,6 +899,9 @@ "updatesCurrentlyInstalled": { "message": "Update-uri instalate:" }, + "usercssAvoidOverwriting": { + "message": "Vă rugăm să modificați valoarea @name și @namespace pentru a împiedica scrierea peste o temă existentă." + }, "usercssConfigIncomplete": { "message": "Tema a fost updatată sau ștearsă după ce configurațiile au fost afișate. Aceste variabile nu au fost salvate pentru a nu corupe metadata temei." }, @@ -872,6 +914,9 @@ "usercssReplaceTemplateName": { "message": "@name este gol și înlocuiețte valoarea de bază" }, + "usercssReplaceTemplateSectionBody": { + "message": "Introduce cod aici..." + }, "versionInvalidOlder": { "message": "Versiunea este mai veche decât cea instalată." }, diff --git a/_locales/sv/messages.json b/_locales/sv/messages.json index 713e1713..2a3ae884 100644 --- a/_locales/sv/messages.json +++ b/_locales/sv/messages.json @@ -5,6 +5,9 @@ "addStyleTitle": { "message": "Lägg till stil" }, + "alphaChannel": { + "message": "Opacitet" + }, "appliesAdd": { "message": "Lägg till" }, @@ -46,6 +49,9 @@ "applyAllUpdates": { "message": "Verkställ alla uppdateringar" }, + "bckpInstStyles": { + "message": "Exportera stilar" + }, "checkAllUpdates": { "message": "Sök efter uppdateringar" }, @@ -129,9 +135,15 @@ "externalUsercssDocument": { "message": "Dokumentation för Usercss" }, + "findStyles": { + "message": "Hitta stilar" + }, "findStylesForSite": { "message": "Hitta fler stilar för denna sida" }, + "genericAdd": { + "message": "Lägg till" + }, "genericDisabledLabel": { "message": "Inaktiverad" }, @@ -141,6 +153,15 @@ "genericHistoryLabel": { "message": "Historik" }, + "genericNext": { + "message": "Nästa" + }, + "genericPrevious": { + "message": "Föregående" + }, + "genericResetLabel": { + "message": "Återställ" + }, "helpAlt": { "message": "Hjälp" }, @@ -165,6 +186,18 @@ "linkGetStyles": { "message": "Skaffa stilar" }, + "linkTranslate": { + "message": "Översätt" + }, + "manageFavicons": { + "message": "Ikoner i 'Gäller för' kolumnen" + }, + "manageFaviconsGray": { + "message": "Nedtonade" + }, + "manageFaviconsHelp": { + "message": "Stylus använder en extern tjänst https://www.google.com/s2/favicons" + }, "manageFilters": { "message": "Filter" }, @@ -201,12 +234,39 @@ "openManage": { "message": "Hantera installerade stilar" }, + "openOptionsPopup": { + "message": "Alternativ" + }, + "openStylesManager": { + "message": "Öppna stilhanteraren" + }, "optionsAdvancedNewStyleAsUsercss": { "message": "Skriv ny stil som Usercss" }, + "optionsCheck": { + "message": "Uppdatera stilar" + }, + "optionsCheckUpdate": { + "message": "Leta efter och installera alla tillgängliga uppdateringar" + }, "optionsHeading": { "message": "Alternativ" }, + "optionsOpenManager": { + "message": "Hantera stilar" + }, + "optionsReset": { + "message": "Återställ alternativen till standard" + }, + "optionsResetButton": { + "message": "Återställ alternativ" + }, + "paginationNext": { + "message": "Nästa sida" + }, + "paginationPrevious": { + "message": "Föregående sida" + }, "popupStylesFirst": { "message": "Lista stilar före kommandon i verktygsfältets knappmeny" }, @@ -222,6 +282,9 @@ "replaceWith": { "message": "Ersätt med" }, + "retrieveBckp": { + "message": "Importera stilar" + }, "search": { "message": "Sök" }, @@ -243,6 +306,15 @@ "sectionRemove": { "message": "Ta bort sektion" }, + "sectionRestore": { + "message": "Återställ borttagen sektion" + }, + "shortcuts": { + "message": "Genvägar" + }, + "shortcutsNote": { + "message": "Ställ in tangentbordsgenvägar" + }, "styleBadRegexp": { "message": "Regexp:en är ogiltig" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index b3cfab78..94eabd6f 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -703,6 +703,9 @@ "sectionRemove": { "message": "删除此部分" }, + "sectionRestore": { + "message": "撤销删除" + }, "shortcuts": { "message": "快捷键" },