| [43] | 1 | class Build { |
|---|
| 2 | constructor(){ |
|---|
| 3 | } |
|---|
| 4 | |
|---|
| [66] | 5 | set_anchor_url( part, item_name, href, text , kind){ |
|---|
| 6 | if( href === undefined ){ |
|---|
| 7 | href = "" |
|---|
| 8 | } |
|---|
| 9 | Globalx.output_url_listx[text] = href |
|---|
| 10 | Globalx[part].sidemenu.set_anchor_down_url( item_name, href, text , kind) |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | setup(part){ |
|---|
| 14 | let item = $( `#${part}-build-build` ) |
|---|
| [43] | 15 | item.on('click' , () => { |
|---|
| 16 | const cmd = "build_one_html" |
|---|
| 17 | let textarea = $( Globalx[part].textarea_sel ) |
|---|
| 18 | const content = textarea.val() |
|---|
| 19 | |
|---|
| [66] | 20 | this.set_anchor_url( part, Globalx[part].item_name, "", "" , "full") |
|---|
| 21 | this.set_anchor_url( part, Globalx[part].item_name, "", "" , "partial") |
|---|
| 22 | |
|---|
| [43] | 23 | Globalx.remotex.upload_file( cmd, Globalx.num, part, Globalx[part].key, content , (data) => { |
|---|
| 24 | if ( data !== undefined ){ |
|---|
| 25 | const obj = JSON.parse(data) |
|---|
| [66] | 26 | console.log("full_download_url=" + obj["full_download_url"]) |
|---|
| 27 | console.log("partial_download_url=" + obj["partial_download_url"]) |
|---|
| [43] | 28 | |
|---|
| [66] | 29 | this.set_anchor_url( part, Globalx[part].item_name, obj["full_download_url"], Globalx[part].item_name, "full") |
|---|
| 30 | this.set_anchor_url( part, Globalx[part].item_name, obj["partial_download_url"], Globalx[part].item_name, "partial") |
|---|
| [43] | 31 | } |
|---|
| 32 | else{ |
|---|
| 33 | console.log( "data=return undefined" ) |
|---|
| 34 | } |
|---|
| 35 | }) |
|---|
| 36 | } ) |
|---|
| 37 | } |
|---|
| 38 | } |
|---|