diff --git a/pwiki2.js b/pwiki2.js index 85a9988..6f01393 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -295,7 +295,8 @@ function(name){ module.path.relative(this.location, path), ...args) } } -// XXX do we need history management??? +// XXX HISTORY do we need history management??? +// XXX FUNC need to handle functions in store... var BasePage = module.BasePage = object.Constructor('BasePage', { @@ -363,17 +364,21 @@ object.Constructor('BasePage', { // page data... // - // XXX handle functions as pages... + // XXX FUNC handle functions as pages... + // XXX need to support pattern pages... get data(){ return this.store.get(this.location) }, - // XXX need to support pattern pages... set data(value){ this.store.update(this.location, value) }, // shorthands... + // XXX FUNC handle functions as pages... // XXX need to support pattern pages... get text(){ - return this.data.text }, - // XXX need to support pattern pages... + var data = this.data + return data instanceof Function ? + // XXX FUNC not sure about this... + data.call(this, 'text') + : data.text }, set text(value){ this.store.update(this.location, {text: value}) },