Added DRL post and svg stuff
This commit is contained in:
parent
ade8feb556
commit
44d34d1788
8 changed files with 185 additions and 2 deletions
|
|
@ -17,5 +17,34 @@
|
|||
<%- js("https://cdn.jsdelivr.net/gh/meethigher/cdn@11/js/layer/layer.js") %>
|
||||
<%- js("js/meethigher.js") %>
|
||||
<%- js("js/toolbar.js") %>
|
||||
<%- js("js/svg-pan-zoom.min.js") %>
|
||||
<% if (theme.graphviz.enable) { %>
|
||||
<script src='https://cdnjs.cloudflare.com/ajax/libs/viz.js/1.7.1/viz.js'></script>
|
||||
<script>
|
||||
String.prototype.replaceAll = function(search, replacement) {
|
||||
var target = this;
|
||||
return target.split(search).join(replacement);
|
||||
};
|
||||
|
||||
let vizObjects = document.querySelectorAll('.graphviz');
|
||||
|
||||
for (let item of vizObjects) {
|
||||
let svg = undefined;
|
||||
try {
|
||||
//svg = Viz(item.textContent.replaceAll('–', '--'), 'svg');
|
||||
svg = Viz(item.textContent, 'svg');
|
||||
var panZoomTiger = svgPanZoom(svg, {
|
||||
controlIconsEnabled: true,
|
||||
fit: true,
|
||||
center: true,
|
||||
});
|
||||
} catch(e) {
|
||||
//svg = `<pre class="error">${e}</pre>`;
|
||||
console.log("got "+e);
|
||||
}
|
||||
item.outerHTML = svg;
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
</body>
|
||||
</html>
|
||||
3
themes/custom/source/js/svg-pan-zoom.min.js
vendored
Normal file
3
themes/custom/source/js/svg-pan-zoom.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue