@@ -65,10 +65,10 @@ function exec_cell(c_id) {
6565 if ( Array . isArray ( output ) ) {
6666 output = print_val ( output )
6767 } else {
68- if ( typeof output === 'object' && output !== null ) {
68+ if ( typeof output === 'object' && output !== null ) {
6969 output = JSON . stringify ( output )
7070 }
71-
71+
7272 }
7373 }
7474
@@ -298,7 +298,7 @@ $(document).on("click", "button.run", function () {
298298
299299$ ( document ) . on ( "click" , "button.del" , function ( ) {
300300 let id = this . id . split ( "_" ) [ 1 ]
301- console . log ( id , this . id , __code_cell_count )
301+ console . log ( id , this . id , __code_cell_count )
302302 delete_cell ( id )
303303} )
304304
@@ -362,7 +362,7 @@ function update_text_box_size() {
362362
363363
364364$ ( "#download" ) . click ( function ( ) {
365- let out = notebook_json ( vars_in_scope , md_texts ) ;
365+ let out = notebook_json ( vars_in_scope , md_texts ) ;
366366
367367 var blob = new Blob ( [ out ] , { "type" : "application/json" } ) ;
368368 var url = ( window . URL || window . webkitURL ) . createObjectURL ( blob ) ;
@@ -377,14 +377,16 @@ $("#download").click(function () {
377377 link_pae . remove ( ) ;
378378} ) ;
379379
380- $ ( "#uploadnb" ) . click ( function ( ) {
380+
381+
382+ $ ( "#import-notebook-file" ) . change ( ( ) => {
381383
382384 var files = $ ( "#import-notebook-file" ) [ 0 ] . files
383385 let json_content = null
384- if ( files . length > 0 ) {
386+ if ( files . length > 0 ) {
385387 var content = files [ 0 ] ;
386388 var reader = new FileReader ( ) ;
387- reader . onload = function ( t ) {
389+ reader . onload = function ( t ) {
388390 json_content = t . target . result ;
389391 let json = JSON . parse ( json_content )
390392
@@ -394,8 +396,28 @@ $("#uploadnb").click(function() {
394396 }
395397 reader . readAsText ( content ) ;
396398 }
399+ // $("#uploadNoteModal").modal('hide');
397400} )
398401
402+ // $("#uploadnb").click(function () {
403+
404+ // var files = $("#import-notebook-file")[0].files
405+ // let json_content = null
406+ // if (files.length > 0) {
407+ // var content = files[0];
408+ // var reader = new FileReader();
409+ // reader.onload = function (t) {
410+ // json_content = t.target.result;
411+ // let json = JSON.parse(json_content)
412+
413+ // $(".content").empty()
414+
415+ // load_notebook(json);
416+ // }
417+ // reader.readAsText(content);
418+ // }
419+ // })
420+
399421
400422
401423async function load_data ( path ) {
0 commit comments