Changeset 410
- Timestamp:
- 2007-07-05 15:55:49 (17 months ago)
- Location:
- FCKeditor/trunk
- Files:
-
- 3 modified
-
editor/dialog/fck_replace.html (modified) (6 diffs)
-
editor/_source/internals/fckundo.js (modified) (7 diffs)
-
fckconfig.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/dialog/fck_replace.html
r408 r410 33 33 function OnLoad() 34 34 { 35 // First of all, translate the dialog box texts 35 // First of all, translate the dialog box texts. 36 36 oEditor.FCKLanguageManager.TranslatePage( document ) ; 37 37 38 38 window.parent.SetAutoSize( true ) ; 39 40 // Place the cursor at the start of document. 41 // This will be the starting point of our search. 42 var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ; 43 range.SetStart( oEditor.FCK.EditorDocument.body, 1 ) ; 44 range.SetEnd( oEditor.FCK.EditorDocument.body, 1 ) ; 45 range.Collapse( true ) ; 46 range.Select() ; 39 47 } 40 48 … … 141 149 case 0x202f: 142 150 case 0x205f: 143 case 3000:151 case 0x3000: 144 152 return true; 145 153 default: … … 177 185 while ( true ) 178 186 { 179 if ( c == this.Pattern [ this._State ])187 if ( c == this.Pattern.charAt( this._State ) ) 180 188 { 181 189 this._State++ ; … … 309 317 selection.Collapse( false ) ; 310 318 selection.Select() ; 311 oEditor.FCK.EditorDocument.body.normalize() ;312 319 } 313 320 } … … 317 324 oEditor.FCKUndo.SaveUndoStep() ; 318 325 319 var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;320 range.SetStart( oEditor.FCK.EditorDocument.body, 1 ) ;321 range.SetEnd( oEditor.FCK.EditorDocument.body, 1 ) ;322 range.Collapse( true ) ;323 range.Select() ;324 326 var replaceCount = 0 ; 325 327 … … 335 337 if ( replaceCount == 0 ) 336 338 alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ; 337 else338 oEditor.FCK.EditorDocument.body.normalize() ;339 339 window.parent.Cancel() ; 340 340 } -
FCKeditor/trunk/editor/_source/internals/fckundo.js
r405 r410 88 88 // Assume the editor content is changed when SaveUndoStep() is called after the first time. 89 89 // This also enables the undo button in toolbar. 90 if ( FCKUndo.SavedData.length )91 FCKUndo.Changed = true ;90 if ( this.SavedData.length ) 91 this.Changed = true ; 92 92 93 93 // Get the HTML content. … … 95 95 96 96 // Shrink the array to the current level. 97 FCKUndo.SavedData = FCKUndo.SavedData.slice( 0, FCKUndo.CurrentIndex + 1 ) ;97 this.SavedData = this.SavedData.slice( 0, this.CurrentIndex + 1 ) ; 98 98 99 99 // Cancel operation if the new step is identical to the previous one. 100 if ( FCKUndo.CurrentIndex > 0 && sHtml == FCKUndo.SavedData[ FCKUndo.CurrentIndex ][0] )100 if ( this.CurrentIndex > 0 && sHtml == this.SavedData[ this.CurrentIndex ][0] ) 101 101 return ; 102 102 // Save the selection and caret position in the first undo level for the first change. 103 else if ( FCKUndo.CurrentIndex == 0 && sHtml == FCKUndo.SavedData[0][0] )103 else if ( this.CurrentIndex == 0 && sHtml == this.SavedData[0][0] ) 104 104 { 105 FCKUndo.SavedData[0][1] = FCKUndo._GetBookmark() ;105 this.SavedData[0][1] = this._GetBookmark() ; 106 106 return ; 107 107 } … … 109 109 // If we reach the Maximun number of undo levels, we must remove the first 110 110 // entry of the list shifting all elements. 111 if ( FCKUndo.CurrentIndex + 1 >= FCKConfig.MaxUndoLevels )112 FCKUndo.SavedData.shift() ;111 if ( this.CurrentIndex + 1 >= FCKConfig.MaxUndoLevels ) 112 this.SavedData.shift() ; 113 113 else 114 FCKUndo.CurrentIndex++ ;114 this.CurrentIndex++ ; 115 115 116 116 // Save the new level in front of the actual position. 117 FCKUndo.SavedData[ FCKUndo.CurrentIndex ] = [ sHtml, FCKUndo._GetBookmark() ] ;117 this.SavedData[ this.CurrentIndex ] = [ sHtml, this._GetBookmark() ] ; 118 118 119 119 FCK.Events.FireEvent( "OnSelectionChange" ) ; … … 122 122 FCKUndo.CheckUndoState = function() 123 123 { 124 return ( FCKUndo.Changed || FCKUndo.CurrentIndex > 0 ) ;124 return ( this.Changed || this.CurrentIndex > 0 ) ; 125 125 } 126 126 127 127 FCKUndo.CheckRedoState = function() 128 128 { 129 return ( FCKUndo.CurrentIndex < ( FCKUndo.SavedData.length - 1 ) ) ;129 return ( this.CurrentIndex < ( this.SavedData.length - 1 ) ) ; 130 130 } 131 131 132 132 FCKUndo.Undo = function() 133 133 { 134 if ( FCKUndo.CheckUndoState() )134 if ( this.CheckUndoState() ) 135 135 { 136 136 // If it is the first step. 137 if ( FCKUndo.CurrentIndex == ( FCKUndo.SavedData.length - 1 ) )137 if ( this.CurrentIndex == ( this.SavedData.length - 1 ) ) 138 138 { 139 139 // Save the actual state for a possible "Redo" call. 140 FCKUndo.SaveUndoStep() ;140 this.SaveUndoStep() ; 141 141 } 142 142 143 143 // Go a step back. 144 FCKUndo._ApplyUndoLevel( --FCKUndo.CurrentIndex ) ;144 this._ApplyUndoLevel( --this.CurrentIndex ) ; 145 145 146 146 FCK.Events.FireEvent( "OnSelectionChange" ) ; … … 150 150 FCKUndo.Redo = function() 151 151 { 152 if ( FCKUndo.CheckRedoState() )152 if ( this.CheckRedoState() ) 153 153 { 154 154 // Go a step forward. 155 FCKUndo._ApplyUndoLevel( ++FCKUndo.CurrentIndex ) ;155 this._ApplyUndoLevel( ++this.CurrentIndex ) ; 156 156 157 157 FCK.Events.FireEvent( "OnSelectionChange" ) ; … … 161 161 FCKUndo._ApplyUndoLevel = function( level ) 162 162 { 163 var oData = FCKUndo.SavedData[ level ] ;163 var oData = this.SavedData[ level ] ; 164 164 165 165 if ( !oData ) … … 173 173 174 174 // Restore the selection 175 FCKUndo._SelectBookmark( oData[1] ) ;175 this._SelectBookmark( oData[1] ) ; 176 176 177 FCKUndo.TypesCount = 0 ;178 FCKUndo.Changed = false ;179 FCKUndo.Typing = false ;177 this.TypesCount = 0 ; 178 this.Changed = false ; 179 this.Typing = false ; 180 180 } -
FCKeditor/trunk/fckconfig.js
r396 r410 39 39 FCKConfig.FullPage = false ; 40 40 41 FCKConfig.Debug = false ;41 FCKConfig.Debug = true ; 42 42 FCKConfig.AllowQueryStringDebug = true ; 43 43