mirror of
https://github.com/flynx/pWiki.git
synced 2025-11-01 19:40:10 +00:00
working on functions as page values...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
76f322a482
commit
cf92d0af8d
15
pwiki2.js
15
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}) },
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user