From efbede4f5bc653275c99ba99d2f4d6fe8aa55669 Mon Sep 17 00:00:00 2001 From: Jerry Jalava Date: Sun, 30 Dec 2007 19:19:31 +0200 Subject: [PATCH] Force the copied tag to the new format --- js/ajatus.tags.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/js/ajatus.tags.js b/js/ajatus.tags.js index a2c0ed2..e35b294 100644 --- a/js/ajatus.tags.js +++ b/js/ajatus.tags.js @@ -56,7 +56,25 @@ $.each(data.rows, function(i,doc){ var doc = new $.ajatus.document(doc); if (! $.ajatus.tags.exists(doc.value.title.val, doc.value.title.widget.config.context, doc.value.title.widget.config.value)) { - $.jqCouch.connection('doc').save($.ajatus.preferences.client.content_database, doc); + var tag = { + value: { + _type: 'tag', + title: { + val: doc.value.title.val, + widget: { + name: 'tag', + config: { + color: (doc.value.title.widget.config.color || '8596b6'), + context: (doc.value.title.widget.config.context || ''), + value: doc.value.title.widget.config.value + } + } + } + } + }; + tag.value.metadata = doc.value.metadata; + tag = new $.ajatus.document(tag); + $.jqCouch.connection('doc').save($.ajatus.preferences.client.content_database, tag); } }); }; -- 2.11.4.GIT