diff --git a/index.html b/index.html index 8be5f6d..160a200 100755 --- a/index.html +++ b/index.html @@ -49,17 +49,25 @@ var reload = () => { var update_editor = function(){ // XXX make this update on enter... + // XXX account for title of edited page... $('.title') .focus(function(){ - $(this).text(Wiki.title) + var to = $(this).attr('saveto') || '.' + $(this).text(Wiki.get(to).title) }) .blur(function(){ + var to = $(this).attr('saveto') || '.' var text = $(this).text().trim() + var page = Wiki.get(to) + if(text[0] == '/'){ - Wiki.path = text + page.path = text } else { - Wiki.title = text + page.title = text } + + // XXX need to account for changed path sufixes... + Wiki.path = page.path reload() }) diff --git a/wiki.js b/wiki.js index 18a27fd..d23d07a 100755 --- a/wiki.js +++ b/wiki.js @@ -726,7 +726,7 @@ var data = { +'\n' +'\n' +'
\n' - +'

' + +'

' +'' +'@source(../title)' +''