diff --git a/client/components/App.vue b/client/components/App.vue index e892dde9..56cce0e1 100644 --- a/client/components/App.vue +++ b/client/components/App.vue @@ -17,6 +17,7 @@ import vueComponent from './vueComponent.js'; import Notify from './share/Notify.vue'; import StdDialog from './share/StdDialog.vue'; +import sanitizeHtml from 'sanitize-html'; import miscApi from '../api/misc'; import * as utils from '../share/utils'; @@ -79,6 +80,9 @@ class App { // setAppTitle this.$root.setAppTitle = this.setAppTitle; + //sanitize + this.$root.sanitize = sanitizeHtml; + //global keyHooks this.keyHooks = []; this.keyHook = (event) => { diff --git a/client/components/CardIndex/Book/Book.vue b/client/components/CardIndex/Book/Book.vue index 0ed31bb5..beef252c 100644 --- a/client/components/CardIndex/Book/Book.vue +++ b/client/components/CardIndex/Book/Book.vue @@ -6,15 +6,14 @@ diff --git a/client/components/CardIndex/Card/Card.vue b/client/components/CardIndex/Card/Card.vue index 2982bbf0..6da789f0 100644 --- a/client/components/CardIndex/Card/Card.vue +++ b/client/components/CardIndex/Card/Card.vue @@ -6,15 +6,14 @@ diff --git a/client/components/CardIndex/History/History.vue b/client/components/CardIndex/History/History.vue index 22d8cd90..9950a8c3 100644 --- a/client/components/CardIndex/History/History.vue +++ b/client/components/CardIndex/History/History.vue @@ -6,15 +6,14 @@ diff --git a/client/components/CardIndex/Search/Search.vue b/client/components/CardIndex/Search/Search.vue index 5ae5d345..1e5072c9 100644 --- a/client/components/CardIndex/Search/Search.vue +++ b/client/components/CardIndex/Search/Search.vue @@ -6,15 +6,14 @@ diff --git a/client/components/ExternalLibs/ExternalLibs.vue b/client/components/ExternalLibs/ExternalLibs.vue index 668a4da5..bb2e5037 100644 --- a/client/components/ExternalLibs/ExternalLibs.vue +++ b/client/components/ExternalLibs/ExternalLibs.vue @@ -704,7 +704,7 @@ class ExternalLibs extends Vue { this.commitLibs(libs); } else if (item.c != this.bookmarkDesc) { if (await this.$root.stdDialog.confirm(`Такая закладка уже существует с другим описанием.
` + - `Заменить '${this.$sanitize(item.c)}' на '${this.$sanitize(this.bookmarkDesc)}'?`, ' ')) { + `Заменить '${this.$root.sanitize(item.c)}' на '${this.$root.sanitize(this.bookmarkDesc)}'?`, ' ')) { item.c = this.bookmarkDesc; this.commitLibs(libs); } else diff --git a/client/components/Help/Help.vue b/client/components/Help/Help.vue index 6c77835f..de1da849 100644 --- a/client/components/Help/Help.vue +++ b/client/components/Help/Help.vue @@ -6,15 +6,14 @@ diff --git a/client/components/Income/Income.vue b/client/components/Income/Income.vue index 877e9e55..737aeb59 100644 --- a/client/components/Income/Income.vue +++ b/client/components/Income/Income.vue @@ -6,15 +6,14 @@ diff --git a/client/components/NotFound404/NotFound404.vue b/client/components/NotFound404/NotFound404.vue index 6738e67e..336348d1 100644 --- a/client/components/NotFound404/NotFound404.vue +++ b/client/components/NotFound404/NotFound404.vue @@ -6,15 +6,14 @@ diff --git a/client/components/Reader/SettingsPage/SettingsPage.vue b/client/components/Reader/SettingsPage/SettingsPage.vue index 79a58e6f..f4f3bbfa 100644 --- a/client/components/Reader/SettingsPage/SettingsPage.vue +++ b/client/components/Reader/SettingsPage/SettingsPage.vue @@ -457,7 +457,7 @@ class SettingsPage extends Vue { return; try { - const result = await this.$root.stdDialog.prompt(`Предупреждение! Удаление профиля '${this.$sanitize(this.currentProfile)}' необратимо.` + + const result = await this.$root.stdDialog.prompt(`Предупреждение! Удаление профиля '${this.$root.sanitize(this.currentProfile)}' необратимо.` + `
Все настройки профиля будут потеряны, однако список читаемых книг сохранится.` + `

Введите 'да' для подтверждения удаления:`, ' ', { inputValidator: (str) => { if (str && str.toLowerCase() === 'да') return true; else return 'Удаление не подтверждено'; }, diff --git a/client/components/Settings/Settings.vue b/client/components/Settings/Settings.vue index de7553a7..ca842378 100644 --- a/client/components/Settings/Settings.vue +++ b/client/components/Settings/Settings.vue @@ -6,15 +6,14 @@ diff --git a/client/components/Sources/Sources.vue b/client/components/Sources/Sources.vue index 83b4d530..f9758e56 100644 --- a/client/components/Sources/Sources.vue +++ b/client/components/Sources/Sources.vue @@ -6,15 +6,14 @@ diff --git a/client/router.js b/client/router.js index cf08d231..b3063f3c 100644 --- a/client/router.js +++ b/client/router.js @@ -2,39 +2,39 @@ import { createRouter, createWebHashHistory } from 'vue-router'; import _ from 'lodash'; const CardIndex = () => import('./components/CardIndex/CardIndex.vue'); -/*const Search = () => import('./components/CardIndex/Search/Search.vue'); +const Search = () => import('./components/CardIndex/Search/Search.vue'); const Card = () => import('./components/CardIndex/Card/Card.vue'); const Book = () => import('./components/CardIndex/Book/Book.vue'); -const History = () => import('./components/CardIndex/History/History.vue');*/ +const History = () => import('./components/CardIndex/History/History.vue'); //немедленная загрузка //import Reader from './components/Reader/Reader.vue'; const Reader = () => import('./components/Reader/Reader1.vue'); //const ExternalLibs = () => import('./components/ExternalLibs/ExternalLibs.vue'); -/*const Income = () => import('./components/Income/Income.vue'); +const Income = () => import('./components/Income/Income.vue'); const Sources = () => import('./components/Sources/Sources.vue'); const Settings = () => import('./components/Settings/Settings.vue'); const Help = () => import('./components/Help/Help.vue'); -const NotFound404 = () => import('./components/NotFound404/NotFound404.vue');*/ +const NotFound404 = () => import('./components/NotFound404/NotFound404.vue'); const myRoutes = [ ['/', null, null, '/cardindex'], ['/cardindex', CardIndex], - /*['/cardindex~search', Search], + ['/cardindex~search', Search], ['/cardindex~card', Card], ['/cardindex~card/:authorId', Card], ['/cardindex~book', Book], ['/cardindex~book/:bookId', Book], - ['/cardindex~history', History],*/ + ['/cardindex~history', History], ['/reader', Reader], //['/external-libs', ExternalLibs], - /*['/income', Income], + ['/income', Income], ['/sources', Sources], ['/settings', Settings], ['/help', Help], - ['/404', NotFound404],*/ + ['/404', NotFound404], ['/(.*)', null, null, '/cardindex'], ]; diff --git a/package-lock.json b/package-lock.json index 5d4a0a98..fd538d55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4921,9 +4921,9 @@ "dev": true }, "klona": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.4.tgz", - "integrity": "sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.5.tgz", + "integrity": "sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==" }, "layerr": { "version": "0.1.2", @@ -7701,12 +7701,6 @@ "@vue/shared": "3.2.20" } }, - "vue-class-component": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-7.2.6.tgz", - "integrity": "sha512-+eaQXVrAm/LldalI272PpDe3+i4mPis0ORiMYxF6Ae4hyuCh15W8Idet7wPUEs4N4YptgFHGys4UrgNQOMyO6w==", - "dev": true - }, "vue-eslint-parser": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.0.0.tgz", @@ -7818,14 +7812,6 @@ "@vue/devtools-api": "^6.0.0-beta.18" } }, - "vue-sanitize": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vue-sanitize/-/vue-sanitize-0.2.1.tgz", - "integrity": "sha512-MhrfAaAqIQ8JXWfdlhK6f+H2WnZ7KQwkOgLNeUyfACI2bq/3HPZ2zeUQDathnLdsXMXAa8pJehOgPYtlaG9Jew==", - "requires": { - "sanitize-html": "^2.1.1" - } - }, "vue-style-loader": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz", diff --git a/package.json b/package.json index 16008c72..3d3f3c3d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "html-webpack-plugin": "^5.5.0", "mini-css-extract-plugin": "^2.4.3", "terser-webpack-plugin": "^5.2.4", - "vue-class-component": "^7.2.6", "vue-eslint-parser": "^8.0.0", "vue-loader": "^16.0.0", "vue-style-loader": "^4.1.3", @@ -70,6 +69,7 @@ "pkg": "^4.4.9", "quasar": "^2.2.1", "safe-buffer": "^5.2.1", + "sanitize-html": "^2.5.2", "sjcl": "^1.0.8", "sql-template-strings": "^2.2.2", "sqlite": "^4.0.23", @@ -78,7 +78,6 @@ "unbzip2-stream": "^1.4.3", "vue": "^3.1.0", "vue-router": "^4.0.12", - "vue-sanitize": "^0.2.1", "vuex": "^4.0.2", "vuex-persistedstate": "^2.7.1", "webdav": "^4.7.0",