Changeset 248 for Dev/branches/jQueryUI/js/api.js
- Timestamp:
- 02/08/12 17:59:48 (13 years ago)
- bzr:base-revision:
- hendrik@van-antwerpen.net-20120208154334-gr4a79sgxd2lp6v0
- bzr:committer:
- Hendrik van Antwerpen <hendrik@van-antwerpen.net>
- bzr:file-ids:
Dev/branches/jQueryUI/api.php 244@e1b9dffa-5495-0410-85d9-cf58ec4b5d15:%2FDev%2Fbranches%2FjQueryUI%2Fapi.php
Dev/branches/jQueryUI/index.php 243@e1b9dffa-5495-0410-85d9-cf58ec4b5d15:%2FDev%2Fbranches%2FjQueryUI%2Findex.php
Dev/branches/jQueryUI/js/api.js api.js-20120207184802-m5kfm0pir6sqj2uh-2
Dev/branches/jQueryUI/js/main.js 244@e1b9dffa-5495-0410-85d9-cf58ec4b5d15:%2FDev%2Fbranches%2FjQueryUI%2Fjs%2Fmain.js- bzr:mapping-version:
- v4
- bzr:repository-uuid:
- e1b9dffa-5495-0410-85d9-cf58ec4b5d15
- bzr:revision-id:
- hendrik@van-antwerpen.net-20120208165851-sf1w30ozqzjucyt2
- bzr:revno:
- 249
- bzr:revprop:branch-nick:
- RESEARCHTOOL
- bzr:testament:
bazaar-ng testament short form 2.1
revision-id: hendrik@van-antwerpen.net-20120208165851-sf1w30ozqzjucyt2
sha1: 0adf580124c52a64c27aba450830a607e348e459- bzr:text-parents:
Dev/branches/jQueryUI/api.php hendrik@van-antwerpen.net-20120208154334-gr4a79sgxd2lp6v0
Dev/branches/jQueryUI/index.php hendrik@van-antwerpen.net-20120208154334-gr4a79sgxd2lp6v0
Dev/branches/jQueryUI/js/api.js hendrik@van-antwerpen.net-20120208154334-gr4a79sgxd2lp6v0
Dev/branches/jQueryUI/js/main.js hendrik@van-antwerpen.net-20120208154334-gr4a79sgxd2lp6v0- bzr:timestamp:
- 2012-02-08 17:58:51.584000111 +0100
- bzr:user-agent:
- bzr2.4.1+bzr-svn1.1.0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/jQueryUI/js/api.js
r247 r248 37 37 api: { 38 38 post: function(action,args) { 39 req = { 40 action:action, 41 args:args 42 } 43 user = rft.auth.getUser(); 44 if ( user ) { 45 req.uid = user.uid 46 } 39 47 return $.ajax({ 40 48 type: "POST", 41 49 url: "api.php", 42 50 contentType: "application/json", 43 data: JSON.stringify({ 44 uid:rft.auth.getUid(), 45 action:action, 46 args:args 47 }) 51 data: JSON.stringify(req) 48 52 }); 49 53 }, … … 102 106 auth: new (function() { 103 107 var self = this; 104 var currentU id= null;108 var currentUser = null; 105 109 106 110 self.login = function(username,password,success,error) { … … 112 116 }) 113 117 .done(function(data, textStatus, jqXHR) { 114 currentU id = data.uid;115 d.resolve(data .uid);118 currentUser = data; 119 d.resolve(data); 116 120 }) 117 121 .fail(function(jqXHR,textStatus,errorThrown){ … … 129 133 }) 130 134 .done(function(data, textStatus, jqXHR) { 131 currentU id = data.uid;132 d.resolve(data .uid);135 currentUser = data; 136 d.resolve(data); 133 137 }) 134 138 .fail(function(jqXHR,textStatus,errorThrown){ … … 138 142 }; 139 143 140 self.getU id= function(){141 return currentU id;144 self.getUser = function(){ 145 return currentUser; 142 146 }; 143 147 })(), … … 168 172 var d = $.Deferred(); 169 173 $.get("pages/"+location+"/"+location+".html") 170 .done(function(html){171 $("#content").html(html);172 $.getScript("pages/"+location+"/"+location+".js")173 .done(function(){174 d.resolve();175 })176 .fail(function(){177 d.reject();178 })179 })180 174 .fail(function(){ 181 175 $("#content").html("Page "+location+" not found."); 182 176 d.reject(); 183 }).then(function(){ 177 }) 178 .always(function(){ 184 179 $.bbq.pushState({ 185 180 "content": location 186 181 }); 187 182 }) 183 .pipe(function(html){ 184 $("#content").html(html); 185 return $.getScript("pages/"+location+"/"+location+".js") 186 }) 187 .done(function(){ 188 d.resolve(); 189 }) 190 .fail(function(){ 191 d.reject(); 192 }) 188 193 return d; 189 194 }
Note: See TracChangeset
for help on using the changeset viewer.