Merge "Replace $wgVisualEditorSupportedSkins with a check for required elements"

This commit is contained in:
jenkins-bot 2017-03-29 23:14:53 +00:00 committed by Gerrit Code Review
commit da05545faf
3 changed files with 14 additions and 12 deletions

View file

@ -592,7 +592,6 @@ class VisualEditorHooks {
'requirements' => [
'javascript' => true,
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
'skins' => $veConfig->get( 'VisualEditorSupportedSkins' ),
]
];
@ -610,7 +609,6 @@ class VisualEditorHooks {
'requirements' => [
'javascript' => true,
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
'skins' => $veConfig->get( 'VisualEditorSupportedSkins' ),
],
'exempt-from-auto-enrollment' => true
];
@ -715,7 +713,6 @@ class VisualEditorHooks {
],
'galleryOptions' => $coreConfig->get( 'GalleryOptions' ),
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
'skins' => $veConfig->get( 'VisualEditorSupportedSkins' ),
'tabPosition' => $veConfig->get( 'VisualEditorTabPosition' ),
'tabMessages' => $veConfig->get( 'VisualEditorTabMessages' ),
'singleEditTab' => $veConfig->get( 'VisualEditorUseSingleEditTab' ),

View file

@ -37,13 +37,6 @@
"VisualEditorFeedbackTitle": false,
"VisualEditorSerializationCacheTimeout": 3600,
"VisualEditorUseChangeTagging": true,
"VisualEditorSupportedSkins": [
"vector",
"apex",
"monobook",
"minerva",
"blueprint"
],
"VisualEditorParsoidPrefix": "localhost",
"VisualEditorParsoidDomain": "localhost",
"VisualEditorDisableForAnons": false,

View file

@ -21,7 +21,7 @@
*/
( function () {
var conf, tabMessages, uri, pageExists, viewUri, veEditUri, veEditSourceUri, isViewPage, isEditPage,
pageCanLoadEditor, init, targetPromise, enable, tempdisable, autodisable,
pageCanLoadEditor, init, targetPromise, enable, tempdisable, autodisable, requiredSkinElements,
tabPreference, userPrefEnabled, userPrefPreferShow, initialWikitext, oldid,
isLoading,
editModes = {
@ -755,6 +755,18 @@
veEditUri.extend( { oldid: oldid } );
}
requiredSkinElements =
$( '#content' ).length &&
$( '#mw-content-text' ).length &&
$( '#ca-edit' ).length;
if ( pageCanLoadEditor && !requiredSkinElements ) {
mw.log.warn(
'Your skin is incompatible with VisualEditor. ' +
'See <https://www.mediawiki.org/wiki/VisualEditor/Skin_requirements> for the requirements.'
);
}
// Whether VisualEditor should be available for the current user, page, wiki, mediawiki skin,
// browser etc.
init.isAvailable = (
@ -764,7 +776,7 @@
( ( 'vewhitelist' in uri.query ) || !$.client.test( init.blacklist, null, true ) ) &&
// Only in supported skins
conf.skins.indexOf( mw.config.get( 'skin' ) ) !== -1 &&
requiredSkinElements &&
// Not on pages which are outputs of the Translate extensions
// TODO: Allow the Translate extension to do this itself