Show More
@@ -11,9 +11,9 b' define([' | |||||
11 | render : function(){ |
|
11 | render : function(){ | |
12 | // Called when view is rendered. |
|
12 | // Called when view is rendered. | |
13 | this.$el |
|
13 | this.$el | |
14 |
.addClass('widget-hbox |
|
14 | .addClass('widget-hbox'); | |
15 | this.$label = $('<div />') |
|
15 | this.$label = $('<div />') | |
16 |
.addClass('widget- |
|
16 | .addClass('widget-label') | |
17 | .appendTo(this.$el) |
|
17 | .appendTo(this.$el) | |
18 | .hide(); |
|
18 | .hide(); | |
19 | this.$checkbox = $('<input />') |
|
19 | this.$checkbox = $('<input />') |
@@ -11,10 +11,10 b' define([' | |||||
11 | render : function(){ |
|
11 | render : function(){ | |
12 | // Called when view is rendered. |
|
12 | // Called when view is rendered. | |
13 | this.$el |
|
13 | this.$el | |
14 |
.addClass('widget-hbox |
|
14 | .addClass('widget-hbox'); | |
15 | this.$label = $('<div />') |
|
15 | this.$label = $('<div />') | |
16 | .appendTo(this.$el) |
|
16 | .appendTo(this.$el) | |
17 |
.addClass('widget- |
|
17 | .addClass('widget-label') | |
18 | .hide(); |
|
18 | .hide(); | |
19 |
|
19 | |||
20 | this.$slider = $('<div />') |
|
20 | this.$slider = $('<div />') | |
@@ -122,26 +122,16 b' define([' | |||||
122 | .removeClass('widget-hslider') |
|
122 | .removeClass('widget-hslider') | |
123 | .addClass('widget-vslider'); |
|
123 | .addClass('widget-vslider'); | |
124 | this.$el |
|
124 | this.$el | |
125 |
.removeClass('widget-hbox |
|
125 | .removeClass('widget-hbox') | |
126 |
|
|
126 | .addClass('widget-vbox'); | |
127 | .removeClass('widget-hlabel') |
|
|||
128 | .addClass('widget-vlabel'); |
|
|||
129 | this.$readout |
|
|||
130 | .removeClass('widget-hreadout') |
|
|||
131 | .addClass('widget-vreadout'); |
|
|||
132 |
|
127 | |||
133 | } else { |
|
128 | } else { | |
134 | this.$slider_container |
|
129 | this.$slider_container | |
135 | .removeClass('widget-vslider') |
|
130 | .removeClass('widget-vslider') | |
136 | .addClass('widget-hslider'); |
|
131 | .addClass('widget-hslider'); | |
137 | this.$el |
|
132 | this.$el | |
138 |
. |
|
133 | .removeClass('widget-vbox') | |
139 |
|
|
134 | .addClass('widget-hbox'); | |
140 | .removeClass('widget-vlabel') |
|
|||
141 | .addClass('widget-hlabel'); |
|
|||
142 | this.$readout |
|
|||
143 | .removeClass('widget-vreadout') |
|
|||
144 | .addClass('widget-hreadout'); |
|
|||
145 | } |
|
135 | } | |
146 |
|
136 | |||
147 | var description = this.model.get('description'); |
|
137 | var description = this.model.get('description'); | |
@@ -198,10 +188,10 b' define([' | |||||
198 | render : function(){ |
|
188 | render : function(){ | |
199 | // Called when view is rendered. |
|
189 | // Called when view is rendered. | |
200 | this.$el |
|
190 | this.$el | |
201 |
.addClass('widget-hbox |
|
191 | .addClass('widget-hbox'); | |
202 | this.$label = $('<div />') |
|
192 | this.$label = $('<div />') | |
203 | .appendTo(this.$el) |
|
193 | .appendTo(this.$el) | |
204 |
.addClass('widget- |
|
194 | .addClass('widget-label') | |
205 | .hide(); |
|
195 | .hide(); | |
206 | this.$textbox = $('<input type="text" />') |
|
196 | this.$textbox = $('<input type="text" />') | |
207 | .addClass('form-control') |
|
197 | .addClass('form-control') | |
@@ -306,10 +296,10 b' define([' | |||||
306 | render : function(){ |
|
296 | render : function(){ | |
307 | // Called when view is rendered. |
|
297 | // Called when view is rendered. | |
308 | this.$el |
|
298 | this.$el | |
309 |
.addClass('widget-hbox |
|
299 | .addClass('widget-hbox'); | |
310 | this.$label = $('<div />') |
|
300 | this.$label = $('<div />') | |
311 | .appendTo(this.$el) |
|
301 | .appendTo(this.$el) | |
312 |
.addClass('widget- |
|
302 | .addClass('widget-label') | |
313 | .hide(); |
|
303 | .hide(); | |
314 | this.$progress = $('<div />') |
|
304 | this.$progress = $('<div />') | |
315 | .addClass('progress') |
|
305 | .addClass('progress') |
@@ -12,10 +12,10 b' define([' | |||||
12 | render : function(){ |
|
12 | render : function(){ | |
13 | // Called when view is rendered. |
|
13 | // Called when view is rendered. | |
14 | this.$el |
|
14 | this.$el | |
15 |
.addClass('widget-hbox |
|
15 | .addClass('widget-hbox'); | |
16 | this.$label = $('<div />') |
|
16 | this.$label = $('<div />') | |
17 | .appendTo(this.$el) |
|
17 | .appendTo(this.$el) | |
18 |
.addClass('widget- |
|
18 | .addClass('widget-label') | |
19 | .hide(); |
|
19 | .hide(); | |
20 | this.$buttongroup = $('<div />') |
|
20 | this.$buttongroup = $('<div />') | |
21 | .addClass('widget_item') |
|
21 | .addClass('widget_item') | |
@@ -155,7 +155,7 b' define([' | |||||
155 | .addClass('widget-hbox'); |
|
155 | .addClass('widget-hbox'); | |
156 | this.$label = $('<div />') |
|
156 | this.$label = $('<div />') | |
157 | .appendTo(this.$el) |
|
157 | .appendTo(this.$el) | |
158 |
.addClass('widget- |
|
158 | .addClass('widget-label') | |
159 | .hide(); |
|
159 | .hide(); | |
160 | this.$container = $('<div />') |
|
160 | this.$container = $('<div />') | |
161 | .appendTo(this.$el) |
|
161 | .appendTo(this.$el) | |
@@ -251,10 +251,10 b' define([' | |||||
251 | render: function() { |
|
251 | render: function() { | |
252 | // Called when view is rendered. |
|
252 | // Called when view is rendered. | |
253 | this.$el |
|
253 | this.$el | |
254 |
.addClass('widget-hbox |
|
254 | .addClass('widget-hbox'); | |
255 | this.$label = $('<div />') |
|
255 | this.$label = $('<div />') | |
256 | .appendTo(this.$el) |
|
256 | .appendTo(this.$el) | |
257 |
.addClass('widget- |
|
257 | .addClass('widget-label') | |
258 | .hide(); |
|
258 | .hide(); | |
259 | this.$buttongroup = $('<div />') |
|
259 | this.$buttongroup = $('<div />') | |
260 | .addClass('btn-group') |
|
260 | .addClass('btn-group') | |
@@ -384,7 +384,7 b' define([' | |||||
384 | .addClass('widget-hbox'); |
|
384 | .addClass('widget-hbox'); | |
385 | this.$label = $('<div />') |
|
385 | this.$label = $('<div />') | |
386 | .appendTo(this.$el) |
|
386 | .appendTo(this.$el) | |
387 |
.addClass('widget- |
|
387 | .addClass('widget-label') | |
388 | .hide(); |
|
388 | .hide(); | |
389 | this.$listbox = $('<select />') |
|
389 | this.$listbox = $('<select />') | |
390 | .addClass('widget-listbox form-control') |
|
390 | .addClass('widget-listbox form-control') |
@@ -50,7 +50,7 b' define([' | |||||
50 | .addClass('widget-hbox'); |
|
50 | .addClass('widget-hbox'); | |
51 | this.$label = $('<div />') |
|
51 | this.$label = $('<div />') | |
52 | .appendTo(this.$el) |
|
52 | .appendTo(this.$el) | |
53 |
.addClass('widget- |
|
53 | .addClass('widget-label') | |
54 | .hide(); |
|
54 | .hide(); | |
55 | this.$textbox = $('<textarea />') |
|
55 | this.$textbox = $('<textarea />') | |
56 | .attr('rows', 5) |
|
56 | .attr('rows', 5) | |
@@ -135,9 +135,9 b' define([' | |||||
135 | render: function(){ |
|
135 | render: function(){ | |
136 | // Called when view is rendered. |
|
136 | // Called when view is rendered. | |
137 | this.$el |
|
137 | this.$el | |
138 |
.addClass('widget-hbox |
|
138 | .addClass('widget-hbox'); | |
139 | this.$label = $('<div />') |
|
139 | this.$label = $('<div />') | |
140 |
.addClass('widget- |
|
140 | .addClass('widget-label') | |
141 | .appendTo(this.$el) |
|
141 | .appendTo(this.$el) | |
142 | .hide(); |
|
142 | .hide(); | |
143 | this.$textbox = $('<input type="text" />') |
|
143 | this.$textbox = $('<input type="text" />') |
@@ -31,36 +31,6 b'' | |||||
31 | /* THE CLASSES BELOW CAN APPEAR ANYWHERE IN THE DOM (POSSIBLEY OUTSIDE OF |
|
31 | /* THE CLASSES BELOW CAN APPEAR ANYWHERE IN THE DOM (POSSIBLEY OUTSIDE OF | |
32 | THE WIDGET AREA). */ |
|
32 | THE WIDGET AREA). */ | |
33 |
|
33 | |||
34 | .widget-hlabel { |
|
|||
35 | /* Horizontal Label */ |
|
|||
36 | min-width : 10ex; |
|
|||
37 | padding-right : 8px; |
|
|||
38 | padding-top : 5px; |
|
|||
39 | text-align : right; |
|
|||
40 | vertical-align : text-top; |
|
|||
41 | } |
|
|||
42 |
|
||||
43 | .widget-vlabel { |
|
|||
44 | /* Vertical Label */ |
|
|||
45 | padding-bottom : 5px; |
|
|||
46 | text-align : center; |
|
|||
47 | vertical-align : text-bottom; |
|
|||
48 | } |
|
|||
49 |
|
||||
50 | .widget-hreadout { |
|
|||
51 | padding-left : 8px; |
|
|||
52 | padding-top : 5px; |
|
|||
53 | text-align : left; |
|
|||
54 | vertical-align : text-top; |
|
|||
55 | } |
|
|||
56 |
|
||||
57 | .widget-vreadout { |
|
|||
58 | /* Vertical Label */ |
|
|||
59 | padding-top : 5px; |
|
|||
60 | text-align : center; |
|
|||
61 | vertical-align : text-top; |
|
|||
62 | } |
|
|||
63 |
|
||||
64 | .slide-track { |
|
34 | .slide-track { | |
65 | /* Slider Track */ |
|
35 | /* Slider Track */ | |
66 | border : 1px solid #CCCCCC; |
|
36 | border : 1px solid #CCCCCC; | |
@@ -215,43 +185,50 b'' | |||||
215 | color: inherit; |
|
185 | color: inherit; | |
216 | } |
|
186 | } | |
217 |
|
187 | |||
218 | .widget-box { |
|
|||
219 | /* The following section sets the style for the invisible div that |
|
|||
220 | hold widgets and their accompanying labels. |
|
|||
221 |
|
||||
222 | Looks like this: |
|
|||
223 | +-----------------------------+ |
|
|||
224 | | widget-box (or similar) | |
|
|||
225 | | +-------+---------------+ | |
|
|||
226 | | | Label | Actual Widget | | |
|
|||
227 | | +-------+---------------+ | |
|
|||
228 | +-----------------------------+ |
|
|||
229 | */ |
|
|||
230 | margin : 5px; |
|
|||
231 |
|
||||
232 | .start(); |
|
|||
233 | .widget-box(); |
|
|||
234 | } |
|
|||
235 |
|
||||
236 | .widget-hbox { |
|
188 | .widget-hbox { | |
237 | /* Horizontal widgets */ |
|
189 | /* Horizontal widgets */ | |
238 | .widget-box(); |
|
|||
239 | .hbox(); |
|
190 | .hbox(); | |
240 | } |
|
|||
241 |
|
||||
242 | .widget-hbox-single { |
|
|||
243 | /* Single line horizontal widgets */ |
|
|||
244 | .widget-hbox(); |
|
|||
245 |
|
191 | |||
246 | input[type="checkbox"] { |
|
192 | input[type="checkbox"] { | |
247 | margin-top: 9px; |
|
193 | margin-top: 9px; | |
248 | } |
|
194 | } | |
|
195 | ||||
|
196 | .widget-label { | |||
|
197 | /* Horizontal Label */ | |||
|
198 | min-width : 10ex; | |||
|
199 | padding-right : 8px; | |||
|
200 | padding-top : 5px; | |||
|
201 | text-align : right; | |||
|
202 | vertical-align : text-top; | |||
|
203 | } | |||
|
204 | ||||
|
205 | .widget-readout { | |||
|
206 | padding-left : 8px; | |||
|
207 | padding-top : 5px; | |||
|
208 | text-align : left; | |||
|
209 | vertical-align : text-top; | |||
|
210 | } | |||
249 | } |
|
211 | } | |
250 |
|
212 | |||
251 | .widget-vbox { |
|
213 | .widget-vbox { | |
252 | /* Vertical widgets */ |
|
214 | /* Vertical widgets */ | |
253 | .widget-box(); |
|
|||
254 | .vbox(); |
|
215 | .vbox(); | |
|
216 | ||||
|
217 | ||||
|
218 | .widget-label { | |||
|
219 | /* Vertical Label */ | |||
|
220 | padding-bottom : 5px; | |||
|
221 | text-align : center; | |||
|
222 | vertical-align : text-bottom; | |||
|
223 | } | |||
|
224 | ||||
|
225 | .widget-readout { | |||
|
226 | /* Vertical Label */ | |||
|
227 | padding-top : 5px; | |||
|
228 | text-align : center; | |||
|
229 | vertical-align : text-top; | |||
|
230 | } | |||
|
231 | ||||
255 | } |
|
232 | } | |
256 |
|
233 | |||
257 | .widget-modal { |
|
234 | .widget-modal { |
@@ -22,19 +22,19 b' casper.notebook_test(function () {' | |||||
22 | 'Widget subarea exists.'); |
|
22 | 'Widget subarea exists.'); | |
23 |
|
23 | |||
24 | this.test.assert(this.cell_element_exists(index, |
|
24 | this.test.assert(this.cell_element_exists(index, | |
25 |
'.widget-area .widget-subarea .widget-hbox |
|
25 | '.widget-area .widget-subarea .widget-hbox input'), | |
26 | 'Checkbox exists.'); |
|
26 | 'Checkbox exists.'); | |
27 |
|
27 | |||
28 | this.test.assert(this.cell_element_function(index, |
|
28 | this.test.assert(this.cell_element_function(index, | |
29 |
'.widget-area .widget-subarea .widget-hbox |
|
29 | '.widget-area .widget-subarea .widget-hbox input', 'prop', ['checked']), | |
30 | 'Checkbox is checked.'); |
|
30 | 'Checkbox is checked.'); | |
31 |
|
31 | |||
32 | this.test.assert(this.cell_element_exists(index, |
|
32 | this.test.assert(this.cell_element_exists(index, | |
33 |
'.widget-area .widget-subarea .widget-hbox |
|
33 | '.widget-area .widget-subarea .widget-hbox .widget-label'), | |
34 | 'Checkbox label exists.'); |
|
34 | 'Checkbox label exists.'); | |
35 |
|
35 | |||
36 | this.test.assert(this.cell_element_function(index, |
|
36 | this.test.assert(this.cell_element_function(index, | |
37 |
'.widget-area .widget-subarea .widget-hbox |
|
37 | '.widget-area .widget-subarea .widget-hbox .widget-label', 'html')=="Title", | |
38 | 'Checkbox labeled correctly.'); |
|
38 | 'Checkbox labeled correctly.'); | |
39 |
|
39 | |||
40 | this.test.assert(this.cell_element_exists(index, |
|
40 | this.test.assert(this.cell_element_exists(index, | |
@@ -61,7 +61,7 b' casper.notebook_test(function () {' | |||||
61 | 'Change bool widget value cell executed with correct output.'); |
|
61 | 'Change bool widget value cell executed with correct output.'); | |
62 |
|
62 | |||
63 | this.test.assert(! this.cell_element_function(bool_index, |
|
63 | this.test.assert(! this.cell_element_function(bool_index, | |
64 |
'.widget-area .widget-subarea .widget-hbox |
|
64 | '.widget-area .widget-subarea .widget-hbox input', 'prop', ['checked']), | |
65 | 'Checkbox is not checked. (1)'); |
|
65 | 'Checkbox is not checked. (1)'); | |
66 |
|
66 | |||
67 | this.test.assert(! this.cell_element_function(bool_index, |
|
67 | this.test.assert(! this.cell_element_function(bool_index, | |
@@ -69,10 +69,10 b' casper.notebook_test(function () {' | |||||
69 | 'Toggle button is not toggled. (1)'); |
|
69 | 'Toggle button is not toggled. (1)'); | |
70 |
|
70 | |||
71 | // Try toggling the bool by clicking on the checkbox. |
|
71 | // Try toggling the bool by clicking on the checkbox. | |
72 |
this.cell_element_function(bool_index, '.widget-area .widget-subarea .widget-hbox |
|
72 | this.cell_element_function(bool_index, '.widget-area .widget-subarea .widget-hbox input', 'click'); | |
73 |
|
73 | |||
74 | this.test.assert(this.cell_element_function(bool_index, |
|
74 | this.test.assert(this.cell_element_function(bool_index, | |
75 |
'.widget-area .widget-subarea .widget-hbox |
|
75 | '.widget-area .widget-subarea .widget-hbox input', 'prop', ['checked']), | |
76 | 'Checkbox is checked. (2)'); |
|
76 | 'Checkbox is checked. (2)'); | |
77 |
|
77 | |||
78 | // Try toggling the bool by clicking on the toggle button. |
|
78 | // Try toggling the bool by clicking on the toggle button. |
@@ -6,8 +6,8 b' casper.notebook_test(function () {' | |||||
6 | 'print("Success")'); |
|
6 | 'print("Success")'); | |
7 | this.execute_cell_then(index); |
|
7 | this.execute_cell_then(index); | |
8 |
|
8 | |||
9 |
var combo_selector = '.widget-area .widget-subarea .widget-hbox |
|
9 | var combo_selector = '.widget-area .widget-subarea .widget-hbox .btn-group .widget-combo-btn'; | |
10 |
var multibtn_selector = '.widget-area .widget-subarea .widget-hbox |
|
10 | var multibtn_selector = '.widget-area .widget-subarea .widget-hbox .btn-group[data-toggle="buttons-radio"]'; | |
11 | var radio_selector = '.widget-area .widget-subarea .widget-hbox .widget-radio-box'; |
|
11 | var radio_selector = '.widget-area .widget-subarea .widget-hbox .widget-radio-box'; | |
12 | var list_selector = '.widget-area .widget-subarea .widget-hbox .widget-listbox'; |
|
12 | var list_selector = '.widget-area .widget-subarea .widget-hbox .widget-listbox'; | |
13 |
|
13 | |||
@@ -115,7 +115,7 b' casper.notebook_test(function () {' | |||||
115 | this.test.assert(verify_selection(this, 3), 'Multibutton selection updated view states correctly.'); |
|
115 | this.test.assert(verify_selection(this, 3), 'Multibutton selection updated view states correctly.'); | |
116 |
|
116 | |||
117 | // Verify that selecting a combobox option updates all of the others. |
|
117 | // Verify that selecting a combobox option updates all of the others. | |
118 |
this.cell_element_function(selection_index, '.widget-area .widget-subarea .widget-hbox |
|
118 | this.cell_element_function(selection_index, '.widget-area .widget-subarea .widget-hbox .btn-group ul.dropdown-menu li:nth-child(3) a', 'click'); | |
119 | }); |
|
119 | }); | |
120 | this.wait_for_idle(); |
|
120 | this.wait_for_idle(); | |
121 | this.then(function () { |
|
121 | this.then(function () { |
@@ -23,7 +23,7 b' casper.notebook_test(function () {' | |||||
23 | 'Widget subarea exists.'); |
|
23 | 'Widget subarea exists.'); | |
24 |
|
24 | |||
25 | this.test.assert(this.cell_element_exists(index, |
|
25 | this.test.assert(this.cell_element_exists(index, | |
26 |
'.widget-area .widget-subarea .widget-hbox |
|
26 | '.widget-area .widget-subarea .widget-hbox input[type=text]'), | |
27 | 'Textbox exists.'); |
|
27 | 'Textbox exists.'); | |
28 |
|
28 | |||
29 | this.test.assert(this.cell_element_exists(index, |
|
29 | this.test.assert(this.cell_element_exists(index, | |
@@ -35,7 +35,7 b' casper.notebook_test(function () {' | |||||
35 | 'Python set textarea value.'); |
|
35 | 'Python set textarea value.'); | |
36 |
|
36 | |||
37 | this.test.assert(this.cell_element_function(index, |
|
37 | this.test.assert(this.cell_element_function(index, | |
38 |
'.widget-area .widget-subarea .widget-hbox |
|
38 | '.widget-area .widget-subarea .widget-hbox input[type=text]', 'val')=='xyz', | |
39 | 'Python set textbox value.'); |
|
39 | 'Python set textbox value.'); | |
40 |
|
40 | |||
41 | this.test.assert(this.cell_element_exists(string_index, |
|
41 | this.test.assert(this.cell_element_exists(string_index, | |
@@ -47,7 +47,7 b' casper.notebook_test(function () {' | |||||
47 | 'Python set textarea placeholder.'); |
|
47 | 'Python set textarea placeholder.'); | |
48 |
|
48 | |||
49 | this.test.assert(this.cell_element_function(index, |
|
49 | this.test.assert(this.cell_element_function(index, | |
50 |
'.widget-area .widget-subarea .widget-hbox |
|
50 | '.widget-area .widget-subarea .widget-hbox input[type=text]', 'attr', ['placeholder'])=='abc', | |
51 | 'Python set textbox placehoder.'); |
|
51 | 'Python set textbox placehoder.'); | |
52 | }); |
|
52 | }); | |
53 | }); |
|
53 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now