Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -216,28 +216,32 @@ |
217 | 217 | /* Event Handlers */ |
218 | 218 | context.evt = { |
219 | 219 | 'change': function( event ) { |
220 | | - // BTW: context is in event.data.context |
221 | | - |
222 | 220 | switch ( event.type ) { |
223 | 221 | case 'keypress': |
224 | | - if ( /* something interesting was deleted */ false ) { |
225 | | - //console.log( 'MAJOR CHANGE' ); |
| 222 | + if ( /* TODO: test if something interesting was deleted */ true ) { |
| 223 | + event.data.scope = 'division'; |
226 | 224 | } else { |
227 | | - //console.log( 'MINOR CHANGE' ); |
| 225 | + event.data.scope = 'character'; |
228 | 226 | } |
229 | 227 | break; |
230 | 228 | case 'mousedown': // FIXME: mouseup? |
231 | | - if ( /* text was dragged and dropped */ false ) { |
232 | | - //console.log( 'MAJOR CHANGE' ); |
| 229 | + if ( /* TODO: test if text was dragged and dropped */ true ) { |
| 230 | + event.data.scope = 'division'; |
233 | 231 | } else { |
234 | | - //console.log( 'MINOR CHANGE' ); |
| 232 | + event.data.scope = 'none'; |
235 | 233 | } |
236 | 234 | break; |
237 | 235 | default: |
238 | | - //console.log( 'MAJOR CHANGE' ); |
| 236 | + event.data.scope = 'division'; |
239 | 237 | break; |
240 | 238 | } |
241 | | - |
| 239 | + if ( event.data.scope !== 'none' ) { |
| 240 | + for ( module in $.wikiEditor.modules ) { |
| 241 | + if ( 'evt' in $.wikiEditor.modules[module] && 'change' in $.wikiEditor.modules[module].evt ) { |
| 242 | + $.wikiEditor.modules[module].evt.change( context, event ); |
| 243 | + } |
| 244 | + } |
| 245 | + } |
242 | 246 | } |
243 | 247 | }; |
244 | 248 | |