From b7a8f1a78440ef9f2a1ddb0705bd9f711f9c63f1 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 28 Dec 2018 06:30:11 +0300 Subject: [PATCH] minor tweaks and cleanup... Signed-off-by: Alex A. Naanou --- ui (gen4)/imagegrid/tags.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ui (gen4)/imagegrid/tags.js b/ui (gen4)/imagegrid/tags.js index cebf1e7d..9012379f 100755 --- a/ui (gen4)/imagegrid/tags.js +++ b/ui (gen4)/imagegrid/tags.js @@ -1115,8 +1115,19 @@ var BaseTagsPrototype = { // NOTE: this will only match tags directly not accounting for // reachability or definitions... // NOTE: this will match tags in .__index, .persistent and .definitions + // NOTE: the func(..) output is automatically normalized... + // + // + // Examples: + // // print out all the tags (read only)... + // ts.replace(tag => console.log(tag)) + // + // // replace tag 'a' with tag 'b'... + // ts.replace('a', + // function(tag){ return tag.replace(/(^[:/])a(?=[:/]|$)/)/g, '$1b') }) + // + // // (see .rename(..) and .removeTag(..) as more advanced examples) // - // XXX revise... replace: function(tag, to, ...tags){ var that = this tags = normalizeSplit(tags) @@ -1207,8 +1218,6 @@ var BaseTagsPrototype = { // NOTE: if any renamed tag is renamed to '' it will be removed // untagging all relevant values... // - // XXX need to sanitize tag -- it can not contain regex characters... - // ...should we guard against this??? rename: function(tag, to, ...tags){ var that = this