Add limit warning in pad2

This commit is contained in:
yflory
2017-08-21 12:24:33 +02:00
parent 30aef71603
commit 140c6f3776
6 changed files with 24 additions and 2 deletions

View File

@@ -1314,6 +1314,7 @@ define([
'image/jpg',
'image/gif',
];
// SFRAME: copied to sframe-common-interface.js
common.displayAvatar = function ($container, href, name, cb) {
var MutationObserver = window.MutationObserver;
var displayDefault = function () {

View File

@@ -71,6 +71,12 @@ define([
});
};
funcs.isOverPinLimit = function (cb) {
ctx.sframeChan.query('Q_GET_PIN_LIMIT_STATUS', null, function (err, data) {
cb(data.error, data.overLimit, data.limits);
});
};
/* funcs.storeLinkToClipboard = function (readOnly, cb) {
ctx.sframeChan.query('Q_STORE_LINK_TO_CLIPBOARD', readOnly, function (err) {
if (cb) { cb(err); }

View File

@@ -57,4 +57,9 @@ define({
// Use anonymous rpc from inside the iframe (for avatars & pin usage)
'Q_ANON_RPC_MESSAGE': true,
// Check the pin limit to determine if we can store the pad in the drive or if we should
// display a warning
'Q_GET_PIN_LIMIT_STATUS': true,
});

View File

@@ -698,7 +698,7 @@ define([
});
}
};
Cryptpad.isOverPinLimit(todo);
Common.isOverPinLimit(todo);
return $limit;
};