Last change
on this file since 249 was
249,
checked in by hendrikvanantwerpen, 13 years ago
|
This one's for Subversion, because it's so close...
First widget (stripped down sequencer).
Seperated client and server code in two direcotry trees.
|
File size:
1.2 KB
|
Rev | Line | |
---|
[249] | 1 | $(function() { |
---|
| 2 | |
---|
| 3 | $("#logoControls").click(function(){ |
---|
| 4 | user = rft.auth.getUser(); |
---|
| 5 | if ( !user ) { |
---|
| 6 | $("#loginForm").dialog("open"); |
---|
| 7 | } |
---|
| 8 | }); |
---|
| 9 | |
---|
| 10 | function loadMenu() { |
---|
| 11 | rft.content.initial("mainmenu"); |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | $("#loginForm").dialog({ |
---|
| 15 | buttons: { |
---|
| 16 | "Login": function() { |
---|
| 17 | rft.auth.login($("#username").val(),$("#password").val()) |
---|
| 18 | .done(function(user){ |
---|
| 19 | $("#loginForm").dialog("close"); |
---|
| 20 | $("#logoControls").text("Welcome, "+user.name); |
---|
| 21 | loadMenu(); |
---|
| 22 | }) |
---|
| 23 | .fail(function(){ |
---|
| 24 | $("#info").text("Login failed."); |
---|
| 25 | }) |
---|
| 26 | }, |
---|
| 27 | "Register": function() { |
---|
| 28 | rft.auth.register($("#username").val(),$("#password").val()) |
---|
| 29 | .done(function(user){ |
---|
| 30 | $("#loginForm").dialog("close"); |
---|
| 31 | $("#logoControls").text("Welcome, "+user.name); |
---|
| 32 | loadMenu(); |
---|
| 33 | }) |
---|
| 34 | .fail(function(){ |
---|
| 35 | $("#info").text("Register failed, username already in use."); |
---|
| 36 | }) |
---|
| 37 | } |
---|
| 38 | } |
---|
| 39 | }); |
---|
| 40 | |
---|
| 41 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.