source: Dev/branches/jQueryUI/js/main.js @ 247

Last change on this file since 247 was 247, checked in by hendrikvanantwerpen, 13 years ago

Introduced basic checking of login.
Added object query and create functions to API.
Fixed sessions overview page.
Added browser history mgmt.

File size: 988 bytes
Line 
1$(function() {
2
3    function loadMenu() {
4        rft.content.initial("mainmenu");
5    }
6
7    $("#loginForm").dialog({
8        buttons: {
9            "Login": function() {
10                rft.auth.login($("#username").val(),$("#password").val())
11                .done(function(){
12                    $("#info").html("Login succesful.");
13                    $("#loginForm").dialog("close");
14                    loadMenu();
15                })
16                .fail(function(){
17                    $("#info").text("Login failed.");
18                })
19            },
20            "Register": function() {
21                rft.auth.register($("#username").val(),$("#password").val())
22                .done(function(){
23                    $("#info").text("Succesfully registered, please login now.");
24                })
25                .fail(function(){
26                    $("#info").text("Register failed, username already in use.");
27                })
28            }
29        }
30    });
31   
32});
Note: See TracBrowser for help on using the repository browser.