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

pull/1/head
ansuz 8 years ago
commit 17838f1d70

@ -37,6 +37,17 @@ define([
var parsed = config.href ? common.parsePadUrl(config.href) : {}; var parsed = config.href ? common.parsePadUrl(config.href) : {};
var secret = common.getSecrets(parsed.type, parsed.hash); var secret = common.getSecrets(parsed.type, parsed.hash);
History.readOnly = 1;
if (!secret.keys) {
secret.keys = secret.key;
History.readOnly = 2;
}
else if (!secret.keys.validateKey) {
secret.keys.validateKey = true;
History.readOnly = 0;
}
var crypto = Crypto.createEncryptor(secret.keys); var crypto = Crypto.createEncryptor(secret.keys);
var to = window.setTimeout(function () { var to = window.setTimeout(function () {
@ -185,6 +196,7 @@ define([
'class':'revertHistory buttonSuccess', 'class':'revertHistory buttonSuccess',
title: Messages.history_restoreTitle title: Messages.history_restoreTitle
}).text(Messages.history_restore).appendTo($nav); }).text(Messages.history_restore).appendTo($nav);
if (!History.readOnly) { $rev.hide(); }
onUpdate = function () { onUpdate = function () {
$cur.attr('max', states.length); $cur.attr('max', states.length);

@ -1783,6 +1783,7 @@ define([
module.hideMenu(); module.hideMenu();
if (!APP.editable) { debug("Read-only mode"); } if (!APP.editable) { debug("Read-only mode"); }
if (!appStatus.isReady && !force) { return; } if (!appStatus.isReady && !force) { return; }
// Only Trash and Root are available in not-owned files manager // Only Trash and Root are available in not-owned files manager
if (displayedCategories.indexOf(path[0]) === -1) { if (displayedCategories.indexOf(path[0]) === -1) {
log(Messages.categoryError); log(Messages.categoryError);
@ -1816,7 +1817,6 @@ define([
if (!isSearch) { delete APP.Search.oldLocation; } if (!isSearch) { delete APP.Search.oldLocation; }
module.resetTree(); module.resetTree();
if (displayedCategories.indexOf(SEARCH) !== -1 && $tree.find('#searchInput').length) { if (displayedCategories.indexOf(SEARCH) !== -1 && $tree.find('#searchInput').length) {
// in history mode we want to focus the version number input // in history mode we want to focus the version number input
if (!history.isHistoryMode && !APP.mobile()) { if (!history.isHistoryMode && !APP.mobile()) {
@ -2539,6 +2539,7 @@ define([
history.onEnterHistory = function (obj) { history.onEnterHistory = function (obj) {
var files = obj.drive; var files = obj.drive;
filesOp = FO.init(files, config); filesOp = FO.init(files, config);
appStatus.isReady = true;
refresh(); refresh();
}; };
history.onLeaveHistory = function () { history.onLeaveHistory = function () {

Loading…
Cancel
Save