Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.2.2
[ckeditor.git]
/
_source
/
plugins
/
fakeobjects
/
plugin.js
diff --git
a/_source/plugins/fakeobjects/plugin.js
b/_source/plugins/fakeobjects/plugin.js
index
137c677
..
0b173c2
100644
(file)
--- a/
_source/plugins/fakeobjects/plugin.js
+++ b/
_source/plugins/fakeobjects/plugin.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
@@
-11,25
+11,25
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
{
\r
$ : function( element )
\r
{
\r
{
\r
$ : function( element )
\r
{
\r
- var realHtml = element.attributes._cke_realelement,
\r
+ var attributes = element.attributes,
\r
+ realHtml = attributes && attributes._cke_realelement,
\r
realFragment = realHtml && new CKEDITOR.htmlParser.fragment.fromHtml( decodeURIComponent( realHtml ) ),
\r
realElement = realFragment && realFragment.children[ 0 ];
\r
\r
realFragment = realHtml && new CKEDITOR.htmlParser.fragment.fromHtml( decodeURIComponent( realHtml ) ),
\r
realElement = realFragment && realFragment.children[ 0 ];
\r
\r
- if ( realElement )
\r
+ // If we have width/height in the element, we must move it into
\r
+ // the real element.
\r
+ if ( realElement && element.attributes._cke_resizable )
\r
{
\r
{
\r
- // If we have width/height in the element, we must move it into
\r
- // the real element.
\r
-
\r
var style = element.attributes.style;
\r
\r
if ( style )
\r
{
\r
// Get the width from the style.
\r
var style = element.attributes.style;
\r
\r
if ( style )
\r
{
\r
// Get the width from the style.
\r
- var match = /(?:^|\s)width\s*:\s*(\d+)/.exec( style ),
\r
+ var match = /(?:^|\s)width\s*:\s*(\d+)/i.exec( style ),
\r
width = match && match[1];
\r
\r
// Get the height from the style.
\r
width = match && match[1];
\r
\r
// Get the height from the style.
\r
- match = /(?:^|\s)height\s*:\s*(\d+)/.exec( style );
\r
+ match = /(?:^|\s)height\s*:\s*(\d+)/i.exec( style );
\r
var height = match && match[1];
\r
\r
if ( width )
\r
var height = match && match[1];
\r
\r
if ( width )
\r
@@
-63,15
+63,20
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable )
\r
{
\r
var lang = this.lang.fakeobjects;
\r
CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable )
\r
{
\r
var lang = this.lang.fakeobjects;
\r
+
\r
var attributes =
\r
{
\r
'class' : className,
\r
src : CKEDITOR.getUrl( 'images/spacer.gif' ),
\r
_cke_realelement : encodeURIComponent( realElement.getOuterHtml() ),
\r
var attributes =
\r
{
\r
'class' : className,
\r
src : CKEDITOR.getUrl( 'images/spacer.gif' ),
\r
_cke_realelement : encodeURIComponent( realElement.getOuterHtml() ),
\r
- alt : lang[ realElementType ] || lang.unknown
\r
+ _cke_real_node_type : realElement.type,
\r
+ alt : lang[ realElementType ] || lang.unknown,
\r
+ align : realElement.getAttribute( 'align' ) || ''
\r
};
\r
};
\r
+
\r
if ( realElementType )
\r
attributes._cke_real_element_type = realElementType;
\r
if ( realElementType )
\r
attributes._cke_real_element_type = realElementType;
\r
+
\r
if ( isResizable )
\r
attributes._cke_resizable = isResizable;
\r
\r
if ( isResizable )
\r
attributes._cke_resizable = isResizable;
\r
\r
@@
-80,19
+85,21
@@
CKEDITOR.editor.prototype.createFakeElement = function( realElement, className,
\r
CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable )
\r
{
\r
\r
CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable )
\r
{
\r
- var writer = new CKEDITOR.htmlParser.basicWriter();
\r
+ var lang = this.lang.fakeobjects,
\r
+ html;
\r
\r
\r
+ var writer = new CKEDITOR.htmlParser.basicWriter();
\r
realElement.writeHtml( writer );
\r
realElement.writeHtml( writer );
\r
-
\r
- var html = writer.getHtml();
\r
- var lang = this.lang.fakeobjects;
\r
+ html = writer.getHtml();
\r
\r
var attributes =
\r
{
\r
'class' : className,
\r
src : CKEDITOR.getUrl( 'images/spacer.gif' ),
\r
_cke_realelement : encodeURIComponent( html ),
\r
\r
var attributes =
\r
{
\r
'class' : className,
\r
src : CKEDITOR.getUrl( 'images/spacer.gif' ),
\r
_cke_realelement : encodeURIComponent( html ),
\r
- alt : lang[ realElementType ] || lang.unknown
\r
+ _cke_real_node_type : realElement.type,
\r
+ alt : lang[ realElementType ] || lang.unknown,
\r
+ align : realElement.attributes.align || ''
\r
};
\r
\r
if ( realElementType )
\r
};
\r
\r
if ( realElementType )
\r
@@
-106,6
+113,10
@@
CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, class
\r
CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
\r
{
\r
\r
CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
\r
{
\r
- var html = decodeURIComponent( fakeElement.getAttribute( '_cke_realelement' ) );
\r
- return CKEDITOR.dom.element.createFromHtml( html, this.document );
\r
+ if ( fakeElement.getAttribute( '_cke_real_node_type' ) != CKEDITOR.NODE_ELEMENT )
\r
+ return null;
\r
+
\r
+ return CKEDITOR.dom.element.createFromHtml(
\r
+ decodeURIComponent( fakeElement.getAttribute( '_cke_realelement' ) ),
\r
+ this.document );
\r
};
\r
};
\r