Show More
@@ -300,7 +300,7 b' class APITest(NotebookTestBase):' | |||||
300 | saved = resp.json() |
|
300 | saved = resp.json() | |
301 | self.assertEqual(saved['name'], 'a2.ipynb') |
|
301 | self.assertEqual(saved['name'], 'a2.ipynb') | |
302 | self.assertEqual(saved['path'], 'foo/bar') |
|
302 | self.assertEqual(saved['path'], 'foo/bar') | |
303 |
assert os.path.isfile(pjoin(self.notebook_dir.name,'foo',' |
|
303 | assert os.path.isfile(pjoin(self.notebook_dir.name,'foo','bar','a2.ipynb')) | |
304 | assert not os.path.isfile(pjoin(self.notebook_dir.name, 'foo', 'a.ipynb')) |
|
304 | assert not os.path.isfile(pjoin(self.notebook_dir.name, 'foo', 'a.ipynb')) | |
305 | with assert_http_error(404): |
|
305 | with assert_http_error(404): | |
306 | self.nb_api.read('a.ipynb', 'foo') |
|
306 | self.nb_api.read('a.ipynb', 'foo') |
@@ -20,7 +20,7 b'' | |||||
20 | * $([IPython.events]).on('app_initialized.NotebookApp', function(){ |
|
20 | * $([IPython.events]).on('app_initialized.NotebookApp', function(){ | |
21 | * IPython.toolbar.add_buttons_group([ |
|
21 | * IPython.toolbar.add_buttons_group([ | |
22 | * { |
|
22 | * { | |
23 |
* 'label |
|
23 | * 'label' : 'run qtconsole', | |
24 | * 'icon' : 'icon-terminal', // select your icon from http://fortawesome.github.io/Font-Awesome/icons |
|
24 | * 'icon' : 'icon-terminal', // select your icon from http://fortawesome.github.io/Font-Awesome/icons | |
25 | * 'callback': function () { |
|
25 | * 'callback': function () { | |
26 | * IPython.notebook.kernel.execute('%qtconsole') |
|
26 | * IPython.notebook.kernel.execute('%qtconsole') |
@@ -144,7 +144,7 b' var IPython = (function (IPython) {' | |||||
144 | * button.click(function(){ |
|
144 | * button.click(function(){ | |
145 | * var v = cell.metadata.foo; |
|
145 | * var v = cell.metadata.foo; | |
146 | * cell.metadata.foo = !v; |
|
146 | * cell.metadata.foo = !v; | |
147 |
* button.button("option", "label |
|
147 | * button.button("option", "label", String(!v)); | |
148 | * }) |
|
148 | * }) | |
149 | * |
|
149 | * | |
150 | * // add the button to the DOM div. |
|
150 | * // add the button to the DOM div. |
@@ -64,7 +64,7 b'' | |||||
64 | button.click(function(){ |
|
64 | button.click(function(){ | |
65 | var v = cell.metadata.foo; |
|
65 | var v = cell.metadata.foo; | |
66 | cell.metadata.foo = !v; |
|
66 | cell.metadata.foo = !v; | |
67 |
button.button("option","label |
|
67 | button.button("option","label",String(!v)); | |
68 | }) |
|
68 | }) | |
69 | button_container.append(button); |
|
69 | button_container.append(button); | |
70 | } |
|
70 | } |
@@ -116,9 +116,9 b' var tour_style = "<div class=\'popover tour\' style=\'position:relative\'>\\' | |||||
116 | <h3 class='popover-title'></h3>\ |
|
116 | <h3 class='popover-title'></h3>\ | |
117 | <div class='popover-content'></div>\ |
|
117 | <div class='popover-content'></div>\ | |
118 | <div class='popover-navigation'>\ |
|
118 | <div class='popover-navigation'>\ | |
119 |
<button class='btn btn-default |
|
119 | <button class='btn btn-default icon-step-backward' data-role='prev'></button>\ | |
120 |
<button class='btn btn-default |
|
120 | <button class='btn btn-default icon-step-forward pull-right' data-role='next'></button>\ | |
121 |
<button id='tour-pause' class='btn btn- |
|
121 | <button id='tour-pause' class='btn btn-sm btn-default icon-pause' data-resume-text='' data-pause-text='' data-role='pause-resume'></button>\ | |
122 | </div>\ |
|
122 | </div>\ | |
123 | </div>"; |
|
123 | </div>"; | |
124 |
|
124 |
@@ -15,7 +15,7 b'' | |||||
15 | padding: 0px; |
|
15 | padding: 0px; | |
16 | padding-top: 3px; |
|
16 | padding-top: 3px; | |
17 | } |
|
17 | } | |
18 |
.btn |
|
18 | .btn { | |
19 | padding: 2px 8px; |
|
19 | padding: 2px 8px; | |
20 | } |
|
20 | } | |
21 | } |
|
21 | } |
@@ -265,7 +265,7 b' var IPython = (function (IPython) {' | |||||
265 |
|
265 | |||
266 | NotebookList.prototype.add_shutdown_button = function (item, session) { |
|
266 | NotebookList.prototype.add_shutdown_button = function (item, session) { | |
267 | var that = this; |
|
267 | var that = this; | |
268 |
var shutdown_button = $("<button/>").text("Shutdown").addClass("btn btn- |
|
268 | var shutdown_button = $("<button/>").text("Shutdown").addClass("btn btn-xs btn-danger"). | |
269 | click(function (e) { |
|
269 | click(function (e) { | |
270 | var settings = { |
|
270 | var settings = { | |
271 | processData : false, |
|
271 | processData : false, | |
@@ -339,7 +339,7 b' var IPython = (function (IPython) {' | |||||
339 | NotebookList.prototype.add_upload_button = function (item) { |
|
339 | NotebookList.prototype.add_upload_button = function (item) { | |
340 | var that = this; |
|
340 | var that = this; | |
341 | var upload_button = $('<button/>').text("Upload") |
|
341 | var upload_button = $('<button/>').text("Upload") | |
342 |
.addClass('btn btn- |
|
342 | .addClass('btn btn-primary btn-xs upload_button') | |
343 | .click(function (e) { |
|
343 | .click(function (e) { | |
344 | var nbname = item.find('.item_name > input').val(); |
|
344 | var nbname = item.find('.item_name > input').val(); | |
345 | if (nbname.slice(nbname.length-6, nbname.length) != ".ipynb") { |
|
345 | if (nbname.slice(nbname.length-6, nbname.length) != ".ipynb") { |
@@ -165,7 +165,7 b' define(["widgets/js/widget"], function(WidgetManager) {' | |||||
165 |
|
165 | |||
166 | this.$show_button = $('<button />') |
|
166 | this.$show_button = $('<button />') | |
167 | .html(" ") |
|
167 | .html(" ") | |
168 |
.addClass('btn btn- |
|
168 | .addClass('btn btn-info widget-modal-show') | |
169 | .appendTo(this.$el) |
|
169 | .appendTo(this.$el) | |
170 | .click(function(){ |
|
170 | .click(function(){ | |
171 | that.show(); |
|
171 | that.show(); |
@@ -31,7 +31,7 b' casper.notebook_test(function () {' | |||||
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-single .widget-hlabel'), |
|
33 | '.widget-area .widget-subarea .widget-hbox-single .widget-hlabel'), | |
34 |
'Checkbox label |
|
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-single .widget-hlabel', 'html')=="Title", |
|
37 | '.widget-area .widget-subarea .widget-hbox-single .widget-hlabel', 'html')=="Title", |
@@ -15,7 +15,7 b' casper.notebook_test(function () {' | |||||
15 | var selection_values = 'abcd'; |
|
15 | var selection_values = 'abcd'; | |
16 | var check_state = function(context, index, state){ |
|
16 | var check_state = function(context, index, state){ | |
17 | if (0 <= index && index < selection_values.length) { |
|
17 | if (0 <= index && index < selection_values.length) { | |
18 |
var multibtn_state = context.cell_element_function(selection_index, multibtn_selector + ' .btn |
|
18 | var multibtn_state = context.cell_element_function(selection_index, multibtn_selector + ' .btn:nth-child(' + (index + 1) + ')', 'hasClass', ['active']); | |
19 | var radio_state = context.cell_element_function(selection_index, radio_selector + ' .radio:nth-child(' + (index + 1) + ') input', 'prop', ['checked']); |
|
19 | var radio_state = context.cell_element_function(selection_index, radio_selector + ' .radio:nth-child(' + (index + 1) + ') input', 'prop', ['checked']); | |
20 | var list_val = context.cell_element_function(selection_index, list_selector, 'val'); |
|
20 | var list_val = context.cell_element_function(selection_index, list_selector, 'val'); | |
21 | var combo_val = context.cell_element_function(selection_index, combo_selector, 'html'); |
|
21 | var combo_val = context.cell_element_function(selection_index, combo_selector, 'html'); | |
@@ -105,7 +105,7 b' casper.notebook_test(function () {' | |||||
105 | this.test.assert(verify_selection(this, 2), 'List selection updated view states correctly.'); |
|
105 | this.test.assert(verify_selection(this, 2), 'List selection updated view states correctly.'); | |
106 |
|
106 | |||
107 | // Verify that selecting a multibutton option updates all of the others. |
|
107 | // Verify that selecting a multibutton option updates all of the others. | |
108 |
this.cell_element_function(selection_index, multibtn_selector + ' .btn |
|
108 | this.cell_element_function(selection_index, multibtn_selector + ' .btn:nth-child(4)', 'click'); | |
109 | }); |
|
109 | }); | |
110 | this.wait_for_idle(); |
|
110 | this.wait_for_idle(); | |
111 | this.then(function () { |
|
111 | this.then(function () { |
@@ -83,11 +83,11 b' casper.notebook_test(function () {' | |||||
83 | 'Widget subarea exists.'); |
|
83 | 'Widget subarea exists.'); | |
84 |
|
84 | |||
85 | this.test.assert(this.cell_element_exists(index, multicontainer2_query), |
|
85 | this.test.assert(this.cell_element_exists(index, multicontainer2_query), | |
86 |
'Widget |
|
86 | 'Widget accordion exists.'); | |
87 |
|
87 | |||
88 | this.test.assert(this.cell_element_exists(index, multicontainer2_query + |
|
88 | this.test.assert(this.cell_element_exists(index, multicontainer2_query + | |
89 |
' .panel |
|
89 | ' .panel:nth-child(1) .panel-collapse'), | |
90 |
'First |
|
90 | 'First accordion page exists.'); | |
91 |
|
91 | |||
92 | // JQuery selector is 1 based |
|
92 | // JQuery selector is 1 based | |
93 | this.test.assert(this.cell_element_function(index, multicontainer2_query + |
|
93 | this.test.assert(this.cell_element_function(index, multicontainer2_query + | |
@@ -95,7 +95,7 b' casper.notebook_test(function () {' | |||||
95 | 'html')=='good', 'Accordion page title set (before display).'); |
|
95 | 'html')=='good', 'Accordion page title set (before display).'); | |
96 |
|
96 | |||
97 | // JQuery selector is 1 based |
|
97 | // JQuery selector is 1 based | |
98 |
this.click(multicontainer2_query + ' .panel |
|
98 | this.click(multicontainer2_query + ' .panel:nth-child(2) .panel-heading .accordion-toggle'); | |
99 | }); |
|
99 | }); | |
100 |
|
100 | |||
101 | this.wait_for_idle(); |
|
101 | this.wait_for_idle(); | |
@@ -106,7 +106,7 b' casper.notebook_test(function () {' | |||||
106 | 'selected_index property updated with tab change.'); |
|
106 | 'selected_index property updated with tab change.'); | |
107 |
|
107 | |||
108 | var is_collapsed = this.evaluate(function(s){ |
|
108 | var is_collapsed = this.evaluate(function(s){ | |
109 |
return $(s + ' div.panel |
|
109 | return $(s + ' div.panel:nth-child(2) a').hasClass('collapsed'); // 1 based | |
110 | }, {s: multicontainer2_query}); |
|
110 | }, {s: multicontainer2_query}); | |
111 | this.test.assertEquals(is_collapsed, false, 'Was tab actually opened?'); |
|
111 | this.test.assertEquals(is_collapsed, false, 'Was tab actually opened?'); | |
112 | }); |
|
112 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now