https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112865
Revision: 112865
Author: christian
Date: 2012-03-02 01:12:18 +0000 (Fri, 02 Mar 2012)
Log Message:
-----------
event binding cleanup
Modified Paths:
--------------
trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js
Modified: trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js
===================================================================
--- trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js
2012-03-02 01:02:41 UTC (rev 112864)
+++ trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js
2012-03-02 01:12:18 UTC (rev 112865)
@@ -42,27 +42,31 @@
}
} );
+ this.$
+ .on( 'cut copy', function( e ) {
+ _this.onCutCopy( e );
+ } )
+ .on( 'paste', function( e ) {
+ _this.onPaste( e );
+ } )
+ .on( 'mousedown', function( e ) {
+ // return _this.onMouseDown( e );
+ } )
+ .on( 'compositionstart', function( e ) {
+ console.log('comp start');
+ _this.onCompositionStart( e );
+ } )
+ .on( 'compositionend', function( e ) {
+ console.log('comp end');
+ _this.onCompositionEnd( e );
+ } )
+ .on('dragover drop', function( e ) {
+ e.preventDefault();
+ });
- this.$.on('cut copy', function( e ) {
- _this.onCutCopy( e );
- } );
-
- this.$.on('paste', function( e ) {
- _this.onPaste( e );
- } );
-
- this.$.mousedown( function(e) {
-// return _this.onMouseDown( e );
- } );
-
// Initialization
this.documentView.renderContent();
- // Prevent dragging text
- this.$.bind('dragover drop', function(e) {
- e.preventDefault();
- });
-
this.poll = {
interval: null,
frequency: 100,
@@ -73,19 +77,11 @@
compositionStart: null,
compositionEnd: null
};
-
- document.addEventListener( 'compositionstart', function( e ) {
- _this.onCompositionStart( e );
- } );
- document.addEventListener( 'compositionend', function( e ) {
- _this.onCompositionEnd( e );
- } );
};
/* Methods */
ve.es.Surface.prototype.onCutCopy = function( e ) {
- console.log('cut/copy');
var _this = this,
rangySel = rangy.getSelection(),
key = rangySel.getRangeAt(0).toString().replace(/\s/gm,"");
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs