https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113542
Revision: 113542
Author: inez
Date: 2012-03-09 23:15:23 +0000 (Fri, 09 Mar 2012)
Log Message:
-----------
Make ContentObserver pass information about content when emiting change event.
Modified Paths:
--------------
trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.ContentObserver.js
Modified: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.ContentObserver.js
===================================================================
--- trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.ContentObserver.js
2012-03-09 23:13:40 UTC (rev 113541)
+++ trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.ContentObserver.js
2012-03-09 23:15:23 UTC (rev 113542)
@@ -38,12 +38,17 @@
};
ve.ce.ContentObserver.prototype.poll = function() {
- console.log(this.$node[0]);
var text = ve.ce.Surface.getDOMText2( this.$node[0] );
var hash = ve.ce.Surface.getDOMHash( this.$node[0] );
if ( text !== this.prevText || hash !== this.prevHash ) {
- this.emit('change');
+ this.emit('change', {
+ $node: this.$node,
+ prevText: this.prevText,
+ text: text,
+ prevHash: this.prevHash,
+ hash: hash
+ } );
this.prevText = text;
this.prevHash = hash;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs