From f56d6c44c0fa30a1e6e6883bd6dbd843521b9479 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 7 Jul 2016 05:05:35 +0300 Subject: [PATCH] reworked page acquesition... Signed-off-by: Alex A. Naanou --- wiki.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wiki.js b/wiki.js index bdc2a50..4584668 100755 --- a/wiki.js +++ b/wiki.js @@ -92,11 +92,20 @@ var Wiki = { // page content... // - // NOTE: if this page has not text, this will get the DefaultPage... - // XXX should this get the DefaultPage or the EmptyPage??? + // Test acquesition order: + // - explicit path + // - .title in path + // - .title in templates + // - aquire default page (same order as above) + // get text(){ + // get the page directly... return (this.__wiki_data[this.location] || {}).text + // acquire the page from path... + || (this.acquire(this.title) || {}).text + // acquire the default page... || (this.acquire(this.__default_page__) || {}).text + // nothing found... || '' }, set text(value){