Update VE core submodule to master (cdfd84e)

New changes:
c02ea46 Clarify documentation of directionality methods
43c9b6f Move initialisation browser support checking from downstream
c89be66 Localisation updates from https://translatewiki.net.
5fb7907 Follow-up c89be66: Fix build for added language 'nan'
fc74fab dm.ElementLinearData.compareElements: Add a few missed test cases

Local changes:
Use initialisation browser support checking from upstream

Depends-On: I27a8e7b4376647f01cee648de987dc3ca6a060d5
Change-Id: I3fc79422ee5e487cf5fae3929fe492f21cd2840a
This commit is contained in:
James D. Forrester 2016-02-16 11:20:04 -08:00
parent 0f2ef11ca3
commit cebaacb546
5 changed files with 19 additions and 38 deletions

View file

@ -68,6 +68,7 @@
"ve.init", "ve.init",
"ve.init.Platform", "ve.init.Platform",
"ve.init.Target", "ve.init.Target",
"window.VisualEditorSupportCheck",
"ve.init.sa*" "ve.init.sa*"
] ]
}, },

View file

@ -123,6 +123,9 @@
<!-- papaparse --> <!-- papaparse -->
<script src="lib/ve/lib/papaparse/papaparse.js"></script> <script src="lib/ve/lib/papaparse/papaparse.js"></script>
<!-- visualEditor.supportCheck -->
<script src="lib/ve/src/init/ve.init.SupportCheck.js"></script>
<!-- unicodejs --> <!-- unicodejs -->
<script src="lib/ve/lib/unicodejs/unicodejs.js"></script> <script src="lib/ve/lib/unicodejs/unicodejs.js"></script>

View file

@ -246,6 +246,13 @@
"mobile" "mobile"
] ]
}, },
"ext.visualEditor.supportCheck": {
"scripts": "lib/ve/src/init/ve.init.SupportCheck.js",
"targets": [
"desktop",
"mobile"
]
},
"ext.visualEditor.desktopArticleTarget.init": { "ext.visualEditor.desktopArticleTarget.init": {
"class": "VisualEditorDesktopArticleTargetInitModule", "class": "VisualEditorDesktopArticleTargetInitModule",
"scripts": "modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js", "scripts": "modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js",
@ -268,6 +275,7 @@
"mediawiki.util", "mediawiki.util",
"mediawiki.api.options", "mediawiki.api.options",
"user.options", "user.options",
"ext.visualEditor.supportCheck",
"ext.visualEditor.track" "ext.visualEditor.track"
], ],
"messages": [ "messages": [
@ -845,7 +853,8 @@
"rangefix", "rangefix",
"papaparse", "papaparse",
"jquery.client", "jquery.client",
"ext.visualEditor.base" "ext.visualEditor.base",
"ext.visualEditor.supportCheck"
], ],
"messages": [ "messages": [
"visualeditor", "visualeditor",

2
lib/ve

@ -1 +1 @@
Subproject commit 33d090bc4e15e7936c3ac31956d8f0375c50b709 Subproject commit cdfd84ea545250dfcc28bdfec011d808cc748951

View file

@ -21,7 +21,7 @@
*/ */
( function () { ( function () {
var conf, tabMessages, uri, pageExists, viewUri, veEditUri, isViewPage, isEditPage, var conf, tabMessages, uri, pageExists, viewUri, veEditUri, isViewPage, isEditPage,
pageCanLoadVE, init, support, targetPromise, enable, tempdisable, autodisable, pageCanLoadVE, init, targetPromise, enable, tempdisable, autodisable,
tabPreference, userPrefEnabled, initialWikitext, oldid, multipleSectionEditLinks, tabPreference, userPrefEnabled, initialWikitext, oldid, multipleSectionEditLinks,
active = false, active = false,
progressStep = 0, progressStep = 0,
@ -303,36 +303,7 @@
veEditUri.extend( { oldid: oldid } ); veEditUri.extend( { oldid: oldid } );
} }
support = {
es5: !!(
// It would be much easier to do a quick inline function that asserts "use strict"
// works, but since IE9 doesn't support strict mode (and we don't use strict mode) we
// have to instead list all the ES5 features we do use.
Array.isArray &&
Array.prototype.filter &&
Array.prototype.indexOf &&
Array.prototype.map &&
Date.now &&
Date.prototype.toJSON &&
Object.create &&
Object.keys &&
String.prototype.trim &&
window.JSON &&
JSON.parse &&
JSON.stringify &&
Function.prototype.bind
),
contentEditable: 'contentEditable' in document.createElement( 'div' ),
svg: !!(
document.createElementNS &&
document.createElementNS( 'http://www.w3.org/2000/svg', 'svg' ).createSVGRect
)
};
init = { init = {
support: support,
blacklist: conf.blacklist, blacklist: conf.blacklist,
/** /**
@ -628,11 +599,6 @@
} }
}; };
support.visualEditor = support.es5 &&
support.contentEditable &&
support.svg &&
( ( 'vewhitelist' in uri.query ) || !$.client.test( init.blacklist, null, true ) );
// Cast "0" (T89513) // Cast "0" (T89513)
enable = Number( mw.user.options.get( 'visualeditor-enable' ) ); enable = Number( mw.user.options.get( 'visualeditor-enable' ) );
tempdisable = Number( mw.user.options.get( 'visualeditor-betatempdisable' ) ); tempdisable = Number( mw.user.options.get( 'visualeditor-betatempdisable' ) );
@ -656,7 +622,9 @@
// Whether VisualEditor should be available for the current user, page, wiki, mediawiki skin, // Whether VisualEditor should be available for the current user, page, wiki, mediawiki skin,
// browser etc. // browser etc.
init.isAvailable = ( init.isAvailable = (
support.visualEditor && window.VisualEditorSupportCheck() &&
( ( 'vewhitelist' in uri.query ) || !$.client.test( init.blacklist, null, true ) ) &&
// Only in supported skins // Only in supported skins
$.inArray( mw.config.get( 'skin' ), conf.skins ) !== -1 && $.inArray( mw.config.get( 'skin' ), conf.skins ) !== -1 &&