Changeset 41 for branches/testa-single-bookmark/js/main.js
- Timestamp:
- Aug 30, 2019 7:54:52 AM (6 years ago)
- File:
-
- 1 edited
-
branches/testa-single-bookmark/js/main.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/testa-single-bookmark/js/main.js
r36 r41 10 10 function init_globalx_storagex() { 11 11 Globalx.storagex = new Storagex(); 12 Globalx.build = { 13 'contest2011.md': { 14 path: '/attempt/contest2011/data/contest2011.md', 15 target: 'cont', 16 subtarget: '2011', 17 category: 'attempt', 18 output_html: 'contest2011.html', 19 alias_html: 'contest.html', 20 } 21 } 22 12 23 } 24 13 25 14 26 function init_globalx() { 15 27 Globalx.num = 0 16 28 Globalx.index = 0 17 Globalx.parts = ["data" , "output", "setting"]29 Globalx.parts = ["data" , "output", "setting"] 18 30 Globalx.bookmark_displayname_max_length = 18 19 31 Globalx.output_url = null 32 Globalx.remote_filename = 'php/content3.php' 33 Globalx.build = new Build() 20 34 21 35 tab_init() 22 36 topmenu_init() 23 Globalx.remotex = new Remotex('php/content.php') 24 console.log( "init_globalx 1 : Globalx.bookmark_mgr=" + Globalx.bookmark_mgr ) 37 Globalx.remotex = new Remotex( Globalx.remote_filename ) 25 38 if( Globalx.bookmark_mgr === null || Globalx.bookmark_mgr === undefined ){ 26 39 Globalx.bookmark_mgr = new BookmarkMgr(Globalx.bookmark_displayname_max_length, Globalx.parts) 27 40 } 28 console.log( "init_globalx 2 : Globalx.bookmark_mgr=" + Globalx.bookmark_mgr )29 41 Globalx.bookmarkmenu = null 42 43 Globalx.build.setup() 30 44 } 31 45 32 async function get_output_url_async( func ){ 46 async function update_all_filelist( ) { 47 Globalx.parts.map( ( part ) => { 48 Globalx[ part ].sidemenu.update(`#${part}-side`) 49 } ) 50 } 51 52 async function get_output_url_async( num, func ){ 33 53 let realData = Globalx.storagex.get_output_url() 34 54 35 55 if( realData === undefined || realData === null ){ 36 await Globalx.remotex.get_output_url( func )56 await Globalx.remotex.get_output_url( num, func ) 37 57 } 38 58 else{ 39 const obj = Globalx.storagex.get_output_url( num , part)59 const obj = Globalx.storagex.get_output_url( num ) 40 60 Globalx.output_url = obj.output_url 41 61 Globalx.storagex.save_as_info_from_globalx() … … 44 64 45 65 async function setup(){ 46 get_output_url_async( (text) => {66 get_output_url_async( Globalx.num, (text) => { 47 67 let str = text 48 68 let obj … … 65 85 setup() 66 86 67 console.log("##### Globalx.bookmarkmenu=" + Globalx.bookmarkmenu)68 console.log("##### Globalx.bookmark_mgr=" + Globalx.bookmark_mgr)69 87 Globalx.bookmarkmenu = new BookmarkMenu( Globalx.bookmark_displayname_max_length , Globalx.bookmark_mgr ) 70 88 Globalx.bookmarkmenu.dlg() … … 73 91 set_globalx_editor(part) 74 92 93 Globalx[ part ].menu = null 75 94 Globalx[ part ].sidemenu = new SideMenu( Globalx.num, part ) 76 95 Globalx[ part ].sidemenu.setup(`#${part}-side`) … … 84 103 if( need_to_save ){ 85 104 // LocalStorageにまだ保存していない場合、ここで保存しておく 86 //console.log("call save_as_info_from_globalx()")87 105 Globalx.storagex.save_as_info_from_globalx( (data) => { console.log( "data=" + data ) } ) 88 106 } 89 /*90 Object.keys(Globalx).forEach((key) => {91 console.log(key)92 }) */93 107 } 94 108 … … 130 144 131 145 let textarea = $( Globalx[part].textarea_sel ) 132 editor.getSession().on("change", (textarea) => { 133 textarea.val(editor.getSession().getValue()); 146 editor.getSession().on("change", () => { 147 /* textarea.val(editor.getSession().getValue()) */ 148 $( Globalx[part].textarea_sel ).val(editor.getSession().getValue()) 134 149 }); 135 150 } 151 152 function upload_to_host( part ){ 153 Globalx.remotex.upload_to_host( part ) 154 }
Note: See TracChangeset
for help on using the changeset viewer.
![(trac.ini の [header_logo] セクションを設定してください)](/python/trac/Flist/chrome/common/trac_logo_mini.png)