mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Merge "Replace $wgVisualEditorSupportedSkins with a check for required elements"
This commit is contained in:
commit
da05545faf
|
@ -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' ),
|
||||
|
|
|
@ -37,13 +37,6 @@
|
|||
"VisualEditorFeedbackTitle": false,
|
||||
"VisualEditorSerializationCacheTimeout": 3600,
|
||||
"VisualEditorUseChangeTagging": true,
|
||||
"VisualEditorSupportedSkins": [
|
||||
"vector",
|
||||
"apex",
|
||||
"monobook",
|
||||
"minerva",
|
||||
"blueprint"
|
||||
],
|
||||
"VisualEditorParsoidPrefix": "localhost",
|
||||
"VisualEditorParsoidDomain": "localhost",
|
||||
"VisualEditorDisableForAnons": false,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue