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

This commit is contained in:
ansuz
2016-10-24 14:54:35 +02:00
5 changed files with 131 additions and 41 deletions

View File

@@ -85,11 +85,12 @@ define([
});
editor.on('instanceReady', function (Ckeditor) {
var $bar = $('#pad-iframe')[0].contentWindow.$('#cke_1_toolbox');
if (readOnly) {
$('#pad-iframe')[0].contentWindow.$('#cke_1_toolbox > .cke_toolbar').hide();
}
/* add a class to the magicline plugin so we can pick it out more easily */
var ml = $('iframe')[0].contentWindow.CKEDITOR.instances.editor1.plugins.magicline
@@ -403,6 +404,7 @@ define([
document.title = oldTitle;
return;
}
$bar.find('.' + Toolbar.constants.title).find('span').text(newTitle);
});
};
@@ -513,13 +515,19 @@ define([
realtimeOptions.onLocal();
};
var renameCb = function (err, title) {
if (err) { return; }
document.title = title;
editor.fire('change');
};
var onInit = realtimeOptions.onInit = function (info) {
var $bar = $('#pad-iframe')[0].contentWindow.$('#cke_1_toolbox');
toolbarList = info.userList;
var config = {
userData: userList,
readOnly: readOnly,
ifrw: ifrw
ifrw: ifrw,
onRename: renameCb
};
if (readOnly) {delete config.changeNameID; }
toolbar = info.realtime.toolbar = Toolbar.create($bar, info.myID, info.realtime, info.getLag, info.userList, config);
@@ -555,11 +563,6 @@ define([
$rightside.append($import);
/* add a rename button */
var renameCb = function (err, title) {
if (err) { return; }
document.title = title;
editor.fire('change');
};
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
$rightside.append($setTitle);
}
@@ -594,13 +597,8 @@ define([
console.log("Couldn't get pad title");
return;
}
updateTitle(title || info.channel.slice(0, 8));
document.title = title || info.channel.slice(0, 8);
Cryptpad.setPadTitle(title, function (err, data) {
if (err) {
console.log("Couldn't remember pad");
console.error(err);
}
});
});
};