From 74773ae30dc63727fc4a4742549907343fd0cd2e Mon Sep 17 00:00:00 2001
From: Aleksander Nowodzinski <a.nowodzinski@cksource.com>
Date: Thu, 7 Mar 2013 09:55:20 +0100
Subject: [PATCH] Simplified fix for Access denied error in IE9-10 when running
in subdomain and document.domain changed.
---
plugins/wysiwygarea/plugin.js | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/plugins/wysiwygarea/plugin.js b/plugins/wysiwygarea/plugin.js
index 4516568..2782c9b 100644
a
|
b
|
|
12 | 12 | CKEDITOR.plugins.add( 'wysiwygarea', { |
13 | 13 | init: function( editor ) { |
14 | 14 | editor.addMode( 'wysiwyg', function( callback ) { |
15 | | var iframe = CKEDITOR.document.createElement( 'iframe' ); |
16 | | iframe.setStyles({ width: '100%', height: '100%' } ); |
17 | | iframe.addClass( 'cke_wysiwyg_frame cke_reset' ); |
18 | | |
19 | | var contentSpace = editor.ui.space( 'contents' ); |
20 | | contentSpace.append( iframe ); |
21 | | |
22 | 15 | var src = 'document.open();' + |
23 | | // The document domain must be set any time we |
| 16 | // The document domain must be set any time we |
24 | 17 | // call document.open(). |
25 | 18 | ( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) + |
26 | 19 | 'document.close();'; |
… |
… |
|
32 | 25 | : |
33 | 26 | ''; |
34 | 27 | |
| 28 | var iframe = CKEDITOR.dom.element.createFromHtml( '<iframe src="' + src + '"></iframe>', CKEDITOR.document ); |
| 29 | |
| 30 | iframe.setStyles( { width: '100%', height: '100%' } ); |
| 31 | iframe.addClass( 'cke_wysiwyg_frame cke_reset' ); |
| 32 | |
| 33 | var contentSpace = editor.ui.space( 'contents' ); |
| 34 | contentSpace.append( iframe ); |
| 35 | |
35 | 36 | // Asynchronous iframe loading is only required in IE>8 and Gecko (other reasons probably). |
36 | 37 | // Do not use it on WebKit as it'll break the browser-back navigation. |
37 | 38 | var useOnloadEvent = CKEDITOR.env.ie || CKEDITOR.env.gecko; |
… |
… |
|
59 | 60 | frameBorder: 0, |
60 | 61 | 'aria-describedby' : labelId, |
61 | 62 | title: frameLabel, |
62 | | src: src, |
63 | 63 | tabIndex: editor.tabIndex, |
64 | 64 | allowTransparency: 'true' |
65 | 65 | }); |