diff --git a/notebook/static/base/js/dialog.js b/notebook/static/base/js/dialog.js index 02c113597..8492c431c 100644 --- a/notebook/static/base/js/dialog.js +++ b/notebook/static/base/js/dialog.js @@ -80,6 +80,9 @@ define(function(require) { .addClass("btn btn-default btn-sm") .attr("data-dismiss", "modal") .text(label); + if (btn_opts.id) { + button.attr('id', btn_opts.id); + } if (btn_opts.click) { button.click($.proxy(btn_opts.click, dialog_content)); } @@ -269,12 +272,58 @@ define(function(require) { modal_obj.on('shown.bs.modal', function(){ editor.refresh(); }); }; + var insert_image = function (options) { + var message = + "Select a file to insert."; + var file_input = $('') + .attr('type', 'file') + .attr('accept', 'image/*') + .attr('name', 'file') + .on('change', function(file) { + var $btn = $(modal_obj).find('#btn_ok'); + if (this.files.length > 0) { + $btn.removeClass('disabled'); + } else { + $btn.addClass('disabled'); + } + }); + var dialogform = $('
').attr('title', 'Edit attachments') + .append( + $('
').append( + $('
').append( + $('