Добавил сохранение флага о необходимости чистки уведомлений

todo - настроить обсервер для самой чистки
master
Sipachev Igor 4 years ago
parent 9c038a4911
commit 71d4f2c051
  1. 8
      assets/js/script.js
  2. 2
      manifest.json
  3. 2
      popup/dist/index.html
  4. 2
      popup/dist/js/app.9bdde6bd.js
  5. 1
      popup/dist/js/app.9bdde6bd.js.map
  6. 2
      popup/dist/js/app.c4534a95.js
  7. 1
      popup/dist/js/app.c4534a95.js.map
  8. 8
      popup/dist/precache-manifest.ea391085ddd36de2a7ecbc5dff885460.js
  9. 2
      popup/dist/service-worker.js
  10. 23
      popup/src/classes/Service/NotificationCleaner.ts
  11. 19
      popup/src/components/script.ts
  12. 2
      popup/src/components/template.html

@ -1,3 +1,4 @@
// todo настроить сборщик и для этого файла. Перевести на ts
function insertValueToNode(target, value) { function insertValueToNode(target, value) {
let nodeList = [] let nodeList = []
switch (target) { switch (target) {
@ -42,3 +43,10 @@ chrome.runtime.onMessage.addListener(
} }
); );
chrome.storage.sync.get(['need-clean-notification'], function (result) {
console.log('Value currently is ' + result['need-clean-notification'])
/**
* todo Добавить обсервер на чиски node с уведомлениями, если опция включена
*/
})

@ -25,7 +25,7 @@
"180": "icons/180.png" "180": "icons/180.png"
}, },
"manifest_version": 2, "manifest_version": 2,
"permissions": [ "tabs", "contextMenus", "\u003Call_urls>" ], "permissions": [ "tabs", "contextMenus", "\u003Call_urls>", "storage" ],
"short_name": "SVEAK helper", "short_name": "SVEAK helper",
"version": "1.0.0", "version": "1.0.0",
"commands": { "commands": {

@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/popup/dist/favicon.ico"><![endif]--><title>sveak-helper</title><link href="/popup/dist/css/app.95f2e473.css" rel="preload" as="style"><link href="/popup/dist/js/app.c4534a95.js" rel="preload" as="script"><link href="/popup/dist/js/chunk-vendors.49bbd58a.js" rel="preload" as="script"><link href="/popup/dist/css/app.95f2e473.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/popup/dist/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/popup/dist/img/icons/favicon-16x16.png"><link rel="manifest" href="/popup/dist/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="sveak-helper"><link rel="apple-touch-icon" href="/popup/dist/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/popup/dist/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but sveak-helper doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/popup/dist/js/chunk-vendors.49bbd58a.js"></script><script src="/popup/dist/js/app.c4534a95.js"></script></body></html> <!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/popup/dist/favicon.ico"><![endif]--><title>sveak-helper</title><link href="/popup/dist/css/app.95f2e473.css" rel="preload" as="style"><link href="/popup/dist/js/app.9bdde6bd.js" rel="preload" as="script"><link href="/popup/dist/js/chunk-vendors.49bbd58a.js" rel="preload" as="script"><link href="/popup/dist/css/app.95f2e473.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/popup/dist/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/popup/dist/img/icons/favicon-16x16.png"><link rel="manifest" href="/popup/dist/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="sveak-helper"><link rel="apple-touch-icon" href="/popup/dist/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/popup/dist/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but sveak-helper doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/popup/dist/js/chunk-vendors.49bbd58a.js"></script><script src="/popup/dist/js/app.9bdde6bd.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,15 +1,15 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([ self.__precacheManifest = (self.__precacheManifest || []).concat([
{ {
"revision": "7624b45c435247052031", "revision": "9f7cc03f956475eec94c",
"url": "/css/app.95f2e473.css" "url": "/css/app.95f2e473.css"
}, },
{ {
"revision": "58ffe4608e1a76e678e6af70c4ad0c23", "revision": "117c3b5969bea3eacecac9b36d7196ef",
"url": "/index.html" "url": "/index.html"
}, },
{ {
"revision": "7624b45c435247052031", "revision": "9f7cc03f956475eec94c",
"url": "/js/app.c4534a95.js" "url": "/js/app.9bdde6bd.js"
}, },
{ {
"revision": "55fa3e18a2c5425a215c", "revision": "55fa3e18a2c5425a215c",

@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts( importScripts(
"/precache-manifest.762f04df3566d31749fb46db2b42ae70.js" "/precache-manifest.ea391085ddd36de2a7ecbc5dff885460.js"
); );
workbox.core.setCacheNameDetails({prefix: "sveak-helper"}); workbox.core.setCacheNameDetails({prefix: "sveak-helper"});

@ -1,3 +1,24 @@
class NotificationCleaner { export class NotificationCleaner {
enable () {
chrome.storage.sync.set({ 'need-clean-notification': true }, function () {
console.log('need-clean-notification: ' + true)
})
}
disable () {
chrome.storage.sync.set({ 'need-clean-notification': false }, function () {
console.log('need-clean-notification: ' + false)
})
}
state (): Promise<boolean> {
return new Promise((resolve, reject) => {
chrome.storage.sync.get(['need-clean-notification'], function (result) {
console.log('Value currently is ' + result['need-clean-notification'])
resolve(result['need-clean-notification'] || false)
})
})
}
} }
export default new NotificationCleaner()

@ -9,6 +9,7 @@ import VueClipboard from 'vue-clipboard2'
import { Target } from '@/classes/Enum/Target' import { Target } from '@/classes/Enum/Target'
import sender from '@/classes/Service/Browser/Chrome/Sender' import sender from '@/classes/Service/Browser/Chrome/Sender'
import { Action } from '@/classes/Enum/Action' import { Action } from '@/classes/Enum/Action'
import notificationCleaner from '@/classes/Service/NotificationCleaner'
Vue.use(VueClipboard) Vue.use(VueClipboard)
@ -16,6 +17,7 @@ Vue.use(VueClipboard)
export default class HelloWorld extends Vue { export default class HelloWorld extends Vue {
tab = 'person' tab = 'person'
person = new Person() person = new Person()
isAutoCleaner = false
copyText = '' copyText = ''
get allowedMonths () { get allowedMonths () {
@ -35,6 +37,14 @@ export default class HelloWorld extends Vue {
return result return result
} }
mounted () {
/** todo заполнить первоначальное значение */
notificationCleaner.state().then((isAutoCleaner) => {
this.isAutoCleaner = isAutoCleaner
console.log('this.isAutoCleaner = ' + isAutoCleaner)
})
}
copyPersonalId () { copyPersonalId () {
const personalId = personalIdGenerator.generate(this.person) const personalId = personalIdGenerator.generate(this.person)
this.copy(personalId) this.copy(personalId)
@ -81,4 +91,13 @@ export default class HelloWorld extends Vue {
action: Action.CLEAN_NOTIFICATION action: Action.CLEAN_NOTIFICATION
}) })
} }
onChangeAutoCleaner () {
console.log(this.isAutoCleaner)
if (this.isAutoCleaner) {
notificationCleaner.enable()
} else {
notificationCleaner.disable()
}
}
} }

@ -74,7 +74,7 @@
<div class="form-row__item"> <div class="form-row__item">
<label for="autocleaner"> <label for="autocleaner">
Use notification cleaner Use notification cleaner
<input type="checkbox" name="autocleaner" id="autocleaner"> <input @change="onChangeAutoCleaner" type="checkbox" v-model="isAutoCleaner">
</label> </label>
</div> </div>
</div> </div>

Loading…
Cancel
Save