diff options
author | Yukai Huang | 2016-10-09 10:51:39 +0800 |
---|---|---|
committer | Yukai Huang | 2016-10-09 10:51:39 +0800 |
commit | 196d546f7e8273b3fdc1bd60c3bf627b2fa1462b (patch) | |
tree | 63a2fcbb1b9e96f698998ddca0936d84ac989e59 /public/js | |
parent | 67d118782de12f851ad38be13fa9f519ba100765 (diff) |
Fix pdfobject require
Diffstat (limited to '')
-rw-r--r-- | public/js/extra.js | 3 | ||||
-rw-r--r-- | public/js/index.js | 31 |
2 files changed, 19 insertions, 15 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index c6a0f432..f449bed1 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -1,3 +1,6 @@ +var hljs = require('highlight.js'); +var PDFObject = require('pdfobject'); + //auto update last change var createtime = null; var lastchangetime = null; diff --git a/public/js/index.js b/public/js/index.js index 376c8ddd..0fba0b21 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -51,7 +51,6 @@ require('js-sequence-diagrams'); require('flowchart.js'); require('viz.js'); -require('pdfobject'); require('file-saver'); require('store'); require('js-url'); @@ -414,18 +413,18 @@ var statusType = { var defaultMode = modeType.view; //global vars -var loaded = false; -var needRefresh = false; -var isDirty = false; -var editShown = false; -var visibleXS = false; -var visibleSM = false; -var visibleMD = false; -var visibleLG = false; -var isTouchDevice = 'ontouchstart' in document.documentElement; +window.loaded = false; +window.needRefresh = false; +window.isDirty = false; +window.editShown = false; +window.visibleXS = false; +window.visibleSM = false; +window.visibleMD = false; +window.visibleLG = false; +window.isTouchDevice = 'ontouchstart' in document.documentElement; window.currentMode = defaultMode; -var currentStatus = statusType.offline; -var lastInfo = { +window.currentStatus = statusType.offline; +window.lastInfo = { needRestore: false, cursor: null, scroll: null, @@ -447,9 +446,9 @@ var lastInfo = { }, history: null }; -var personalInfo = {}; -var onlineUsers = []; -var fileTypes = { +window.personalInfo = {}; +window.onlineUsers = []; +window.fileTypes = { "pl": "perl", "cgi": "perl", "js": "javascript", @@ -2274,6 +2273,8 @@ function havePermission() { } return bool; } +// global module workaround +window.havePermission = havePermission; //socket.io actions var socket = io.connect({ |