@@ -144,27 +144,27 @@ function table(df) {
144144
145145}
146146
147- function notebook_json ( scope , md_scope ) {
147+ function notebook_json ( scope , md_scope ) {
148148
149149 var store = { }
150150
151151 for ( let key in scope ) {
152152
153153 let key_split = key . split ( "-" )
154154 let id = key_split [ 1 ]
155-
155+
156156 let type = key_split [ 0 ] . split ( "_" ) [ 1 ]
157157
158- if ( type == "text" ) {
158+ if ( type == "text" ) {
159159
160160 let md_out = md_scope [ `text-div_${ Number ( id ) } ` ]
161161 let text_output = $ ( `#cell-${ id } ` ) . html ( )
162162 store [ `cell-${ id } ` ] = {
163163 "out" : text_output ,
164- "md" : md_out
164+ "md" : md_out
165165 }
166166 }
167- else {
167+ else {
168168 let cell_content = scope [ key ] . getValue ( )
169169
170170 let cell_output = $ ( `#out_${ key } ` ) . html ( )
@@ -174,7 +174,7 @@ function notebook_json(scope,md_scope){
174174 "out" : cell_output
175175 }
176176 }
177-
177+
178178 }
179179
180180 store = JSON . stringify ( store ) ;
@@ -204,14 +204,14 @@ function LoadPackage(array, callback) {
204204 } ) ( ) ;
205205}
206206
207- function md_load ( id ) {
207+ function md_load ( id ) {
208208
209209 let md = `<div class="row" style="margin-top: 10px;" id="cell-${ id } "></div>`
210210
211211 return md ;
212212}
213213
214- function html_load ( new_id ) {
214+ function html_load ( new_id ) {
215215
216216 let html = `
217217 <div class="row" style="margin-top: 10px;" id="cell-${ new_id } ">
@@ -257,17 +257,17 @@ function html_load(new_id){
257257 <div class="col-md-2"></div>
258258 </div>
259259 `
260- return html ;
260+ return html ;
261261}
262262
263- function load_notebook ( json ) {
263+ function load_notebook ( json ) {
264+
265+
266+ for ( let key in json ) {
264267
265-
266- for ( let key in json ) {
267-
268268 let id = key . split ( "-" ) [ 1 ]
269269
270- if ( Object . prototype . hasOwnProperty . call ( json [ key ] , "in" ) ) {
270+ if ( Object . prototype . hasOwnProperty . call ( json [ key ] , "in" ) ) {
271271 let html = html_load ( id )
272272
273273 $ ( ".content" ) . append ( html )
@@ -289,44 +289,43 @@ function load_notebook(json){
289289 $ ( `#out_div-${ id } ` ) . html ( out ) ;
290290
291291 $ ( `#div-${ id } ` )
292- . mouseover ( function ( ) {
293- $ ( `#btn-actions-${ id } ` ) . show ( )
294- } )
295- . mouseout ( function ( ) {
296- $ ( `#btn-actions-${ id } ` ) . hide ( )
297- } ) ;
292+ . mouseover ( function ( ) {
293+ $ ( `#btn-actions-${ id } ` ) . show ( )
294+ } )
295+ . mouseout ( function ( ) {
296+ $ ( `#btn-actions-${ id } ` ) . hide ( )
297+ } ) ;
298298
299- } else {
299+ } else {
300300
301- let md = md_load ( id )
301+ let md = md_load ( id )
302302
303- $ ( ".content" ) . append ( md ) ;
303+ $ ( ".content" ) . append ( md ) ;
304304
305- let out = json [ key ] [ "out" ]
306- $ ( `#cell-${ id } ` ) . html ( out )
305+ let out = json [ key ] [ "out" ]
306+ $ ( `#cell-${ id } ` ) . html ( out )
307307
308- let md_out = json [ key ] [ "md" ]
309- // console.log(md_out)
310- md_texts [ `text-div_${ Number ( id ) } ` ] = md_out ;
308+ let md_out = json [ key ] [ "md" ]
309+ // console.log(md_out)
310+ md_texts [ `text-div_${ Number ( id ) } ` ] = md_out ;
311311
312- vars_in_scope [ `div_text-${ id } ` ] = ""
312+ vars_in_scope [ `div_text-${ id } ` ] = ""
313313
314- $ ( `textarea#text-box_${ id } ` ) . addClass ( "text-box" )
315- $ ( `textarea#text-box_${ id } ` ) . val ( md_out )
316- // update_text_box_size()
314+ $ ( `textarea#text-box_${ id } ` ) . addClass ( "text-box" )
315+ $ ( `textarea#text-box_${ id } ` ) . val ( md_out )
316+ // update_text_box_size()
317317
318- $ ( `#text-div_${ id } ` )
319- . mouseover ( function ( ) {
320- document . getElementById ( `btn-actions-${ id } ` ) . style . display = "block"
321- } )
322- . mouseout ( function ( ) {
323- document . getElementById ( `btn-actions-${ id } ` ) . style . display = "none"
324- } ) ;
318+ $ ( `#text-div_${ id } ` )
319+ . mouseover ( function ( ) {
320+ document . getElementById ( `btn-actions-${ id } ` ) . style . display = "block"
321+ } )
322+ . mouseout ( function ( ) {
323+ document . getElementById ( `btn-actions-${ id } ` ) . style . display = "none"
324+ } ) ;
325325 }
326326
327327 __code_cell_count = parseInt ( id )
328-
328+
329329 }
330330}
331331
332-
0 commit comments