Move slide to secure iframe
This commit is contained in:
@@ -86,6 +86,39 @@ define([
|
||||
|
||||
var isHistoryMode = false;
|
||||
|
||||
var setEditable = APP.setEditable = function (bool) {
|
||||
if (readOnly && bool) { return; }
|
||||
editor.setOption('readOnly', !bool);
|
||||
};
|
||||
|
||||
var Title;
|
||||
|
||||
var config = {
|
||||
readOnly: readOnly,
|
||||
transformFunction: JsonOT.validate,
|
||||
// cryptpad debug logging (default is 1)
|
||||
// logLevel: 0,
|
||||
validateContent: function (content) {
|
||||
try {
|
||||
JSON.parse(content);
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.log("Failed to parse, rejecting patch");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var canonicalize = function (t) { return t.replace(/\r\n/g, '\n'); };
|
||||
|
||||
var setHistory = function (bool, update) {
|
||||
isHistoryMode = bool;
|
||||
setEditable(!bool);
|
||||
if (!bool && update) {
|
||||
config.onRemote();
|
||||
}
|
||||
};
|
||||
|
||||
var $contentContainer = $('#cp-app-code-editor');
|
||||
var $previewContainer = $('#cp-app-code-preview');
|
||||
var $preview = $('#cp-app-code-preview-content');
|
||||
@@ -120,39 +153,6 @@ define([
|
||||
typeof(useTabs) === 'boolean'? useTabs: false);
|
||||
};
|
||||
|
||||
var setEditable = APP.setEditable = function (bool) {
|
||||
if (readOnly && bool) { return; }
|
||||
editor.setOption('readOnly', !bool);
|
||||
};
|
||||
|
||||
var Title;
|
||||
|
||||
var config = {
|
||||
readOnly: readOnly,
|
||||
transformFunction: JsonOT.validate,
|
||||
// cryptpad debug logging (default is 1)
|
||||
// logLevel: 0,
|
||||
validateContent: function (content) {
|
||||
try {
|
||||
JSON.parse(content);
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.log("Failed to parse, rejecting patch");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var canonicalize = function (t) { return t.replace(/\r\n/g, '\n'); };
|
||||
|
||||
var setHistory = function (bool, update) {
|
||||
isHistoryMode = bool;
|
||||
setEditable(!bool);
|
||||
if (!bool && update) {
|
||||
config.onRemote();
|
||||
}
|
||||
};
|
||||
|
||||
CommonRealtime.onInfiniteSpinner(function () { setEditable(false); });
|
||||
|
||||
setEditable(false);
|
||||
@@ -336,14 +336,14 @@ define([
|
||||
$previewContainer.toggle();
|
||||
if ($previewContainer.is(':visible')) {
|
||||
forceDrawPreview();
|
||||
$codeMirror.removeClass('fullPage');
|
||||
$previewButton.addClass('active');
|
||||
$codeMirror.removeClass('cp-ap-code-fullpage');
|
||||
$previewButton.addClass('cp-toolbar-button-active');
|
||||
common.setPadAttribute('previewMode', true, function (e) {
|
||||
if (e) { return console.log(e); }
|
||||
});
|
||||
} else {
|
||||
$codeMirror.addClass('fullPage');
|
||||
$previewButton.removeClass('active');
|
||||
$codeMirror.addClass('cp-app-code-fullpage');
|
||||
$previewButton.removeClass('cp-toolbar-button-active');
|
||||
common.setPadAttribute('previewMode', false, function (e) {
|
||||
if (e) { return console.log(e); }
|
||||
});
|
||||
@@ -574,30 +574,7 @@ define([
|
||||
|
||||
Cryptpad.onLogout(function () { setEditable(false); });
|
||||
};
|
||||
/*
|
||||
var interval = 100;
|
||||
var second = function (CM) {
|
||||
Cryptpad.ready(function () {
|
||||
andThen(CM);
|
||||
Cryptpad.reportAppUsage();
|
||||
});
|
||||
Cryptpad.onError(function (info) {
|
||||
if (info && info.type === "store") {
|
||||
onConnectError();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var first = function () {
|
||||
if (ifrw.CodeMirror) {
|
||||
second(ifrw.CodeMirror);
|
||||
} else {
|
||||
console.log("CodeMirror was not defined. Trying again in %sms", interval);
|
||||
setTimeout(first, interval);
|
||||
}
|
||||
};
|
||||
|
||||
first();*/
|
||||
var CMEDITOR_CHECK_INTERVAL = 100;
|
||||
var cmEditorAvailable = function (cb) {
|
||||
var intr;
|
||||
@@ -628,7 +605,7 @@ define([
|
||||
}));
|
||||
SFCommon.create(waitFor(function (c) { APP.common = common = c; }));
|
||||
}).nThen(function (/*waitFor*/) {
|
||||
CodeMirror = Cryptpad.createCodemirror(window, Cryptpad, null, CM);
|
||||
CodeMirror = common.initCodeMirrorApp(null, CM);
|
||||
$('.CodeMirror').addClass('fullPage');
|
||||
editor = CodeMirror.editor;
|
||||
Cryptpad.onError(function (info) {
|
||||
|
||||
Reference in New Issue
Block a user