Use less2 for the loading screen

This commit is contained in:
yflory
2017-09-13 16:19:26 +02:00
parent 8c41e0bdd6
commit ab64bf9e59
15 changed files with 47 additions and 617 deletions

View File

@@ -200,20 +200,7 @@ define([
return button;
};
UI.getFileSize = function (Common, href, cb) {
var channelId = Cryptpad.hrefToHexChannelId(href);
Common.sendAnonRpcMsg("GET_FILE_SIZE", channelId, function (data) {
if (!data) { return void cb("No response"); }
if (data.error) { return void cb(data.error); }
if (data.response && data.response.length && typeof(data.response[0]) === 'number') {
return void cb(void 0, data.response[0]);
} else {
cb('INVALID_RESPONSE');
}
});
};
// Avatars
UI.displayAvatar = function (Common, $container, href, name, cb) {
var MutationObserver = window.MutationObserver;
var displayDefault = function () {
@@ -229,7 +216,7 @@ define([
var cryptKey = secret.keys && secret.keys.fileKeyStr;
var hexFileName = Cryptpad.base64ToHex(secret.channel);
var src = Cryptpad.getBlobPathFromHex(hexFileName);
UI.getFileSize(Common, href, function (e, data) {
Common.getFileSize(href, function (e, data) {
if (e) {
displayDefault();
return void console.error(e);