Use new editor, hide [[,]] from sidebar
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2020-09-03 15:42:34 +02:00
parent 30b24903f1
commit bbc2ebc30f
6 changed files with 25 additions and 9 deletions

View File

@ -9267,9 +9267,9 @@
}
},
"wiki-list-editor": {
"version": "0.8.12",
"resolved": "https://registry.npmjs.org/wiki-list-editor/-/wiki-list-editor-0.8.12.tgz",
"integrity": "sha512-1YdtzQv38WdbtyGFV9DAO5bJi7ndcyQlFXG64aJRimbguu6x1YRP8dzGiStGKfoVqZpR5zZ8Q+7HrqsxKVb24g==",
"version": "0.8.13",
"resolved": "https://registry.npmjs.org/wiki-list-editor/-/wiki-list-editor-0.8.13.tgz",
"integrity": "sha512-UMKzZ91WA4O2w6kL0lxS5KIfOMWIXW3AK63BVMP4vyFn2X4uvBEGJSknGVEoSxyXDhYoWTYzejb8B9RNefkNPA==",
"requires": {
"dragula": "^3.7.2",
"he": "^1.2.0",

View File

@ -41,7 +41,7 @@
"vis-data": "^6.6.1",
"vis-network": "^7.6.10",
"vis-util": "^4.3.2",
"wiki-list-editor": "^0.8.12"
"wiki-list-editor": "^0.8.13"
},
"scripts": {
"test": "node_modules/.bin/mocha -r esm",

View File

@ -210,8 +210,14 @@ MD.use(MarkdownItWikilinks({
},
})).use(MarkdownItMark).use(MarkdownItKatex)
let holder = document.getElementById('editor');
if (holder) {
let holders = document.getElementsByClassName('wiki-list-editor');
_.forEach(holders, (item, i) => {
console.log(i, item)
let EDITOR = new Editor(item)
})
function Editor(holder) {
const options = {
transform(text, element) {
let converted = text
@ -255,7 +261,7 @@ if (holder) {
})
editor.on('change', function () {
let element = document.getElementById('editor');
let element = holder
let indicator = Indicator(document.getElementById('save-indicator'), 2);
let saveUrl = element.dataset.saveurl;
let page = element.dataset.page;
@ -463,6 +469,8 @@ if (holder) {
})
menu.connectContextMenu(editor)
return editor
}
let timeout = null;

View File

@ -215,6 +215,14 @@ mark {
.sidebar {
padding: 0 12px;
width: 100%;
.wiki-link {
&::before, &::after {
content: '';
}
}
}
}

View File

@ -32,7 +32,7 @@
<div class="column">
{{ if .ShowGraph }}
<div class="graph-network" data-name="{{ .Name }}" style="height:80vh; top:0; position: sticky"></div>
<div class="graph-network" data-name="{{ .Name }}" style="height:80vh; top:0; position: sticky"></div>
{{ end }}
</div>
</div>

View File

@ -1 +1 @@
<div id="editor" data-url="{{ .BaseURL }}{{ .Page }}?format=json" data-input="{{ .Data }}" data-saveurl="/save/" data-base-url="{{ .BaseURL }}" data-page="{{ .Page }}" save-type="{{ .ContentType }}"></div>
<div class="wiki-list-editor" data-url="{{ .BaseURL }}{{ .Page }}?format=json" data-input="{{ .Data }}" data-saveurl="/save/" data-base-url="{{ .BaseURL }}" data-page="{{ .Page }}" save-type="{{ .ContentType }}"></div>