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

This commit is contained in:
ansuz 2017-08-28 14:49:01 +02:00
commit 1280cd1659
5 changed files with 16 additions and 3 deletions

View File

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

View File

@ -1851,6 +1851,11 @@ define([
if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); }
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
var stronger = recent && common.findStronger(null, recent);
if (stronger) {

View File

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

View File

@ -585,7 +585,7 @@ define([
}).appendTo($hoverable).text(config.pageTitle);
};
var createLinkToMain = function (toolbar) {
var createLinkToMain = function (toolbar, config) {
var $linkContainer = $('<span>', {
'class': "cryptpad-link"
}).appendTo(toolbar.$top);
@ -593,7 +593,9 @@ define([
// We need to override the "a" tag action here because it is inside the iframe!
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 $aTag = $('<a>', {
@ -609,7 +611,7 @@ define([
window.open(href);
return;
}
window.location = href;
window.top.location = href;
};
var onContext = function (e) { e.stopPropagation(); };

View File

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