File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -374,11 +374,13 @@ function update_text_box_size() {
374374$ ( "#download" ) . click ( function ( ) {
375375 let out = notebook_json ( cells_order , vars_in_scope , md_texts ) ;
376376
377- var blob = new Blob ( [ out ] , { "type" : "application/json" } ) ;
378- var url = ( window . URL || window . webkitURL ) . createObjectURL ( blob ) ;
377+ let blob = new Blob ( [ out ] , { "type" : "application/json" } ) ;
378+ let url = ( window . URL || window . webkitURL ) . createObjectURL ( blob ) ;
379379
380- var link = document . createElement ( 'a' ) ;
381- link . download = 'danfo_notebook.json' ;
380+ let link = document . createElement ( 'a' ) ;
381+ let text = $ ( "#notebookname" ) . text ( )
382+ let name = text . length > 0 ? `${ text } .json` : "Dnotebook.json"
383+ link . download = name ;
382384 link . href = url ;
383385
384386 var link_pae = $ ( link ) ;
@@ -438,6 +440,13 @@ async function load_data(path) {
438440
439441}
440442
443+ $ ( "#closename" ) . click ( function ( ) {
444+
445+ let textval = $ ( "#namebook" ) . val ( )
446+
447+ $ ( "#notebookname" ) . html ( `<h2>${ textval } </h2>` )
448+ } ) ;
449+
441450
442451
443452
Original file line number Diff line number Diff line change 4646 <span class =" navbar-toggler-icon" ></span >
4747 </button >
4848
49+ <div style =" margin-right: 150px;color:white;" id =" notebookname" ></div >
50+
4951 <div style =" margin-right: 200px;" class =" collapse navbar-collapse" id =" navbarSupportedContent" >
5052 <ul class =" navbar-nav ml-auto" >
5153 <li class =" nav-item" >
6567 Options
6668 </a >
6769 <div class =" dropdown-menu" aria-labelledby =" navbarDropdown" >
70+ <a class =" dropdown-item" data-toggle =" modal" data-target =" #nameNoteModal" href =" #" >Name Notebook</a >
6871 <a class =" dropdown-item" id =" download" href =" #" >Download Notebook</a >
6972 <a class =" dropdown-item" data-toggle =" modal" data-target =" #uploadNoteModal" href =" #" >Upload Notebook</a >
7073
111114 </div >
112115 </div >
113116 </div >
117+ {{!-- Notebook Name Modal--}}
118+ <div class =" modal" id =" nameNoteModal" tabindex =" -1" >
119+ <div class =" modal-dialog" >
120+ <div class =" modal-content" >
121+ <div class =" modal-header" >
122+ <h5 class =" modal-title" >Name Your Notebook</h5 >
123+ <button type =" button" class =" close" data-dismiss =" modal" aria-label =" Close" >
124+ <span aria-hidden =" true" >× </span >
125+ </button >
126+ </div >
127+ <div class =" modal-body" >
128+ <form >
129+ <div class =" form-group" >
130+ <input type =" text" class =" form-control-file" name =" name-notebook" id =" namebook" >
131+ </div >
132+ </form >
133+ </div >
134+ <div class =" modal-footer" >
135+ <button type =" button" class =" btn btn-secondary" data-dismiss =" modal" id =" closename" >Close</button >
136+ </div >
137+ </div >
138+ </div >
139+ </div >
114140
115141 {{{ body }}}
116142
You can’t perform that action at this time.
0 commit comments