Show More
@@ -1,47 +1,45 b'' | |||
|
1 | 1 | // Copyright (c) IPython Development Team. |
|
2 | 2 | // Distributed under the terms of the Modified BSD License. |
|
3 | 3 | |
|
4 | 4 | define([ |
|
5 | 5 | 'base/js/namespace', |
|
6 | 6 | 'base/js/utils', |
|
7 | 7 | 'jquery', |
|
8 | 8 | ], function(IPython, utils, $){ |
|
9 | 9 | "use strict"; |
|
10 | 10 | |
|
11 | 11 | var LoginWidget = function (selector, options) { |
|
12 | 12 | options = options || {}; |
|
13 | 13 | this.base_url = options.base_url || utils.get_body_data("baseUrl"); |
|
14 | 14 | this.selector = selector; |
|
15 | 15 | if (this.selector !== undefined) { |
|
16 | 16 | this.element = $(selector); |
|
17 | 17 | this.style(); |
|
18 | 18 | this.bind_events(); |
|
19 | 19 | } |
|
20 | 20 | }; |
|
21 | 21 | |
|
22 | LoginWidget.prototype.style = function () { | |
|
23 | this.element.find("button").addClass("btn btn-default btn-sm"); | |
|
24 | }; | |
|
22 | LoginWidget.prototype.style = function () {}; | |
|
25 | 23 | |
|
26 | 24 | |
|
27 | 25 | LoginWidget.prototype.bind_events = function () { |
|
28 | 26 | var that = this; |
|
29 | 27 | this.element.find("button#logout").click(function () { |
|
30 | 28 | window.location = utils.url_join_encode( |
|
31 | 29 | that.base_url, |
|
32 | 30 | "logout" |
|
33 | 31 | ); |
|
34 | 32 | }); |
|
35 | 33 | this.element.find("button#login").click(function () { |
|
36 | 34 | window.location = utils.url_join_encode( |
|
37 | 35 | that.base_url, |
|
38 | 36 | "login" |
|
39 | 37 | ); |
|
40 | 38 | }); |
|
41 | 39 | }; |
|
42 | 40 | |
|
43 | 41 | // Set module variables |
|
44 | 42 | IPython.LoginWidget = LoginWidget; |
|
45 | 43 | |
|
46 | 44 | return {'LoginWidget': LoginWidget}; |
|
47 | }); No newline at end of file | |
|
45 | }); |
@@ -1,102 +1,108 b'' | |||
|
1 | 1 | /** |
|
2 | 2 | * Primary styles |
|
3 | 3 | * |
|
4 | 4 | * Author: IPython Development Team |
|
5 | 5 | */ |
|
6 | 6 | |
|
7 | 7 | |
|
8 | 8 | body { |
|
9 | 9 | background-color: white; |
|
10 | 10 | /* This makes sure that the body covers the entire window and needs to |
|
11 | 11 | be in a different element than the display: box in wrapper below */ |
|
12 | 12 | position: absolute; |
|
13 | 13 | left: 0px; |
|
14 | 14 | right: 0px; |
|
15 | 15 | top: 0px; |
|
16 | 16 | bottom: 0px; |
|
17 | 17 | overflow: visible; |
|
18 | 18 | } |
|
19 | 19 | |
|
20 | 20 | div#header { |
|
21 | 21 | /* Initially hidden to prevent FLOUC */ |
|
22 | 22 | display: none; |
|
23 | 23 | margin-bottom: 0px; |
|
24 | 24 | padding-left: 30px; |
|
25 | 25 | padding-bottom: 5px; |
|
26 | 26 | border-bottom: 1px solid @navbar-default-border; |
|
27 | 27 | .border-box-sizing(); |
|
28 | 28 | } |
|
29 | 29 | |
|
30 | 30 | #ipython_notebook { |
|
31 | 31 | padding-left: 0px; |
|
32 | 32 | } |
|
33 | 33 | |
|
34 | 34 | #noscript { |
|
35 | 35 | width: auto; |
|
36 | 36 | padding-top: 16px; |
|
37 | 37 | padding-bottom: 16px; |
|
38 | 38 | text-align: center; |
|
39 | 39 | font-size: 22px; |
|
40 | 40 | color: red; |
|
41 | 41 | font-weight: bold; |
|
42 | 42 | } |
|
43 | 43 | |
|
44 | 44 | #ipython_notebook img { |
|
45 | 45 | font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; |
|
46 | 46 | height: 24px; |
|
47 | 47 | text-decoration:none; |
|
48 | 48 | color: black; |
|
49 | 49 | } |
|
50 | 50 | |
|
51 | 51 | #site { |
|
52 | 52 | width: 100%; |
|
53 | 53 | display: none; |
|
54 | 54 | .border-box-sizing(); |
|
55 | 55 | } |
|
56 | 56 | |
|
57 | 57 | /* Smaller buttons */ |
|
58 | 58 | .ui-button .ui-button-text { |
|
59 | 59 | padding: 0.2em 0.8em; |
|
60 | 60 | font-size: 77%; |
|
61 | 61 | } |
|
62 | 62 | |
|
63 | 63 | input.ui-button { |
|
64 | 64 | padding: 0.3em 0.9em; |
|
65 | 65 | } |
|
66 | 66 | .navbar span { |
|
67 | 67 | margin-top: 3px; |
|
68 | 68 | } |
|
69 | 69 | |
|
70 | 70 | span#login_widget { |
|
71 | 71 | float: right; |
|
72 | 72 | } |
|
73 | 73 | |
|
74 | span#login_widget > .button { | |
|
75 | .btn(); | |
|
76 | .btn-default(); | |
|
77 | .btn-sm(); | |
|
78 | } | |
|
79 | ||
|
74 | 80 | .nav-header { |
|
75 | 81 | text-transform: none; |
|
76 | 82 | } |
|
77 | 83 | |
|
78 | 84 | #header > span { |
|
79 | 85 | margin-top: 10px; |
|
80 | 86 | } |
|
81 | 87 | |
|
82 | 88 | // class for stretching dialogs to fill the screen |
|
83 | 89 | .modal_stretch .modal-dialog { |
|
84 | 90 | .vbox(); |
|
85 | 91 | min-height: 80%; |
|
86 | 92 | .modal-body { |
|
87 | 93 | max-height: none; |
|
88 | 94 | flex: 1; |
|
89 | 95 | } |
|
90 | 96 | } |
|
91 | 97 | |
|
92 | 98 | @media (min-width: 768px) { |
|
93 | 99 | .modal .modal-dialog { |
|
94 | 100 | width: 700px; |
|
95 | 101 | } |
|
96 | 102 | } |
|
97 | 103 | |
|
98 | 104 | // less mixin to be sure to add the right class to get icons with font awesome. |
|
99 | 105 | .icon(@ico){ |
|
100 | 106 | .fa(); |
|
101 | 107 | content: @ico; |
|
102 | 108 | } |
General Comments 0
You need to be logged in to leave comments.
Login now