X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fpreview%2Fplugin.js;h=dd53d4396ecd48f68a5db6a07a832e7b28e1ced2;hp=fc4f694b6d74cfdb7f9aa3a65e2c26cc6e0bf9b9;hb=941b0a9ba4e673e292510d80a5a86806994b8ea6;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d diff --git a/_source/plugins/preview/plugin.js b/_source/plugins/preview/plugin.js index fc4f694..dd53d43 100644 --- a/_source/plugins/preview/plugin.js +++ b/_source/plugins/preview/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -16,19 +16,29 @@ For licensing, see LICENSE.html or http://ckeditor.com/license exec : function( editor ) { var sHTML, + config = editor.config, + baseTag = config.baseHref ? '' : '', isCustomDomain = CKEDITOR.env.isCustomDomain(); - if ( editor.config.fullPage ) - sHTML = editor.getData(); + + if ( config.fullPage ) + { + sHTML = editor.getData() + .replace( //, '$&' + baseTag ) + .replace( /[^>]*(?=<\/title>)/, editor.lang.preview ); + } else { var bodyHtml = ' 0 ) ? '' : ''; + body = editor.document && editor.document.getBody(); + + if ( body ) + { + if ( body.getAttribute( 'id' ) ) + bodyHtml += 'id="' + body.getAttribute( 'id' ) + '" '; + if ( body.getAttribute( 'class' ) ) + bodyHtml += 'class="' + body.getAttribute( 'class' ) + '" '; + } - if ( body.getAttribute( 'id' ) ) - bodyHtml += 'id="' + body.getAttribute( 'id' ) + '" '; - if ( body.getAttribute( 'class' ) ) - bodyHtml += 'class="' + body.getAttribute( 'class' ) + '" '; bodyHtml += '>'; sHTML = @@ -37,9 +47,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license '' + baseTag + '' + editor.lang.preview + '' + - '' + + CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) + '' + bodyHtml + editor.getData() + '';