- 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
- Location:
- Dev/branches/jQueryUI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/jQueryUI/api.php
r247 r248 21 21 $user = $user_results[0]; 22 22 if ($password == $user->password) { 23 $output ['uid'] = $user->uid;23 $output = $user; 24 24 $returnValue = 200; 25 25 } … … 37 37 $user->password = $password; 38 38 $user->save(); 39 $output ['uid'] = $user->uid;39 $output = $user; 40 40 $returnValue = 200; 41 41 } -
Dev/branches/jQueryUI/index.php
r247 r248 14 14 <script type="text/javascript" src="js/api.js"></script> 15 15 <script type="text/javascript" src="js/main.js"></script> 16 17 <?php new StyleSheet("visualeditors"); ?> 16 <link type="text/css" href="css/visualeditors.css" rel="stylesheet"></link> 18 17 </head> 19 18 <body> 20 19 <div id="header"> 21 <?php new Logo(); ?> 20 <div id="logo"> 21 <div id="logoImage">Research Tool</div> 22 <div id="logoControls">Log in</div> 23 </div> 22 24 </div> 23 25 -
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 } -
Dev/branches/jQueryUI/js/main.js
r247 r248 1 1 $(function() { 2 3 $("#logoControls").click(function(){ 4 user = rft.auth.getUser(); 5 if ( !user ) { 6 $("#loginForm").dialog("open"); 7 } 8 }); 2 9 3 10 function loadMenu() { … … 9 16 "Login": function() { 10 17 rft.auth.login($("#username").val(),$("#password").val()) 11 .done(function(){ 12 $("#info").html("Login succesful."); 18 .done(function(user){ 13 19 $("#loginForm").dialog("close"); 20 $("#logoControls").text("Welcome, "+user.name); 14 21 loadMenu(); 15 22 }) … … 20 27 "Register": function() { 21 28 rft.auth.register($("#username").val(),$("#password").val()) 22 .done(function(){ 23 $("#info").text("Succesfully registered, please login now."); 29 .done(function(user){ 30 $("#loginForm").dialog("close"); 31 $("#logoControls").text("Welcome, "+user.name); 32 loadMenu(); 24 33 }) 25 34 .fail(function(){
Note: See TracChangeset
for help on using the changeset viewer.