Ignore:
Timestamp:
Sep 5, 2019 9:42:27 AM (6 years ago)
Author:
anonymous
Message:

full, partial

File:
1 edited

Legend:

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

    r66 r67  
    4545}
    4646
     47function set_output_url_listx(text){
     48    if( text.match( /{.*}/ ) !== null ){
     49        const obj = JSON.parse( text )
     50        //console.log("update_all_info_on_host text=" + text )
     51        Globalx.output_url_listx = {}
     52        obj["htmlfname"].forEach( (item) => {
     53            let words = item.full.split('.')
     54            let base = words[0]
     55            Globalx.output_url_listx[ base ] = {}
     56            Globalx.output_url_listx[ base ].full = `${obj["output_url"]}/${item.full}`
     57            Globalx.output_url_listx[ base ].partial = `${obj["output_url"]}/${item.partial}`
     58            console.log(`${words[0].full}=${ Globalx.output_url_listx[ base ].full }`)
     59            console.log(`${words[0].partial}=${ Globalx.output_url_listx[ base ].partial }`)
     60        } )
     61        Globalx.storagex.save_as_info_from_globalx()
     62    }
     63}
     64
    4765async function update_all_info_on_host_async( ) {
    48     await Globalx.remotex.get_output_url_listx( Globalx.num , (text) => {
    49         if( text.match( /{.*}/ ) !== null ){
    50             const obj = JSON.parse( text )
    51 //console.log("update_all_info_on_host text=" + text )
    52             Globalx.output_url_listx = obj
    53             Globalx.storagex.save_as_info_from_globalx()
    54         }
     66    await Globalx.remotex.update_output_url_listx( Globalx.num , (text) => {
     67        set_output_url_listx(text)
    5568    } )
    5669
     
    8699async function get_output_url_listx_async( num ) {
    87100    await Globalx.remotex.get_output_url_listx( num , (text) => {
    88         if( text.match( /{.*}/ ) !== null ){
    89             const obj = JSON.parse( text )
    90 //console.log("update_all_info_on_host text=" + text )
    91             Globalx.output_url_listx = obj
    92             Globalx.storagex.save_as_info_from_globalx()
    93         }
     101        set_output_url_listx(text)
    94102    } )
    95103}
     104
    96105async function setup(){
    97106    await get_output_url_listx_async( Globalx.num )
    98     await get_output_url( Globalx.num )
     107//    await get_output_url( Globalx.num )
    99108}
    100109
Note: See TracChangeset for help on using the changeset viewer.