add a class to the magicline markup so it's easier to remove

pull/1/head
ansuz 9 years ago
parent c2b4b1283c
commit 8af49698da

@ -45,6 +45,7 @@ define([
var userName = Crypto.rand64(8), var userName = Crypto.rand64(8),
toolbar; toolbar;
// TODO update this filter to use the .non-realtime class
var isNotMagicLine = function (el) { var isNotMagicLine = function (el) {
// factor as: // factor as:
// return !(el.tagName === 'SPAN' && el.contentEditable === 'false'); // return !(el.tagName === 'SPAN' && el.contentEditable === 'false');
@ -104,6 +105,7 @@ define([
} }
var fixThings = false; var fixThings = false;
var editor = window.editor = Ckeditor.replace('editor1', { var editor = window.editor = Ckeditor.replace('editor1', {
// https://dev.ckeditor.com/ticket/10907 // https://dev.ckeditor.com/ticket/10907
needsBrFiller: fixThings, needsBrFiller: fixThings,
@ -114,7 +116,17 @@ define([
removePlugins: 'resize' removePlugins: 'resize'
}); });
editor.on('instanceReady', function (Ckeditor) { editor.on('instanceReady', function (Ckeditor) {
/* add a class to the magicline plugin so we can pick it out more easily */
$('iframe')[0].contentWindow.CKEDITOR.instances.editor1.plugins.magicline
.backdoor.that.line.$.setAttribute('class', 'non-realtime');
/* in XWiki this is
CKEDITOR.instances.content.plugins.magicline.backdoor.that.line
.$.setAttribute('class', 'non-realtime') */
editor.execCommand('maximize'); editor.execCommand('maximize');
var documentBody = ifrw.$('iframe')[0].contentDocument.body; var documentBody = ifrw.$('iframe')[0].contentDocument.body;
@ -422,6 +434,9 @@ define([
var interval = 100; var interval = 100;
var first = function () { var first = function () {
Ckeditor = ifrw.CKEDITOR; Ckeditor = ifrw.CKEDITOR;
console.log(Ckeditor);
if (Ckeditor) { if (Ckeditor) {
andThen(Ckeditor); andThen(Ckeditor);
} else { } else {

Loading…
Cancel
Save