summaryrefslogtreecommitdiff
path: root/public/js/pretty.js
diff options
context:
space:
mode:
authorYukai Huang2016-10-08 20:02:30 +0800
committerYukai Huang2016-10-08 20:02:30 +0800
commit963a435ae1e9248b42b4665acf106dcffa549678 (patch)
tree99446e874b353d4f373df33e14582187aaa44578 /public/js/pretty.js
parent0be342c44d5b6287c67922758f076e7897f6c3a8 (diff)
Resolve dependency module requiring
* es5 style module exports * remove script tag require * webpack config ProvidePlugin Note that this commit only fix JavaScript module loading runtime error.
Diffstat (limited to 'public/js/pretty.js')
-rw-r--r--public/js/pretty.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/public/js/pretty.js b/public/js/pretty.js
index 0ca7ee18..ebdec2a9 100644
--- a/public/js/pretty.js
+++ b/public/js/pretty.js
@@ -1,3 +1,16 @@
+var extra = require('./extra')
+var md = extra.md;
+var finishView = extra.finishView;
+var autoLinkify = extra.autoLinkify;
+var deduplicatedHeaderId = extra.deduplicatedHeaderId;
+var renderTOC = extra.renderTOC;
+var generateToc = extra.generateToc;
+var smoothHashScroll = extra.smoothHashScroll;
+var postProcess = extra.postProcess;
+var lastchangeui = extra.lastchangeui;
+var updateLastChange = extra.updateLastChange;
+var preventXSS = require('./render').preventXSS;
+
var markdown = $(".markdown-body");
var text = $('<textarea/>').html(markdown.html()).text();
var lastMeta = md.meta;
@@ -109,4 +122,8 @@ function scrollToBottom() {
$('body, html').stop(true, true).animate({
scrollTop: $(document.body)[0].scrollHeight
}, 100, "linear");
-} \ No newline at end of file
+}
+
+module.exports = {
+ scrollToBottom: scrollToBottom
+}