[Jifty-commit] jifty branch, jifty_client, updated. e4f2d650810d1540c33f0daa5412e62e29621abe

Jifty commits jifty-commit at lists.jifty.org
Fri Apr 30 23:51:59 EDT 2010


The branch, jifty_client has been updated
       via  e4f2d650810d1540c33f0daa5412e62e29621abe (commit)
       via  ff60410fd3160c37fbe0b9922cda8bf519477796 (commit)
      from  549a1693d0dd569baa771c5ffa543cc72cdc1382 (commit)

Summary of changes:
 share/web/static/js/jifty_client.js |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit ff60410fd3160c37fbe0b9922cda8bf519477796
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat May 1 11:45:50 2010 +0800

    Helper method _includeBaseUrl

diff --git a/share/web/static/js/jifty_client.js b/share/web/static/js/jifty_client.js
index fe4ff93..394e503 100644
--- a/share/web/static/js/jifty_client.js
+++ b/share/web/static/js/jifty_client.js
@@ -23,6 +23,13 @@ Class("JiftyClient", {
                 onFailure
             );
         },
+        _includeBaseUrl: function (path) {
+            var url = path;
+            if (this.hasBaseUrl()) {
+                url = this.baseUrl + url;
+            }
+            return url;
+        },
         runAction: function (name, params, onSuccess, onFailure) {
             // if the action returns failure then we want to run the onFailure
             // handler, even though the AJAX request was successful
@@ -35,13 +42,8 @@ Class("JiftyClient", {
                 }
             };
 
-            var url = "/=/action/" + name + ".json";
-            if (this.hasBaseUrl()) {
-                url = this.baseUrl + url;
-            }
-
             jQuery.ajax({
-                url: url,
+                url: this._includeBaseUrl("/=/action/" + name + ".json"),
                 data: params,
                 dataType: "json",
                 type: 'POST',

commit e4f2d650810d1540c33f0daa5412e62e29621abe
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat May 1 11:51:52 2010 +0800

    Begin mirrorModel and buildClassFromModel methods

diff --git a/share/web/static/js/jifty_client.js b/share/web/static/js/jifty_client.js
index 394e503..d7b97a9 100644
--- a/share/web/static/js/jifty_client.js
+++ b/share/web/static/js/jifty_client.js
@@ -50,6 +50,20 @@ Class("JiftyClient", {
                 error: onFailure,
                 success: onAjaxSuccess
             });
+        },
+        mirrorModel: function (modelName, className, onSuccess, onFailure) {
+            var that = this;
+            jQuery.ajax({
+                url: this._includeBaseUrl("/=/model/" + modelName + ".json"),
+                dataType: "json",
+                type: 'GET',
+                error: onFailure,
+                success: function (result) {
+                    onSuccess(that.buildClassFromModel(result, className));
+                }
+            });
+        },
+        buildClassFromModel: function (classStructure, className) {
         }
     }
 });

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list