From 544c856c7aeb37842025ea5de3168f1163e9860b Mon Sep 17 00:00:00 2001 From: narcolepticinsomniac Date: Sun, 23 Aug 2020 11:28:24 -0400 Subject: [PATCH] Remove deprecated dropbox and add sync button --- _locales/en/messages.json | 4 +++ manage.html | 27 ++--------------- manage/import-export.js | 10 ++----- manage/manage.css | 62 ++------------------------------------- manage/manage.js | 5 ++-- 5 files changed, 13 insertions(+), 95 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 6ed037fb..b8a036a6 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1421,6 +1421,10 @@ "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" }, + "syncLabel": { + "message": "Sync to cloud", + "description": "Sync button text" + }, "syncStorageErrorSaving": { "message": "The value cannot be saved. Try reducing the amount of text.", "description": "Displayed when trying to save an excessively big value via storage.sync API" diff --git a/manage.html b/manage.html index d168af14..34b4cf48 100644 --- a/manage.html +++ b/manage.html @@ -368,30 +368,9 @@

- - - - + + +
diff --git a/manage/import-export.js b/manage/import-export.js index 0c1c3bd8..7d08fc89 100644 --- a/manage/import-export.js +++ b/manage/import-export.js @@ -11,14 +11,8 @@ let bulkChangeQueue = []; let bulkChangeTime = 0; onDOMready().then(() => { - $('#file-all-styles').onclick = event => { - event.preventDefault(); - exportToFile(); - }; - $('#unfile-all-styles').onclick = event => { - event.preventDefault(); - importFromFile({fileTypeFilter: STYLUS_BACKUP_FILE_EXT}); - }; + $('#file-all-styles').onclick = () => exportToFile(); + $('#unfile-all-styles').onclick = () => importFromFile({fileTypeFilter: STYLUS_BACKUP_FILE_EXT}); Object.assign(document.body, { ondragover(event) { diff --git a/manage/manage.css b/manage/manage.css index 74375b25..31f2b325 100644 --- a/manage/manage.css +++ b/manage/manage.css @@ -291,7 +291,8 @@ a:hover { padding-top: .1rem; } -#options-buttons button, +#options-buttons > a, +#options-buttons > button, #backup-buttons button { margin: 0 .2rem .5rem 0; } @@ -1046,54 +1047,6 @@ input[id^="manage.newUI"] { text-overflow: ellipsis; } -/* export/import buttons */ -#backup-buttons .dropbtn { - padding: 3px 7px; - cursor: pointer; - text-overflow: inherit; -} - -#backup-buttons .dropbtn span { - display: inline-block; - margin-right: 12px; -} - -#backup-buttons .dropdown { - position: relative; - display: inline-block; -} - -#backup-buttons .dropdown-content { - display: none; - position: absolute; - background-color: #f9f9f9; - min-width: 160px; - box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); - z-index: 1; -} - -#backup-buttons .dropdown-content a { - color: black; - padding: 8px; - text-decoration: none; - display: block; -} - -#backup-buttons .dropdown-content a:hover { - /* background-color: #f2f2f2 */ - background-color: #e9e9e9 -} - -#backup-buttons .dropdown:hover .dropdown-content { - display: block; -} - -#backup-buttons .dropdown:hover .dropbtn { - background-color: hsl(0, 0%, 95%); - border-color: hsl(0, 0%, 52%); - /* background-color: #3e8e41; */ -} - /* sort font */ @font-face { font-family: 'sorticon'; @@ -1302,14 +1255,3 @@ input[id^="manage.newUI"] { margin-left: -2px; } } - -/* Deprecated dropbox backup (dropbox-sync) */ -#sync-dropbox-export, -#sync-dropbox-import { - opacity: 0.5; - cursor: not-allowed; -} -#backup-buttons .dropdown-content #sync-dropbox-export:hover, -#backup-buttons .dropdown-content #sync-dropbox-import:hover { - background: transparent; -} diff --git a/manage/manage.js b/manage/manage.js index 26c26c01..d7478b63 100644 --- a/manage/manage.js +++ b/manage/manage.js @@ -86,9 +86,8 @@ function onRuntimeMessage(msg) { function initGlobalEvents() { installed = $('#installed'); installed.onclick = handleEvent.entryClicked; - $('#manage-options-button').onclick = () => { - router.updateHash('#stylus-options'); - }; + $('#manage-options-button').onclick = () => router.updateHash('#stylus-options'); + $('#sync-styles').onclick = () => router.updateHash('#stylus-options'); { const btn = $('#manage-shortcuts-button'); btn.onclick = btn.onclick || (() => openURL({url: URLS.configureCommands}));