1
//----------------------------------------------------------------------------
2
// Copyright (C) 2008-2011 The IPython Development Team
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
//----------------------------------------------------------------------------
8
//============================================================================
10
//============================================================================
12
var IPython = (function (IPython) {
14
var LoginWidget = function (selector) {
15
this.selector = selector;
16
if (this.selector !== undefined) {
17
this.element = $(selector);
23
LoginWidget.prototype.style = function () {
24
this.element.find('button#logout').button();
25
this.element.find('button#login').button();
29
LoginWidget.prototype.bind_events = function () {
31
this.element.find("button#logout").click(function () {
32
window.location = "/logout";
34
this.element.find("button#login").click(function () {
35
window.location = "/login";
39
// Set module variables
40
IPython.LoginWidget = LoginWidget;