summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYukai Huang2016-10-13 08:56:02 +0800
committerYukai Huang2016-10-13 08:56:02 +0800
commitb90c26fe908c126a03b286ed952b719a4624731b (patch)
tree90f2add5cd4f0007649fedb70ffc4e379ec3ad28
parentdda41c489dff2ca9603ad792755f3590ccfb5bdf (diff)
Config CDN for viz.js
Diffstat (limited to '')
-rw-r--r--public/js/extra.js1
-rw-r--r--public/views/foot.ejs2
-rw-r--r--public/views/pretty.ejs1
-rw-r--r--public/views/slide.ejs1
-rw-r--r--webpackBaseConfig.js4
5 files changed, 8 insertions, 1 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index af43c2b2..1dd86760 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -306,6 +306,7 @@ function finishView(view) {
}
});
//graphviz
+ var Viz = require("viz.js");
var graphvizs = view.find(".graphviz.raw").removeClass("raw");
graphvizs.each(function (key, value) {
try {
diff --git a/public/views/foot.ejs b/public/views/foot.ejs
index abf2da12..323d18f3 100644
--- a/public/views/foot.ejs
+++ b/public/views/foot.ejs
@@ -20,7 +20,7 @@
<script src="<%- url %>/vendor/moment/min/moment-with-locales.js" defer></script>
<script src="<%- url %>/vendor/mermaid/dist/mermaid.min.js" defer></script>
<% } %>
-<!--codemirror-->
+<script src="//cdnjs.cloudflare.com/ajax/libs/viz.js/1.3.0/viz.js" defer></script>
<%- include build/index-scripts %>
<script src="<%- url %>/js/google-drive-upload.js" defer></script>
<script src="<%- url %>/js/google-drive-picker.js" defer></script>
diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs
index 7e617dc5..ecce68d9 100644
--- a/public/views/pretty.ejs
+++ b/public/views/pretty.ejs
@@ -102,6 +102,7 @@
<script src="<%- url %>/vendor/moment/min/moment-with-locales.js" defer></script>
<script src="<%- url %>/vendor/mermaid/dist/mermaid.min.js" defer></script>
<% } %>
+<script src="//cdnjs.cloudflare.com/ajax/libs/viz.js/1.3.0/viz.js" defer></script>
<%- include build/pretty-scripts %>
<script src="<%- url %>/js/reveal-markdown.js" defer></script>
<%- include ga %>
diff --git a/public/views/slide.ejs b/public/views/slide.ejs
index ac34006b..5b24ab4e 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -102,6 +102,7 @@
<script src="<%- url %>/vendor/moment/min/moment-with-locales.js" defer></script>
<script src="<%- url %>/vendor/mermaid/dist/mermaid.min.js" defer></script>
<% } %>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/viz.js/1.3.0/viz.js" defer></script>
<%- include build/slide-scripts %>
</body>
</html>
diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js
index 22ddadda..33753ef5 100644
--- a/webpackBaseConfig.js
+++ b/webpackBaseConfig.js
@@ -66,6 +66,10 @@ module.exports = {
extensions: ["", ".js"]
},
+ externals: {
+ "viz.js": "Viz"
+ },
+
module: {
loaders: [{
test: /\.json$/,