summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorYukai Huang2017-03-28 19:30:06 +0800
committerYukai Huang2017-03-28 19:30:06 +0800
commitb711ecfadb83f59316021f2266234b7fdba54c53 (patch)
tree8f21c76fb8877e89780124de402390f3e6c3e3c5 /public
parentba1bef015fa2a596c9ba86b935f2d76624f53b9e (diff)
Drop global variable ui exposing
Diffstat (limited to '')
-rw-r--r--public/js/extra.js9
-rw-r--r--public/js/index.js2
2 files changed, 6 insertions, 5 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index fecd8a8b..a5be4251 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -19,6 +19,9 @@ require('./lib/common/login')
require('../vendor/md-toc')
var Viz = require('viz.js')
+import getUIElements from './lib/editor/ui-elements'
+const ui = getUIElements()
+
// auto update last change
window.createtime = null
window.lastchangetime = null
@@ -634,7 +637,7 @@ function generateCleanHTML (view) {
}
export function exportToRawHTML (view) {
- const filename = `${renderFilename(window.ui.area.markdown)}.html`
+ const filename = `${renderFilename(ui.area.markdown)}.html`
const src = generateCleanHTML(view)
$(src).find('a.anchor').remove()
const html = src[0].outerHTML
@@ -646,8 +649,8 @@ export function exportToRawHTML (view) {
// extract markdown body to html and compile to template
export function exportToHTML (view) {
- const title = renderTitle(window.ui.area.markdown)
- const filename = `${renderFilename(window.ui.area.markdown)}.html`
+ const title = renderTitle(ui.area.markdown)
+ const filename = `${renderFilename(ui.area.markdown)}.html`
const src = generateCleanHTML(view)
// generate toc
const toc = $('#ui-toc').clone()
diff --git a/public/js/index.js b/public/js/index.js
index b84cc43a..86564e93 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -322,8 +322,6 @@ defaultTextHeight = parseInt($('.CodeMirror').css('line-height'))
// initalize ui reference
const ui = getUIElements()
-// FIXME: fix global ui element expose
-window.ui = ui
// page actions
var opts = {