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

pull/1/head
ansuz 7 years ago
commit 1280cd1659

@ -214,6 +214,10 @@ Version 1
Hash.getHashes = function (channel, secret) { Hash.getHashes = function (channel, secret) {
var hashes = {}; var hashes = {};
if (!secret.keys) {
console.error('e');
return hashes;
}
if (secret.keys.editKeyStr) { if (secret.keys.editKeyStr) {
hashes.editHash = getEditHashFromKeys(channel, secret.keys); hashes.editHash = getEditHashFromKeys(channel, secret.keys);
} }

@ -1851,6 +1851,11 @@ define([
if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); } if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); }
var hashes = common.getHashes(secret.channel, secret); var hashes = common.getHashes(secret.channel, secret);
if (!hashes.editHash && !hashes.viewHash && parsed.hashData && !parsed.hashData.mode) {
// It means we're using an old hash
hashes.editHash = window.location.hash.slice(1);
}
// If we have a stronger version in drive, add it and add a redirect button // If we have a stronger version in drive, add it and add a redirect button
var stronger = recent && common.findStronger(null, recent); var stronger = recent && common.findStronger(null, recent);
if (stronger) { if (stronger) {

@ -64,6 +64,7 @@ define(['jquery'], function ($) {
var md = metadataMgr.getMetadata(); var md = metadataMgr.getMetadata();
$title.find('span.title').text(md.title || md.defaultTitle); $title.find('span.title').text(md.title || md.defaultTitle);
$title.find('input').val(md.title || md.defaultTitle); $title.find('input').val(md.title || md.defaultTitle);
exp.title = md.title;
//exp.updateTitle(md.title || md.defaultTitle); //exp.updateTitle(md.title || md.defaultTitle);
}); });

@ -585,7 +585,7 @@ define([
}).appendTo($hoverable).text(config.pageTitle); }).appendTo($hoverable).text(config.pageTitle);
}; };
var createLinkToMain = function (toolbar) { var createLinkToMain = function (toolbar, config) {
var $linkContainer = $('<span>', { var $linkContainer = $('<span>', {
'class': "cryptpad-link" 'class': "cryptpad-link"
}).appendTo(toolbar.$top); }).appendTo(toolbar.$top);
@ -593,7 +593,9 @@ define([
// We need to override the "a" tag action here because it is inside the iframe! // We need to override the "a" tag action here because it is inside the iframe!
var inDrive = /^\/drive/; var inDrive = /^\/drive/;
var href = inDrive ? '/index.html' : '/drive/'; var origin = config.metadataMgr.getPrivateData().origin;
var href = inDrive ? origin+'/index.html' : origin+'/drive/';
var buttonTitle = inDrive ? Messages.header_homeTitle : Messages.header_logoTitle; var buttonTitle = inDrive ? Messages.header_homeTitle : Messages.header_logoTitle;
var $aTag = $('<a>', { var $aTag = $('<a>', {
@ -609,7 +611,7 @@ define([
window.open(href); window.open(href);
return; return;
} }
window.location = href; window.top.location = href;
}; };
var onContext = function (e) { e.stopPropagation(); }; var onContext = function (e) { e.stopPropagation(); };

@ -127,6 +127,7 @@ define([
}); });
sframeChan.on('Q_SET_PAD_TITLE_IN_DRIVE', function (newTitle, cb) { sframeChan.on('Q_SET_PAD_TITLE_IN_DRIVE', function (newTitle, cb) {
document.title = newTitle;
Cryptpad.renamePad(newTitle, undefined, function (err) { Cryptpad.renamePad(newTitle, undefined, function (err) {
if (err) { cb('ERROR'); } else { cb(); } if (err) { cb('ERROR'); } else { cb(); }
}); });

Loading…
Cancel
Save