Changeset 703
- Timestamp:
- 2007-08-22 18:53:08 (16 months ago)
- Location:
- FCKeditor/trunk/editor
- Files:
-
- 3 modified
-
dialog/fck_link/fck_link.js (modified) (3 diffs)
-
_source/internals/fck.js (modified) (1 diff)
-
_source/internals/fcktools.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/dialog/fck_link/fck_link.js
r694 r703 231 231 { 232 232 // Decode the protected string 233 onclick = FCKTools.DecodeHex( onclick ) ;233 onclick = decodeURIComponent( onclick ) ; 234 234 235 235 oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ; … … 564 564 onclick = BuildOnClickPopup() ; 565 565 // Encode the attribute 566 onclick = FCKTools.EncodeToHex( " onclick=\"" + onclick + "\"" ) ;566 onclick = encodeURIComponent( " onclick=\"" + onclick + "\"" ) ; 567 567 SetAttribute( oLink, 'onclick_fckprotectedatt', onclick ) ; 568 568 } … … 575 575 { 576 576 // Decode the protected string 577 onclick = FCKTools.DecodeHex( onclick ) ;577 onclick = decodeURIComponent( onclick ) ; 578 578 579 579 if( oRegex.OnClickPopup.test( onclick ) ) -
FCKeditor/trunk/editor/_source/internals/fck.js
r694 r703 755 755 function _FCK_ProtectEvents_ReplaceEvents( eventMatch, attName ) 756 756 { 757 return ' ' + attName + '_fckprotectedatt="' + FCKTools.EncodeToHex( eventMatch ) + '"' ;757 return ' ' + attName + '_fckprotectedatt="' + encodeURIComponent( eventMatch ) + '"' ; 758 758 } 759 759 760 760 function _FCK_ProtectEvents_RestoreEvents( match, encodedOriginal ) 761 761 { 762 return FCKTools.DecodeHex( encodedOriginal ) ;762 return decodeURIComponent( encodedOriginal ) ; 763 763 } 764 764 -
FCKeditor/trunk/editor/_source/internals/fcktools.js
r666 r703 417 417 } 418 418 419 FCKTools.EncodeToHex = function( str )420 {421 var symbols = FCKListsLib.HexList ;422 var output = [] ;423 // assume code points are 16-bits424 for ( var i = 0 ; i < str.length ; i++ )425 {426 var c = str.charCodeAt( i ) ;427 var lsn = c & 0x000f ;428 var second = ( c & 0x00f0 ) >> 4 ;429 var third = ( c & 0x0f00 ) >> 8 ;430 var msn = ( c & 0xf000 ) >> 12 ;431 output.push( [ symbols[msn], symbols[third], symbols[second], symbols[lsn] ].join( "" ) ) ;432 }433 return output.join( "" ) ;434 }435 436 FCKTools.DecodeHex = function( hexstr )437 {438 if ( hexstr.length % 4 != 0 )439 throw "FCKTools.DecodeHex(): hexstr length must be multiple of 4." ;440 441 var symbols = FCKListsLib.HexMap ;442 var output = [] ;443 for ( var i = 0 ; i < hexstr.length ; i+=4 )444 {445 var codePoint = symbols[ hexstr.charAt( i ) ] << 12 ;446 codePoint |= symbols[ hexstr.charAt( i + 1 ) ] << 8 ;447 codePoint |= symbols[ hexstr.charAt( i + 2 ) ] << 4 ;448 codePoint |= symbols[ hexstr.charAt( i + 3 ) ] ;449 output.push( String.fromCharCode( codePoint ) ) ;450 }451 return output.join( "" ) ;452 }453 454 419 FCKTools.GetDocumentPosition = function( w, node ) 455 420 {