~ubuntu-branches/ubuntu/trusty/qiime/trusty

« back to all changes in this revision

Viewing changes to web/home_static/nih-cloud-apr2012/NIHCloudDemo_Fast_files/loginwidget.js

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2013-06-17 18:28:26 UTC
  • mfrom: (9.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130617182826-376az5ad080a0sfe
Tags: 1.7.0+dfsg-1
Upload preparations done for BioLinux to Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//----------------------------------------------------------------------------
2
 
//  Copyright (C) 2008-2011  The IPython Development Team
3
 
//
4
 
//  Distributed under the terms of the BSD License.  The full license is in
5
 
//  the file COPYING, distributed as part of this software.
6
 
//----------------------------------------------------------------------------
7
 
 
8
 
//============================================================================
9
 
// Login button
10
 
//============================================================================
11
 
 
12
 
var IPython = (function (IPython) {
13
 
 
14
 
    var LoginWidget = function (selector) {
15
 
        this.selector = selector;
16
 
        if (this.selector !== undefined) {
17
 
            this.element = $(selector);
18
 
            this.style();
19
 
            this.bind_events();
20
 
        }
21
 
    };
22
 
 
23
 
    LoginWidget.prototype.style = function () {
24
 
        this.element.find('button#logout').button();
25
 
        this.element.find('button#login').button();
26
 
    };
27
 
 
28
 
 
29
 
    LoginWidget.prototype.bind_events = function () {
30
 
        var that = this;
31
 
        this.element.find("button#logout").click(function () {
32
 
            window.location = "/logout";
33
 
        });
34
 
        this.element.find("button#login").click(function () {
35
 
            window.location = "/login";
36
 
        });
37
 
    };
38
 
 
39
 
    // Set module variables
40
 
    IPython.LoginWidget = LoginWidget;
41
 
 
42
 
    return IPython;
43
 
 
44
 
}(IPython));