Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
commit
1a0ac9830a
@ -22,8 +22,3 @@ before_script:
|
|||||||
- ./node_modules/bower/bin/bower install
|
- ./node_modules/bower/bin/bower install
|
||||||
- node ./server.js &
|
- node ./server.js &
|
||||||
- sleep 2
|
- sleep 2
|
||||||
addons:
|
|
||||||
sauce_connect:
|
|
||||||
username: "cjdelisle"
|
|
||||||
access_key:
|
|
||||||
secure: "pgGh8YGXLPq6fpdwwK2jnjRtwXPbVWQ/HIFvwX7E6HBpzxxcF2edE8sCdonWW9TP2LQisZFmVLqoSnZWMnjBr2CBAMKMFvaHQDJDQCo4v3BXkID7KgqyKmNcwW+FPfSJ5MxNBro8/GE/awkhZzJLYGUTS5zi/gVuIUwdi6cHI8s="
|
|
||||||
|
|||||||
23
rpc.js
23
rpc.js
@ -1057,11 +1057,9 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var rpc = function (
|
var rpc0 = function (ctx, data, respond) {
|
||||||
ctx /*:{ store: Object }*/,
|
if (!Env.msgStore) { Env.msgStore = ctx.store; }
|
||||||
data /*:Array<Array<any>>*/,
|
|
||||||
respond /*:(?string, ?Array<any>)=>void*/)
|
|
||||||
{
|
|
||||||
if (!Array.isArray(data)) {
|
if (!Array.isArray(data)) {
|
||||||
return void respond('INVALID_ARG_FORMAT');
|
return void respond('INVALID_ARG_FORMAT');
|
||||||
}
|
}
|
||||||
@ -1140,8 +1138,6 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||||||
Respond('E_ACCESS_DENIED');
|
Respond('E_ACCESS_DENIED');
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Env.msgStore) { Env.msgStore = ctx.store; }
|
|
||||||
|
|
||||||
var handleMessage = function (privileged) {
|
var handleMessage = function (privileged) {
|
||||||
if (config.logRPC) { console.log(msg[0]); }
|
if (config.logRPC) { console.log(msg[0]); }
|
||||||
switch (msg[0]) {
|
switch (msg[0]) {
|
||||||
@ -1272,6 +1268,19 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||||||
handleMessage(session.privilege);
|
handleMessage(session.privilege);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var rpc = function (
|
||||||
|
ctx /*:{ store: Object }*/,
|
||||||
|
data /*:Array<Array<any>>*/,
|
||||||
|
respond /*:(?string, ?Array<any>)=>void*/)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return rpc0(ctx, data, respond);
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Error from RPC with data " + JSON.stringify(data));
|
||||||
|
console.log(e.stack);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var updateLimitDaily = function () {
|
var updateLimitDaily = function () {
|
||||||
updateLimits(config, undefined, function (e) {
|
updateLimits(config, undefined, function (e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
|
|||||||
@ -253,6 +253,13 @@ define([
|
|||||||
newContent = normalize(newContent);
|
newContent = normalize(newContent);
|
||||||
contentUpdate(newContent);
|
contentUpdate(newContent);
|
||||||
} else {
|
} else {
|
||||||
|
if (!cpNfInner.metadataMgr.getPrivateData().isNewFile) {
|
||||||
|
// We're getting 'new pad' but there is an existing file
|
||||||
|
// We don't know exactly why this can happen but under no circumstances
|
||||||
|
// should we overwrite the content, so lets just try again.
|
||||||
|
common.gotoURL();
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log('updating title');
|
console.log('updating title');
|
||||||
title.updateTitle(title.defaultTitle);
|
title.updateTitle(title.defaultTitle);
|
||||||
evOnDefaultContentNeeded.fire();
|
evOnDefaultContentNeeded.fire();
|
||||||
|
|||||||
@ -150,6 +150,7 @@ define([
|
|||||||
if (!secret.keys) {
|
if (!secret.keys) {
|
||||||
isNewHash = false;
|
isNewHash = false;
|
||||||
secret.keys = secret.key;
|
secret.keys = secret.key;
|
||||||
|
readOnly = false;
|
||||||
}
|
}
|
||||||
var parsed = Utils.Hash.parsePadUrl(window.location.href);
|
var parsed = Utils.Hash.parsePadUrl(window.location.href);
|
||||||
if (!parsed.type) { throw new Error(); }
|
if (!parsed.type) { throw new Error(); }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user