diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 32fc1343..8a89754f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -706,5 +706,14 @@ }, "optionsCheck": { "message": "Update styles" + }, + "scheduleButton": { + "message": "Schedule" + }, + "scheduleButtonActive": { + "message": "Scheduled" + }, + "scheduleMSG": { + "message": "Either clear both start and end values to disable the schedule or set both to enable it" } } diff --git a/background.js b/background.js index 2f70e159..ec16d00d 100644 --- a/background.js +++ b/background.js @@ -1,4 +1,4 @@ -/* global dbExec, getStyles, saveStyle */ +/* global dbExec, getStyles, saveStyle, schedule, download */ 'use strict'; // eslint-disable-next-line no-var @@ -278,5 +278,9 @@ function onRuntimeMessage(request, sender, sendResponse) { .then(sendResponse) .catch(() => sendResponse(null)); return KEEP_CHANNEL_OPEN; + case 'schedule': + schedule.entry(request) + .then(sendResponse) + .catch(e => sendResponse(e)); } } diff --git a/manage.css b/manage.css index f576411e..7ede6f87 100644 --- a/manage.css +++ b/manage.css @@ -145,6 +145,33 @@ a:hover { margin-left: 1ex; } +.schedule { + position: relative; + opacity: 0.5; +} +.schedule:hover { + opacity: 1; +} +.schedule[data-edit=true], +.schedule[data-active=true] { + opacity: 1; +} +.schedule>input { + margin-right: 5px; +} +.schedule>div { + position: absolute; + right: 10px; + top: 25%; + white-space: nowrap; +} +.schedule[data-edit=false]>div { + display: none; +} +.schedule[data-edit=true]>input { + display: none; +} + summary { font-weight: bold; cursor: pointer; diff --git a/manage.html b/manage.html index eb405e0a..87d455db 100644 --- a/manage.html +++ b/manage.html @@ -57,6 +57,14 @@
+