mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
02eb0d0d44
commit
3400c3ab34
@ -1988,7 +1988,6 @@ module.TagsWithHandlers =
|
|||||||
// means of translating a tag back to that form.
|
// means of translating a tag back to that form.
|
||||||
//
|
//
|
||||||
// XXX hook tag and value removal...
|
// XXX hook tag and value removal...
|
||||||
// XXX EXPERIMENTAL...
|
|
||||||
var TagsWithDictPrototype = {
|
var TagsWithDictPrototype = {
|
||||||
__proto__: BaseTagsPrototype,
|
__proto__: BaseTagsPrototype,
|
||||||
|
|
||||||
@ -2117,18 +2116,22 @@ var TagsWithDictPrototype = {
|
|||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
rename: function(from, to, ...tags){
|
rename: function(from, to, ...tags){
|
||||||
|
|
||||||
var res = object.parent(TagsWithDictPrototype.rename, this).call(this, ...arguments)
|
var res = object.parent(TagsWithDictPrototype.rename, this).call(this, ...arguments)
|
||||||
|
|
||||||
arguments.length == 2
|
arguments.length == 2
|
||||||
&& this.normalizeSave(to)
|
&& this.normalizeSave(to)
|
||||||
this.removeOrphansFromDict(from)
|
this.removeOrphansFromDict(from)
|
||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
replace: function(tag, to, ...tags){
|
replace: function(tag, to, ...tags){
|
||||||
|
// XXX can we avoid doing this here???
|
||||||
if(tag instanceof Function){
|
if(tag instanceof Function){
|
||||||
to = tag
|
to = tag
|
||||||
tag = '*'
|
tag = '*'
|
||||||
}
|
}
|
||||||
var can_remove = []
|
var can_remove = []
|
||||||
|
|
||||||
var res = object.parent(TagsWithDictPrototype.replace, this).call(this,
|
var res = object.parent(TagsWithDictPrototype.replace, this).call(this,
|
||||||
tag,
|
tag,
|
||||||
arguments.length == 2 ?
|
arguments.length == 2 ?
|
||||||
@ -2143,13 +2146,16 @@ var TagsWithDictPrototype = {
|
|||||||
: this.normalizeSave(to))
|
: this.normalizeSave(to))
|
||||||
: to,
|
: to,
|
||||||
...[...arguments].slice(2))
|
...[...arguments].slice(2))
|
||||||
|
|
||||||
typeof(tag) == typeof('str')
|
typeof(tag) == typeof('str')
|
||||||
&& this.removeOrphansFromDict(can_remove)
|
&& this.removeOrphansFromDict(can_remove)
|
||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
togglePersistent: function(...tags){
|
togglePersistent: function(...tags){
|
||||||
this.normalizeSave(tags)
|
this.normalizeSave(tags)
|
||||||
|
|
||||||
var res = object.parent(TagsWithDictPrototype.togglePersistent, this).call(this, ...arguments)
|
var res = object.parent(TagsWithDictPrototype.togglePersistent, this).call(this, ...arguments)
|
||||||
|
|
||||||
this.removeOrphansFromDict(res
|
this.removeOrphansFromDict(res
|
||||||
.map(function(r, i){
|
.map(function(r, i){
|
||||||
return r == 'off' ? tags[i] : [] })
|
return r == 'off' ? tags[i] : [] })
|
||||||
@ -2160,7 +2166,9 @@ var TagsWithDictPrototype = {
|
|||||||
arguments.length > 1
|
arguments.length > 1
|
||||||
&& value != null
|
&& value != null
|
||||||
&& this.normalizeSave(tag, value)
|
&& this.normalizeSave(tag, value)
|
||||||
|
|
||||||
var res = object.parent(TagsWithDictPrototype.define, this).call(this, ...arguments)
|
var res = object.parent(TagsWithDictPrototype.define, this).call(this, ...arguments)
|
||||||
|
|
||||||
value == null
|
value == null
|
||||||
&& this.removeOrphansFromDict(tag)
|
&& this.removeOrphansFromDict(tag)
|
||||||
return res
|
return res
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user