|
|
|
@ -86,6 +86,11 @@ define([
|
|
|
|
|
|
|
|
|
|
editor.on('instanceReady', function (Ckeditor) {
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
@ -397,8 +402,7 @@ define([
|
|
|
|
|
// build a dom from HJSON, diff, and patch the editor
|
|
|
|
|
applyHjson(shjson);
|
|
|
|
|
|
|
|
|
|
if (readOnly) { return; }
|
|
|
|
|
|
|
|
|
|
if (!readOnly) {
|
|
|
|
|
var shjson2 = stringifyDOM(inner);
|
|
|
|
|
if (shjson2 !== shjson) {
|
|
|
|
|
console.error("shjson2 !== shjson");
|
|
|
|
@ -427,6 +431,7 @@ define([
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
notify();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -505,7 +510,9 @@ define([
|
|
|
|
|
.text(Messages.exportButton)
|
|
|
|
|
.addClass('rightside-button')
|
|
|
|
|
.click(exportFile);
|
|
|
|
|
$rightside.append($export);
|
|
|
|
|
|
|
|
|
|
if (!readOnly) {
|
|
|
|
|
/* add an import button */
|
|
|
|
|
var $import = $('<button>', {
|
|
|
|
|
title: Messages.importButtonTitle
|
|
|
|
@ -517,7 +524,8 @@ define([
|
|
|
|
|
applyHjson(shjson);
|
|
|
|
|
realtimeOptions.onLocal();
|
|
|
|
|
}));
|
|
|
|
|
$rightside.append($export).append($import);
|
|
|
|
|
$rightside.append($import);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* add a rename button */
|
|
|
|
|
var $rename = $('<button>', {
|
|
|
|
@ -578,7 +586,7 @@ define([
|
|
|
|
|
.addClass('rightside-button')
|
|
|
|
|
.click(function () {
|
|
|
|
|
var baseUrl = window.location.origin + window.location.pathname + '#';
|
|
|
|
|
var content = '<b>' + Messages.readonlyUrl + '</b><br><a target="_blank">' + baseUrl + viewHash + '</a><br>';
|
|
|
|
|
var content = '<b>' + Messages.readonlyUrl + '</b><br><a>' + baseUrl + viewHash + '</a><br>';
|
|
|
|
|
Cryptpad.alert(content);
|
|
|
|
|
});
|
|
|
|
|
$rightside.append($links);
|
|
|
|
|