| Rev | Line | |
|---|
| [43] | 1 | class Build { |
|---|
| 2 | constructor(){ |
|---|
| 3 | } |
|---|
| 4 | |
|---|
| 5 | setup(){ |
|---|
| 6 | let item = $( '#data-build-build' ) |
|---|
| 7 | item.on('click' , () => { |
|---|
| 8 | const part = Globalx.parts[ Globalx.index ] |
|---|
| 9 | const cmd = "build_one_html" |
|---|
| 10 | let textarea = $( Globalx[part].textarea_sel ) |
|---|
| 11 | const content = textarea.val() |
|---|
| 12 | |
|---|
| 13 | Globalx.remotex.upload_file( cmd, Globalx.num, part, Globalx[part].key, content , (data) => { |
|---|
| 14 | if ( data !== undefined ){ |
|---|
| 15 | let array = null |
|---|
| 16 | let len = null |
|---|
| 17 | const obj = JSON.parse(data) |
|---|
| 18 | |
|---|
| 19 | array = obj["full_download_url"].split('/') |
|---|
| 20 | len = array.length |
|---|
| 21 | $('#data-down-url').attr('href' , obj["full_download_url"]) |
|---|
| 22 | |
|---|
| 23 | $('#data-down-url').text( "Full HTML:" + array[len - 1] ) |
|---|
| 24 | |
|---|
| 25 | array = obj["partial_download_url"].split('/') |
|---|
| 26 | len = array.length |
|---|
| 27 | $('#data-partial-down-url').attr('href' , obj["partial_download_url"]) |
|---|
| 28 | $('#data-partial-down-url').text( "Partial HTML:" + array[len - 1] ) |
|---|
| 29 | |
|---|
| 30 | } |
|---|
| 31 | else{ |
|---|
| 32 | console.log( "data=return undefined" ) |
|---|
| 33 | } |
|---|
| 34 | }) |
|---|
| 35 | } ) |
|---|
| 36 | } |
|---|
| 37 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.