##// END OF EJS Templates
Merge pull request #7667 from jdfreder/treeselector...
Brian E. Granger -
r20333:ebd8e933 merge
parent child Browse files
Show More
@@ -8703,6 +8703,17 ul.breadcrumb span {
8703 .list_header > div input,
8703 .list_header > div input,
8704 .list_item > div input {
8704 .list_item > div input {
8705 margin-right: 7px;
8705 margin-right: 7px;
8706 margin-left: 14px;
8707 vertical-align: baseline;
8708 line-height: 22px;
8709 position: relative;
8710 top: -1px;
8711 }
8712 .list_header > div .item_link,
8713 .list_item > div .item_link {
8714 margin-left: -1px;
8715 vertical-align: baseline;
8716 line-height: 22px;
8706 }
8717 }
8707 .new-file input[type=checkbox] {
8718 .new-file input[type=checkbox] {
8708 visibility: hidden;
8719 visibility: hidden;
@@ -8715,6 +8726,9 ul.breadcrumb span {
8715 font-size: 14px;
8726 font-size: 14px;
8716 color: #5e5e5e;
8727 color: #5e5e5e;
8717 margin-right: 7px;
8728 margin-right: 7px;
8729 margin-left: 7px;
8730 line-height: 22px;
8731 vertical-align: baseline;
8718 }
8732 }
8719 .item_buttons {
8733 .item_buttons {
8720 padding-top: 4px;
8734 padding-top: 4px;
@@ -8754,12 +8768,25 input.engine_num_input {
8754 .highlight_text {
8768 .highlight_text {
8755 color: blue;
8769 color: blue;
8756 }
8770 }
8771 #project_name {
8772 display: inline-block;
8773 padding-left: 7px;
8774 margin-left: -2px;
8775 }
8757 #project_name > .breadcrumb {
8776 #project_name > .breadcrumb {
8758 padding: 0px;
8777 padding: 0px;
8759 margin-bottom: 0px;
8778 margin-bottom: 0px;
8760 background-color: transparent;
8779 background-color: transparent;
8761 font-weight: bold;
8780 font-weight: bold;
8762 }
8781 }
8782 #tree-selector {
8783 display: inline-block;
8784 padding-right: 0px;
8785 }
8786 #tree-selector input[type=checkbox] {
8787 margin-left: 7px;
8788 vertical-align: baseline;
8789 }
8763 .tab-content .row {
8790 .tab-content .row {
8764 margin-left: 0px;
8791 margin-left: 0px;
8765 margin-right: 0px;
8792 margin-right: 0px;
@@ -8789,6 +8816,8 input.engine_num_input {
8789 -moz-osx-font-smoothing: grayscale;
8816 -moz-osx-font-smoothing: grayscale;
8790 transform: translate(0, 0);
8817 transform: translate(0, 0);
8791 content: "\f02d";
8818 content: "\f02d";
8819 position: relative;
8820 top: -1px;
8792 }
8821 }
8793 .notebook_icon:before.pull-left {
8822 .notebook_icon:before.pull-left {
8794 margin-right: .3em;
8823 margin-right: .3em;
@@ -8805,6 +8834,8 input.engine_num_input {
8805 -moz-osx-font-smoothing: grayscale;
8834 -moz-osx-font-smoothing: grayscale;
8806 transform: translate(0, 0);
8835 transform: translate(0, 0);
8807 content: "\f02d";
8836 content: "\f02d";
8837 position: relative;
8838 top: -1px;
8808 color: #5cb85c;
8839 color: #5cb85c;
8809 }
8840 }
8810 .running_notebook_icon:before.pull-left {
8841 .running_notebook_icon:before.pull-left {
@@ -8822,6 +8853,8 input.engine_num_input {
8822 -moz-osx-font-smoothing: grayscale;
8853 -moz-osx-font-smoothing: grayscale;
8823 transform: translate(0, 0);
8854 transform: translate(0, 0);
8824 content: "\f016";
8855 content: "\f016";
8856 position: relative;
8857 top: -2px;
8825 }
8858 }
8826 .file_icon:before.pull-left {
8859 .file_icon:before.pull-left {
8827 margin-right: .3em;
8860 margin-right: .3em;
@@ -114,10 +114,19 define([
114 that.load_sessions();
114 that.load_sessions();
115 });
115 });
116
116
117 // Bind events for action buttons.
117 $('.rename-button').click($.proxy(this.rename_selected, this));
118 $('.rename-button').click($.proxy(this.rename_selected, this));
118 $('.shutdown-button').click($.proxy(this.shutdown_selected, this));
119 $('.shutdown-button').click($.proxy(this.shutdown_selected, this));
119 $('.duplicate-button').click($.proxy(this.duplicate_selected, this));
120 $('.duplicate-button').click($.proxy(this.duplicate_selected, this));
120 $('.delete-button').click($.proxy(this.delete_selected, this));
121 $('.delete-button').click($.proxy(this.delete_selected, this));
122
123 // Bind events for selection menu buttons.
124 $('#tree-selector .select-all').click($.proxy(this.select_all, this));
125 $('#tree-selector .select-notebooks').click($.proxy(this.select_notebooks, this));
126 $('#tree-selector .select-running-notebooks').click($.proxy(this.select_running_notebooks, this));
127 $('#tree-selector .select-files').click($.proxy(this.select_files, this));
128 $('#tree-selector .select-directories').click($.proxy(this.select_directories, this));
129 $('#tree-selector .deselect-all').click($.proxy(this.deselect_all, this));
121 }
130 }
122 };
131 };
123
132
@@ -372,10 +381,83 define([
372 };
381 };
373
382
374 /**
383 /**
384 * Select all of the items in the tree.
385 */
386 NotebookList.prototype.select_all = function() {
387 $('.list_item input[type=checkbox]').each(function(index, item) {
388 $(item).prop('checked', true);
389 });
390 this._selection_changed();
391 };
392
393 /**
394 * Select all of the notebooks in the tree.
395 */
396 NotebookList.prototype.select_notebooks = function() {
397 this.deselect_all();
398 $('.list_item').each(function(index, item) {
399 if ($(item).data('type') === 'notebook') {
400 $(item).find('input[type=checkbox]').prop('checked', true);
401 }
402 });
403 this._selection_changed();
404 };
405
406 /**
407 * Select all of the running notebooks in the tree.
408 */
409 NotebookList.prototype.select_running_notebooks = function() {
410 this.deselect_all();
411 var that = this;
412 $('.list_item').each(function(index, item) {
413 if ($(item).data('type') === 'notebook' && that.sessions[$(item).data('path')] !== undefined) {
414 $(item).find('input[type=checkbox]').prop('checked', true);
415 }
416 });
417 this._selection_changed();
418 };
419
420 /**
421 * Select all of the files in the tree.
422 */
423 NotebookList.prototype.select_files = function() {
424 this.deselect_all();
425 $('.list_item').each(function(index, item) {
426 if ($(item).data('type') === 'file') {
427 $(item).find('input[type=checkbox]').prop('checked', true);
428 }
429 });
430 this._selection_changed();
431 };
432
433 /**
434 * Select all of the directories in the tree.
435 */
436 NotebookList.prototype.select_directories = function() {
437 this.deselect_all();
438 $('.list_item').each(function(index, item) {
439 if ($(item).data('type') === 'directory') {
440 $(item).find('input[type=checkbox]').prop('checked', true);
441 }
442 });
443 this._selection_changed();
444 };
445
446 /**
447 * Unselect everything selected in the tree.
448 */
449 NotebookList.prototype.deselect_all = function() {
450 $('.list_item input[type=checkbox]').each(function(index, item) {
451 $(item).prop('checked', false);
452 });
453 this._selection_changed();
454 };
455
456
457 /**
375 * Handles when any row selector checkbox is toggled.
458 * Handles when any row selector checkbox is toggled.
376 */
459 */
377 NotebookList.prototype._selection_changed = function() {
460 NotebookList.prototype._selection_changed = function() {
378
379 // Use a JQuery selector to find each row with a checked checkbox. If
461 // Use a JQuery selector to find each row with a checked checkbox. If
380 // we decide to add more checkboxes in the future, this code will need
462 // we decide to add more checkboxes in the future, this code will need
381 // to be changed to distinguish which checkbox is the row selector.
463 // to be changed to distinguish which checkbox is the row selector.
@@ -384,11 +466,14 define([
384 var has_directory = false;
466 var has_directory = false;
385 var has_file = false;
467 var has_file = false;
386 var that = this;
468 var that = this;
469 var checked = 0;
387 $('.list_item :checked').each(function(index, item) {
470 $('.list_item :checked').each(function(index, item) {
388 var parent = $(item).parent().parent();
471 var parent = $(item).parent().parent();
389
472
390 // If the item doesn't have an upload button, it can be selected.
473 // If the item doesn't have an upload button and it's not the
391 if (parent.find('.upload_button').length === 0) {
474 // breadcrumbs, it can be selected. Breadcrumbs path == ''.
475 if (parent.find('.upload_button').length === 0 && parent.data('path') !== '') {
476 checked++;
392 selected.push({
477 selected.push({
393 name: parent.data('name'),
478 name: parent.data('name'),
394 path: parent.data('path'),
479 path: parent.data('path'),
@@ -433,6 +518,29 define([
433 } else {
518 } else {
434 $('.delete-button').css('display', 'none');
519 $('.delete-button').css('display', 'none');
435 }
520 }
521
522 // If all of the items are selected, show the selector as checked. If
523 // some of the items are selected, show it as checked. Otherwise,
524 // uncheck it.
525 var total = 0;
526 $('.list_item input[type=checkbox]').each(function(index, item) {
527 var parent = $(item).parent().parent();
528 // If the item doesn't have an upload button and it's not the
529 // breadcrumbs, it can be selected. Breadcrumbs path == ''.
530 if (parent.find('.upload_button').length === 0 && parent.data('path') !== '') {
531 total++;
532 }
533 });
534 if (checked === 0) {
535 $('#tree-selector input[type=checkbox]')[0].indeterminate = false;
536 $('#tree-selector input[type=checkbox]').prop('checked', false);
537 } else if (checked === total) {
538 $('#tree-selector input[type=checkbox]')[0].indeterminate = false;
539 $('#tree-selector input[type=checkbox]').prop('checked', true);
540 } else {
541 $('#tree-selector input[type=checkbox]').prop('checked', false);
542 $('#tree-selector input[type=checkbox]')[0].indeterminate = true;
543 }
436 };
544 };
437
545
438 NotebookList.prototype.add_link = function (model, item) {
546 NotebookList.prototype.add_link = function (model, item) {
@@ -14,6 +14,9
14 @dark_dashboard_color: @breadcrumb-color;
14 @dark_dashboard_color: @breadcrumb-color;
15 @list_stripe_color: lighten(@page-backdrop-color,3%);
15 @list_stripe_color: lighten(@page-backdrop-color,3%);
16
16
17 // The left padding of the selector button's contents.
18 @dashboard-selectorbtn-lpad: 7px;
19
17 ul#tabs {
20 ul#tabs {
18 margin-bottom: @dashboard_tb_pad;
21 margin-bottom: @dashboard_tb_pad;
19 }
22 }
@@ -100,6 +103,17 ul.breadcrumb {
100
103
101 input {
104 input {
102 margin-right: @dashboard_lr_pad;
105 margin-right: @dashboard_lr_pad;
106 margin-left: @dashboard_lr_pad + @dashboard-selectorbtn-lpad;
107 vertical-align: baseline;
108 line-height: @btn_mini_height;
109 position: relative;
110 top: -1px;
111 }
112
113 .item_link {
114 margin-left: -1px;
115 vertical-align: baseline;
116 line-height: @btn_mini_height;
103 }
117 }
104 }
118 }
105
119
@@ -116,6 +130,9 ul.breadcrumb {
116 font-size: 14px;
130 font-size: 14px;
117 color: @dark_dashboard_color;
131 color: @dark_dashboard_color;
118 margin-right: @dashboard_lr_pad;
132 margin-right: @dashboard_lr_pad;
133 margin-left: @dashboard_lr_pad;
134 line-height: @btn_mini_height;
135 vertical-align: baseline;
119 }
136 }
120
137
121 .item_buttons {
138 .item_buttons {
@@ -152,12 +169,27 input.engine_num_input {
152 color: blue;
169 color: blue;
153 }
170 }
154
171
155 #project_name > .breadcrumb {
172 #project_name {
156 padding: 0px;
173 display: inline-block;
157 margin-bottom: 0px;
174 padding-left: @dashboard_lr_pad;
158 background-color: transparent;
175 margin-left: -2px;
159 font-weight: bold;
176
160
177 > .breadcrumb {
178 padding: 0px;
179 margin-bottom: 0px;
180 background-color: transparent;
181 font-weight: bold;
182 }
183 }
184
185 #tree-selector {
186 display: inline-block;
187 padding-right: 0px;
188
189 input[type=checkbox] {
190 margin-left: @dashboard_lr_pad;
191 vertical-align: baseline;
192 }
161 }
193 }
162
194
163 .tab-content .row {
195 .tab-content .row {
@@ -166,21 +198,28 input.engine_num_input {
166 }
198 }
167
199
168 .folder_icon:before {
200 .folder_icon:before {
169 .icon(@fa-var-folder-o)
201 .icon(@fa-var-folder-o);
170 }
202 }
171
203
172 .notebook_icon:before {
204 .notebook_icon:before {
173 .icon(@fa-var-book)
205 .icon(@fa-var-book);
206 position: relative;
207 top: -1px;
174 }
208 }
175
209
176 .running_notebook_icon:before {
210 .running_notebook_icon:before {
177 .icon(@fa-var-book);
211 .icon(@fa-var-book);
178 color: @brand-success
212 position: relative;
213 top: -1px;
214
215 color: @brand-success;
179 }
216 }
180
217
181
218
182 .file_icon:before {
219 .file_icon:before {
183 .icon(@fa-var-file-o)
220 .icon(@fa-var-file-o);
221 position: relative;
222 top: -2px;
184 }
223 }
185
224
186 #notebook_toolbar .pull-right {
225 #notebook_toolbar .pull-right {
@@ -76,6 +76,21 data-terminals-available="{{terminals_available}}"
76 </div>
76 </div>
77 <div id="notebook_list">
77 <div id="notebook_list">
78 <div id="notebook_list_header" class="row list_header">
78 <div id="notebook_list_header" class="row list_header">
79 <div class="dropdown" id='tree-selector'>
80 <button class="btn btn-default btn-xs dropdown-toggle" type="button" id="tree-selector-btn" data-toggle="dropdown" aria-expanded="true">
81 <input type='checkbox'></input>
82 <span class="caret"></span>
83 </button>
84 <ul class="dropdown-menu" role="menu" aria-labelledby="tree-selector-btn">
85 <li role="presentation" class="select-all"><a role="menuitem" tabindex="-1" href="#">Select all</a></li>
86 <li role="presentation" class="select-notebooks"><a role="menuitem" tabindex="-1" href="#">Select notebooks</a></li>
87 <li role="presentation" class="select-running-notebooks"><a role="menuitem" tabindex="-1" href="#">Select running notebooks</a></li>
88 <li role="presentation" class="select-files"><a role="menuitem" tabindex="-1" href="#">Select files</a></li>
89 <li role="presentation" class="select-directories"><a role="menuitem" tabindex="-1" href="#">Select directories</a></li>
90 <li role="presentation" class="divider"></li>
91 <li role="presentation" class="deselect-all"><a role="menuitem" tabindex="-1" href="#">Deselect all</a></li>
92 </ul>
93 </div>
79 <div id="project_name">
94 <div id="project_name">
80 <ul class="breadcrumb">
95 <ul class="breadcrumb">
81 <li><a href="{{breadcrumbs[0][0]}}"><i class="fa fa-home"></i></a></li>
96 <li><a href="{{breadcrumbs[0][0]}}"><i class="fa fa-home"></i></a></li>
General Comments 0
You need to be logged in to leave comments. Login now