Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
commit
b2003b32c9
@ -32,9 +32,7 @@ define([
|
|||||||
Clipboard: Clipboard,
|
Clipboard: Clipboard,
|
||||||
donateURL: 'https://accounts.cryptpad.fr/#/donate?on=' + origin,
|
donateURL: 'https://accounts.cryptpad.fr/#/donate?on=' + origin,
|
||||||
upgradeURL: 'https://accounts.cryptpad.fr/#/?on=' + origin,
|
upgradeURL: 'https://accounts.cryptpad.fr/#/?on=' + origin,
|
||||||
account: {
|
account: {},
|
||||||
usage: 0,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// constants
|
// constants
|
||||||
@ -759,7 +757,9 @@ define([
|
|||||||
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
||||||
|
|
||||||
rpc.getFileListSize(function (err, bytes) {
|
rpc.getFileListSize(function (err, bytes) {
|
||||||
common.account.usage = typeof(bytes) === 'number'? bytes: 0;
|
if (typeof(bytes) === 'number') {
|
||||||
|
common.account.usage = bytes;
|
||||||
|
}
|
||||||
cb(err, bytes);
|
cb(err, bytes);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -785,13 +785,21 @@ define([
|
|||||||
|
|
||||||
common.getPinLimit = function (cb) {
|
common.getPinLimit = function (cb) {
|
||||||
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
||||||
rpc.getLimit(function (e, limit, plan, note) {
|
|
||||||
if (e) { return cb(e); }
|
var account = common.account;
|
||||||
common.account.limit = limit;
|
if (typeof(account.limit) !== 'number' ||
|
||||||
common.account.plan = plan;
|
typeof(account.plan) !== 'string' ||
|
||||||
common.account.note = note;
|
typeof(account.note) !== 'string') {
|
||||||
cb(void 0, limit, plan, note);
|
return void rpc.getLimit(function (e, limit, plan, note) {
|
||||||
});
|
if (e) { return cb(e); }
|
||||||
|
common.account.limit = limit;
|
||||||
|
common.account.plan = plan;
|
||||||
|
common.account.note = note;
|
||||||
|
cb(void 0, limit, plan, note);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cb(void 0, account.limit, account.plan, account.note);
|
||||||
};
|
};
|
||||||
|
|
||||||
common.isOverPinLimit = function (cb) {
|
common.isOverPinLimit = function (cb) {
|
||||||
|
|||||||
@ -492,6 +492,8 @@ define([
|
|||||||
$pencilIcon.show();
|
$pencilIcon.show();
|
||||||
$saveIcon.hide();
|
$saveIcon.hide();
|
||||||
//$pencilIcon.css('display', '');
|
//$pencilIcon.css('display', '');
|
||||||
|
} else if (e.which === 32) {
|
||||||
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$saveIcon.click(save);
|
$saveIcon.click(save);
|
||||||
@ -664,13 +666,17 @@ define([
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var limit = Cryptpad.account.limit;
|
|
||||||
var usage = Cryptpad.account.usage;
|
Cryptpad.isOverPinLimit(function (e, isOver, data) {
|
||||||
if (typeof(limit) !== 'number' || typeof(usage) !== 'number') {
|
var limit = data.limit;
|
||||||
todo("invalid types");
|
var usage = data.usage;
|
||||||
} else if (Cryptpad.isLoggedIn() && usage >= limit) {
|
if (typeof(limit) !== 'number' || typeof(usage) !== 'number') {
|
||||||
todo(void 0, true);
|
todo("invalid types");
|
||||||
} else { todo(void 0, false); }
|
} else if (Cryptpad.isLoggedIn() && usage >= limit) {
|
||||||
|
todo(void 0, true);
|
||||||
|
} else { todo(void 0, false); }
|
||||||
|
});
|
||||||
|
|
||||||
return $limit;
|
return $limit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user