diff options
author | Wu Cheng-Han | 2016-10-19 22:14:32 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-10-19 22:14:32 +0800 |
commit | 7ebc84bec0bf8f6e1f28e5fb3e9e7449bd7a2347 (patch) | |
tree | e4e91a306de3acb4b0eb7cc91384f006a729122f /public | |
parent | d70d0318e5acb7ad2994689741cfee976e754792 (diff) |
Try to remove unused front-end dependency
Diffstat (limited to '')
-rw-r--r-- | public/js/cover.js | 2 | ||||
-rw-r--r-- | public/js/extra.js | 5 | ||||
-rw-r--r-- | public/js/index.js | 10 | ||||
-rw-r--r-- | public/js/locale.js | 2 | ||||
-rw-r--r-- | public/js/public.js | 25 | ||||
-rw-r--r-- | public/js/slide.js | 19 |
6 files changed, 10 insertions, 53 deletions
diff --git a/public/js/cover.js b/public/js/cover.js index 3dd4de09..c02f6c81 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -1,3 +1,5 @@ +require('./locale'); + var common = require('./common'); var checkIfAuth = common.checkIfAuth; var urlpath = common.urlpath; diff --git a/public/js/extra.js b/public/js/extra.js index 1eae80f6..499bdc4c 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -1,3 +1,8 @@ +require('prismjs/themes/prism.css'); +require('highlight.js/styles/github-gist.css'); + +var Prism = require('prismjs'); +require('prismjs/components/prism-wiki'); var hljs = require('highlight.js'); var PDFObject = require('pdfobject'); var S = require('string'); diff --git a/public/js/index.js b/public/js/index.js index 6625d2d1..d85a0902 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1,16 +1,11 @@ /* jquery and jquery plugins */ require('../vendor/showup/showup'); -require('prismjs/themes/prism.css'); -require('highlight.js/styles/github-gist.css'); - -require('prismjs'); -require('prismjs/components/prism-wiki'); var toMarkdown = require('to-markdown'); var saveAs = require('file-saver').saveAs; -require('js-url'); -require('randomcolor'); +var url = require('js-url'); +var randomColor = require('randomcolor'); var _ = require("lodash"); @@ -28,7 +23,6 @@ var noteurl = common.noteurl; var checkLoginStateChanged = common.checkLoginStateChanged; -require('./pretty'); var extra = require('./extra'); var md = extra.md; var updateLastChange = extra.updateLastChange; diff --git a/public/js/locale.js b/public/js/locale.js index 484ce22f..702496e7 100644 --- a/public/js/locale.js +++ b/public/js/locale.js @@ -1,5 +1,3 @@ -require('./cover'); - var lang = "en"; var userLang = navigator.language || navigator.userLanguage; var userLangCode = userLang.split('-')[0]; diff --git a/public/js/public.js b/public/js/public.js deleted file mode 100644 index f83ef41f..00000000 --- a/public/js/public.js +++ /dev/null @@ -1,25 +0,0 @@ -/* jquery and jquery plugins */ -require('../vendor/showup/showup'); - -require('prismjs/themes/prism.css'); -require('highlight.js/styles/github-gist.css'); - -/* other vendors plugin */ -require('string'); -require('prismjs'); -require('prismjs/components/prism-wiki'); -require('to-markdown'); - -require('file-saver'); -require('store'); -require('js-url'); -require('visibilityjs'); -require('list.js'); -require('../vendor/md-toc'); -require('randomcolor'); - -require('./extra'); -require('./syncscroll'); -require('./history'); -require('./pretty'); -require('./render'); diff --git a/public/js/slide.js b/public/js/slide.js index 2536c602..c260de6d 100644 --- a/public/js/slide.js +++ b/public/js/slide.js @@ -1,30 +1,13 @@ -require('prismjs/themes/prism.css'); /* other vendors plugin */ var S = require('string'); -require('prismjs'); -require('prismjs/components/prism-wiki'); -require('to-markdown'); - -require('../vendor/md-toc'); -require('randomcolor'); - -var commonModule = require('./common'); -var urlpath = commonModule.urlpath; -var noteid = commonModule.noteid; -var debug = commonModule.debug; -var version = commonModule.version; -var GOOGLE_API_KEY = commonModule.GOOGLE_API_KEY; -var GOOGLE_CLIENT_ID = commonModule.GOOGLE_CLIENT_ID; -var DROPBOX_APP_KEY = commonModule.DROPBOX_APP_KEY; -var noteurl = commonModule.noteurl; var extraModule = require('./extra'); var md = extraModule.md; var updateLastChange = extraModule.updateLastChange; var finishView = extraModule.finishView; -require('./render'); +var preventXSS = require('./render').preventXSS; var body = $(".slides").html(); $(".slides").html(S(body).unescapeHTML().s); |