Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/155797

Change subject: Remove broken ve.isMsie() function
......................................................................

Remove broken ve.isMsie() function

It didn't detect IE11, which is all we care about right now.
Also removed selection fixup code in ve.ce.Surface that was dead
code because it was using ve.isMsie(): it doesn't appear to
be needed, at least in IE11.

Change-Id: Id88c688522fb67ebb45ebec324970c557a6ab60a
---
M src/ce/ve.ce.Surface.js
M src/ve.js
2 files changed, 0 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/97/155797/1

diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 430b1d5..25b8357 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -778,25 +778,6 @@
  * @param {jQuery.Event} e Key press event
  */
 ve.ce.Surface.prototype.onDocumentKeyPress = function ( e ) {
-       var selection, prevNode, documentModel = this.model.getDocument();
-
-       // Prevent IE from editing Aliens/Entities
-       // This is for cases like <p><div>alien</div></p>, to put the cursor 
outside
-       // the alien tag.
-       if ( ve.isMsie === true ) {
-               selection = this.model.getSelection();
-               if ( selection.start !== 0 && selection.isCollapsed() ) {
-                       prevNode = 
documentModel.getDocumentNode().getNodeFromOffset( selection.start - 1 );
-                       if (
-                               !this.documentView.getSlugAtOffset( 
selection.start ) &&
-                               prevNode.isContent() &&
-                               documentModel.data.isCloseElementData( 
selection.start - 1 )
-                       ) {
-                               this.model.setSelection( new ve.Range( 
selection.start ) );
-                       }
-               }
-       }
-
        // Filter out non-character keys. Doing this prevents:
        // * Unexpected content deletion when selection is not collapsed and 
the user presses, for
        //   example, the Home key (Firefox fires 'keypress' for it)
diff --git a/src/ve.js b/src/ve.js
index d69f930..5f9df57 100644
--- a/src/ve.js
+++ b/src/ve.js
@@ -934,13 +934,6 @@
        }() );
 
        /**
-        * DEPRECATED: Detect Internet Explorer
-        *
-        * Code still using this should be fixed to use specific feature 
detection.
-        */
-       ve.isMsie = navigator.userAgent.indexOf( 'MSIE' ) !== -1;
-
-       /**
         * Get the client platform string from the browser.
         *
         * HACK: This is a wrapper for calling getSystemPlatform() on the 
current platform

-- 
To view, visit https://gerrit.wikimedia.org/r/155797
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id88c688522fb67ebb45ebec324970c557a6ab60a
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to