Show More
@@ -0,0 +1,38 b'' | |||||
|
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#login').button(); | |||
|
25 | }; | |||
|
26 | LoginWidget.prototype.bind_events = function () { | |||
|
27 | var that = this; | |||
|
28 | this.element.find("button#login").click(function () { | |||
|
29 | window.location = "/login?next="+location.pathname; | |||
|
30 | }); | |||
|
31 | }; | |||
|
32 | ||||
|
33 | // Set module variables | |||
|
34 | IPython.LoginWidget = LoginWidget; | |||
|
35 | ||||
|
36 | return IPython; | |||
|
37 | ||||
|
38 | }(IPython)); |
General Comments 0
You need to be logged in to leave comments.
Login now