diff --git a/.env.example b/.env.example index bab7dcc..baca2d7 100644 --- a/.env.example +++ b/.env.example @@ -5,5 +5,7 @@ NODE_ENV = 'example' VUE_APP_BASE_API = 'http://x.x.x.x:80' # github login client id -# get it in page : https://github.com/settings/developers -VUE_APP_GITHUB_CLIENTID='xxxxxxxxxxxxxxxxxxx' +# get it in page : https://github.com/settings/developers +VUE_APP_GITHUB_CLIENTID = 'xxxxxxxxxxxxxxxxxxx' + +VUE_APP_ICP_ID = '' diff --git a/.gitignore b/.gitignore index bfad2f7..f0f30bd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /context/ /log/ node_modules/ +node_modules* dist/ tmp/ npm-debug.log* diff --git a/README.md b/README.md index f0bfed8..8685115 100644 --- a/README.md +++ b/README.md @@ -22,3 +22,8 @@ npm run lint ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). + + +### Todo list +[] add admin's page +[] how to display draft and private articles diff --git a/package.json b/package.json index c2abb33..b29555a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "axios": "^0.26.1", "babel-plugin-transform-remove-console": "^6.9.4", "core-js": "^3.8.3", + "echarts": "^5.4.1", "element-plus": "^2.2.21", "express": "^4.18.2", "highlight.js": "^11.5.0", diff --git a/src/components/PagiNation/index.vue b/src/components/PagiNation/index.vue new file mode 100644 index 0000000..d0d0f2a --- /dev/null +++ b/src/components/PagiNation/index.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/components/TinyMce/components/EditorImage.vue b/src/components/TinyMce/components/EditorImage.vue new file mode 100644 index 0000000..989d4d1 --- /dev/null +++ b/src/components/TinyMce/components/EditorImage.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/src/components/TinyMce/dynamicLoadScript.js b/src/components/TinyMce/dynamicLoadScript.js new file mode 100644 index 0000000..185f58d --- /dev/null +++ b/src/components/TinyMce/dynamicLoadScript.js @@ -0,0 +1,59 @@ +let callbacks = [] + +function loadedTinymce() { + // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144 + // check is successfully downloaded script + return window.tinymce +} + +const dynamicLoadScript = (src, callback) => { + const existingScript = document.getElementById(src) + const cb = callback || function() {} + + if (!existingScript) { + const script = document.createElement('script') + script.src = src // src url for the third-party library being loaded. + script.id = src + document.body.appendChild(script) + callbacks.push(cb) + const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd + onEnd(script) + } + + if (existingScript && cb) { + if (loadedTinymce()) { + cb(null, existingScript) + } else { + callbacks.push(cb) + } + } + + function stdOnEnd(script) { + script.onload = function() { + // this.onload = null here is necessary + // because even IE9 works not like others + this.onerror = this.onload = null + for (const cb of callbacks) { + cb(null, script) + } + callbacks = null + } + script.onerror = function() { + this.onerror = this.onload = null + cb(new Error('Failed to load ' + src), script) + } + } + + function ieOnEnd(script) { + script.onreadystatechange = function() { + if (this.readyState !== 'complete' && this.readyState !== 'loaded') return + this.onreadystatechange = null + for (const cb of callbacks) { + cb(null, script) // there is no way to catch loading errors in IE8 + } + callbacks = null + } + } +} + +export default dynamicLoadScript diff --git a/src/components/TinyMce/index.vue b/src/components/TinyMce/index.vue new file mode 100644 index 0000000..678bf37 --- /dev/null +++ b/src/components/TinyMce/index.vue @@ -0,0 +1,255 @@ +