Opened 9 years ago

Closed 9 years ago

#14295 closed Bug (invalid)

not working in popup window created by Javascript

Reported by: jmvanel Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Steps to reproduce

<html>
<script src="ckeditor.js"></script>
<script type="text/javascript">
  var popupWindow = window.open('', 'windowName', 'height=300,width=300');
  var editorDiv = popupWindow.document.createElement("textarea");
  var body = popupWindow.document.body;
  body.appendChild(editorDiv);

  CKEDITOR.replace( editorDiv );
</script>
</html>

Expected result

CKEDITOR in popup Window.

Actual result

Part of user manual in popup Window:

Éditeur de Texte Enrichi, editorDiv Barre d'outils de l'éditeurDocument Source Enregistrer Nouvelle page Aperçu Imprimer ModèlesPresse-papier/Défaire Couper Copier Coller Coller comme texte sans mise en forme ... etc ...

Other details (browser, OS, CKEditor version, installed plugins)

Ubuntu 14.4 LTS Firefox 43.0 and Chromium (updated by Ubuntu )

Chromium	47.0.2526.73 (Build de développement) Ubuntu 14.04 (64 bits)
Révision	2d637ddb1c5ed38b794d9c2c00f0379868892bc8
Système d'exploitation	Linux 
Blink	537.36 (@2d637ddb1c5ed38b794d9c2c00f0379868892bc8)
JavaScript	V8 4.7.80.23
Flash	(désactivée)
Agent utilisateur	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/47.0.2526.73 Chrome/47.0.2526.73 Safari/537.36
Ligne de commande	/usr/lib/chromium-browser/chromium-browser --enable-pinch --flag-switches-begin --flag-switches-end
Chemin d'accès exécutable	/usr/lib/chromium-browser/chromium-browser
Chemin d'accès au profil	/home/jmv/.config/chromium/Default
Variantes	16e0dd70-3f4a17df
775ebbd7-3f4a17df
97dfc274-3f4a17df
4ea303a6-3f4a17df
5c3cc7b1-3f4a17df

Change History (1)

comment:1 Changed 9 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.6.0 (GitHub - major)

You need to have CKEDITOR namespace in context of window in which you want to open the editor.

Please note that it may take some time to load CKEditor from CDN so setting timeout period is necessary.

var popupWindow = window.open('', 'windowName', 'height=300,width=300');
	var doc = popupWindow.document;
	doc.write(
		"<html><head>" +
		'    <script type="text/javascript" src="//cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></' + 'script>' +
		'</head><body><textarea id="editor1" name="editor1"></textarea></body></html>'
	);
	doc.close();
	window.setTimeout( function() {
		// Wait 2 second, in production you want to hook to a proper load event.
		popupWindow.CKEDITOR.replace( 'editor1' );
}, 2000 );
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy