Use user object as default store in file manager

This commit is contained in:
yflory
2016-12-20 17:27:45 +01:00
parent 4aed585574
commit c359c27997
7 changed files with 68 additions and 32 deletions

View File

@@ -19,6 +19,7 @@ define([
var storeObj;
var ready = false;
var filesOp;
var exp = {};
var safeSet = function (key, val) {
storeObj[key] = val;
@@ -85,6 +86,10 @@ define([
cb();
};
Store.getProxy = function () {
return exp;
};
var changeHandlers = Store.changeHandlers = [];
Store.change = function (f) {
@@ -134,7 +139,9 @@ define([
};
var rt = window.rt = Listmap.create(listmapConfig);
exp.proxy = rt.proxy;
rt.proxy.on('create', function (info) {
exp.info = info;
var realtime = info.realtime;
if (!Cryptpad.getUserHash()) {
localStorage.FS_hash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys);
@@ -170,12 +177,12 @@ define([
};
Store.ready = function (f, Cryptpad) {
if (Cryptpad.parsePadUrl(window.location.href).type === "file") {
/*if (Cryptpad.parsePadUrl(window.location.href).type === "file") {
if (typeof(f) === 'function') {
f(void 0, Cryptpad.getStore(true));
}
return;
}
}*/
if (ready) {
if (typeof(f) === 'function') {
f(void 0, Store);

View File

@@ -80,7 +80,7 @@
</tbody>
</table>-->
<iframe src="/file/#iframe" id="fileManagerIframe" style="display: none;"></iframe>
<iframe src="/file/#iframe" id="fileManagerIframe"></iframe>
<div id="buttons" class="buttons">
<a id="create-pad" class="button create" href="/pad/" data-localization="button_newpad"></a>

View File

@@ -40,7 +40,7 @@
</tbody>
</table>-->
<iframe src="/file/#iframe" id="fileManagerIframe" style="display: none;"></iframe>
<iframe src="/file/#iframe" id="fileManagerIframe"></iframe>
<div id="buttons" class="buttons">
<a id="create-pad" class="button create" href="/pad/" data-localization="button_newpad"></a>

View File

@@ -39,6 +39,7 @@
}
.cryptpad-lag {
box-sizing: content-box;
vertical-align: top;
height: 16px;
width: 16px;

View File

@@ -39,6 +39,7 @@
float: right;
}
.cryptpad-toolbar .cryptpad-lag {
box-sizing: content-box;
vertical-align: top;
height: 16px;
width: 16px;