@ -21,8 +21,9 @@ define([
var ifrw = $ ( '#pad-iframe' ) [ 0 ] . contentWindow ;
var $iframe = $ ( '#pad-iframe' ) . contents ( ) ;
var $form = $iframe . find ( '#upload-form' ) ;
//var $progress = $form.find('#progress');
var $dlform = $iframe . find ( '#download-form' ) ;
var $label = $form . find ( 'label' ) ;
var $dllabel = $dlform . find ( 'label' ) ;
var $table = $iframe . find ( '#status' ) ;
Cryptpad . addLoadingScreen ( ) ;
@ -100,8 +101,6 @@ define([
var b64Key = Nacl . util . encodeBase64 ( key ) ;
Cryptpad . replaceHash ( Cryptpad . getFileHashFromKeys ( id , b64Key ) ) ;
//$form.hide();
APP . toolbar . addElement ( [ 'fileshare' ] , { } ) ;
var title = document . title = metadata . name ;
@ -250,6 +249,12 @@ define([
Title . updateTitle ( Cryptpad . initialName || getTitle ( ) || Title . defaultTitle ) ;
if ( ! uploadMode ) {
$dlform . show ( ) ;
Cryptpad . removeLoadingScreen ( ) ;
$dlform . find ( '#dl' ) . click ( function ( e ) {
if ( myFile ) { exportFile ( ) ; }
var src = Cryptpad . getBlobPathFromHex ( hexFileName ) ;
return Cryptpad . fetch ( src , function ( e , u8 ) {
if ( e ) { return void Cryptpad . alert ( e ) ; }
@ -263,7 +268,6 @@ define([
FileCrypto . decrypt ( u8 , key , function ( e , data ) {
if ( e ) {
Cryptpad . removeLoadingScreen ( ) ;
return console . error ( e ) ;
}
console . log ( data ) ;
@ -271,9 +275,12 @@ define([
myFile = data . content ;
myDataType = data . metadata . type ;
Title . updateTitle ( title || Title . defaultTitle ) ;
Cryptpad . removeLoadingScreen ( ) ;
exportFile ( ) ;
} ) ;
} ) ;
} ) ;
return ;
}
if ( ! Cryptpad . isLoggedIn ( ) ) {