mirror of
https://github.com/flynx/pWiki.git
synced 2025-11-02 12:00: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),
|
module.path.relative(this.location, path),
|
||||||
...args) } }
|
...args) } }
|
||||||
|
|
||||||
// XXX do we need history management???
|
// XXX HISTORY do we need history management???
|
||||||
|
// XXX FUNC need to handle functions in store...
|
||||||
var BasePage =
|
var BasePage =
|
||||||
module.BasePage =
|
module.BasePage =
|
||||||
object.Constructor('BasePage', {
|
object.Constructor('BasePage', {
|
||||||
@ -363,17 +364,21 @@ object.Constructor('BasePage', {
|
|||||||
|
|
||||||
// page data...
|
// page data...
|
||||||
//
|
//
|
||||||
// XXX handle functions as pages...
|
// XXX FUNC handle functions as pages...
|
||||||
|
// XXX need to support pattern pages...
|
||||||
get data(){
|
get data(){
|
||||||
return this.store.get(this.location) },
|
return this.store.get(this.location) },
|
||||||
// XXX need to support pattern pages...
|
|
||||||
set data(value){
|
set data(value){
|
||||||
this.store.update(this.location, value) },
|
this.store.update(this.location, value) },
|
||||||
// shorthands...
|
// shorthands...
|
||||||
|
// XXX FUNC handle functions as pages...
|
||||||
// XXX need to support pattern pages...
|
// XXX need to support pattern pages...
|
||||||
get text(){
|
get text(){
|
||||||
return this.data.text },
|
var data = this.data
|
||||||
// XXX need to support pattern pages...
|
return data instanceof Function ?
|
||||||
|
// XXX FUNC not sure about this...
|
||||||
|
data.call(this, 'text')
|
||||||
|
: data.text },
|
||||||
set text(value){
|
set text(value){
|
||||||
this.store.update(this.location, {text: value}) },
|
this.store.update(this.location, {text: value}) },
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user