move renderGraphs

This commit is contained in:
Peter Stuifzand 2020-08-31 16:12:10 +02:00
parent 607ab7ce15
commit e83cba6a3f

View File

@ -136,6 +136,27 @@ function showSearchResultsExtended(element, template, searchTool, query, input,
}) })
} }
function renderGraphs() {
$('code.language-dot').each(function (i, code) {
if (!code.innerText) {
return true
}
let data = parseDOTNetwork(code.innerText)
let network = new Network(code, data, {
layout: {
randomSeed: 1239043
}
});
$(code).on('click', function () {
return false
})
})
}
/*
* EVENTS
*/
$(document).on('keydown', '.keyboard-list', function (event) { $(document).on('keydown', '.keyboard-list', function (event) {
if (!$(':visible', this).length) { if (!$(':visible', this).length) {
return true return true
@ -173,24 +194,6 @@ $(document).on('popup:selected', '#autocomplete', function (event, linkName, res
} }
}) })
function renderGraphs() {
$('code.language-dot').each(function (i, code) {
if (!code.innerText) {
return true
}
let data = parseDOTNetwork(code.innerText)
let network = new Network(code, data, {
layout: {
randomSeed: 1239043
}
});
$(code).on('click', function () {
return false
})
})
}
const MD = new MarkdownIt({ const MD = new MarkdownIt({
linkify: true, linkify: true,
highlight: function (str, lang) { highlight: function (str, lang) {