show the size of your files, if you're logged in
This commit is contained in:
@@ -676,6 +676,14 @@ define([
|
||||
rpc.getFileListSize(cb);
|
||||
};
|
||||
|
||||
var getFileSize = common.getFileSize = function (href, cb) {
|
||||
var channelId = Hash.hrefToHexChannelId(href);
|
||||
rpc.getFileSize(channelId, function (e, bytes) {
|
||||
if (e) { return void cb(e); }
|
||||
cb(void 0, bytes);
|
||||
});
|
||||
};
|
||||
|
||||
var createButton = common.createButton = function (type, rightside, data, callback) {
|
||||
var button;
|
||||
var size = "17px";
|
||||
|
||||
@@ -83,7 +83,14 @@ define([
|
||||
|
||||
// get the total stored size of a channel's patches (in bytes)
|
||||
exp.getFileSize = function (file, cb) {
|
||||
rpc.send('GET_FILE_SIZE', file, cb);
|
||||
rpc.send('GET_FILE_SIZE', file, function (e, response) {
|
||||
if (e) { return void cb(e); }
|
||||
if (response && response.length) {
|
||||
cb(void 0, response[0]);
|
||||
} else {
|
||||
cb('INVALID_RESPONSE');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// get the combined size of all channels (in bytes) for all the
|
||||
@@ -93,6 +100,8 @@ define([
|
||||
if (e) { return void cb(e); }
|
||||
if (response && response.length) {
|
||||
cb(void 0, response[0]);
|
||||
} else {
|
||||
cb('INVALID_RESPONSE');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user