mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Merge branch 'staging' into 5.2-candidate
This commit is contained in:
commit
9ef6ea4dff
@ -1152,10 +1152,10 @@ define([
|
||||
|
||||
var FILTER_BY = "filterBy";
|
||||
|
||||
var refresh = APP.refresh = function () {
|
||||
var refresh = APP.refresh = function (cb) {
|
||||
var type = APP.store[FILTER_BY];
|
||||
var path = type ? [FILTER, type, currentPath] : currentPath;
|
||||
APP.displayDirectory(path);
|
||||
APP.displayDirectory(path, undefined, cb);
|
||||
};
|
||||
|
||||
// `app`: true (force open wiht the app), false (force open in preview),
|
||||
@ -4290,10 +4290,12 @@ define([
|
||||
|
||||
appStatus.ready(true);
|
||||
};
|
||||
var displayDirectory = APP.displayDirectory = function (path, force) {
|
||||
var displayDirectory = APP.displayDirectory = function (path, force, cb) {
|
||||
cb = cb || function () {};
|
||||
if (APP.closed || (APP.$content && !$.contains(document.documentElement, APP.$content[0]))) { return; }
|
||||
if (history.isHistoryMode) {
|
||||
return void _displayDirectory(path, force);
|
||||
_displayDirectory(path, force);
|
||||
return void cb();
|
||||
}
|
||||
if (!manager.comparePath(currentPath, path)) {
|
||||
removeSelected();
|
||||
@ -4302,6 +4304,7 @@ define([
|
||||
copyObjectValue(files, proxy.drive);
|
||||
updateSharedFolders(sframeChan, manager, files, folders, function () {
|
||||
_displayDirectory(path, force);
|
||||
cb();
|
||||
});
|
||||
});
|
||||
};
|
||||
@ -5347,8 +5350,9 @@ define([
|
||||
};
|
||||
APP.FM = common.createFileManager(fmConfig);
|
||||
|
||||
refresh();
|
||||
UI.removeLoadingScreen();
|
||||
refresh(function () {
|
||||
UI.removeLoadingScreen();
|
||||
});
|
||||
|
||||
/*
|
||||
if (!APP.team) {
|
||||
|
||||
@ -335,11 +335,6 @@ define([
|
||||
}
|
||||
}).nThen(function (waitFor) {
|
||||
var href = data.href;
|
||||
var hashes = priv.hashes || {};
|
||||
var bestHash = hashes.editHash || hashes.viewHash || hashes.fileHash;
|
||||
if (data.fakeHref) {
|
||||
href = Hash.hashToHref(bestHash, priv.app);
|
||||
}
|
||||
sel.forEach(function (el) {
|
||||
var curve = $(el).attr('data-curve');
|
||||
if (curve === user.curvePublic) { return; }
|
||||
@ -928,12 +923,7 @@ define([
|
||||
}
|
||||
|
||||
var href = data.href;
|
||||
var hashes = priv.hashes || {};
|
||||
var bestHash = hashes.editHash || hashes.viewHash || hashes.fileHash;
|
||||
if (data.fakeHref) {
|
||||
href = Hash.hashToHref(bestHash, priv.app);
|
||||
}
|
||||
var isNotStored = Boolean(data.fakeHref);
|
||||
var isNotStored = Boolean(data.isNotStored);
|
||||
sframeChan.query(q, {
|
||||
teamId: typeof(owned) !== "boolean" ? owned : undefined,
|
||||
href: href,
|
||||
@ -1055,7 +1045,7 @@ define([
|
||||
var owned = Modal.isOwned(Env, data);
|
||||
|
||||
// Request edit access
|
||||
if (common.isLoggedIn() && ((data.roHref && !data.href) || data.fakeHref) && !owned && !opts.calendar && priv.app !== 'form') {
|
||||
if (common.isLoggedIn() && data.roHref && !owned && !opts.calendar && priv.app !== 'form') {
|
||||
var requestButton = h('button.btn.btn-secondary.no-margin.cp-access-margin-right',
|
||||
Messages.requestEdit_button);
|
||||
var requestBlock = h('p', requestButton);
|
||||
|
||||
@ -42,11 +42,13 @@ define([
|
||||
if (err || !val) {
|
||||
if (opts.access) {
|
||||
data.password = priv.password;
|
||||
// Access modal and the pad is not stored: we're not an owner
|
||||
// so we don't need the correct href, just the type
|
||||
var h = Hash.createRandomHash(priv.app, priv.password);
|
||||
data.fakeHref = true;
|
||||
data.href = base + priv.pathname + '#' + h;
|
||||
// Access modal and the pad is not stored: get the hashes from outer
|
||||
var hashes = priv.hashes || {};
|
||||
data.href = Hash.hashToHref(hashes.editHash || hashes.fileHash, priv.app);
|
||||
if (hashes.viewHash) {
|
||||
data.roHref = Hash.hashToHref(hashes.viewHash, priv.app);
|
||||
}
|
||||
data.isNotStored = true;
|
||||
} else {
|
||||
waitFor.abort();
|
||||
return void cb(err || 'EEMPTY');
|
||||
|
||||
@ -37,20 +37,18 @@ define([
|
||||
}));
|
||||
}
|
||||
|
||||
if (!data.fakeHref) {
|
||||
if (data.href) {
|
||||
$('<label>', {'for': 'cp-app-prop-link'}).text(Messages.editShare).appendTo($d);
|
||||
$d.append(UI.dialog.selectable(data.href, {
|
||||
id: 'cp-app-prop-link',
|
||||
}));
|
||||
}
|
||||
if (data.href) {
|
||||
$('<label>', {'for': 'cp-app-prop-link'}).text(Messages.editShare).appendTo($d);
|
||||
$d.append(UI.dialog.selectable(data.href, {
|
||||
id: 'cp-app-prop-link',
|
||||
}));
|
||||
}
|
||||
|
||||
if (data.roHref && !opts.noReadOnly) {
|
||||
$('<label>', {'for': 'cp-app-prop-rolink'}).text(Messages.viewShare).appendTo($d);
|
||||
$d.append(UI.dialog.selectable(data.roHref, {
|
||||
id: 'cp-app-prop-rolink',
|
||||
}));
|
||||
}
|
||||
if (data.roHref && !opts.noReadOnly) {
|
||||
$('<label>', {'for': 'cp-app-prop-rolink'}).text(Messages.viewShare).appendTo($d);
|
||||
$d.append(UI.dialog.selectable(data.roHref, {
|
||||
id: 'cp-app-prop-rolink',
|
||||
}));
|
||||
}
|
||||
|
||||
if (data.tags && Array.isArray(data.tags)) {
|
||||
|
||||
@ -942,7 +942,7 @@ define([
|
||||
var metadata = data.metadata;
|
||||
var add = data.add;
|
||||
var _secret = secret;
|
||||
if (metadata && (metadata.href || metadata.roHref) && !metadata.fakeHref) {
|
||||
if (metadata && (metadata.href || metadata.roHref)) {
|
||||
var _parsed = Utils.Hash.parsePadUrl(metadata.href || metadata.roHref);
|
||||
_secret = Utils.Hash.getSecrets(_parsed.type, _parsed.hash, metadata.password);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user