|
|
@ -14,11 +14,11 @@ define([
|
|
|
|
'less!/customize/src/less/cryptpad.less',
|
|
|
|
'less!/customize/src/less/cryptpad.less',
|
|
|
|
], function ($, Crypto, realtimeInput, Toolbar, Cryptpad /*, Visible, Notify*/) {
|
|
|
|
], function ($, Crypto, realtimeInput, Toolbar, Cryptpad /*, Visible, Notify*/) {
|
|
|
|
var Messages = Cryptpad.Messages;
|
|
|
|
var Messages = Cryptpad.Messages;
|
|
|
|
|
|
|
|
Messages = Messages; // jshint
|
|
|
|
//var saveAs = window.saveAs;
|
|
|
|
//var saveAs = window.saveAs;
|
|
|
|
//var Nacl = window.nacl;
|
|
|
|
//var Nacl = window.nacl;
|
|
|
|
|
|
|
|
|
|
|
|
var APP = window.APP = {};
|
|
|
|
var APP = window.APP = {};
|
|
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
|
|
|
var andThen = function () {
|
|
|
|
var andThen = function () {
|
|
|
@ -32,27 +32,17 @@ define([
|
|
|
|
Cryptpad.addLoadingScreen();
|
|
|
|
Cryptpad.addLoadingScreen();
|
|
|
|
|
|
|
|
|
|
|
|
var Title;
|
|
|
|
var Title;
|
|
|
|
|
|
|
|
|
|
|
|
var uploadMode = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $bar = $iframe.find('.toolbar-container');
|
|
|
|
var $bar = $iframe.find('.toolbar-container');
|
|
|
|
|
|
|
|
|
|
|
|
var secret;
|
|
|
|
var secret;
|
|
|
|
var hexFileName;
|
|
|
|
|
|
|
|
if (window.location.hash) {
|
|
|
|
if (window.location.hash) {
|
|
|
|
secret = Cryptpad.getSecrets();
|
|
|
|
secret = Cryptpad.getSecrets();
|
|
|
|
if (!secret.keys) { throw new Error("You need a hash"); } // TODO
|
|
|
|
if (!secret.keys) { throw new Error("You need a hash"); } // TODO
|
|
|
|
hexFileName = Cryptpad.base64ToHex(secret.channel);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
uploadMode = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Title = Cryptpad.createTitle({}, function(){}, Cryptpad);
|
|
|
|
Title = Cryptpad.createTitle({}, function(){}, Cryptpad);
|
|
|
|
|
|
|
|
|
|
|
|
var displayed = ['useradmin', 'newpad', 'limit', 'upgrade'];
|
|
|
|
var displayed = ['useradmin', 'newpad', 'limit', 'upgrade'];
|
|
|
|
if (secret && hexFileName) {
|
|
|
|
|
|
|
|
displayed.push('fileshare');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var configTb = {
|
|
|
|
var configTb = {
|
|
|
|
displayed: displayed,
|
|
|
|
displayed: displayed,
|
|
|
@ -62,13 +52,8 @@ define([
|
|
|
|
$container: $bar,
|
|
|
|
$container: $bar,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (uploadMode) {
|
|
|
|
APP.toolbar = Toolbar.create(configTb);
|
|
|
|
displayed.push('pageTitle');
|
|
|
|
//toolbar.$rightside.html(''); // Remove the drawer if we don't use it to hide the toolbar
|
|
|
|
configTb.pageTitle = Messages.upload_title;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var toolbar = APP.toolbar = Toolbar.create(configTb);
|
|
|
|
|
|
|
|
toolbar.$rightside.html(''); // Remove the drawer if we don't use it to hide the toolbar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// we're in upload mode
|
|
|
|
// we're in upload mode
|
|
|
|
Cryptpad.removeLoadingScreen();
|
|
|
|
Cryptpad.removeLoadingScreen();
|
|
|
|