Ticket #171: 171.patch
File 171.patch, 5.5 KB (added by , 16 years ago) |
---|
-
editor/_source/internals/fck.js
329 329 FCK.Events.FireEvent( 'OnAfterSetHTML' ) ; 330 330 }, 331 331 332 // Saves URLs on links and images on special attributes, so they don't change when 333 // moving around. 334 ProtectUrls : function( html ) 332 // Saves special attributes that might be lost if we only assign it directly to document.body.innerHTML. 333 ProtectAttributes : function( html ) 335 334 { 336 335 // <A> href 337 336 html = html.replace( FCKRegexLib.ProtectUrlsA , '$& _fcksavedurl=$1' ) ; … … 340 339 html = html.replace( FCKRegexLib.ProtectUrlsImg , '$& _fcksavedurl=$1' ) ; 341 340 342 341 // <AREA> href 343 html = html.replace( FCKRegexLib.ProtectUrlsArea 342 html = html.replace( FCKRegexLib.ProtectUrlsArea, '$& _fcksavedurl=$1' ) ; 344 343 344 // <INPUT type="text"> size 345 html = html.replace( FCKRegexLib.ProtectSizesInput, '$& _fcksavedsize=$1' ) ; 346 347 // <TEXTAREA> cols 348 html = html.replace( FCKRegexLib.ProtectColsTextarea, '$& _fcksavedcols=$1' ) ; 349 345 350 return html ; 346 351 }, 347 352 … … 399 404 // If there was an onSelectionChange listener in IE we must remove it to avoid crashes #1498 400 405 if ( FCKBrowserInfo.IsIE && FCK.EditorDocument ) 401 406 { 402 407 FCK.EditorDocument.detachEvent("onselectionchange", Doc_OnSelectionChange ) ; 403 408 } 404 409 405 410 if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) … … 421 426 data = FCK.ProtectEvents( data ) ; 422 427 423 428 // Protect some things from the browser itself. 424 data = FCK.Protect Urls( data ) ;429 data = FCK.ProtectAttributes( data ) ; 425 430 data = FCK.ProtectTags( data ) ; 426 431 427 432 // Insert the base tag (FCKConfig.BaseHref), if not exists in the source. -
editor/_source/internals/fckregexlib.js
75 75 ProtectUrlsImg : /<img(?=\s).*?\ssrc=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi , 76 76 ProtectUrlsA : /<a(?=\s).*?\shref=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi , 77 77 ProtectUrlsArea : /<area(?=\s).*?\shref=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi , 78 ProtectSizesInput: /<input(?=\s).*?\ssize=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi , 79 ProtectColsTextarea: /<textarea(?=\s).*?\scols=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi , 78 80 79 81 Html4DocType : /HTML 4\.0 Transitional/i , 80 82 DocTypeTag : /<!DOCTYPE[^>]*>/i , -
editor/_source/internals/fckxhtml_ie.js
130 130 if ( htmlNode.value && !node.attributes.getNamedItem( 'value' ) ) 131 131 FCKXHtml._AppendAttribute( node, 'value', htmlNode.value ) ; 132 132 133 var sSavedSize = htmlNode.getAttribute( '_fcksavedsize' ) ; 134 if ( sSavedSize != null ) 135 FCKXHtml._AppendAttribute( node, 'size', sSavedSize ) ; 136 133 137 if ( !node.attributes.getNamedItem( 'type' ) ) 134 138 FCKXHtml._AppendAttribute( node, 'type', 'text' ) ; 135 139 … … 197 201 if ( htmlNode.name ) 198 202 FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ; 199 203 204 var sSavedCols = htmlNode.getAttribute( '_fcksavedcols' ) ; 205 if ( sSavedCols != null ) 206 FCKXHtml._AppendAttribute( node, 'cols', sSavedCols ) ; 207 200 208 node = FCKXHtml._AppendChildNodes( node, htmlNode ) ; 201 209 202 210 return node ; 203 } 204 No newline at end of file 211 } -
editor/dialog/fck_textarea.html
45 45 if ( oActiveEl && oActiveEl.tagName == 'TEXTAREA' ) 46 46 { 47 47 GetE('txtName').value = oActiveEl.name ; 48 GetE('txtCols').value = GetAttribute( oActiveEl, 'cols' ) ;48 GetE('txtCols').value = GetAttribute( oActiveEl, 'cols' ) || GetAttribute( oActiveEl, '_fcksavedcols' ) ; ; 49 49 GetE('txtRows').value = GetAttribute( oActiveEl, 'rows' ) ; 50 50 } 51 51 else … … 63 63 oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'TEXTAREA', {name: GetE('txtName').value} ) ; 64 64 65 65 SetAttribute( oActiveEl, 'cols', GetE('txtCols').value ) ; 66 SetAttribute( oActiveEl, '_fcksavedcols', GetE('txtCols').value ) ; 66 67 SetAttribute( oActiveEl, 'rows', GetE('txtRows').value ) ; 67 68 68 69 return true ; -
editor/dialog/fck_textfield.html
46 46 { 47 47 GetE('txtName').value = oActiveEl.name ; 48 48 GetE('txtValue').value = oActiveEl.value ; 49 GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) ;49 GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) || GetAttribute( oActiveEl, '_fcksavedsize' ) ; 50 50 GetE('txtMax').value = GetAttribute( oActiveEl, 'maxLength' ) ; 51 51 GetE('txtType').value = oActiveEl.type ; 52 52 } … … 79 79 80 80 SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ; 81 81 SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ; 82 SetAttribute( oActiveEl, '_fcksavedsize', GetE('txtSize').value ) ; 82 83 SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ; 83 84 84 85 return true ;