2017-11-02 15:12:26 -07:00
var stagedFiles = null ;
2017-11-01 13:07:13 -07:00
2017-11-13 15:21:26 -05:00
const publishFileFunctions = {
2017-11-01 17:14:38 -07:00
// Validate the publish submission and then trigger upload
2017-11-02 15:12:26 -07:00
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 ( '<p>File is loading to server</p>' ) ;
2017-11-06 15:18:45 -08:00
this . updateUploadPercent ( '<p class="blue">' + percentage + '% </p>' ) ;
2017-11-02 15:12:26 -07:00
} ,
showFilePublishUpdate : function ( msg ) {
this . updatePublishStatus ( '<p>' + msg + '</p>' ) ;
this . updateUploadPercent ( '<p>Curious what magic is happening here? <a class="link--primary" target="blank" href="https://lbry.io/faq/what-is-lbry">Learn more.</a></p>' ) ;
} ,
showFilePublishFailure : function ( msg ) {
2017-11-13 15:12:16 -05:00
this . updatePublishStatus ( '<p>Something went wrong...</p><p><strong>' + msg + '</strong></p><p>For help, post the above error text in the #speech channel on the <a class="link--primary" href="https://discord.gg/YjYbwhS" target="_blank">lbry discord</a>' ) ;
2017-11-02 15:12:26 -07:00
this . hidePublishProgressBar ( ) ;
this . hideUploadPercent ( ) ;
} ,
showFilePublishComplete : function ( msg ) {
console . log ( 'Publish complete!' ) ;
const showUrl = msg . lbryTx . claim _id + "/" + msg . name ;
// update status
this . updatePublishStatus ( '<p>Your publish is complete! You are being redirected to it now.</p>' ) ;
this . updateUploadPercent ( '<p><a class="link--primary" target="_blank" href="' + showUrl + '">If you do not get redirected, click here.</a></p>' )
// redirect the user
window . location . href = showUrl ;
} ,
2017-11-01 17:14:38 -07:00
}
2017-11-01 13:07:13 -07:00