JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _source / plugins / preview / plugin.js
index dd53d43..fd6e633 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -13,6 +13,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        {\r
                modes : { wysiwyg:1, source:1 },\r
                canUndo : false,\r
+               readOnly : 1,\r
                exec : function( editor )\r
                {\r
                        var sHTML,\r
@@ -24,7 +25,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        {\r
                                sHTML = editor.getData()\r
                                                .replace( /<head>/, '$&' + baseTag )\r
-                                               .replace( /[^>]*(?=<\/title>)/, editor.lang.preview );\r
+                                               .replace( /[^>]*(?=<\/title>)/, '$& &mdash; ' + editor.lang.preview );\r
                        }\r
                        else\r
                        {\r
@@ -83,9 +84,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                        if ( !isCustomDomain )\r
                        {\r
-                               oWindow.document.open();\r
-                               oWindow.document.write( sHTML );\r
-                               oWindow.document.close();\r
+                               var doc = oWindow.document;\r
+                               doc.open();\r
+                               doc.write( sHTML );\r
+                               doc.close();\r
+\r
+                               // Chrome will need this to show the embedded. (#8016)\r
+                               CKEDITOR.env.webkit && setTimeout( function() { doc.body.innerHTML += ''; }, 0 );\r
                        }\r
                }\r
        };\r