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