mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
added dict serialization...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
095aa58ee0
commit
2f7bb422f2
@ -1627,11 +1627,13 @@ var BaseTagsPrototype = {
|
||||
var res = {}
|
||||
|
||||
// definitions...
|
||||
this.definitions && Object.keys(this.definitions).length > 0
|
||||
this.definitions
|
||||
&& Object.keys(this.definitions).length > 0
|
||||
&& (res.definitions = Object.assign({}, this.definitions))
|
||||
|
||||
// persistent tags...
|
||||
this.persistent && this.persistent.size > 0
|
||||
this.persistent
|
||||
&& this.persistent.size > 0
|
||||
&& (res.persistent = [...this.persistent])
|
||||
|
||||
// tags...
|
||||
@ -1970,6 +1972,31 @@ var TagsWithDictPrototype = {
|
||||
&& this.removeOrphansFromDict(tag)
|
||||
return res
|
||||
},
|
||||
json: function(){
|
||||
var res = object.parent(TagsWithDictPrototype.json, this).call(this, ...arguments)
|
||||
|
||||
// dict...
|
||||
this.dict
|
||||
&& Object.keys(this.dict).length > 0
|
||||
&& (res.dict = {})
|
||||
&& Object.entries(this.dict)
|
||||
.forEach(function(e){
|
||||
res.dict[e[0]] = e[1].slice() })
|
||||
|
||||
return res
|
||||
},
|
||||
load: function(json){
|
||||
var that = this
|
||||
|
||||
// dict...
|
||||
json.dict
|
||||
&& (this.dict = {})
|
||||
&& Object.entries(json.dict)
|
||||
.forEach(function(e){
|
||||
that.dict[e[0]] = e[1].slice() })
|
||||
|
||||
return object.parent(TagsWithDictPrototype.load, this).call(this, ...arguments)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user