diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 66a885f8..004301a6 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -375,6 +375,12 @@ }, "description": "Title of the page for editing styles" }, + "editorCodeLabel": { + "message": "Code" + }, + "editorSettingLabel": { + "message": "Settings" + }, "enableStyleLabel": { "message": "Enable", "description": "Label for the button to enable a style" @@ -1634,6 +1640,30 @@ "message": "As a security precaution, the browser prohibits extensions from affecting its built-in pages (like chrome://version, the standard new tab page as of Chrome 61, about:addons, and so on) as well as other extensions' pages. Each browser also restricts access to its own extensions gallery (like Chrome Web Store or AMO).", "description": "Sub-note in the toolbar pop-up when on a URL Stylus can't affect" }, + "styleOriginLabel": { + "message": "Style origin" + }, + "styleUpdateUrlLabel": { + "message": "Update URL" + }, + "stylePreferSchemeLabel": { + "message": "Dark/Light mode" + }, + "styleIncludeLabel": { + "message": "User defined inclusion" + }, + "styleIncludeNewLabel": { + "message": "Add new inclusion rule" + }, + "styleExcludeLabel": { + "message": "User defined exclusion" + }, + "styleExcludeNewLabel": { + "message": "Add new exclusion rule" + }, + "stylePriorityLabel": { + "message": "Priority" + }, "syncDropboxDeprecated": { "message": "Dropbox import/export is replaced by a more advanced style sync in the options page." }, diff --git a/background/style-manager.js b/background/style-manager.js index c71a70ba..a6c8b4ed 100644 --- a/background/style-manager.js +++ b/background/style-manager.js @@ -297,6 +297,13 @@ const styleMan = (() => { removeExclusion: removeIncludeExclude.bind(null, 'exclusions'), /** @returns {Promise} */ removeInclusion: removeIncludeExclude.bind(null, 'inclusions'), + + async config(id, prop, value) { + if (ready.then) await ready; + const style = Object.assign({}, id2style(id)); + style[prop] = value; + return saveStyle(style, {reason: 'config', codeIsUpdated: false}); + }, }; //#endregion diff --git a/edit.html b/edit.html index 23dbeb25..4cc9ce66 100644 --- a/edit.html +++ b/edit.html @@ -17,6 +17,7 @@ + @@ -61,6 +62,7 @@ +