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/sidemenu.js

    r66 r67  
    8383            Globalx[part].editor.getSession().setValue( "" );
    8484
     85            let words = Globalx[part].item_name.split('.')
     86            let base = words[0]
    8587            $( this.textarea_sel ).val( "" );
    86             this.set_anchor_url( part, Globalx[part].item_name, "", "" , "full")
    87             this.set_anchor_url( part, Globalx[part].item_name, "", "" , "partial")
     88            this.set_anchor_url( part, base, "", "" , "full")
     89            this.set_anchor_url( part, base, "", "" , "partial")
    8890
    8991            if( Globalx[part].key != '/' ){
     
    128130
    129131        if( jsondata !== undefined && jsondata[Globalx[part].key] !== undefined ){
     132            let words = item_name.split('.')
     133            let base = words[0]
    130134            if( jsondata[Globalx[part].key].length == 0 ){
    131135                Globalx[part].key_indicate_file = true;
    132136console.log("Globalx[" + part + "].key_indicate_file = " + Globalx[part].key_indicate_file)
    133                 let url = ""
     137                let url = Globalx.output_url_listx[base].full
     138console.log( "item_name="+item_name )
     139console.log( "base="+base )
     140console.log( "url="+url )
    134141                $( Globalx[part].download_url_sel ).val( Globalx[part].key )
    135142                $( Globalx[part].download_url_sel ).attr('href' , url )
     
    142149                });
    143150
    144                 this.set_anchor_down_url( item_name, Globalx.output_url_listx[item_name], item_name , "full" )
    145                 this.set_anchor_down_url( item_name, Globalx.output_url_listx[item_name], item_name , "partial" )
     151                this.set_anchor_down_url( base, Globalx.output_url_listx[base].full, item_name , "full" )
     152                this.set_anchor_down_url( base, Globalx.output_url_listx[base].partial, item_name , "partial" )
    146153            }
    147154            else{
    148                 this.set_anchor_url( part, Globalx[part].item_name, "", "" , "full")
    149                 this.set_anchor_url( part, Globalx[part].item_name, "", "" , "partial")
     155                this.set_anchor_url( part, base, "", "" , "full")
     156                this.set_anchor_url( part, base, "", "" , "partial")
    150157            }
    151158        }
     
    184191    }
    185192
    186     set_anchor_down_url( item_name, href, text , kind ){
     193    set_anchor_url( part, base, href, text , kind){
     194        if( href === undefined ){
     195            href = ""
     196        }
     197        if( text === "" ){
     198            Globalx[part].sidemenu.set_anchor_down_url( base, href, text , kind)
     199        }
     200        else{
     201            let words = text.split('.')
     202            let base = words[0]
     203            if( Globalx.output_url_listx[base] !==  undefined ){
     204                Globalx[part].sidemenu.set_anchor_down_url( base, href, text , kind)
     205            }
     206        }
     207    }
     208
     209    set_anchor_down_url( base, href, text , kind ){
    187210        let sel = null
    188211        if( href === undefined ){
    189212            href = ""
    190213        }
    191         Globalx.output_url_listx[item_name] = href
    192 
     214        if( href === "" ){
     215            text = ""
     216        }
     217        if( text !== "" ){
     218            if( kind == "full" ){
     219                Globalx.output_url_listx[base].full = href
     220            }
     221            else{
     222                Globalx.output_url_listx[base].partial = href
     223            }
     224        }
    193225        if( kind === "full" ){
    194226            sel = this.full_download_url_sel
Note: See TracChangeset for help on using the changeset viewer.