Last change
on this file since 246 was
246,
checked in by hendrikvanantwerpen, 13 years ago
|
Created first page mainmenu in new system.
Moved old pages out of project root.
Fixed RDFAPI.php case for people with proper OS'es.
|
File size:
1.3 KB
|
Line | |
---|
1 | $(function() { |
---|
2 | |
---|
3 | rft = { |
---|
4 | api: { |
---|
5 | post: function(action,args,success,error) { |
---|
6 | $.ajax({ |
---|
7 | type: "POST", |
---|
8 | url: "api.php", |
---|
9 | contentType: "application/json", |
---|
10 | data: JSON.stringify({ action:action, args:args }), |
---|
11 | success: success, |
---|
12 | error: error |
---|
13 | }); |
---|
14 | } |
---|
15 | }, |
---|
16 | auth: { |
---|
17 | login: function(username,password,success,error) { |
---|
18 | rft.api.post("login", |
---|
19 | {username:username,password:password}, |
---|
20 | function(data,textStatus,jqXHR) { |
---|
21 | success && success() |
---|
22 | }, |
---|
23 | function(jqXHR,textStatus,errorThrown) { |
---|
24 | error && error() |
---|
25 | } |
---|
26 | ); |
---|
27 | }, |
---|
28 | register: function(username,password,success,error) { |
---|
29 | rft.api.post("register", |
---|
30 | {username:username,password:password}, |
---|
31 | function(data,textStatus,jqXHR) { |
---|
32 | success && success() |
---|
33 | }, |
---|
34 | function(jqXHR,textStatus,errorThrown) { |
---|
35 | error && error() |
---|
36 | } |
---|
37 | ); |
---|
38 | } |
---|
39 | } |
---|
40 | }; |
---|
41 | |
---|
42 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.