Ticket #2751: 2751.patch
File 2751.patch, 5.4 KB (added by , 16 years ago) |
---|
-
_source/plugins/elementspath/plugin.js
78 78 79 79 while ( element ) 80 80 { 81 var index = elementsList.push( element ) - 1, 81 var index = elementsList.push( element ) - 1; 82 var name; 83 if ( element.getAttribute( '_cke_real_element_type' ) ) 84 name = element.getAttribute( '_cke_real_element_type' ); 85 else 82 86 name = element.getName(); 83 87 84 88 // Use this variable to add conditional stuff to the -
_source/plugins/fakeobjects/plugin.js
45 45 { 46 46 match : function( nodeName, attributes ) 47 47 { 48 return ( nodeName == 'a' && attributes.name != null && attributes.name != '' ); 49 }, 50 cssClass : 'anchor', 51 priority : 10 52 }, 53 { 54 match : function( nodeName, attributes ) 55 { 48 56 return nodeName == 'embed' || nodeName == 'object'; 49 57 }, 50 58 cssClass : 'object', … … 129 137 130 138 // Get the fake element's CSS class. 131 139 var cssClass = 'unknown'; 140 var realElementType = element.getName(); 132 141 for ( var i = 0 ; i < objectTypes.length ; i++ ) 133 142 { 134 143 if ( objectTypes[i].match( element.getName(), element.$ ) ) 135 144 { 136 145 cssClass = '_cke_fakeobject' + ' ' + objectTypes[i].cssClass; 146 realElementType = objectTypes[i].cssClass; 137 147 break; 138 148 } 139 149 } … … 150 160 if ( heightMatch ) 151 161 fakeRawElement.style.height = heightMatch[1] + 'px'; 152 162 fakeRawElement.setAttribute( '_cke_protected_html', encodeURIComponent( html ) ); 163 fakeRawElement.setAttribute( '_cke_real_element_type', realElementType ); 153 164 return new CKEDITOR.dom.element( fakeRawElement ); 154 165 }, 155 166 … … 264 275 parser.parse( html ); 265 276 return processedHtml.join( '' ); 266 277 }, 278 /** 279 * Updates HTML into a placeholder 280 * @param {CKEDITOR.dom.element} fakeImgElement The placeholder <img>. 281 * @param {CKEDITOR.dom.element} element Input DOM element. 282 * @returns {String} encoded HTML. 283 * @example 284 */ 285 updateFakeElement : function( fakeElement, realElement ) 286 { 287 var $ = realElement.$.cloneNode( true ), 288 doc = $.ownerDocument, 289 temp = doc.createElement( 'div' ), 290 html; 267 291 292 // Get the object's HTML code. 293 temp.appendChild( $ ); 294 html = temp.innerHTML; 295 fakeElement.setAttribute( '_cke_protected_html', encodeURIComponent( html ) ); 296 return html; 297 }, 298 268 299 /** 269 300 * Restores placeholders in an HTML string back to their original elements. 270 301 * @param {String} html HTML with placeholders. -
_source/plugins/link/dialogs/anchor.js
55 55 // It doesn't work with IE. 56 56 this.restoreSelection(); 57 57 this.clearSavedSelection(); 58 editor.insertElement( this.editObj ); 58 59 var fakeElement = CKEDITOR.plugins.fakeobjects.protectElement( this.editObj ); 60 editor.insertElement( fakeElement ); 59 61 } 62 else 63 CKEDITOR.plugins.fakeobjects.updateFakeElement( this.fakeObj, this.editObj ); 60 64 return true; 61 65 }, 62 66 onShow : function() 63 67 { 64 68 this.editObj = false; 69 this.fakeObj = false; 65 70 this.editMode = false; 66 71 67 72 // IE BUG: Selection must be in the editor for getSelection() to work. … … 75 80 { 76 81 ranges[0].enlarge( CKEDITOR.ENLARGE_ELEMENT ); 77 82 rangeRoot = ranges[0].getCommonAncestor( true ); 78 var element = rangeRoot.getAscendant( ' a', true );79 if ( element && element.getAttribute( ' name' ))83 var element = rangeRoot.getAscendant( 'img', true ); 84 if ( element && element.getAttribute( '_cke_real_element_type' ) && element.getAttribute( '_cke_real_element_type' ) == 'anchor' ) 80 85 { 86 this.fakeObj = element; 87 element = CKEDITOR.plugins.fakeobjects.restoreElement( this.fakeObj ); 81 88 loadElements.apply( this, [ editor, selection, ranges, element ] ); 82 selection.selectElement( element);89 selection.selectElement( this.fakeObj ); 83 90 this.saveSelection(); 84 91 } 85 92 } -
_source/skins/default/toolbar.css
257 257 background-position: 0 -656px; 258 258 } 259 259 260 .cke_skin_default a.cke_button_pagebreak .cke_icon 261 { 262 background-position: 0 -672px; 263 } 264 260 265 .cke_skin_default a.cke_button_form .cke_icon 261 266 { 262 267 background-position: 0 -752px; -
contents.css
47 47 { 48 48 background-image: url(images/plugin.gif); 49 49 } 50 51 img._cke_fakeobject.anchor 52 { 53 background-image: url(images/anchor.gif); 54 width: 18px; 55 height: 18px; 56 }