added aoutline template...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-08-10 16:36:18 +03:00
parent 4c4c6fa2f7
commit 08f879f212

50
wiki.js
View File

@ -815,11 +815,14 @@ var data = {
+'<macro src="../*">'
+'<div class="todo-item">'
+'<input type="checkbox"/>'
+'<include class="raw" '
+'<include '
+'class="raw" '
+'contenteditable tabindex="0" '
+'style="display:inline-block" '
+'saveto="@source(./path)" '
+'src="./raw"/>'
+'src="."'
+'/>'
//+'<span class="separator"/>\n'
+'<a class="button" href="#@source(./path)/delete">&times;</a>'
+'</div>'
+'</macro>'
@ -841,6 +844,42 @@ var data = {
+'</slot>'
+'\n',
},
'Templates/outline': {
text: ''
//*
+'<div>'
// XXX select all on focus...
+'<span class="raw" contenteditable tabindex="0" '
+'saveto="@source(../path)/@now()" style="display:inline-block">'
+'+'
+'</span>'
+'</div>'
//+'<br>'
//*/
+'<macro src="../*">'
+'<div class="todo-item">'
+'<div>'
+'<include '
+'class="raw" '
+'contenteditable tabindex="0" '
+'style="display:inline-block" '
+'saveto="@source(./path)" '
+'src="."'
+'/>'
+'<span class="separator"/>'
+'<a class="button" href="#@source(./path)/delete">&times;</a>'
+'</div>'
+'<div style="padding-left: 30px">'
+'<include '
+'style="display:inline-block" '
+'src="@source(./path)/outline" '
+'/>'
+'</div>'
+'</div>'
+'</macro>'
+'\n',
},
}
data.__proto__ = BaseData
@ -912,6 +951,11 @@ var Wiki = {
.replace(/\$NOW|\$\{NOW\}/g, ''+Date.now())
},
resolvePathActions: function(){
// XXX this can happen when we are getting '.../*' of an empty item...
if(this.path == null){
return this
}
var p = path2lst(this.path).pop()
if(p in PathActions){
@ -1025,6 +1069,8 @@ var Wiki = {
// NOTE: changing path will update all the links to the moving page.
// NOTE: if a link can't be updated without a conflit then it is left
// unchanged, and a redirect page will be created.
//
// XXX this can be null if we are getting '.../*' of an empty item...
get path(){
return (this.__order || this.resolveStarPath(this.location))[this.at()] },
// XXX should link updating be part of this???