From 3ef60b6584741bf980cf206ef86920c41a0a1408 Mon Sep 17 00:00:00 2001 From: Jerry Jalava Date: Wed, 5 Dec 2007 19:04:37 +0200 Subject: [PATCH] Remove duplicate function normalizing as this is now done in the new jqcouch --- js/ajatus.views.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/js/ajatus.views.js b/js/ajatus.views.js index 7b20cc1..ddac338 100644 --- a/js/ajatus.views.js +++ b/js/ajatus.views.js @@ -120,7 +120,7 @@ { var view_exists = false; var existing_rev = null; - var jqcouch = $.jqcouch.view; + var vc = $.jqCouch.connection('view'); var static_views = { _id: '_design/' + view_name, @@ -132,24 +132,18 @@ && fn) { if (typeof(fn) == 'string') { - fn = $.ajatus.views.generate(eval(fn)); + fn = $.ajatus.views.generate(fn);//eval(fn) } - if (typeof(fn['toSource']) == 'function') { - static_views.views[name] = fn.toSource(); - } else { - static_views.views[name] = fn; - } + static_views.views[name] = fn; } }); - jqcouch.on_success = function(data, caller) - { - view_exists = data.exists; - existing_rev = data.rev; - } - jqcouch.exists($.ajatus.preferences.client.content_database, '_design/' + view_name); - + vc.exists($.ajatus.preferences.client.content_database, view_name, function(data){ + view_exists = true; + existing_rev = data._rev; + }); + if ( !view_exists || view.update_statics) { @@ -158,7 +152,7 @@ { static_views['_rev'] = existing_rev; } - jqcouch.save($.ajatus.preferences.client.content_database, static_views); + vc.save($.ajatus.preferences.client.content_database, static_views); } }; -- 2.11.4.GIT