diff --git a/www/code/index.html b/www/code/index.html
index be053d582..539681839 100644
--- a/www/code/index.html
+++ b/www/code/index.html
@@ -5,7 +5,7 @@
-
+
-
+
diff --git a/www/code/inner.js b/www/code/inner.js
index be2697294..d2dac0968 100644
--- a/www/code/inner.js
+++ b/www/code/inner.js
@@ -1,5 +1,8 @@
define([
+ 'jquery',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
'less!/code/code.less',
'less!/customize/src/less/toolbar.less',
-], function () {});
+], function ($) {
+ $('.loading-hidden').removeClass('loading-hidden');
+});
diff --git a/www/common/LessLoader.js b/www/common/LessLoader.js
index a2ba28c0c..b25db9418 100644
--- a/www/common/LessLoader.js
+++ b/www/common/LessLoader.js
@@ -2,7 +2,7 @@
/*:: const define = () => {}; */
define([
'/api/config',
- '/bower_components/less/dist/less.js'
+ '/bower_components/less/dist/less.min.js'
], function (Config, Less) { /*::});module.exports = (function() {
const Config = (undefined:any);
const Less = (undefined:any);
diff --git a/www/common/common-codemirror.js b/www/common/common-codemirror.js
index 75da658b8..6202a9ce3 100644
--- a/www/common/common-codemirror.js
+++ b/www/common/common-codemirror.js
@@ -150,6 +150,7 @@ define([
options: options, // Entries displayed in the menu
left: true, // Open to the left of the button
isSelect: true,
+ feedback: 'CODE_LANGUAGE',
};
var $block = exp.$language = Cryptpad.createDropdown(dropdownConfig);
$block.find('button').attr('title', Messages.languageButtonTitle);
@@ -183,7 +184,8 @@ define([
options: options, // Entries displayed in the menu
left: true, // Open to the left of the button
isSelect: true,
- initialValue: lastTheme
+ initialValue: lastTheme,
+ feedback: 'CODE_THEME',
};
var $block = exp.$theme = Cryptpad.createDropdown(dropdownConfig);
$block.find('button').attr('title', Messages.themeButtonTitle);
diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js
index 7c0990a84..92254b9fa 100644
--- a/www/common/cryptpad-common.js
+++ b/www/common/cryptpad-common.js
@@ -719,14 +719,14 @@ define([
return false;
}
if (!rpc) {
- console.error('[RPC_NOT_READY]');
+ console.error('RPC_NOT_READY');
return false;
}
return true;
};
common.arePinsSynced = function (cb) {
- if (!pinsReady()) { return void cb ('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb ('RPC_NOT_READY'); }
var list = getCanonicalChannelList();
var local = Hash.hashChannelList(list);
@@ -737,7 +737,7 @@ define([
};
common.resetPins = function (cb) {
- if (!pinsReady()) { return void cb ('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb ('RPC_NOT_READY'); }
var list = getCanonicalChannelList();
rpc.reset(list, function (e, hash) {
@@ -747,7 +747,7 @@ define([
};
common.pinPads = function (pads, cb) {
- if (!pinsReady()) { return void cb ('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb ('RPC_NOT_READY'); }
rpc.pin(pads, function (e, hash) {
if (e) { return void cb(e); }
@@ -756,7 +756,7 @@ define([
};
common.unpinPads = function (pads, cb) {
- if (!pinsReady()) { return void cb ('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb ('RPC_NOT_READY'); }
rpc.unpin(pads, function (e, hash) {
if (e) { return void cb(e); }
@@ -765,7 +765,7 @@ define([
};
common.getPinnedUsage = function (cb) {
- if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb('RPC_NOT_READY'); }
rpc.getFileListSize(function (err, bytes) {
if (typeof(bytes) === 'number') {
@@ -776,6 +776,7 @@ define([
};
common.getFileSize = function (href, cb) {
+ if (!pinsReady()) { return void cb('RPC_NOT_READY'); }
var channelId = Hash.hrefToHexChannelId(href);
rpc.getFileSize(channelId, function (e, bytes) {
if (e) { return void cb(e); }
@@ -784,7 +785,7 @@ define([
};
common.updatePinLimit = function (cb) {
- if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb('RPC_NOT_READY'); }
rpc.updatePinLimits(function (e, limit, plan, note) {
if (e) { return cb(e); }
common.account.limit = limit;
@@ -795,7 +796,7 @@ define([
};
common.getPinLimit = function (cb) {
- if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb('RPC_NOT_READY'); }
var account = common.account;
if (typeof(account.limit) !== 'number' ||
@@ -833,17 +834,17 @@ define([
};
common.uploadComplete = function (cb) {
- if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb('RPC_NOT_READY'); }
rpc.uploadComplete(cb);
};
common.uploadStatus = function (size, cb) {
- if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb('RPC_NOT_READY'); }
rpc.uploadStatus(size, cb);
};
common.uploadCancel = function (cb) {
- if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
+ if (!pinsReady()) { return void cb('RPC_NOT_READY'); }
rpc.uploadCancel(cb);
};
@@ -1274,6 +1275,7 @@ define([
setActive($val);
$innerblock.scrollTop($val.position().top + $innerblock.scrollTop());
}
+ if (config.feedback) { Cryptpad.feedback(config.feedback); }
};
$container.click(function (e) {
@@ -1472,7 +1474,8 @@ define([
text: $userButton.html(), // Button initial text
options: options, // Entries displayed in the menu
left: true, // Open to the left of the button
- container: config.$initBlock // optional
+ container: config.$initBlock, // optional
+ feedback: "USER_ADMIN",
};
var $userAdmin = createDropdown(dropdownConfigUser);
diff --git a/www/common/toolbar2.js b/www/common/toolbar2.js
index c4286041c..8fe8116f9 100644
--- a/www/common/toolbar2.js
+++ b/www/common/toolbar2.js
@@ -291,7 +291,9 @@ define([
var visible = $content.is(':visible');
if (visible) { hide(); }
else { show(); }
- Cryptpad.setAttribute('userlist-drawer', $content.is(':visible'));
+ visible = !visible;
+ Cryptpad.setAttribute('userlist-drawer', visible);
+ Cryptpad.feedback(visible?'USERLIST_SHOW': 'USERLIST_HIDE');
});
@@ -371,7 +373,8 @@ define([
}
var dropdownConfigShare = {
text: $('
').append($shareIcon).html(),
- options: options
+ options: options,
+ feedback: 'SHARE',
};
var $shareBlock = Cryptpad.createDropdown(dropdownConfigShare);
//$shareBlock.find('button').attr('id', 'shareButton');
@@ -706,7 +709,9 @@ define([
text: '', // Button initial text
options: pads_options, // Entries displayed in the menu
container: $newPad,
- left: true
+ left: true,
+ feedback: /drive/.test(window.location.pathname)?
+ 'DRIVE_NEWPAD': 'NEWPAD',
};
var $newPadBlock = Cryptpad.createDropdown(dropdownConfig);
$newPadBlock.find('button').attr('title', Messages.newButtonTitle);
diff --git a/www/drive/index.html b/www/drive/index.html
index babfa1264..f959cfac6 100644
--- a/www/drive/index.html
+++ b/www/drive/index.html
@@ -4,7 +4,7 @@
CryptDrive
-
+
-
+
diff --git a/www/file/inner.js b/www/file/inner.js
index 7f901f08d..4be0b8483 100644
--- a/www/file/inner.js
+++ b/www/file/inner.js
@@ -1,7 +1,14 @@
define([
+ 'jquery',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
'less!/file/file.less',
'less!/customize/src/less/cryptpad.less',
'less!/customize/src/less/toolbar.less',
-], function () {});
+], function ($) {
+ $('.loading-hidden').removeClass('loading-hidden');
+ // dirty hack to get rid the flash of the lock background
+ setTimeout(function () {
+ $('#app').addClass('ready');
+ }, 100);
+});
diff --git a/www/file/main.js b/www/file/main.js
index b2dac261e..638db697d 100644
--- a/www/file/main.js
+++ b/www/file/main.js
@@ -164,19 +164,28 @@ define([
Cryptpad.removeLoadingScreen();
$dllabel.append($('
'));
$dllabel.append(Cryptpad.fixHTML(metadata.name));
- $dllabel.append($('
'));
- $dllabel.append(Messages._getKey('formattedMB', [sizeMb]));
+
+ // don't display the size if you don't know it.
+ if (typeof(sizeM) === 'number') {
+ $dllabel.append($('
'));
+ $dllabel.append(Messages._getKey('formattedMB', [sizeMb]));
+ }
var decrypting = false;
var onClick = function (ev) {
if (decrypting) { return; }
decrypting = true;
displayFile(ev, sizeMb);
};
- if (sizeMb < 5) { return void onClick(); }
+ if (typeof(sizeMb) === 'number' && sizeMb < 5) { return void onClick(); }
$dlform.find('#dl, #progress').click(onClick);
};
Cryptpad.getFileSize(window.location.href, function (e, data) {
- if (e) { return void Cryptpad.errorLoadingScreen(e); }
+ if (e) {
+ // TODO when GET_FILE_SIZE is made unauthenticated
+ // you won't need to handle this error (there won't be one)
+ if (e === 'RPC_NOT_READY') { return todoBigFile(); }
+ return void Cryptpad.errorLoadingScreen(e);
+ }
var size = Cryptpad.bytesToMegabytes(data);
return void todoBigFile(size);
});
diff --git a/www/pad/index.html b/www/pad/index.html
index 223c708ae..381134365 100644
--- a/www/pad/index.html
+++ b/www/pad/index.html
@@ -5,7 +5,7 @@
-
+
-
+
diff --git a/www/slide/inner.js b/www/slide/inner.js
index 9c0226403..2d542d4f2 100644
--- a/www/slide/inner.js
+++ b/www/slide/inner.js
@@ -1,5 +1,8 @@
define([
- 'less!/slide/slide.less',
+ 'jquery',
'less!/customize/src/less/toolbar.less',
'less!/customize/src/less/cryptpad.less',
-], function () {});
+ 'less!/slide/slide.less',
+], function ($) {
+ $('.loading-hidden').removeClass('loading-hidden');
+});
diff --git a/www/whiteboard/index.html b/www/whiteboard/index.html
index 7b0eebd26..dde6a61f2 100644
--- a/www/whiteboard/index.html
+++ b/www/whiteboard/index.html
@@ -3,7 +3,7 @@
-
+