mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
some cleanup + minor tweak to .json(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ee8df1330f
commit
e5f19dfdf3
@ -246,18 +246,22 @@ actions.Actions({
|
|||||||
{journal: true},
|
{journal: true},
|
||||||
function(lst, base){ this.load(this.dataFromURLs(lst, base)) }],
|
function(lst, base){ this.load(this.dataFromURLs(lst, base)) }],
|
||||||
|
|
||||||
// XXX experimental...
|
|
||||||
// ...the bad thing about this is that we can not extend this,
|
|
||||||
// adding new items to the resulting structure...
|
|
||||||
// XXX is this the correct way to go???
|
// XXX is this the correct way to go???
|
||||||
// ...can we save simple attribute values???
|
// ...can we save simple attribute values???
|
||||||
json: ['- File/Dump state as JSON object',
|
json: ['- File/Dump state as JSON object',
|
||||||
'This will collect JSON data from every available attribute '
|
core.doc`Dump state as JSON object
|
||||||
+'supporting the .dumpJSON() method.',
|
|
||||||
|
This will collect JSON data from every available attribute supporting
|
||||||
|
the .dumpJSON() method.
|
||||||
|
|
||||||
|
NOTE: this will ignore attributes starting with '__'.
|
||||||
|
`,
|
||||||
function(mode){
|
function(mode){
|
||||||
var res = {}
|
var res = {}
|
||||||
for(var k in this){
|
for(var k in this){
|
||||||
if(this[k] != null && this[k].dumpJSON != null){
|
if(!k.startsWith('__')
|
||||||
|
&& this[k] != null
|
||||||
|
&& this[k].dumpJSON != null){
|
||||||
res[k] = this[k].dumpJSON()
|
res[k] = this[k].dumpJSON()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -216,7 +216,11 @@ var PeerActions = actions.Actions({
|
|||||||
})],
|
})],
|
||||||
|
|
||||||
peerCall: ['- Peer/',
|
peerCall: ['- Peer/',
|
||||||
function(id, action){ return new CooperativePromise() }],
|
//function(id, action){ return new CooperativePromise() }],
|
||||||
|
function(id, action){
|
||||||
|
var args = [].slice.call(arguments, 2)
|
||||||
|
return this.peerApply(id, action, args)
|
||||||
|
}],
|
||||||
peerApply: ['- Peer/',
|
peerApply: ['- Peer/',
|
||||||
function(id, action, args){ return new CooperativePromise() }],
|
function(id, action, args){ return new CooperativePromise() }],
|
||||||
|
|
||||||
@ -338,11 +342,6 @@ var ChildProcessPeerActions = actions.Actions({
|
|||||||
// ...this would be useful to 100% match the action api and
|
// ...this would be useful to 100% match the action api and
|
||||||
// make the thing transparent...
|
// make the thing transparent...
|
||||||
// XXX prop access???
|
// XXX prop access???
|
||||||
peerCall: ['- Peer/',
|
|
||||||
makeProtocolHandler('child', function(id, action){
|
|
||||||
var args = [].slice.call(arguments, 2)
|
|
||||||
return this.peerApply(id, action, args)
|
|
||||||
})],
|
|
||||||
peerApply: ['- Peer/',
|
peerApply: ['- Peer/',
|
||||||
makeProtocolHandler('child', function(id, action, args){
|
makeProtocolHandler('child', function(id, action, args){
|
||||||
return new Promise((function(resolve, reject){
|
return new Promise((function(resolve, reject){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user