mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-30 02:20:08 +00:00
tweaking....
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
1a939e17f7
commit
dd22f1faba
29
pwiki2.js
29
pwiki2.js
@ -1012,8 +1012,6 @@ object.Constructor('BasePage', {
|
|||||||
//
|
//
|
||||||
// NOTE: all pages that are created via a read-only page are also
|
// NOTE: all pages that are created via a read-only page are also
|
||||||
// read-only.
|
// read-only.
|
||||||
//
|
|
||||||
// XXX test .ro().virtual() combinations...
|
|
||||||
// XXX EXPERIMENTAL...
|
// XXX EXPERIMENTAL...
|
||||||
ro: function(data={}){
|
ro: function(data={}){
|
||||||
return Object.assign({
|
return Object.assign({
|
||||||
@ -1030,9 +1028,7 @@ object.Constructor('BasePage', {
|
|||||||
//
|
//
|
||||||
// NOTE: .get(..) / .clone(..) will return normal non-virtual pages
|
// NOTE: .get(..) / .clone(..) will return normal non-virtual pages
|
||||||
// unless the target path is the same as the virtual page .path...
|
// unless the target path is the same as the virtual page .path...
|
||||||
//
|
// NOTE: changing .path/.location is not supported.
|
||||||
// XXX test .ro().virtual() combinations...
|
|
||||||
// XXX should we be able to change path/location here???
|
|
||||||
// XXX EXPERIMENTAL...
|
// XXX EXPERIMENTAL...
|
||||||
virtual: function(data={}){
|
virtual: function(data={}){
|
||||||
var that = this
|
var that = this
|
||||||
@ -1586,7 +1582,8 @@ function(spec, func){
|
|||||||
module.PAGE_NOT_FOUND = '404: PAGE NOT FOUND: $PATH'
|
module.PAGE_NOT_FOUND = '404: PAGE NOT FOUND: $PATH'
|
||||||
|
|
||||||
// XXX PATH_VARS need to handle path variables...
|
// XXX PATH_VARS need to handle path variables...
|
||||||
// XXX macros and filters should be features for simpler plugin handlng (???)
|
// XXX filters (and macros?) should be features for simpler plugin handlng (???)
|
||||||
|
// XXX STUB filters...
|
||||||
var Page =
|
var Page =
|
||||||
module.Page =
|
module.Page =
|
||||||
object.Constructor('Page', BasePage, {
|
object.Constructor('Page', BasePage, {
|
||||||
@ -2073,12 +2070,15 @@ object.Constructor('Page', BasePage, {
|
|||||||
return this.__parser__.parse(this, text, state) }.bind(this)) }
|
return this.__parser__.parse(this, text, state) }.bind(this)) }
|
||||||
return this.__parser__.parse(this, text, state) },
|
return this.__parser__.parse(this, text, state) },
|
||||||
|
|
||||||
// XXX not sure about the semantics here...
|
// true if page has an array value but is not a pattern page...
|
||||||
// XXX this feels a bit overcomplicated...
|
//
|
||||||
// ...can we merge pattern and array pages into one???
|
// XXX the split into pattern and array pages feels a bit overcomplicated...
|
||||||
|
// ...can we merge the two and simplify things???
|
||||||
// XXX EXPERIMENTAL
|
// XXX EXPERIMENTAL
|
||||||
get isArray(){
|
get isArray(){
|
||||||
return !this.isPattern
|
return !this.isPattern
|
||||||
|
// NOTE: we can't only use .data here as it can be a function
|
||||||
|
// that will return an array...
|
||||||
&& this.raw instanceof Array },
|
&& this.raw instanceof Array },
|
||||||
|
|
||||||
// raw page text...
|
// raw page text...
|
||||||
@ -2125,7 +2125,7 @@ object.Constructor('Page', BasePage, {
|
|||||||
get text(){
|
get text(){
|
||||||
var tpl = '/'+ this.find('./'+ this.PAGE_TPL)
|
var tpl = '/'+ this.find('./'+ this.PAGE_TPL)
|
||||||
return [this.parse(
|
return [this.parse(
|
||||||
tpl.endsWith(this.PAGE_TPL) ?
|
tpl.endsWith(this.PAGE_TPL.split(/[\\\/]/).pop()) ?
|
||||||
[this.get(tpl).raw]
|
[this.get(tpl).raw]
|
||||||
: [] )]
|
: [] )]
|
||||||
.flat()
|
.flat()
|
||||||
@ -2172,8 +2172,13 @@ module.store =
|
|||||||
|
|
||||||
|
|
||||||
var System = {
|
var System = {
|
||||||
// XXX EXPERIMENTAL...
|
// base templates...
|
||||||
_text: {text: '<macro src="." join="\n">@source(.)</macro>'},
|
//
|
||||||
|
_text: {
|
||||||
|
text: '<macro src="." join="\n">@source(.)</macro>' },
|
||||||
|
NotFound: {
|
||||||
|
text: module.PAGE_NOT_FOUND
|
||||||
|
.replace('$PATH', '@source(./path)') },
|
||||||
|
|
||||||
// XXX tests...
|
// XXX tests...
|
||||||
test_list: function(){
|
test_list: function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user