Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

This commit is contained in:
yflory
2017-03-15 17:15:03 +01:00
5 changed files with 60 additions and 2 deletions

View File

@@ -987,6 +987,28 @@ define([
});
*/
};
var getUserChannelList = common.getUserChannelList = function () {
var store = common.getStore();
var proxy = store.getProxy();
var fo = proxy.fo;
var list = fo.getFilesDataFiles().map(function (href) {
var parsed = common.parsePadUrl(href);
if (!parsed || !parsed.hash) { return; }
parsed = common.parseHash(parsed.hash);
var channel = parsed.channel;
if (!channel) { return; }
var hex = common.base64ToHex(channel);
return hex;
}).filter(function (x) { return x; }).sort();
return list;
};
var createButton = common.createButton = function (type, rightside, data, callback) {
var button;
var size = "17px";

View File

@@ -30,6 +30,20 @@ define([
if (e) { return void console.error(e); }
console.log(msg);
});
var list = Cryptpad.getUserChannelList();
if (list.length) {
rpc.send('GET_FILE_SIZE', list[0], function (e, msg) {
if (e) {
return void console.error(e);
}
console.log(msg);
});
}
rpc.send('GET_FILE_SIZE', 'pewpew', function (e, msg) {
if (e) { return void console.error(e); }
console.log(msg);
});
});
});
});