var stagedFiles = null; const publishFileFunctions = { returnNullOrChannel: function () { const channelRadio = document.getElementById('channel-radio'); if (channelRadio.checked) { const channelInput = document.getElementById('channel-name-select'); return channelInput.value.trim(); } return null; }, // Validate the publish submission and then trigger upload showUploadStartedMessage: function (){ console.log('starting upload'); // hide the publish tool this.hidePublishTools(); // show the progress status and animation this.showPublishStatus(); this.showPublishProgressBar(); }, showUploadProgressMessage: function (percentage){ this.updatePublishStatus('

File is loading to server

'); this.updateUploadPercent('

' + percentage + '%

'); }, showFilePublishUpdate: function (msg) { this.updatePublishStatus('

' + msg + '

'); this.updateUploadPercent('

Curious what magic is happening here? Learn more.

'); }, showFilePublishFailure: function (msg){ this.updatePublishStatus('

Something went wrong...

' + msg + '

For help, post the above error text in the #speech channel on the lbry discord'); this.hidePublishProgressBar(); this.hideUploadPercent(); }, showFilePublishComplete: function (msg) { console.log('Publish complete!'); const showUrl = msg.lbryTx.claim_id + "/" + msg.name; // update status this.updatePublishStatus('

Your publish is complete! You are being redirected to it now.

'); this.updateUploadPercent('

If you do not get redirected, click here.

') // redirect the user window.location.href = showUrl; }, }