Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install styles from *.user.css file #134

Merged
merged 252 commits into from
Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
252 commits
Select commit Hold shift + click to select a range
81f490c
Fix: csslint is moved
eight04 Aug 30, 2017
6aaa7ef
Fix: configure icon
eight04 Sep 1, 2017
9c2acd5
Fix: remove unused variable 'event'
eight04 Sep 1, 2017
8607d77
Change how var is saved
eight04 Sep 1, 2017
dfb7ac9
Extend messageBox to set onclick handler on buttons
eight04 Sep 1, 2017
acd9bef
Change how configure dialog works.
eight04 Sep 1, 2017
0e5ab44
Fix: remove message.js dependency from localization.js
eight04 Sep 1, 2017
3c40b52
Add 'injectResource' message to inject js/css
eight04 Sep 1, 2017
4dec097
Rewrite usercss installation page
eight04 Sep 1, 2017
b3b4769
Fix: display homepage icon for usercss
eight04 Sep 1, 2017
78264a1
Add: parse more metas, add variable type
eight04 Sep 5, 2017
f74641e
Add: make filterUsercss build code to get section includes
eight04 Sep 5, 2017
6e52d48
Add: Add 'applies to' to install page
eight04 Sep 5, 2017
3f06ce8
Fix: don't mix url and updateUrl
eight04 Sep 5, 2017
f7a43d7
Add: draw different type of input
eight04 Sep 5, 2017
1f44898
Add: adopt node-semver
eight04 Sep 5, 2017
4e0f4b3
Add: colorParser
eight04 Sep 5, 2017
bf45575
Use options dialog style
eight04 Sep 5, 2017
3daff40
Add: vars validation
eight04 Sep 9, 2017
cb23f89
Add: allow saveUsercss to build style
eight04 Sep 10, 2017
8c374db
Add: live-reload
eight04 Sep 10, 2017
1c33172
Refactor: init
eight04 Sep 10, 2017
cfdb0b4
Add mode stylus, loadmode
eight04 Sep 11, 2017
8bc6986
Change: make unknown preprocessor throw
eight04 Sep 11, 2017
a15493b
Add: source editor
eight04 Sep 11, 2017
f305719
Fix: update progress
eight04 Sep 11, 2017
381ee88
Fix: i18n error message
eight04 Sep 11, 2017
20481c9
Fix: i18n config dialog
eight04 Sep 11, 2017
3730a4e
Fix: i18n and escapeHtml, url
eight04 Sep 11, 2017
41f0174
Add: valid url
eight04 Sep 11, 2017
d4ddefe
Merge branch 'master' of https://github.com/openstyles/stylus into de…
eight04 Sep 11, 2017
de84248
Fix: add editors hack
eight04 Sep 11, 2017
e2ea93a
Fix: decodeURI -> encodeURI
eight04 Sep 11, 2017
5fecd7e
Drop .before, .after, .prepend, .append
eight04 Sep 11, 2017
6ce4af8
Fix: wrong indentation
eight04 Sep 12, 2017
8207d60
Fix: injectResource -> injectContent
eight04 Sep 12, 2017
33200db
Fix: cleanup injectContent
eight04 Sep 12, 2017
a395df1
Fix: rewrite filterUsercss
eight04 Sep 12, 2017
e13a6f6
Fix: saveUsercss
eight04 Sep 12, 2017
e1d221e
Fix: saveStyle indent
eight04 Sep 12, 2017
f3176de
Fix: findDupUsercss indent
eight04 Sep 12, 2017
97b4d91
Fix: communicate -> runtimeSend
eight04 Sep 12, 2017
bbe37ad
Fix: drop tHTML
eight04 Sep 12, 2017
43b912c
Fix: remove suffix check
eight04 Sep 12, 2017
e4d3025
Revert changes to editors global
eight04 Sep 12, 2017
27f8bc2
Fix: don't use leading underscore for function name
eight04 Sep 12, 2017
7612cd3
Fix: move createEmptyStyle, windowLoaded into init
eight04 Sep 12, 2017
02c61b9
Fix: self -> _
eight04 Sep 12, 2017
e7eb38b
Fix: drop dummy Promise.resolve
eight04 Sep 12, 2017
4b2f7a1
Fix: make codeIsUpdated flag work properly
eight04 Sep 12, 2017
39df704
Fix: move editor creation to one structure
eight04 Sep 12, 2017
431dbdc
Fix: remove escapeHtml completely
eight04 Sep 12, 2017
7c1b140
Fix: drop tHTML
eight04 Sep 12, 2017
51e92e5
Fix: use IIFE for try-catch in tDocLoader
eight04 Sep 12, 2017
9069562
Fix: err -> e
eight04 Sep 12, 2017
e3c3dcc
Fix: use .map to build vars
eight04 Sep 12, 2017
a3f26d8
Fix: _parse -> parseRGB
eight04 Sep 12, 2017
8e5ffd0
Fix: use rgb() when alpha === 1
eight04 Sep 12, 2017
6b1d656
Fix: drop pad
eight04 Sep 12, 2017
23bd3e2
fixup! Fix: err -> e
eight04 Sep 12, 2017
a1b8945
Fix: remove try-catch in util.js
eight04 Sep 12, 2017
dc37588
Fix: drop windowLoaded
eight04 Sep 12, 2017
2506b95
Fix: rewrite loadScript, merge onDOMscripted, injectCSS, injectScript
eight04 Sep 12, 2017
2342cc5
fixup! Fix: rewrite loadScript, merge onDOMscripted, injectCSS, injec…
eight04 Sep 12, 2017
acaa1ed
Fix: appendChild -> textContent
eight04 Sep 12, 2017
436551a
Fix: alpha channel -> opacity
eight04 Sep 12, 2017
6165487
Fix: use lowercase placeholder
eight04 Sep 12, 2017
93fe23f
Fix: innerHTML -> textContent
eight04 Sep 12, 2017
279c7d0
Fix: _style -> newStyle
eight04 Sep 12, 2017
31464bb
Fix: reference error
eight04 Sep 13, 2017
fa06b29
Fix: add 'v' before version
eight04 Sep 13, 2017
b102aa0
Fix: beforeunload warning
eight04 Sep 13, 2017
6195e55
Fix: draw title
eight04 Sep 13, 2017
0e92e6d
Add applies-to line widget
eight04 Sep 13, 2017
d7f0e3c
fixup! Fix: draw title
eight04 Sep 13, 2017
b61b058
Fix: pull out makeLink
eight04 Sep 13, 2017
3c450e7
Fix: resize grip style
eight04 Sep 13, 2017
411df8b
Fix: no need to use $$ for element existence check
eight04 Sep 13, 2017
40a5dab
Fix: script order of loadLinterAssets
eight04 Sep 13, 2017
97fd2aa
Compat: firefox
eight04 Sep 13, 2017
b7b5888
Fix: should't edit the style object directly returned from getStyles …
eight04 Sep 14, 2017
37c83ce
Fix: shouldn't contain new line
eight04 Sep 14, 2017
2ba4c4f
Fix: remove debounce dependency
eight04 Sep 14, 2017
70bbc08
Add editor.appliesToLineWidget option
eight04 Sep 14, 2017
a542d22
Fix: adjust install page layout
eight04 Sep 14, 2017
553cc94
Fix: style install button
eight04 Sep 14, 2017
5a9ac5c
Add: scroll the editor when cursor is outside of the editor
eight04 Sep 14, 2017
21256e3
Fix: wrap long line
eight04 Sep 15, 2017
eaf33af
Rewrite parser, add uso preprocessor
eight04 Sep 15, 2017
ccb5f48
Fix: move to new format
eight04 Sep 15, 2017
693a048
Add: offset info
eight04 Sep 15, 2017
a73493d
Add: make applies-to line widget editable
eight04 Sep 15, 2017
4d6f856
Revert "Add: scroll the editor when cursor is outside of the editor"
eight04 Sep 15, 2017
dc988a4
Revert: editors
eight04 Sep 16, 2017
a0495f4
Change style structure
eight04 Sep 16, 2017
aed3698
Fix: looseJSONParse doesn't work on chrome 49
eight04 Sep 16, 2017
90ca2f2
Fix: autocomplete should use changes event
eight04 Sep 17, 2017
94e5336
Fix: don't set updateUrl to a local file
eight04 Sep 17, 2017
1e9ee78
Fix: normalize new line
eight04 Sep 18, 2017
1d829fe
Fix: split up usercss logic from saveStyle
eight04 Sep 18, 2017
94a7e0c
Fix: manually updated usercss doesn't keep settings
eight04 Sep 18, 2017
aa71984
Fix: save name when updating usercss
eight04 Sep 18, 2017
ead006a
Fix: remove button style
eight04 Sep 18, 2017
d1964bb
Fix: make download be able to read file:
eight04 Sep 18, 2017
ba4c06a
Fix: lint initialize issue
eight04 Sep 18, 2017
0852b56
Fix: add set updateUrl option
eight04 Sep 19, 2017
2b6404c
Fix: stop live-reload and refresh the page when style is removed
eight04 Sep 19, 2017
a4e3fba
Fix: source editor is not closed when style is removed
eight04 Sep 19, 2017
18fd153
WIP: install page
eight04 Sep 24, 2017
24cd856
WIP: install page + editor
eight04 Sep 24, 2017
cb7aaa7
Fix: move to root
eight04 Sep 24, 2017
587feb3
Fix: externalLink might be null
eight04 Sep 25, 2017
7365a8b
Fix: various fixes
eight04 Sep 25, 2017
04ebc83
Fix: use closeCurrentTab
eight04 Sep 25, 2017
c2eadda
Add: live-reload
eight04 Sep 25, 2017
2912a53
Fix: missing id when updating digest
eight04 Oct 4, 2017
6636d33
Fix: install error when live-reload is disabled
eight04 Oct 4, 2017
bb508b6
Fix: import error is not displayed correctly
eight04 Oct 4, 2017
b69b834
Fix: handle editor.options.expanded
eight04 Oct 4, 2017
0f6de58
Add: remove/add button in applies-to widget
eight04 Oct 5, 2017
b866688
Add: parse author string
eight04 Oct 6, 2017
c0514a6
Change: default linter
eight04 Oct 6, 2017
f194155
Add: close source tab after install
eight04 Oct 6, 2017
0d4d058
Fix: remove unused initInstallPage
eight04 Oct 6, 2017
da5626a
Add: save usercss from multi-section editor
eight04 Oct 6, 2017
56e669f
Fix: normalize version
eight04 Oct 6, 2017
fc51d80
Fix: force using stylelint when editor mode is not css
eight04 Oct 7, 2017
40a1781
Fix: TypeError when missing author meta
eight04 Oct 7, 2017
7652315
Fix: onbeforeunload handler would disable the save button
eight04 Oct 7, 2017
f255631
Fix: live-reload doesn't send style id
eight04 Oct 7, 2017
9ee7e20
Refactor: split out regexp tester
eight04 Oct 7, 2017
50a5bbe
Add: regexp tester in applies-to line widget
eight04 Oct 8, 2017
8007f47
Revert "Add: save usercss from multi-section editor"
eight04 Oct 8, 2017
3cb1943
Add: newStyleFormat option
eight04 Oct 8, 2017
228057d
Add: make source editor work with newly created style
eight04 Oct 8, 2017
1a6f9df
Add: confirmation to replace dirty style
eight04 Oct 8, 2017
2f3c477
Fix: openEditor has no response
eight04 Oct 8, 2017
cd00c20
Fix: newStyleFormat -> newStyleInUsercss
eight04 Oct 8, 2017
a901ca2
Add: allow array in var select
eight04 Oct 8, 2017
77b6b6c
Change: drop looseJSONParse
eight04 Oct 8, 2017
1d1c7da
Fix: hide the header in error page
eight04 Oct 8, 2017
c0378e3
Fix: uso preprocessor infinite recursion
eight04 Oct 8, 2017
4115705
Fix: uso replace doesn't work on var select
eight04 Oct 8, 2017
3906060
Add: multi-line string syntax
eight04 Oct 8, 2017
5b701d0
Add: detail dialog. Move makeAuthor to dom.js. Move external.svg into
eight04 Oct 10, 2017
2642206
Change: the layout of color input
eight04 Oct 11, 2017
7ca9938
Change: always set updateUrl
eight04 Oct 11, 2017
ce2a214
Add: usercss documentation link in the editor
eight04 Oct 11, 2017
eec52ad
Revert "Add: detail dialog. Move makeAuthor to dom.js. Move external.…
eight04 Oct 12, 2017
40ad783
Change: allow makeLink to append child. Add rel=noopener
eight04 Oct 12, 2017
33607e7
Fix: let makeAuthor use makeLink
eight04 Oct 12, 2017
54076d9
Merge branch 'master' of https://github.com/openstyles/stylus into de…
eight04 Oct 12, 2017
a1ca416
Fix: miss makeLink global
eight04 Oct 14, 2017
7c22489
Change: let makeLink accept object
eight04 Oct 14, 2017
c1d2857
Add: config dialog heading - feedback link
eight04 Oct 14, 2017
9770523
Fix: vertical rhythm in config dialog
eight04 Oct 14, 2017
96a046f
Fix: toggle style outside of the editor
eight04 Oct 14, 2017
368bb34
Fix: make updateLinter wait linterConfig to load
eight04 Oct 14, 2017
9590238
Fix: default linter hacks
eight04 Oct 15, 2017
be4a896
Fix: disable CSSLint option in stylus mode
eight04 Oct 16, 2017
831a4ef
Fix: remove logging in wrapReject
eight04 Oct 16, 2017
0a6de8e
Add: make dirtyReporter.clear accept a key
eight04 Oct 16, 2017
ce348d4
Fix: add isWarm flag to decide if the editor can be reloaded
eight04 Oct 16, 2017
7101362
Fix: description for linterCSSLintIncompatible
eight04 Oct 16, 2017
adc0c80
Fix: lazy load regexp tester
eight04 Oct 29, 2017
62748b3
Fix: use arrow function for IIFE
eight04 Oct 29, 2017
6fac838
Fix: unused translation
eight04 Nov 1, 2017
6536028
Fix: typo
eight04 Nov 1, 2017
6f51100
Fix: unused injectContent
eight04 Nov 1, 2017
79b6266
Fix: no new line before use strict
eight04 Nov 1, 2017
098dc10
Fix: pull out runtimeSend
eight04 Nov 1, 2017
398056c
Fix: _source -> newSource
eight04 Nov 1, 2017
13ca45a
Fix: reorder global comment
eight04 Nov 1, 2017
45da3ff
Fix: style.id consistency
eight04 Nov 1, 2017
9dddbbb
Fix: unused getName
eight04 Nov 1, 2017
534803c
Fix: isWarm
eight04 Nov 1, 2017
8f642dc
Fix: drop innerHTML
eight04 Nov 1, 2017
6a53ea4
Refactor: pull out createAppliesToLineWidget
eight04 Nov 1, 2017
d981660
Fix: drop getParams
eight04 Nov 1, 2017
45e70b2
Fix: use Array.isArray
eight04 Nov 1, 2017
f35fbb5
Fix: add styleMetaErrorSelectValueMismatch
eight04 Nov 1, 2017
71a1c5e
Fix: old -> oldStyle
eight04 Nov 1, 2017
db1643e
Refactor: pull out colorParser
eight04 Nov 1, 2017
0ad0c70
Fix: unnecessary trim line
eight04 Nov 1, 2017
2b17c07
Fix: use CodeMirror.defineExtension
eight04 Nov 1, 2017
5a9f78e
Add: key:label syntax in var select
eight04 Nov 4, 2017
391cfb5
Fix: then -> than the
eight04 Nov 8, 2017
90be1da
Fix: status: 'success' -> success: true
eight04 Nov 8, 2017
08c7004
Fix: use switch for version compare
eight04 Nov 8, 2017
8d19e0b
Fix: noReject in one line
eight04 Nov 8, 2017
92b01e1
Fix: reindent single then
eight04 Nov 8, 2017
e0bd991
Fix: promise indent
eight04 Nov 8, 2017
f70cf01
Fix: move let definition into one line
eight04 Nov 8, 2017
285f314
Fix: style -> gutterStyle
eight04 Nov 8, 2017
a7b73e8
Fix: use debounce
eight04 Nov 8, 2017
caaeec0
Fix: use Math.max
eight04 Nov 8, 2017
191603a
Fix: makeInputEl -> makeLi
eight04 Nov 8, 2017
9d1b088
Fix: use this.value
eight04 Nov 8, 2017
3c51361
Fix: use messageBox
eight04 Nov 8, 2017
8094149
Refactor: add createApply
eight04 Nov 8, 2017
3d57fd4
Fix: e.target -> this
eight04 Nov 8, 2017
0c64e60
Fix: insertBefore -> insertAdjancentElement
eight04 Nov 8, 2017
3844b3d
Fix: cm.findPosH in one line
eight04 Nov 8, 2017
2edd22e
Fix: normalizeString -> unquote
eight04 Nov 8, 2017
92cadc0
Fix: avoid return short circuit for editor selection
eight04 Nov 8, 2017
c4c4b56
Refactor: isUsercss
eight04 Nov 8, 2017
b4dfe5c
Fix: use isArray
eight04 Nov 8, 2017
eef17cc
Fix: replaceMetas -> replaceMeta
eight04 Nov 8, 2017
48e5650
Fix: reindent promise
eight04 Nov 8, 2017
0d06f32
Fix: updateMetas -> updateMeta
eight04 Nov 8, 2017
fa1c55b
Fix: EOF
eight04 Nov 8, 2017
7266c38
Fix: inline svg
eight04 Nov 9, 2017
2b614bd
Fix: dom.js is not a content script anymore
eight04 Nov 9, 2017
5f5b06b
Fix: use FIREFOX variable
eight04 Nov 9, 2017
0c292c3
Fix: download should throw status code
eight04 Nov 9, 2017
95e3ba1
Fix: newStyleInUsercss -> newStyleAsUsercss
eight04 Nov 9, 2017
3a78681
Fix: use .map to build varDef
eight04 Nov 9, 2017
6358162
Fix: createOption in one line
eight04 Nov 9, 2017
f86d0fc
Fix: use sticky flag to avoid slicing string
eight04 Nov 9, 2017
a1b818f
Fix: invalid default value for dropdown
eight04 Nov 9, 2017
09e7d67
Refactor: buildMeta
eight04 Nov 9, 2017
7842ac7
i18n: styleMetaErrorPreprocessor
eight04 Nov 9, 2017
c17433c
Fix: use switch-case
eight04 Nov 9, 2017
dd64551
Fix: set dirty prop in one line
eight04 Nov 9, 2017
78c1a1b
Fix: el -> elements
eight04 Nov 9, 2017
5dd322e
Refactor: shouldShowConfig
eight04 Nov 9, 2017
f070d7f
Fix: indent of promises
eight04 Nov 9, 2017
137198e
Refactor: messageBox
eight04 Nov 9, 2017
4a8894d
Add: use messageBox in install page
eight04 Nov 9, 2017
1dd0dbf
Revert: isSame/isEdited util
eight04 Nov 9, 2017
29f5daa
i18n: live reload error
eight04 Nov 9, 2017
3011ba8
Fix: isInit -> initialized
eight04 Nov 9, 2017
9a8c19b
Fix: move isClean into unbeforeunload handler
eight04 Nov 9, 2017
988a920
Fix: use getOwnTab in closeCurrentTab
eight04 Nov 9, 2017
d03c752
Fix: promise indent
eight04 Nov 9, 2017
53770c0
i18n: appliesRemoveError
eight04 Nov 9, 2017
6d411c0
Fix: use sticky flag to avoid text slicing
eight04 Nov 9, 2017
d93bf05
Fix: isWarm -> isTouched
eight04 Nov 9, 2017
c268757
Add setStyleDirty, refactor replaceStyle
eight04 Nov 9, 2017
ae50cbe
Refactor: move alert/confirm util to msgbox.js
eight04 Nov 9, 2017
4d8268b
Fix: use messageBox
eight04 Nov 9, 2017
d02984e
Add: expose parseError.index
eight04 Nov 9, 2017
79a7a21
Fix: align text to left in pre
eight04 Nov 9, 2017
a1c1eb3
Add: draw line pointer for parsing error
eight04 Nov 9, 2017
7543b84
Fix: messageBox global
eight04 Nov 9, 2017
ecc306d
Change: move header to the top
eight04 Nov 11, 2017
d59f24c
Change: a simpler installUpdateFromLabel
eight04 Nov 11, 2017
9b41a70
Fix: link style
eight04 Nov 11, 2017
26e46a9
Fix: min height of message box title
eight04 Nov 11, 2017
58c0239
Change: allow select to stretch up to 124px
eight04 Nov 11, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 184 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"message": "Add Style",
"description": "Title of the page for adding styles"
},
"alphaChannel": {
"message": "Opacity",
"description": "Label of color's opacity"
},
"appliesAdd": {
"message": "Add",
"description": "Label for the button to add an 'applies' entry"
Expand Down Expand Up @@ -36,6 +40,14 @@
"message": "Applies to",
"description": "Label for 'applies to' fields on the edit/add screen"
},
"appliesLineWidgetLabel": {
"message": "Display 'Applies to' info",
"description": "Label for the checkbox to display applies-to information in the single editor"
},
"appliesLineWidgetWarning": {
"message": "Does not work with minified CSS",
"description": "A warning that applies-to information won't show properly with minified CSS"
},
"appliesRegexpOption": {
"message": "URLs matching the regexp",
"description": "Option to make the style apply to the entered string as a regular expression"
Expand All @@ -44,6 +56,10 @@
"message": "Remove",
"description": "Label for the button to remove an 'applies' entry"
},
"appliesRemoveError": {
"message": "Can not remove last 'applies to' entry",
"description": "Error displayed when the last 'applies' is going to be removed"
},
"appliesSpecify": {
"message": "Specify",
"description": "Label for the button to make a style apply only to specific sites"
Expand All @@ -64,6 +80,10 @@
"message": "Apply all updates",
"description": "Label for the button to apply all detected updates"
},
"author": {
"message": "Author",
"description": "Label for the style author"
},
"backupButtons": {
"message": "Backup",
"description": "Heading for backup"
Expand All @@ -83,6 +103,10 @@
"updateCheckHistory": {
"message": "History of update checks"
},
"configureStyle": {
"message": "Configure",
"description": "Label for the button to configure userstyle"
},
"checkForUpdate": {
"message": "Check for update",
"description": "Label for the button to check a single style for an update"
Expand Down Expand Up @@ -167,6 +191,14 @@
"message": "No",
"description": "'No' button in a confirm dialog"
},
"confirmDefault": {
"message": "Use default",
"description": "'Set to default' button in a confirm dialog"
},
"confirmSave": {
"message": "Save",
"description": "'Save' button in a confirm dialog"
},
"confirmStop": {
"message": "Stop",
"description": "'Stop' button in a confirm dialog"
Expand All @@ -175,6 +207,10 @@
"message": "Yes",
"description": "'Yes' button in a confirm dialog"
},
"confirmClose": {
"message": "Close",
"description": "'Close' button in a confirm dialog"
},
"dbError": {
"message": "An error has occurred using the Stylus database. Would you like to visit a web page with possible solutions?",
"description": "Prompt when a DB error is encountered"
Expand Down Expand Up @@ -257,6 +293,26 @@
"message": "Export",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
},
"externalLink": {
"message": "External link",
"description": "Label for external links"
},
"externalHomepage": {
"message": "Homepage",
"description": "Label for the external link to style's homepage"
},
"externalSupport": {
"message": "Support",
"description": "Label for the external link to style's support site"
},
"externalFeedback": {
"message": "Feedback",
"description": "Label for the external link to send feedback for the style"
},
"externalUsercssDocument": {
"message": "Documentation for Usercss",
"description": "Label for the external link to usercss documentation"
},
"filteredStyles": {
"message": "$numShown$ shown of $numTotal$ total",
"description": "TL note - make this message short",
Expand Down Expand Up @@ -345,10 +401,43 @@
"message": "Discard contents of current style and overwrite it with the imported style",
"description": "Label for the button to import and overwrite current style"
},
"installButton": {
"message": "Install",
"description": "Label for install button"
},
"installButtonInstalled": {
"message": "Installed",
"description": "Text displayed when the style is successfully installed"
},
"installButtonUpdate": {
"message": "Update",
"description": "Label for update button"
},
"installButtonReinstall": {
"message": "Reinstall",
"description": "Label for reinstall button"
},
"installUpdate": {
"message": "Install update",
"description": "Label for the button to install an update for a single style"
},
"installUpdateFrom": {
"message": "Currently the style is updated from $url$",
"description": "Label to describe where the style gets update",
"placeholders": {
"url": {
"content": "$1"
}
}
},
"installUpdateFromLabel": {
"message": "Check for updates",
"description": "Label for the checkbox to save current URL for update check"
},
"license": {
"message": "License",
"description": "Label for the license"
},
"linterConfigPopupTitle": {
"message": "Set $linter$ rules configuration",
"description": "Stylelint or CSSLint popup header",
Expand All @@ -366,6 +455,15 @@
"message": "(Set rule as: 0 = disabled; 1 = warning; 2 = error)",
"description": "CSSLint rule config values"
},
"linterCSSLintIncompatible": {
"message": "CSSLint doesn't support $preprocessorname$ preprocessor",
"description": "The label to display when the preprocessor isn't compatible with CSSLint",
"placeholders": {
"preprocessorname": {
"content": "$1"
}
}
},
"linterInvalidConfigError": {
"message": "Not saved due to these invalid configuration settings:",
"description": "Invalid linter config will show a message followed by a list of invalid entries"
Expand Down Expand Up @@ -395,6 +493,14 @@
"message": "See a full list of rules",
"description": "Stylelint or CSSLint rules label added immediately before a link"
},
"liveReloadLabel": {
"message": "Live reload",
"description": "The label of live-reload feature"
},
"liveReloadError": {
"message": "An error occurred while watching the file",
"description": "The label of live-reload error"
},
"manageFilters": {
"message": "Filters",
"description": "Label for filters container"
Expand Down Expand Up @@ -483,6 +589,10 @@
"message": "More Options",
"description": "Subheading for options section on manage page."
},
"parseUsercssError": {
"message": "Stylus failed to parse usercss:",
"description": "The error message to show when stylus failed to parse usercss"
},
"popupManageTooltip": {
"message": "Shift-click or right-click opens manager with styles applicable for current site",
"description": "Tooltip for the 'Manage' button in the popup."
Expand Down Expand Up @@ -629,6 +739,65 @@
}
}
},
"styleInstallOverwrite" : {
"message": "'$stylename$' is already installed. Overwrite?\nVersion: $oldVersion$ -> $newVersion$",
"description": "Confirmation when re-installing a style",
"placeholders": {
"stylename": {
"content": "$1"
},
"oldVersion": {
"content": "$2"
},
"newVersion": {
"content": "$3"
}
}
},
"styleInstallFailed": {
"message": "Failed to install userstyle!\n$error$",
"description": "Warning when installation failed",
"placeholders": {
"error": {
"content": "$1"
}
}
},
"styleMetaErrorCheckbox": {
"message": "Invalid @var checkbox: value must be 0 or 1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These messages are used by usercss parser. Is it necessary to translate error messages? If not, we can remove them. Also note that errors from JSON parser is not translated, and errors thrown by CSSLint (moz-parser) or Stylus-lang preprocessor are not translatable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let them be.

"description": "Error displayed when the value of @var checkbox is invalid"
},
"styleMetaErrorColor": {
"message": "$color$ is not a valid color",
"description": "Error displayed when the value of @var color is invalid",
"placeholders": {
"color": {
"content": "$1"
}
}
},
"styleMetaErrorPreprocessor": {
"message": "Unsupported @preprocessor: $preprocessor$",
"description": "Error displayed when the value of @preprocessor is not supported",
"placeholders": {
"preprocessor": {
"content": "$1"
}
}
},
"styleMetaErrorSelectValueMismatch": {
"message": "Invalid @select: value doesn't exist in the list",
"description": "Error displayed when the value of @select is invalid"
},
"styleMissingMeta": {
"message": "Missing metadata @$key$",
"description": "Error displayed when a mandatory metadata is missing",
"placeholders": {
"key": {
"content": "$1"
}
}
},
"styleMissingName": {
"message": "Enter a name.",
"description": "Error displayed when user saves without providing a name"
Expand All @@ -645,6 +814,10 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"styleFromMozillaFormatError": {
"message": "Failed to import from Mozilla format",
"description": "Label for the import error"
},
"styleFromMozillaFormatPrompt": {
"message": "Paste the Mozilla-format code",
"description": "Prompt in the dialog displayed after clicking 'Import from Mozilla format' button"
Expand All @@ -666,6 +839,10 @@
}
}
},
"styleUpdateDiscardChanges": {
"message": "The style is changed outside of the editor. Would you like to reload the style?",
"description": "Confirmation to update the style in the editor"
},
"stylusUnavailableForURL": {
"message": "Stylus doesn't work on pages like this.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
Expand Down Expand Up @@ -743,6 +920,10 @@
"message": "Updates installed:",
"description": "Text that displays when an update is installed on options page. Followed by the number of currently installed updates."
},
"versionInvalidOlder": {
"message": "The version is older than the installed style.",
"description": "Displayed when the version of style is older than the installed one"
},
"writeStyleFor": {
"message": "Write style for: ",
"description": "Label for toolbar pop-up that precedes the links to write a new style"
Expand Down Expand Up @@ -805,6 +986,9 @@
"optionsAdvancedContextDelete": {
"message": "Add 'Delete' in editor context menu"
},
"optionsAdvancedNewStyleAsUsercss": {
"message": "Write new style as usercss"
},
"optionsActions": {
"message": "Actions"
},
Expand Down
40 changes: 40 additions & 0 deletions background/background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* global dbExec, getStyles, saveStyle */
/* global handleCssTransitionBug */
/* global usercssHelper openEditor */
'use strict';

// eslint-disable-next-line no-var
Expand Down Expand Up @@ -302,6 +303,14 @@ function onRuntimeMessage(request, sender, sendResponse) {
saveStyle(request).then(sendResponse);
return KEEP_CHANNEL_OPEN;

case 'saveUsercss':
usercssHelper.save(request, true).then(sendResponse);
return KEEP_CHANNEL_OPEN;

case 'buildUsercss':
usercssHelper.build(request, true).then(sendResponse);
return KEEP_CHANNEL_OPEN;

case 'healthCheck':
dbExec()
.then(() => sendResponse(true))
Expand All @@ -313,5 +322,36 @@ function onRuntimeMessage(request, sender, sendResponse) {
.then(sendResponse)
.catch(() => sendResponse(null));
return KEEP_CHANNEL_OPEN;

case 'openUsercssInstallPage':
usercssHelper.openInstallPage(sender.tab.id, request).then(sendResponse);
return KEEP_CHANNEL_OPEN;

case 'closeTab':
closeTab(sender.tab.id, request).then(sendResponse);
return KEEP_CHANNEL_OPEN;

case 'openEditor':
openEditor(request.id);
return;
}
}

function closeTab(tabId, request) {
return new Promise(resolve => {
if (request.tabId) {
tabId = request.tabId;
}
chrome.tabs.remove(tabId, () => {
const {lastError} = chrome.runtime;
if (lastError) {
resolve({
success: false,
error: lastError.message || String(lastError)
});
return;
}
resolve({success: true});
});
});
}
Loading