Changeset 245
- Timestamp:
- 04/11/07 20:31:28 (6 years ago)
- Location:
- FCKeditor/branches/features/dataprocessor
- Files:
-
- 9 edited
-
_dev/releaser/fckreleaser.php (modified) (5 diffs)
-
_whatsnew.html (modified) (1 diff)
-
editor/_source/classes/fckdataprocessor.js (modified) (3 diffs)
-
editor/_source/internals/fck.js (modified) (6 diffs)
-
editor/_source/internals/fck_gecko.js (modified) (1 diff)
-
editor/_source/internals/fck_ie.js (modified) (1 diff)
-
editor/css/fck_internal.css (modified) (2 diffs)
-
editor/dialog/fck_listprop.html (modified) (1 diff)
-
editor/plugins/bbcode/fckplugin.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/features/dataprocessor/_dev/releaser/fckreleaser.php
r164 r245 349 349 function StrEndsWith( $str, $sub ) 350 350 { 351 return ( substr( $str, strlen( $str ) - strlen( $sub ) ) == $sub ) ;351 return ( substr( $str, strlen( $str ) - strlen( $sub ) ) == $sub ) ; 352 352 } 353 353 … … 363 363 { 364 364 $dirParts = explode( '/', $path ) ; 365 365 366 366 $currentDir = '' ; 367 367 … … 369 369 { 370 370 $currentDir .= $dirPart . '/' ; 371 371 372 372 if ( strlen( $dirPart ) > 0 && !is_dir( $currentDir ) ) 373 373 mkdir( $currentDir, $rights ) ; … … 385 385 fwrite( $f, "\xEF\xBB\xBF" ) ; // BOM 386 386 387 fwrite( $f, $strData ) ; 388 fclose( $f ) ; 389 390 return TRUE ; 391 } 392 393 function SaveStringToUtf8File( $strData, $filePath, $includeBom = TRUE ) 394 { 395 $f = @fopen( $filePath, 'wb' ) ; 396 397 if ( !$f ) 398 return FALSE ; 399 400 if ( $includeBom ) 401 fwrite( $f, "\xEF\xBB\xBF" ) ; // BOM 402 403 fwrite( $f, ( $strData ) ) ; 404 387 fwrite( $f, StripUtf8Bom( $strData ) ) ; 405 388 fclose( $f ) ; 406 389 … … 954 937 function ProcessFile( $sourceFilePath, $destinationFilePath, $onlyHeader = FALSE ) 955 938 { 956 SaveStringTo Utf8File(939 SaveStringToFile( 957 940 FCKPreProcessor::Process( file_get_contents( $sourceFilePath ), $onlyHeader ), 958 941 $destinationFilePath, 959 ( !StrEndsWith( $sourceFilePath, '.asp' ) && !StrEndsWith( $sourceFilePath, '.js' ) ) ) ; // Only ASP and JavaScript files require the BOM.942 ( StrEndsWith( $sourceFilePath, '.asp' ) || StrEndsWith( $sourceFilePath, '.js' ) ) ) ; // Only ASP and JavaScript files require the BOM. 960 943 961 944 // Set the destination file Last Access and Last Write times. -
FCKeditor/branches/features/dataprocessor/_whatsnew.html
r225 r245 31 31 <body> 32 32 <h3> 33 Version 2.4.1 (SVN)</h3> 33 Version 2.4.3 (SVN)</h3> 34 <p> 35 New Features and Improvements:</p> 36 <ul> 37 <li>The editor now uses the <strong>Data Processor</strong> technology, which makes 38 it possible to handle different input formats. A sample of it may be found at "editor/plugins/bbcode/_sample", 39 that shows some simple BBCode support.</li> 40 </ul> 41 <p> 42 Fixed Bugs:</p> 43 <ul> 44 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/300">#300</a>] The fck_internal.css 45 file was not validating with the W3C CSS Validation Service.</li> 46 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/336">#336</a>] Ordered 47 list didn't keep the Type attribute properly (it was converted to lowercase when 48 the properties dialog was opened again).</li> 49 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/318">#318</a>] Multiple 50 linked images are merged in a single link in IE.</li> 51 </ul> 52 <h3> 53 Version 2.4.2</h3> 54 <p> 55 Fixed Bugs:</p> 56 <ul> 57 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/279">#279</a>] The UTF-8 58 BOM was being included in the wrong files, affecting mainly PHP installations.</li> 59 </ul> 60 <h3> 61 Version 2.4.1</h3> 34 62 <p> 35 63 New Features and Improvements:</p> -
FCKeditor/branches/features/dataprocessor/editor/_source/classes/fckdataprocessor.js
r225 r245 45 45 ConvertToHtml : function( data ) 46 46 { 47 // Protect event attributes (they could get fired in the editing area).48 data = this._ProtectEvents( data ) ;49 50 47 // The default data processor must handle two different cases depending 51 48 // on the FullPage setting. Custom Data Processors will not be … … 116 113 return '' ; 117 114 118 // Restore protected event attributes.119 data = this._ProtectEventsRestore( data ) ;120 121 115 return data ; 122 116 }, … … 128 122 */ 129 123 FixHtml : function( html ) 130 {},131 132 // Saves event attributes (like onclick) so they don't get executed while133 // editing.134 _ProtectEvents : function( html )135 124 { 136 return html.replace( FCKRegexLib.TagsWithEvent, _FCKDataProcessor_ProtectEvents_ReplaceTags ) ; 137 }, 138 139 _ProtectEventsRestore : function( html ) 140 { 141 return html.replace( FCKRegexLib.ProtectedEvents, _FCKDataProcessor_ProtectEvents_RestoreEvents ) ; 125 return html ; 142 126 } 143 127 } ; 144 145 // Replace all events attributes (like onclick).146 function _FCKDataProcessor_ProtectEvents_ReplaceTags( tagMatch )147 {148 return tagMatch.replace( FCKRegexLib.EventAttributes, _FCKDataProcessor_ProtectEvents_ReplaceEvents ) ;149 }150 151 // Replace an event attribute with its respective __fckprotectedatt attribute.152 // The original event markup will be encoded and saved as the value of the new153 // attribute.154 function _FCKDataProcessor_ProtectEvents_ReplaceEvents( eventMatch, attName )155 {156 return ' ' + attName + '_fckprotectedatt="' + eventMatch.ReplaceAll( [/&/g,/'/g,/"/g,/=/g,/</g,/>/g,/\r/g,/\n/g], [''',''','"','=','<','>',' ',' '] ) + '"' ;157 }158 159 function _FCKDataProcessor_ProtectEvents_RestoreEvents( match, encodedOriginal )160 {161 return encodedOriginal.ReplaceAll( [/'/g,/"/g,/=/g,/</g,/>/g,/ /g,/ /g,/'/g], ["'",'"','=','<','>','\r','\n','&'] ) ;162 }163 -
FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck.js
r225 r245 214 214 format ) ; 215 215 216 // Restore protected attributes. 217 data = FCK.ProtectEventsRestore( data ) ; 218 216 219 if ( FCKBrowserInfo.IsIE ) 217 220 data = data.replace( FCKRegexLib.ToReplace, '$1' ) ; … … 272 275 }, 273 276 277 // Saves event attributes (like onclick) so they don't get executed while 278 // editing. 279 ProtectEvents : function( html ) 280 { 281 return html.replace( FCKRegexLib.TagsWithEvent, _FCK_ProtectEvents_ReplaceTags ) ; 282 }, 283 284 ProtectEventsRestore : function( html ) 285 { 286 return html.replace( FCKRegexLib.ProtectedEvents, _FCK_ProtectEvents_RestoreEvents ) ; 287 }, 288 274 289 ProtectTags : function( html ) 275 290 { … … 279 294 if ( FCKBrowserInfo.IsIE ) 280 295 sTags += sTags.length > 0 ? '|ABBR' : 'ABBR' ; 281 296 282 297 var oRegex ; 283 298 if ( sTags.length > 0 ) … … 289 304 html = html.replace( oRegex, '<\/FCK:$1>' ) ; 290 305 } 291 306 292 307 // Protect some empty elements. We must do it separately becase the 293 308 // original tag may not contain the closing slash, like <hr>: … … 325 340 // Fix for invalid self-closing tags (see #152). 326 341 data = data.replace( FCKRegexLib.InvalidSelfCloseTags, '$1></$2>' ) ; 327 342 343 // Protect event attributes (they could get fired in the editing area). 344 data = FCK.ProtectEvents( data ) ; 345 328 346 // Protect some things from the browser itself. 329 347 data = FCK.ProtectUrls( data ) ; … … 570 588 FCK.SetHTML = FCK.SetData ; 571 589 590 // Replace all events attributes (like onclick). 591 function _FCK_ProtectEvents_ReplaceTags( tagMatch ) 592 { 593 return tagMatch.replace( FCKRegexLib.EventAttributes, _FCK_ProtectEvents_ReplaceEvents ) ; 594 } 595 596 // Replace an event attribute with its respective __fckprotectedatt attribute. 597 // The original event markup will be encoded and saved as the value of the new 598 // attribute. 599 function _FCK_ProtectEvents_ReplaceEvents( eventMatch, attName ) 600 { 601 return ' ' + attName + '_fckprotectedatt="' + eventMatch.ReplaceAll( [/&/g,/'/g,/"/g,/=/g,/</g,/>/g,/\r/g,/\n/g], [''',''','"','=','<','>',' ',' '] ) + '"' ; 602 } 603 604 function _FCK_ProtectEvents_RestoreEvents( match, encodedOriginal ) 605 { 606 return encodedOriginal.ReplaceAll( [/'/g,/"/g,/=/g,/</g,/>/g,/ /g,/ /g,/'/g], ["'",'"','=','<','>','\r','\n','&'] ) ; 607 } 608 572 609 function _FCK_EditingArea_OnLoad() 573 610 { -
FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck_gecko.js
r187 r245 155 155 // Firefox can't handle correctly the editing of the STRONG and EM tags. 156 156 // We must replace them with B and I. 157 html = html.replace( FCKRegexLib.StrongOpener, '<b$1' ) ;158 html = html.replace( FCKRegexLib.StrongCloser, '<\/b>' ) ;159 html = html.replace( FCKRegexLib.EmOpener, '<i$1' ) ;160 html = html.replace( FCKRegexLib.EmCloser, '<\/i>' ) ;157 html = html.replace( FCKRegexLib.StrongOpener, '<b$1' ) ; 158 html = html.replace( FCKRegexLib.StrongCloser, '<\/b>' ) ; 159 html = html.replace( FCKRegexLib.EmOpener, '<i$1' ) ; 160 html = html.replace( FCKRegexLib.EmCloser, '<\/i>' ) ; 161 161 162 162 // Delete the actual selection. -
FCKeditor/branches/features/dataprocessor/editor/_source/internals/fck_ie.js
r225 r245 357 357 if ( url.length > 0 ) 358 358 { 359 // If there are several images, and you try to link each one, all the images get inside the link: 360 // <img><img> -> <a><img></a><img> -> <a><img><img></a> due to the call to 'CreateLink' (bug in IE) 361 if (FCKSelection.GetType() == 'Control') 362 { 363 // Create a link 364 var oLink = this.EditorDocument.createElement( 'A' ) ; 365 oLink.href = url ; 366 367 // Get the selected object 368 var oControl = FCKSelection.GetSelectedElement() ; 369 // Put the link just before the object 370 oControl.parentNode.insertBefore(oLink, oControl) ; 371 // Move the object inside the link 372 oControl.parentNode.removeChild( oControl ) ; 373 oLink.appendChild( oControl ) ; 374 375 return oLink ; 376 } 377 359 378 // Generate a temporary name for the link. 360 379 var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ; -
FCKeditor/branches/features/dataprocessor/editor/css/fck_internal.css
r225 r245 43 43 .FCK__Flash 44 44 { 45 border: darkgray1px solid;45 border: #a9a9a9 1px solid; 46 46 background-position: center center; 47 47 background-image: url(images/fck_flashlogo.gif); … … 67 67 { 68 68 border: 1px dotted #00F; 69 background-position: 1 center;69 background-position: 1px center; 70 70 background-image: url(images/fck_anchor.gif); 71 71 background-repeat: no-repeat; -
FCKeditor/branches/features/dataprocessor/editor/dialog/fck_listprop.html
r132 r245 61 61 { 62 62 if ( oActiveEl.getAttribute('type') ) 63 oActiveSel.value = oActiveEl.getAttribute('type') .toLowerCase();63 oActiveSel.value = oActiveEl.getAttribute('type') ; 64 64 } 65 65 -
FCKeditor/branches/features/dataprocessor/editor/plugins/bbcode/fckplugin.js
r225 r245 100 100 */ 101 101 FixHtml : function( html ) 102 {} 102 { 103 return html ; 104 } 103 105 } ; 104 106
Note: See TracChangeset
for help on using the changeset viewer.
