Ignore:
Timestamp:
Aug 30, 2019 7:54:52 AM (6 years ago)
Author:
anonymous
Message:

add bin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/testa-single-bookmark/js/main.js

    r36 r41  
    1010function init_globalx_storagex() {
    1111    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
    1223}
     24
    1325
    1426function init_globalx() {
    1527    Globalx.num = 0
    1628    Globalx.index = 0
    17     Globalx.parts = ["data", "output", "setting"]
     29    Globalx.parts = ["data" , "output", "setting"]
    1830    Globalx.bookmark_displayname_max_length = 18
    1931    Globalx.output_url = null
     32    Globalx.remote_filename = 'php/content3.php'
     33    Globalx.build = new Build()
    2034
    2135    tab_init()
    2236    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 )
    2538    if( Globalx.bookmark_mgr === null || Globalx.bookmark_mgr === undefined ){
    2639        Globalx.bookmark_mgr = new BookmarkMgr(Globalx.bookmark_displayname_max_length, Globalx.parts)
    2740    }
    28     console.log( "init_globalx 2 : Globalx.bookmark_mgr="  + Globalx.bookmark_mgr )
    2941    Globalx.bookmarkmenu = null
     42
     43    Globalx.build.setup()
    3044}
    3145
    32 async function get_output_url_async( func ){
     46async function update_all_filelist( ) {
     47    Globalx.parts.map( ( part ) => {
     48        Globalx[ part ].sidemenu.update(`#${part}-side`)
     49    } )
     50}
     51
     52async function get_output_url_async( num, func ){
    3353    let realData = Globalx.storagex.get_output_url()
    3454
    3555    if( realData === undefined || realData === null ){
    36         await Globalx.remotex.get_output_url( func )
     56        await Globalx.remotex.get_output_url( num, func )
    3757    }
    3858    else{
    39         const obj = Globalx.storagex.get_output_url( num , part )
     59        const obj = Globalx.storagex.get_output_url( num )
    4060        Globalx.output_url = obj.output_url
    4161        Globalx.storagex.save_as_info_from_globalx()
     
    4464
    4565async function setup(){
    46     get_output_url_async( (text) => {
     66    get_output_url_async( Globalx.num, (text) => {
    4767        let str = text
    4868        let obj
     
    6585    setup()
    6686
    67     console.log("##### Globalx.bookmarkmenu=" + Globalx.bookmarkmenu)
    68     console.log("##### Globalx.bookmark_mgr=" + Globalx.bookmark_mgr)
    6987    Globalx.bookmarkmenu = new BookmarkMenu( Globalx.bookmark_displayname_max_length , Globalx.bookmark_mgr )
    7088    Globalx.bookmarkmenu.dlg()
     
    7391        set_globalx_editor(part)
    7492
     93        Globalx[ part ].menu = null
    7594        Globalx[ part ].sidemenu = new SideMenu( Globalx.num, part )
    7695        Globalx[ part ].sidemenu.setup(`#${part}-side`)
     
    84103    if( need_to_save ){
    85104        // LocalStorageにまだ保存していない場合、ここで保存しておく
    86         //console.log("call save_as_info_from_globalx()")
    87105        Globalx.storagex.save_as_info_from_globalx( (data) => { console.log( "data=" + data ) } )
    88106    }
    89 /*
    90     Object.keys(Globalx).forEach((key) => {
    91         console.log(key)
    92     }) */
    93107}
    94108
     
    130144
    131145      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())
    134149      });
    135150}
     151
     152function upload_to_host( part ){
     153    Globalx.remotex.upload_to_host( part )
     154}
Note: See TracChangeset for help on using the changeset viewer.