Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
1.0 KB
|
Line | |
---|
1 | define(['dojo/_base/declare','dojo/_base/lang','dijit/Dialog','dijit/_WidgetsInTemplateMixin', |
---|
2 | '../auth', 'dojo/text!./LoginDialog.html','../content', |
---|
3 | 'dijit/form/Form','dijit/form/Button','dijit/form/TextBox'], |
---|
4 | function (declare, lang, Dialog, _WidgetsInTemplateMixin, auth, template, content) { |
---|
5 | return declare([Dialog,_WidgetsInTemplateMixin], { |
---|
6 | templateString: template, |
---|
7 | widgetsInTemplate: true, |
---|
8 | title: "Login", |
---|
9 | baseClass: "rftLoginDialog", |
---|
10 | onLogin: function() { |
---|
11 | this.loginErrors.innerHTML = ''; |
---|
12 | var data = this.loginForm.get('value'); |
---|
13 | var hide = lang.hitch(this,"hide"); |
---|
14 | auth.login(data.username,data.password) |
---|
15 | .then(function() { |
---|
16 | hide(); |
---|
17 | content.initial("sessions"); |
---|
18 | },function() { |
---|
19 | this.loginErrors.innerHTML = 'Login failed.'; |
---|
20 | }) |
---|
21 | return false; |
---|
22 | } |
---|
23 | }); |
---|
24 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.