Ignore:
Timestamp:
Sep 4, 2019 11:03:12 AM (6 years ago)
Author:
anonymous
Message:

set_anchor_url

File:
1 edited

Legend:

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

    r41 r66  
    77        this.textarea_sel = Globalx[part].textarea_sel
    88        this.bookmark_op_sel = Globalx[part].bookmark_op_sel
    9     }
     9        this.full_download_url_sel = `#${part}-down-url`
     10        this.partial_download_url_sel = `#${part}-partial-down-url`
     11    }
     12
    1013    set_editor( editor ){
    1114        this.editor = editor /* Globalx[part].editor */
     
    7982            this.set_globalx_item_name(part, "")
    8083            Globalx[part].editor.getSession().setValue( "" );
     84
    8185            $( 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
    8289            if( Globalx[part].key != '/' ){
    8390                let array = Globalx[part].key.split("/")
     
    134141                    $( Globalx[part].textarea_sel ).val( content );
    135142                });
     143
     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" )
     146            }
     147            else{
     148                this.set_anchor_url( part, Globalx[part].item_name, "", "" , "full")
     149                this.set_anchor_url( part, Globalx[part].item_name, "", "" , "partial")
    136150            }
    137151        }
     
    168182        dl.attr('download' , Globalx[part].item_name)
    169183        dl.removeAttr('href')
     184    }
     185
     186    set_anchor_down_url( item_name, href, text , kind ){
     187        let sel = null
     188        if( href === undefined ){
     189            href = ""
     190        }
     191        Globalx.output_url_listx[item_name] = href
     192
     193        if( kind === "full" ){
     194            sel = this.full_download_url_sel
     195            if( text !== "" ){
     196                text = "Full HTML:" + text
     197            }
     198        }
     199        else{
     200            sel = this.partial_download_url_sel
     201            if( text !== "" ){
     202                text = "Partial HTML:" + text
     203            }
     204        }
     205
     206        $( sel ).attr( "href" , href )
     207        $( sel ).text( text )
    170208    }
    171209
Note: See TracChangeset for help on using the changeset viewer.