Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
13
rpc.js
13
rpc.js
@@ -872,28 +872,17 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||||||
var blobStagingPath = paths.staging = keyOrDefaultString('blobStagingPath', './blobstage');
|
var blobStagingPath = paths.staging = keyOrDefaultString('blobStagingPath', './blobstage');
|
||||||
|
|
||||||
var isUnauthenticateMessage = function (msg) {
|
var isUnauthenticateMessage = function (msg) {
|
||||||
var unAuthed = msg && msg.length === 2 && isUnauthenticatedCall(msg[0]);
|
return msg && msg.length === 2 && isUnauthenticatedCall(msg[0]);
|
||||||
|
|
||||||
if (unAuthed) {
|
|
||||||
console.log(msg);
|
|
||||||
console.log('is unauthenticated call!');
|
|
||||||
return unAuthed;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var handleUnauthenticatedMessage = function (msg, respond) {
|
var handleUnauthenticatedMessage = function (msg, respond) {
|
||||||
console.log(msg);
|
|
||||||
switch (msg[0]) {
|
switch (msg[0]) {
|
||||||
case 'GET_FILE_SIZE':
|
case 'GET_FILE_SIZE':
|
||||||
console.log("Get file size");
|
|
||||||
return void getFileSize(Env, msg[1], function (e, size) {
|
return void getFileSize(Env, msg[1], function (e, size) {
|
||||||
if (e) {
|
if (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
WARN(e, msg[1]);
|
WARN(e, msg[1]);
|
||||||
console.log(size);
|
|
||||||
respond(e, [null, size, null]);
|
respond(e, [null, size, null]);
|
||||||
});
|
});
|
||||||
case 'GET_MULTIPLE_FILE_SIZE':
|
case 'GET_MULTIPLE_FILE_SIZE':
|
||||||
|
|||||||
@@ -1235,7 +1235,6 @@ define([
|
|||||||
$img.attr('src', src);
|
$img.attr('src', src);
|
||||||
$img.attr('data-crypto-key', 'cryptpad:' + cryptKey);
|
$img.attr('data-crypto-key', 'cryptpad:' + cryptKey);
|
||||||
require(['/common/media-tag.js'], function (MediaTag) {
|
require(['/common/media-tag.js'], function (MediaTag) {
|
||||||
MediaTag.CryptoFilter.setAllowedMediaTypes(common.avatarAllowedTypes);
|
|
||||||
MediaTag($img[0]);
|
MediaTag($img[0]);
|
||||||
var observer = new MutationObserver(function(mutations) {
|
var observer = new MutationObserver(function(mutations) {
|
||||||
mutations.forEach(function(mutation) {
|
mutations.forEach(function(mutation) {
|
||||||
|
|||||||
@@ -590,7 +590,7 @@ define([
|
|||||||
|
|
||||||
Cryptpad.getPadAttribute('previewMode', function (e, data) {
|
Cryptpad.getPadAttribute('previewMode', function (e, data) {
|
||||||
if (e) { return void console.error(e); }
|
if (e) { return void console.error(e); }
|
||||||
if (data === true && APP.$previewButton) {
|
if ([true, undefined].indexOf(data) !== -1 && APP.$previewButton) {
|
||||||
APP.$previewButton.click();
|
APP.$previewButton.click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user