mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Fixes to permaturely merged browser compatibility checks
See comments on Idc5f4a23a2709264d869a9 Bug: 38128 Change-Id: Ic38992e04b5f3932cf18f2dfc217cd733196efb8
This commit is contained in:
parent
03f56f7852
commit
0b14b0da66
|
@ -23,8 +23,7 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() {
|
|||
'use strict';
|
||||
return this === undefined;
|
||||
}() ),
|
||||
// TODO: MW test runner fires before document.body exists, so we just skip it here.
|
||||
supportsContentEditable = document.body && 'contentEditable' in document.body;
|
||||
supportsContentEditable = 'contentEditable' in document.createElement( 'div' );
|
||||
|
||||
// Parent constructor
|
||||
ve.init.mw.Target.call(
|
||||
|
@ -77,12 +76,14 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() {
|
|||
this.tabLayout = 'replace';
|
||||
|
||||
browserWhitelisted = (
|
||||
$.client.test( ve.init.mw.ViewPageTarget.compatibility, null, true ) ||
|
||||
'vewhitelist' in currentUri.query
|
||||
currentUri.query.vewhitelist !== undefined ?
|
||||
currentUri.query.vewhitelist === '1' :
|
||||
$.client.test( ve.init.mw.ViewPageTarget.compatibility.whitelist, null, true )
|
||||
);
|
||||
browserBlacklisted = (
|
||||
$.client.test( ve.init.mw.ViewPageTarget.compatibility, null, true ) ||
|
||||
'veblacklist' in currentUri.query
|
||||
currentUri.query.veblacklist !== undefined ?
|
||||
currentUri.query.veblacklist === '1' :
|
||||
$.client.test( ve.init.mw.ViewPageTarget.compatibility.blacklist, null, true )
|
||||
);
|
||||
|
||||
// Events
|
||||
|
@ -100,8 +101,8 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() {
|
|||
} );
|
||||
|
||||
// Initialization
|
||||
if ( supportsStrictMode && supportsContentEditable && !this.browserBlacklisted ) {
|
||||
if ( !this.browserWhitelisted || true ) {
|
||||
if ( supportsStrictMode && supportsContentEditable && !browserBlacklisted ) {
|
||||
if ( !browserWhitelisted ) {
|
||||
// show warning
|
||||
this.localNoticeMessages.push( 'visualeditor-browserwarning' );
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ ve.init.mw.Target.onLoad = function ( response ) {
|
|||
* @static
|
||||
* @method
|
||||
*/
|
||||
ve.init.mw.Target.onNoticesReady = function() {
|
||||
ve.init.mw.Target.onNoticesReady = function () {
|
||||
var i, len, noticeHtmls, tmp, el;
|
||||
|
||||
// Since we're going to parse them, we might as well save these nodes
|
||||
|
@ -195,7 +195,7 @@ ve.init.mw.Target.onNoticesReady = function() {
|
|||
document.body.appendChild( tmp );
|
||||
|
||||
// Merge locally and remotely generated notices
|
||||
noticeHtmls = this.remoteNotices;
|
||||
noticeHtmls = this.remoteNotices.slice( 0 );
|
||||
for ( i = 0, len = this.localNoticeMessages.length; i < len; i++ ) {
|
||||
noticeHtmls.push(
|
||||
'<p>' + ve.init.platform.getParsedMessage( this.localNoticeMessages[i] ) + '</p>'
|
||||
|
|
Loading…
Reference in a new issue