diff --git a/pwiki/page.js b/pwiki/page.js index 58f4a4e..a96c368 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -178,6 +178,11 @@ object.Constructor('BasePage', { args == '' ? '.' : '.:'+ args }, + // helper... + get argstr(){ + return pwpath.obj2args(this.args) }, + set argstr(value){ + this.args = value }, // NOTE: these are mostly here as helpers to be accessed via page // actions... @@ -1449,12 +1454,15 @@ object.Constructor('Page', BasePage, { console.warn('UNKNOWN RENDER TEMPLATE: '+ tpl_name) return this.get(this.NOT_FOUND_TEMPLATE_ERROR).parse() } - // render template in context of page... var depends = this.depends = new Set([tpl]) - var state = {depends} // do the parse... + // NOTE: we render the template in context of page... return this - .parse(this.get('/'+tpl).raw, state) }).call(this) }, + .parse( + this.get( + '/'+tpl, + {args: this.args}).raw, + {depends}) }).call(this) }, set text(value){ this.__update__({text: value}) }, //this.onTextUpdate(value) }, @@ -1735,11 +1743,16 @@ module.System = { text: '@include(.:$ARGS isolated join="@source(file-separator)")' }, // XXX /rootpath here is not relative -- makes reuse harder... _view: { + // XXX can we avoid explicitly passing args to ./location ???? + // i.e.: + // @source(./path) + // instead of (current): + // @source(./path) text: object.doc` - @source(./path/!) - + @source(./path) +
@@ -1816,6 +1829,7 @@ module.System = { // XXX debug... _path: {text: '@source(./path join=" ")'}, + _location: {text: '@source(./location join=" ")'}, list: { diff --git a/pwiki2.html b/pwiki2.html index 781db77..8875414 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -220,7 +220,7 @@ require(['./browser'], function(browser){ // separates the navigate and load events... logTime( this.refresh(), - this.path) }) + this.location) }) .onLoad(function(evt){ var that = this // stop spinner... @@ -241,7 +241,7 @@ require(['./browser'], function(browser){ setTimeout(function(){ logTime( that.refresh(), - that.path) }, REFRESH_DELAY) }) } }) + that.location) }, REFRESH_DELAY) }) } }) // wait for stuff to finish... browser.setup.then(function(){ diff --git a/pwiki2.js b/pwiki2.js index d331cbf..4511e52 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,6 +1,11 @@ /********************************************************************** * * +* XXX can we avoid explicitly passing args to ./location ???? +* i.e.: +* @source(./path) +* instead of (current): +* @source(./path) * XXX BUG: * /System/info * and: