Changeset 884
- Timestamp:
- 02/25/08 07:15:43
- Files:
-
- apps/notifier/app/resources/users_resource.php (modified) (1 diff)
- apps/notifier/app/views/test/index.php (modified) (1 diff)
- apps/notifier/public/js/notifier.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
apps/notifier/app/resources/users_resource.php
r882 r884 11 11 $this->responds_created($user); 12 12 else 13 $this->responds_ nothing(400);13 $this->responds_error($user->errors, 400); 14 14 } 15 15 } apps/notifier/app/views/test/index.php
r882 r884 39 39 <input type="submit" onclick="notifier.api.sendNote($('#note_text').val(), notifier.ui.prependNote);" 40 40 value="Envoyer" /> 41 <a href="#" onclick="notifier.a pi.publicTimeline(notifier.ui.refreshFriendsTimeline);">Actualiser</a>41 <a href="#" onclick="notifier.actions.refreshFriendsTimeline();">Actualiser</a> 42 42 <div id="friends-timeline"></div> 43 43 </div> apps/notifier/public/js/notifier.js
r882 r884 8 8 notifier.actions = {}; 9 9 notifier.actions.login = function() { 10 10 $('#login').hide(); 11 $('#main').show(); 11 12 } 12 13 notifier.actions.register = function() { … … 24 25 } 25 26 }); 27 } 28 notifier.actions.refreshFriendsTimeline = function() { 29 26 30 } 27 31 … … 58 62 params: {}, 59 63 authenticate: false, 60 success: null 64 success: null, 65 error: null 61 66 }; 62 67 if (options == null) options = {}; … … 87 92 var data = null; 88 93 } 89 if (options. callback!== null) {90 options. callback(data, status);94 if (options.success !== null) { 95 options.success(data, status); 91 96 } 92 97 }, 93 98 error: function (xhr, status, error) { 94 alert("Erreur "+xhr.status+" !\n\n"+error); 99 try { 100 error = eval('(' + xhr.responseText + ')'); 101 } catch (e) { 102 error = error; 103 } 104 if (options.error !== null) { 105 options.error(data, status); 106 } else { 107 var str = "Erreur "+xhr.status+" !\n\n"; 108 for (var key in error) { 109 str += key+': '+error[key]+"\n"; 110 } 111 alert(str); 112 } 95 113 } 96 114 }
