summaryrefslogtreecommitdiff
path: root/public/js/extra.js
diff options
context:
space:
mode:
authorMax Wu2017-04-10 11:41:33 +0800
committerGitHub2017-04-10 11:41:33 +0800
commit5ecea7e1183e4efce445967318d6c43c223504f1 (patch)
treef6e426f7ed9d10d77c4dbbaa8d1906d17d1e97c2 /public/js/extra.js
parent3ef22fd303d46c53f5937649c242277a22ffd940 (diff)
parenta4385ec19dc3ad89a8e084f9bce560c7197275a8 (diff)
Merge pull request #417 from hackmdio/refactor
Refactor editor cont.
Diffstat (limited to '')
-rw-r--r--public/js/extra.js9
1 files changed, 6 insertions, 3 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()