mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-17 08:31:38 +00:00
added .clone()...
Signed-off-by: Alex A. Naanou <alec.nanou@gmail.com>
This commit is contained in:
parent
024be0174b
commit
05c89e0726
15
wiki.js
15
wiki.js
@ -236,6 +236,14 @@ var Wiki = {
|
||||
return this.__wiki_data[this.acquire()] },
|
||||
|
||||
|
||||
// XXX
|
||||
clone: function(){
|
||||
var o = Object.create(Wiki)
|
||||
o.location = this.location
|
||||
return o
|
||||
},
|
||||
|
||||
|
||||
// page path...
|
||||
//
|
||||
// Format:
|
||||
@ -427,8 +435,10 @@ var Wiki = {
|
||||
// navigation...
|
||||
get parent(){
|
||||
return this.get('..') },
|
||||
// XXX add prpper insyantiation ( .clone() )...
|
||||
get: function(path){
|
||||
var o = Object.create(this)
|
||||
//var o = Object.create(this)
|
||||
var o = this.clone()
|
||||
o.location = path || this.path
|
||||
return o
|
||||
},
|
||||
@ -518,7 +528,8 @@ var Wiki = {
|
||||
var that = this
|
||||
Object.keys(this.__wiki_data).forEach(function(location){
|
||||
// XXX not sure if this is the right way to go...
|
||||
var o = Object.create(that)
|
||||
//var o = Object.create(that)
|
||||
var o = that.clone()
|
||||
o.location = location
|
||||
callback.call(o, o)
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user