##// END OF EJS Templates
Add some more comments...
Jonathan Frederic -
Show More
@@ -1,723 +1,735 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 'jquery',
7 7 'base/js/utils',
8 8 'base/js/dialog',
9 9 'base/js/events',
10 10 'base/js/keyboard',
11 11 ], function(IPython, $, utils, dialog, events, keyboard) {
12 12 "use strict";
13 13
14 14 var NotebookList = function (selector, options) {
15 15 /**
16 16 * Constructor
17 17 *
18 18 * Parameters:
19 19 * selector: string
20 20 * options: dictionary
21 21 * Dictionary of keyword arguments.
22 22 * session_list: SessionList instance
23 23 * element_name: string
24 24 * base_url: string
25 25 * notebook_path: string
26 26 * contents: Contents instance
27 27 */
28 28 var that = this;
29 29 this.session_list = options.session_list;
30 30 // allow code re-use by just changing element_name in kernellist.js
31 31 this.element_name = options.element_name || 'notebook';
32 32 this.selector = selector;
33 33 if (this.selector !== undefined) {
34 34 this.element = $(selector);
35 35 this.style();
36 36 this.bind_events();
37 37 }
38 38 this.notebooks_list = [];
39 39 this.sessions = {};
40 40 this.base_url = options.base_url || utils.get_body_data("baseUrl");
41 41 this.notebook_path = options.notebook_path || utils.get_body_data("notebookPath");
42 42 this.contents = options.contents;
43 43 if (this.session_list && this.session_list.events) {
44 44 this.session_list.events.on('sessions_loaded.Dashboard',
45 45 function(e, d) { that.sessions_loaded(d); });
46 46 }
47 47 };
48 48
49 49 NotebookList.prototype.style = function () {
50 50 var prefix = '#' + this.element_name;
51 51 $(prefix + '_toolbar').addClass('list_toolbar');
52 52 $(prefix + '_list_info').addClass('toolbar_info');
53 53 $(prefix + '_buttons').addClass('toolbar_buttons');
54 54 $(prefix + '_list_header').addClass('list_header');
55 55 this.element.addClass("list_container");
56 56 };
57 57
58 58 NotebookList.prototype.bind_events = function () {
59 59 var that = this;
60 60 $('#refresh_' + this.element_name + '_list').click(function () {
61 61 that.load_sessions();
62 62 });
63 63 this.element.bind('dragover', function () {
64 64 return false;
65 65 });
66 66 this.element.bind('drop', function(event){
67 67 that.handleFilesUpload(event,'drop');
68 68 return false;
69 69 });
70 70
71 71 // Bind events for singleton controls.
72 72 if (!NotebookList._bound_singletons) {
73 73 NotebookList._bound_singletons = true;
74 74 $('#new-file').click(function(e) {
75 75 var w = window.open();
76 76 that.contents.new_untitled(that.notebook_path || '', {type: 'file', ext: '.txt'}).then(function(data) {
77 77 var url = utils.url_join_encode(
78 78 that.base_url, 'edit', data.path
79 79 );
80 80 w.location = url;
81 81 });
82 82 that.load_sessions();
83 83 });
84 84 $('#new-folder').click(function(e) {
85 85 that.contents.new_untitled(that.notebook_path || '', {type: 'directory'})
86 86 .then(function(){
87 87 that.load_list();
88 88 });
89 89 });
90 90
91 91 $('.rename-button').click($.proxy(this.rename_selected, this));
92 92 $('.shutdown-button').click($.proxy(this.shutdown_selected, this));
93 93 $('.duplicate-button').click($.proxy(this.duplicate_selected, this));
94 94 $('.delete-button').click($.proxy(this.delete_selected, this));
95 95 }
96 96 };
97 97
98 98 NotebookList.prototype.handleFilesUpload = function(event, dropOrForm) {
99 99 var that = this;
100 100 var files;
101 101 if(dropOrForm =='drop'){
102 102 files = event.originalEvent.dataTransfer.files;
103 103 } else
104 104 {
105 105 files = event.originalEvent.target.files;
106 106 }
107 107 for (var i = 0; i < files.length; i++) {
108 108 var f = files[i];
109 109 var name_and_ext = utils.splitext(f.name);
110 110 var file_ext = name_and_ext[1];
111 111
112 112 var reader = new FileReader();
113 113 if (file_ext === '.ipynb') {
114 114 reader.readAsText(f);
115 115 } else {
116 116 // read non-notebook files as binary
117 117 reader.readAsArrayBuffer(f);
118 118 }
119 119 var item = that.new_item(0, true);
120 120 item.addClass('new-file');
121 121 that.add_name_input(f.name, item, file_ext == '.ipynb' ? 'notebook' : 'file');
122 122 // Store the list item in the reader so we can use it later
123 123 // to know which item it belongs to.
124 124 $(reader).data('item', item);
125 125 reader.onload = function (event) {
126 126 var item = $(event.target).data('item');
127 127 that.add_file_data(event.target.result, item);
128 128 that.add_upload_button(item);
129 129 };
130 130 reader.onerror = function (event) {
131 131 var item = $(event.target).data('item');
132 132 var name = item.data('name');
133 133 item.remove();
134 134 dialog.modal({
135 135 title : 'Failed to read file',
136 136 body : "Failed to read file '" + name + "'",
137 137 buttons : {'OK' : { 'class' : 'btn-primary' }}
138 138 });
139 139 };
140 140 }
141 141 // Replace the file input form wth a clone of itself. This is required to
142 142 // reset the form. Otherwise, if you upload a file, delete it and try to
143 143 // upload it again, the changed event won't fire.
144 144 var form = $('input.fileinput');
145 145 form.replaceWith(form.clone(true));
146 146 return false;
147 147 };
148 148
149 149 NotebookList.prototype.clear_list = function (remove_uploads) {
150 150 /**
151 151 * Clears the navigation tree.
152 152 *
153 153 * Parameters
154 154 * remove_uploads: bool=False
155 155 * Should upload prompts also be removed from the tree.
156 156 */
157 157 if (remove_uploads) {
158 158 this.element.children('.list_item').remove();
159 159 } else {
160 160 this.element.children('.list_item:not(.new-file)').remove();
161 161 }
162 162 };
163 163
164 164 NotebookList.prototype.load_sessions = function(){
165 165 this.session_list.load_sessions();
166 166 };
167 167
168 168
169 169 NotebookList.prototype.sessions_loaded = function(data){
170 170 this.sessions = data;
171 171 this.load_list();
172 172 };
173 173
174 174 NotebookList.prototype.load_list = function () {
175 175 var that = this;
176 176 this.contents.list_contents(that.notebook_path).then(
177 177 $.proxy(this.draw_notebook_list, this),
178 178 function(error) {
179 179 that.draw_notebook_list({content: []}, "Server error: " + error.message);
180 180 }
181 181 );
182 182 };
183 183
184 184 /**
185 185 * Draw the list of notebooks
186 186 * @method draw_notebook_list
187 187 * @param {Array} list An array of dictionaries representing files or
188 188 * directories.
189 189 * @param {String} error_msg An error message
190 190 */
191 191
192 192
193 193 var type_order = {'directory':0,'notebook':1,'file':2};
194 194
195 195 NotebookList.prototype.draw_notebook_list = function (list, error_msg) {
196 196 list.content.sort(function(a, b) {
197 197 if (type_order[a['type']] < type_order[b['type']]) {
198 198 return -1;
199 199 }
200 200 if (type_order[a['type']] > type_order[b['type']]) {
201 201 return 1;
202 202 }
203 203 if (a['name'] < b['name']) {
204 204 return -1;
205 205 }
206 206 if (a['name'] > b['name']) {
207 207 return 1;
208 208 }
209 209 return 0;
210 210 });
211 211 var message = error_msg || 'Notebook list empty.';
212 212 var item = null;
213 213 var model = null;
214 214 var len = list.content.length;
215 215 this.clear_list();
216 216 var n_uploads = this.element.children('.list_item').length;
217 217 if (len === 0) {
218 218 item = this.new_item(0);
219 219 var span12 = item.children().first();
220 220 span12.empty();
221 221 span12.append($('<div style="margin:auto;text-align:center;color:grey"/>').text(message));
222 222 }
223 223 var path = this.notebook_path;
224 224 var offset = n_uploads;
225 225 if (path !== '') {
226 226 item = this.new_item(offset, false);
227 227 model = {
228 228 type: 'directory',
229 229 name: '..',
230 230 path: utils.url_path_split(path)[0],
231 231 };
232 232 this.add_link(model, item);
233 233 offset += 1;
234 234 }
235 235 for (var i=0; i<len; i++) {
236 236 model = list.content[i];
237 237 item = this.new_item(i+offset, true);
238 238 this.add_link(model, item);
239 239 }
240 240 // Trigger an event when we've finished drawing the notebook list.
241 241 events.trigger('draw_notebook_list.NotebookList');
242 242 this._selection_changed();
243 243 };
244 244
245 245
246 246 /**
247 247 * Creates a new item.
248 248 * @param {integer} index
249 249 * @param {boolean} [selectable] - tristate, undefined: don't draw checkbox,
250 250 * false: don't draw checkbox but pad
251 251 * where it should be, true: draw checkbox.
252 252 * @return {JQuery} row
253 253 */
254 254 NotebookList.prototype.new_item = function (index, selectable) {
255 255 var row = $('<div/>')
256 256 .addClass("list_item")
257 257 .addClass("row");
258 258
259 259 var item = $("<div/>")
260 260 .addClass("col-md-12")
261 261 .appendTo(row);
262 262
263 263 var checkbox;
264 264 if (selectable !== undefined) {
265 265 checkbox = $('<input/>')
266 266 .attr('type', 'checkbox')
267 267 .attr('title', 'Click here to rename, delete, etc.')
268 268 .appendTo(item);
269 269 }
270 270
271 271 $('<i/>')
272 272 .addClass('item_icon')
273 273 .appendTo(item);
274 274
275 275 var link = $("<a/>")
276 276 .addClass("item_link")
277 277 .appendTo(item);
278 278
279 279 $("<span/>")
280 280 .addClass("item_name")
281 281 .appendTo(link);
282 282
283 283 if (selectable === false) {
284 284 checkbox.css('visibility', 'hidden');
285 285 } else if (selectable === true) {
286 286 var that = this;
287 287 link.click(function(e) {
288 288 e.stopPropagation();
289 289 });
290 290 checkbox.click(function(e) {
291 291 e.stopPropagation();
292 292 that._selection_changed();
293 293 });
294 294 row.click(function(e) {
295 295 e.stopPropagation();
296 296 checkbox.prop('checked', !checkbox.prop('checked'));
297 297 that._selection_changed();
298 298 });
299 299 }
300 300
301 301 var buttons = $('<div/>')
302 302 .addClass("item_buttons pull-right")
303 303 .appendTo(item);
304 304
305 305 $('<div/>')
306 306 .addClass('running-indicator')
307 307 .text('Running')
308 308 .css('visibility', 'hidden')
309 309 .appendTo(buttons);
310 310
311 311 if (index === -1) {
312 312 this.element.append(row);
313 313 } else {
314 314 this.element.children().eq(index).after(row);
315 315 }
316 316 return row;
317 317 };
318 318
319 319
320 320 NotebookList.icons = {
321 321 directory: 'folder_icon',
322 322 notebook: 'notebook_icon',
323 323 file: 'file_icon',
324 324 };
325 325
326 326 NotebookList.uri_prefixes = {
327 327 directory: 'tree',
328 328 notebook: 'notebooks',
329 329 file: 'edit',
330 330 };
331 331
332 /**
333 * Handles when any row selector checkbox is toggled.
334 */
332 335 NotebookList.prototype._selection_changed = function() {
336
337 // Use a JQuery selector to find each row with a checked checkbox. If
338 // we decide to add more checkboxes in the future, this code will need
339 // to be changed to distinguish which checkbox is the row selector.
333 340 var selected = [];
334 341 var has_running_notebook = false;
335 342 var has_directory = false;
336 343 var has_file = false;
337 344 var that = this;
338 345 $('.list_item :checked').each(function(index, item) {
339 346 var parent = $(item).parent().parent();
347
348 // If the item doesn't have an upload button, it can be selected.
340 349 if (parent.find('.upload_button').length === 0) {
341 350 selected.push({
342 351 name: parent.data('name'),
343 352 path: parent.data('path'),
344 353 type: parent.data('type')
345 354 });
346 355
356 // Set flags according to what is selected. Flags are later
357 // used to decide which action buttons are visible.
347 358 has_running_notebook = has_running_notebook ||
348 359 (parent.data('type') == 'notebook' && that.sessions[parent.data('path')] !== undefined);
349 360 has_file = has_file || parent.data('type') == 'file';
350 361 has_directory = has_directory || parent.data('type') == 'directory';
351 362 }
352 363 });
353 364 this.selected = selected;
354 365
355 366 // Rename is only visible when one item is selected.
356 367 if (selected.length==1) {
357 368 $('.rename-button').css('display', 'inline-block');
358 369 } else {
359 370 $('.rename-button').css('display', 'none');
360 371 }
361 372
362 // Shutdown is only visible when one or more notebooks are visible.
373 // Shutdown is only visible when one or more notebooks running notebooks
374 // are selected and no non-notebook items are selected.
363 375 if (has_running_notebook && !(has_file || has_directory)) {
364 376 $('.shutdown-button').css('display', 'inline-block');
365 377 } else {
366 378 $('.shutdown-button').css('display', 'none');
367 379 }
368 380
369 // Duplicate isn't visible if a directory is selected.
381 // Duplicate isn't visible when a directory is selected.
370 382 if (selected.length > 0 && !has_directory) {
371 383 $('.duplicate-button').css('display', 'inline-block');
372 384 } else {
373 385 $('.duplicate-button').css('display', 'none');
374 386 }
375 387
376 388 // Delete is visible if one or more items are selected.
377 389 if (selected.length > 0) {
378 390 $('.delete-button').css('display', 'inline-block');
379 391 } else {
380 392 $('.delete-button').css('display', 'none');
381 393 }
382 394 };
383 395
384 396 NotebookList.prototype.add_link = function (model, item) {
385 397 var path = model.path,
386 398 name = model.name;
387 399 item.data('name', name);
388 400 item.data('path', path);
389 401 item.data('type', model.type);
390 402 item.find(".item_name").text(name);
391 403 var icon = NotebookList.icons[model.type];
392 404 var uri_prefix = NotebookList.uri_prefixes[model.type];
393 405 item.find(".item_icon").addClass(icon).addClass('icon-fixed-width');
394 406 var link = item.find("a.item_link")
395 407 .attr('href',
396 408 utils.url_join_encode(
397 409 this.base_url,
398 410 uri_prefix,
399 411 path
400 412 )
401 413 );
402 414
403 415 var running = (model.type == 'notebook' && this.sessions[path] !== undefined);
404 416 item.find(".item_buttons .running-indicator").css('visibility', running ? '' : 'hidden');
405 417
406 418 // directory nav doesn't open new tabs
407 419 // files, notebooks do
408 420 if (model.type !== "directory") {
409 421 link.attr('target','_blank');
410 422 }
411 423 };
412 424
413 425
414 426 NotebookList.prototype.add_name_input = function (name, item, icon_type) {
415 427 item.data('name', name);
416 428 item.find(".item_icon").addClass(NotebookList.icons[icon_type]).addClass('icon-fixed-width');
417 429 item.find(".item_name").empty().append(
418 430 $('<input/>')
419 431 .addClass("filename_input")
420 432 .attr('value', name)
421 433 .attr('size', '30')
422 434 .attr('type', 'text')
423 435 .keyup(function(event){
424 436 if(event.keyCode == 13){item.find('.upload_button').click();}
425 437 else if(event.keyCode == 27){item.remove();}
426 438 })
427 439 );
428 440 };
429 441
430 442
431 443 NotebookList.prototype.add_file_data = function (data, item) {
432 444 item.data('filedata', data);
433 445 };
434 446
435 447
436 448 NotebookList.prototype.shutdown_selected = function() {
437 449 var that = this;
438 450 this.selected.forEach(function(item) {
439 451 if (item.type == 'notebook') {
440 452 that.shutdown_notebook(item.path);
441 453 }
442 454 });
443 455 };
444 456
445 457 NotebookList.prototype.shutdown_notebook = function(path) {
446 458 var that = this;
447 459 var settings = {
448 460 processData : false,
449 461 cache : false,
450 462 type : "DELETE",
451 463 dataType : "json",
452 464 success : function () {
453 465 that.load_sessions();
454 466 },
455 467 error : utils.log_ajax_error,
456 468 };
457 469
458 470 var session = this.sessions[path];
459 471 if (session) {
460 472 var url = utils.url_join_encode(
461 473 this.base_url,
462 474 'api/sessions',
463 475 session
464 476 );
465 477 $.ajax(url, settings);
466 478 }
467 479 }
468 480
469 481 NotebookList.prototype.rename_selected = function() {
470 482 if (this.selected.length != 1) return;
471 483
472 484 var that = this;
473 485 var path = this.selected[0].path;
474 486 var input = $('<input/>').attr('type','text').attr('size','25').addClass('form-control')
475 487 .val(path);
476 488 var dialog_body = $('<div/>').append(
477 489 $("<p/>").addClass("rename-message")
478 490 .text('Enter a new directory name:')
479 491 ).append(
480 492 $("<br/>")
481 493 ).append(input);
482 494 var d = dialog.modal({
483 495 title : "Rename directory",
484 496 body : dialog_body,
485 497 buttons : {
486 498 OK : {
487 499 class: "btn-primary",
488 500 click: function() {
489 501 that.contents.rename(path, input.val()).then(function() {
490 502 that.load_list();
491 503 }).catch(function(e) {
492 504 dialog.modal({
493 505 title : "Error",
494 506 body : $('<div/>')
495 507 .text("An error occurred while renaming \"" + path + "\" to \"" + input.val() + "\".")
496 508 .append($('<div/>').addClass('alert alert-danger').text(String(e))),
497 509 buttons : {
498 510 OK : {}
499 511 }
500 512 });
501 513 });
502 514 }
503 515 },
504 516 Cancel : {}
505 517 },
506 518 open : function () {
507 519 // Upon ENTER, click the OK button.
508 520 input.keydown(function (event) {
509 521 if (event.which === keyboard.keycodes.enter) {
510 522 d.find('.btn-primary').first().click();
511 523 return false;
512 524 }
513 525 });
514 526 input.focus().select();
515 527 }
516 528 });
517 529 };
518 530
519 531 NotebookList.prototype.delete_selected = function() {
520 532 var message;
521 533 if (this.selected.length == 1) {
522 534 message = 'Are you sure you want to permanently delete: ' + this.selected[0].name + '?';
523 535 } else {
524 536 message = 'Are you sure you want to permanently delete the ' + this.selected.length + ' files/folders selected?';
525 537 }
526 538 var that = this;
527 539 dialog.modal({
528 540 title : "Delete",
529 541 body : message,
530 542 buttons : {
531 543 Delete : {
532 544 class: "btn-danger",
533 545 click: function() {
534 546 // Shutdown any/all selected notebooks before deleting
535 547 // the files.
536 548 that.shutdown_selected();
537 549
538 550 // Delete selected.
539 551 that.selected.forEach(function(item) {
540 552 that.contents.delete(item.path).then(function() {
541 553 that.notebook_deleted(item.path);
542 554 }).catch(function(e) {
543 555 dialog.modal({
544 556 title : "Error",
545 557 body : $('<div/>')
546 558 .text("An error occurred while deleting \"" + item.path + "\".")
547 559 .append($('<div/>').addClass('alert alert-danger').text(String(e))),
548 560 buttons : {
549 561 OK : {}
550 562 }
551 563 });
552 564 });
553 565 });
554 566 }
555 567 },
556 568 Cancel : {}
557 569 }
558 570 });
559 571 };
560 572
561 573 NotebookList.prototype.duplicate_selected = function() {
562 574 var message;
563 575 if (this.selected.length == 1) {
564 576 message = 'Are you sure you want to duplicate: ' + this.selected[0].name + '?';
565 577 } else {
566 578 message = 'Are you sure you want to duplicate the ' + this.selected.length + ' files selected?';
567 579 }
568 580 var that = this;
569 581 dialog.modal({
570 582 title : "Delete",
571 583 body : message,
572 584 buttons : {
573 585 Duplicate : {
574 586 class: "btn-primary",
575 587 click: function() {
576 588 that.selected.forEach(function(item) {
577 589 that.contents.copy(item.path, that.notebook_path).then(function () {
578 590 that.load_list();
579 591 }).catch(function(e) {
580 592 dialog.modal({
581 593 title : "Error",
582 594 body : $('<div/>')
583 595 .text("An error occurred while copying \"" + item.path + "\".")
584 596 .append($('<div/>').addClass('alert alert-danger').text(String(e))),
585 597 buttons : {
586 598 OK : {}
587 599 }
588 600 });
589 601 });
590 602 });
591 603 }
592 604 },
593 605 Cancel : {}
594 606 }
595 607 });
596 608 };
597 609
598 610 NotebookList.prototype.notebook_deleted = function(path) {
599 611 /**
600 612 * Remove the deleted notebook.
601 613 */
602 614 var that = this;
603 615 $( ":data(path)" ).each(function() {
604 616 var element = $(this);
605 617 if (element.data("path") === path) {
606 618 element.remove();
607 619 events.trigger('notebook_deleted.NotebookList');
608 620 that._selection_changed();
609 621 }
610 622 });
611 623 };
612 624
613 625
614 626 NotebookList.prototype.add_upload_button = function (item) {
615 627 var that = this;
616 628 var upload_button = $('<button/>').text("Upload")
617 629 .addClass('btn btn-primary btn-xs upload_button')
618 630 .click(function (e) {
619 631 var filename = item.find('.item_name > input').val();
620 632 var path = utils.url_path_join(that.notebook_path, filename);
621 633 var filedata = item.data('filedata');
622 634 var format = 'text';
623 635 if (filename.length === 0 || filename[0] === '.') {
624 636 dialog.modal({
625 637 title : 'Invalid file name',
626 638 body : "File names must be at least one character and not start with a dot",
627 639 buttons : {'OK' : { 'class' : 'btn-primary' }}
628 640 });
629 641 return false;
630 642 }
631 643 if (filedata instanceof ArrayBuffer) {
632 644 // base64-encode binary file data
633 645 var bytes = '';
634 646 var buf = new Uint8Array(filedata);
635 647 var nbytes = buf.byteLength;
636 648 for (var i=0; i<nbytes; i++) {
637 649 bytes += String.fromCharCode(buf[i]);
638 650 }
639 651 filedata = btoa(bytes);
640 652 format = 'base64';
641 653 }
642 654 var model = {};
643 655
644 656 var name_and_ext = utils.splitext(filename);
645 657 var file_ext = name_and_ext[1];
646 658 var content_type;
647 659 if (file_ext === '.ipynb') {
648 660 model.type = 'notebook';
649 661 model.format = 'json';
650 662 try {
651 663 model.content = JSON.parse(filedata);
652 664 } catch (e) {
653 665 dialog.modal({
654 666 title : 'Cannot upload invalid Notebook',
655 667 body : "The error was: " + e,
656 668 buttons : {'OK' : {
657 669 'class' : 'btn-primary',
658 670 click: function () {
659 671 item.remove();
660 672 }
661 673 }}
662 674 });
663 675 return false;
664 676 }
665 677 content_type = 'application/json';
666 678 } else {
667 679 model.type = 'file';
668 680 model.format = format;
669 681 model.content = filedata;
670 682 content_type = 'application/octet-stream';
671 683 }
672 684 filedata = item.data('filedata');
673 685
674 686 var on_success = function () {
675 687 item.removeClass('new-file');
676 688 that.add_link(model, item);
677 689 that.session_list.load_sessions();
678 690 };
679 691
680 692 var exists = false;
681 693 $.each(that.element.find('.list_item:not(.new-file)'), function(k,v){
682 694 if ($(v).data('name') === filename) { exists = true; return false; }
683 695 });
684 696
685 697 if (exists) {
686 698 dialog.modal({
687 699 title : "Replace file",
688 700 body : 'There is already a file named ' + filename + ', do you want to replace it?',
689 701 buttons : {
690 702 Overwrite : {
691 703 class: "btn-danger",
692 704 click: function () {
693 705 that.contents.save(path, model).then(on_success);
694 706 }
695 707 },
696 708 Cancel : {
697 709 click: function() { item.remove(); }
698 710 }
699 711 }
700 712 });
701 713 } else {
702 714 that.contents.save(path, model).then(on_success);
703 715 }
704 716
705 717 return false;
706 718 });
707 719 var cancel_button = $('<button/>').text("Cancel")
708 720 .addClass("btn btn-default btn-xs")
709 721 .click(function (e) {
710 722 item.remove();
711 723 return false;
712 724 });
713 725 item.find(".item_buttons").empty()
714 726 .append(upload_button)
715 727 .append(cancel_button);
716 728 };
717 729
718 730
719 731 // Backwards compatability.
720 732 IPython.NotebookList = NotebookList;
721 733
722 734 return {'NotebookList': NotebookList};
723 735 });
General Comments 0
You need to be logged in to leave comments. Login now