[MediaWiki-commits] [Gerrit] Only listen for copy/paste on documentNode and pasteTarget - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Only listen for copy/paste on documentNode and pasteTarget .. Only listen for copy/paste on documentNode and pasteTarget As these are the only places we want to override the events. Bug: 54375 Change-Id: I8a4e207f38508cdaf35cd869f267dd9f1059c83d (cherry picked from commit 25ae630009b91c9e824f94186732b0a85aa6a626) --- M modules/ve/ce/ve.ce.Surface.js 1 file changed, 7 insertions(+), 9 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js index 99c59ff..5eadc52 100644 --- a/modules/ve/ce/ve.ce.Surface.js +++ b/modules/ve/ce/ve.ce.Surface.js @@ -60,24 +60,22 @@ $documentNode = this.documentView.getDocumentNode().$; $documentNode.on( { + 'cut': ve.bind( this.onCut, this ), + 'copy': ve.bind( this.onCopy, this ), 'focus': ve.bind( this.documentOnFocus, this ), 'blur': ve.bind( this.documentOnBlur, this ) } ); + this.$pasteTarget.on( { + 'cut': ve.bind( this.onCut, this ), + 'copy': ve.bind( this.onCopy, this ) + } ); + $documentNode.on( $.browser.msie ? 'beforepaste' : 'paste', ve.bind( this.onPaste, this ) ); $documentNode.on( 'focus', 'a', function () { // Opera triggers 'blur' on document node before any link is // focused and we don't want that $documentNode.focus(); } ); - this.$document.on( { - 'cut': ve.bind( this.onCut, this ), - 'copy': ve.bind( this.onCopy, this ) - } ); - if ( $.browser.msie ) { - this.$document.on( 'beforepaste', ve.bind( this.onPaste, this ) ); - } else { - this.$document.on( 'paste', ve.bind( this.onPaste, this ) ); - } this.$.on( { 'dragover': ve.bind( this.onDocumentDragOver, this ), 'drop': ve.bind( this.onDocumentDrop, this ) -- To view, visit https://gerrit.wikimedia.org/r/85784 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a4e207f38508cdaf35cd869f267dd9f1059c83d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: wmf/1.22wmf18 Gerrit-Owner: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Esanders esand...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Only listen for copy/paste on documentNode and pasteTarget - change (mediawiki...VisualEditor)
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/85204 Change subject: Only listen for copy/paste on documentNode and pasteTarget .. Only listen for copy/paste on documentNode and pasteTarget As these are the only places we want to override the events. Bug: 54375 Change-Id: I8a4e207f38508cdaf35cd869f267dd9f1059c83d --- M modules/ve/ce/ve.ce.Surface.js 1 file changed, 7 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/04/85204/1 diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js index 99c59ff..5eadc52 100644 --- a/modules/ve/ce/ve.ce.Surface.js +++ b/modules/ve/ce/ve.ce.Surface.js @@ -60,24 +60,22 @@ $documentNode = this.documentView.getDocumentNode().$; $documentNode.on( { + 'cut': ve.bind( this.onCut, this ), + 'copy': ve.bind( this.onCopy, this ), 'focus': ve.bind( this.documentOnFocus, this ), 'blur': ve.bind( this.documentOnBlur, this ) } ); + this.$pasteTarget.on( { + 'cut': ve.bind( this.onCut, this ), + 'copy': ve.bind( this.onCopy, this ) + } ); + $documentNode.on( $.browser.msie ? 'beforepaste' : 'paste', ve.bind( this.onPaste, this ) ); $documentNode.on( 'focus', 'a', function () { // Opera triggers 'blur' on document node before any link is // focused and we don't want that $documentNode.focus(); } ); - this.$document.on( { - 'cut': ve.bind( this.onCut, this ), - 'copy': ve.bind( this.onCopy, this ) - } ); - if ( $.browser.msie ) { - this.$document.on( 'beforepaste', ve.bind( this.onPaste, this ) ); - } else { - this.$document.on( 'paste', ve.bind( this.onPaste, this ) ); - } this.$.on( { 'dragover': ve.bind( this.onDocumentDragOver, this ), 'drop': ve.bind( this.onDocumentDrop, this ) -- To view, visit https://gerrit.wikimedia.org/r/85204 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a4e207f38508cdaf35cd869f267dd9f1059c83d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders esand...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Only listen for copy/paste on documentNode and pasteTarget - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Only listen for copy/paste on documentNode and pasteTarget .. Only listen for copy/paste on documentNode and pasteTarget As these are the only places we want to override the events. Bug: 54375 Change-Id: I8a4e207f38508cdaf35cd869f267dd9f1059c83d --- M modules/ve/ce/ve.ce.Surface.js 1 file changed, 7 insertions(+), 9 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js index 99c59ff..5eadc52 100644 --- a/modules/ve/ce/ve.ce.Surface.js +++ b/modules/ve/ce/ve.ce.Surface.js @@ -60,24 +60,22 @@ $documentNode = this.documentView.getDocumentNode().$; $documentNode.on( { + 'cut': ve.bind( this.onCut, this ), + 'copy': ve.bind( this.onCopy, this ), 'focus': ve.bind( this.documentOnFocus, this ), 'blur': ve.bind( this.documentOnBlur, this ) } ); + this.$pasteTarget.on( { + 'cut': ve.bind( this.onCut, this ), + 'copy': ve.bind( this.onCopy, this ) + } ); + $documentNode.on( $.browser.msie ? 'beforepaste' : 'paste', ve.bind( this.onPaste, this ) ); $documentNode.on( 'focus', 'a', function () { // Opera triggers 'blur' on document node before any link is // focused and we don't want that $documentNode.focus(); } ); - this.$document.on( { - 'cut': ve.bind( this.onCut, this ), - 'copy': ve.bind( this.onCopy, this ) - } ); - if ( $.browser.msie ) { - this.$document.on( 'beforepaste', ve.bind( this.onPaste, this ) ); - } else { - this.$document.on( 'paste', ve.bind( this.onPaste, this ) ); - } this.$.on( { 'dragover': ve.bind( this.onDocumentDragOver, this ), 'drop': ve.bind( this.onDocumentDrop, this ) -- To view, visit https://gerrit.wikimedia.org/r/85204 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a4e207f38508cdaf35cd869f267dd9f1059c83d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders esand...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits