mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
experimenting and notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
4b9d8e9d78
commit
f8e5b88a09
@ -33,10 +33,12 @@ module.setup =
|
||||
Promise.all([
|
||||
// static stores...
|
||||
//
|
||||
store.update('System',
|
||||
Object.create(basestore.BaseStore).load(page.System)),
|
||||
store.update('Settings',
|
||||
Object.create(basestore.BaseStore).load(page.Settings)),
|
||||
store.update('System',
|
||||
Object.create(basestore.BaseStore).load(page.System)),
|
||||
store.update('Test',
|
||||
Object.create(basestore.BaseStore).load(page.Test)),
|
||||
|
||||
// persistent stores...
|
||||
//
|
||||
|
||||
@ -1435,7 +1435,6 @@ module.System = {
|
||||
return this.get('..').path },
|
||||
location: function(){
|
||||
return this.get('..').path },
|
||||
// XXX this can be a list for pattern paths...
|
||||
resolved: async function(){
|
||||
return this.get('..').resolve() },
|
||||
dir: function(){
|
||||
@ -1460,10 +1459,10 @@ module.System = {
|
||||
// XXX
|
||||
return '' },
|
||||
// XXX links to pages...
|
||||
to: function(){
|
||||
LinksTo: function(){
|
||||
return (this.get('..').data || {}).to ?? [] },
|
||||
// XXX pages linking to us...
|
||||
'from': function(){
|
||||
LinksFrom: function(){
|
||||
return (this.get('..').data || {})['from'] ?? [] },
|
||||
|
||||
|
||||
@ -1480,16 +1479,68 @@ module.System = {
|
||||
// show info about the delete operation...
|
||||
return target.get('DeletingPage').text },
|
||||
|
||||
// XXX EXPERIMENTAL
|
||||
// move page one level up...
|
||||
moveUp: function(){
|
||||
var target = this.get('..')
|
||||
var to = '../../'+target.name
|
||||
|
||||
target.move(to)
|
||||
|
||||
// redirect...
|
||||
this.render_root
|
||||
&& (this.render_root.location = to)
|
||||
// show info about the move operation...
|
||||
return this.render_root.path },
|
||||
// moves page to current location...
|
||||
// Example
|
||||
// /path/to/page/moveDown
|
||||
// /path/page -> /path/to/page
|
||||
moveDown: function(){
|
||||
var to = this.get('..')
|
||||
var target = to.get('../../'+ to.name)
|
||||
|
||||
target.move(to.path)
|
||||
|
||||
// redirect...
|
||||
this.render_root
|
||||
&& (this.render_root.location = to.path)
|
||||
return this.render_root.path },
|
||||
|
||||
// syntax:
|
||||
// /<path-from>/to:<path-to>/move
|
||||
//
|
||||
// XXX the syntax works, but there are problems with .move(..) method...
|
||||
move: async function(){
|
||||
var [from, to] = this.get('..').path.split(/\/to:/)
|
||||
// can't move...
|
||||
if(!from || !to){
|
||||
console.warn(`move: can't move: "${from}" -> "${to}"`)
|
||||
return '' }
|
||||
|
||||
await this.get(from).move(to)
|
||||
|
||||
// redirect...
|
||||
this.render_root
|
||||
&& (this.render_root.location = to)
|
||||
return '' },
|
||||
|
||||
// XXX System/back
|
||||
// XXX System/forward
|
||||
// XXX System/sort
|
||||
// XXX System/reverse
|
||||
|
||||
|
||||
// XXX broken...
|
||||
test_list: function(){
|
||||
return 'abcdef'.split('') },
|
||||
test_slots: {
|
||||
}
|
||||
|
||||
var Test =
|
||||
module.Test = {
|
||||
'list/action': function(){
|
||||
return [...'abcdef'] },
|
||||
'list/statuc': {
|
||||
text: [...'abcdef'] },
|
||||
|
||||
slots: {
|
||||
text: object.doc`
|
||||
Sequential:
|
||||
<slot name="sequential">unfilled</slot>
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
/**********************************************************************
|
||||
*
|
||||
*
|
||||
* XXX does @macro(..) have to follow the same overloading rules as @slot(..)???
|
||||
* ...does it??
|
||||
* XXX GENERATOR make pattern path parsing a generator...
|
||||
* ...experiment with a controllable iterator/range thing...
|
||||
* This would require:
|
||||
@ -19,6 +17,11 @@
|
||||
* ...might be a good idea to make filters local only...
|
||||
* XXX slots/macros might also pose a problem...
|
||||
* 2) all the macros that can source pages to produce generators (DONE)
|
||||
* XXX BUG: .move(..) behaves in an odd way...
|
||||
* see: System/move page action
|
||||
* ...deletes the original and moves an empty page -- sync error???
|
||||
* XXX does @macro(..) have to follow the same overloading rules as @slot(..)???
|
||||
* ...does it??
|
||||
* XXX ranges in pattern paths -- page-size=X page=Y | from=X to=Y / ...
|
||||
* ...url syntax???
|
||||
* XXX differenced in behaviour between _abc and abc, either need to make
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user