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' => [
|
'requirements' => [
|
||||||
'javascript' => true,
|
'javascript' => true,
|
||||||
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
|
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
|
||||||
'skins' => $veConfig->get( 'VisualEditorSupportedSkins' ),
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -610,7 +609,6 @@ class VisualEditorHooks {
|
||||||
'requirements' => [
|
'requirements' => [
|
||||||
'javascript' => true,
|
'javascript' => true,
|
||||||
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
|
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
|
||||||
'skins' => $veConfig->get( 'VisualEditorSupportedSkins' ),
|
|
||||||
],
|
],
|
||||||
'exempt-from-auto-enrollment' => true
|
'exempt-from-auto-enrollment' => true
|
||||||
];
|
];
|
||||||
|
@ -715,7 +713,6 @@ class VisualEditorHooks {
|
||||||
],
|
],
|
||||||
'galleryOptions' => $coreConfig->get( 'GalleryOptions' ),
|
'galleryOptions' => $coreConfig->get( 'GalleryOptions' ),
|
||||||
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
|
'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ),
|
||||||
'skins' => $veConfig->get( 'VisualEditorSupportedSkins' ),
|
|
||||||
'tabPosition' => $veConfig->get( 'VisualEditorTabPosition' ),
|
'tabPosition' => $veConfig->get( 'VisualEditorTabPosition' ),
|
||||||
'tabMessages' => $veConfig->get( 'VisualEditorTabMessages' ),
|
'tabMessages' => $veConfig->get( 'VisualEditorTabMessages' ),
|
||||||
'singleEditTab' => $veConfig->get( 'VisualEditorUseSingleEditTab' ),
|
'singleEditTab' => $veConfig->get( 'VisualEditorUseSingleEditTab' ),
|
||||||
|
|
|
@ -37,13 +37,6 @@
|
||||||
"VisualEditorFeedbackTitle": false,
|
"VisualEditorFeedbackTitle": false,
|
||||||
"VisualEditorSerializationCacheTimeout": 3600,
|
"VisualEditorSerializationCacheTimeout": 3600,
|
||||||
"VisualEditorUseChangeTagging": true,
|
"VisualEditorUseChangeTagging": true,
|
||||||
"VisualEditorSupportedSkins": [
|
|
||||||
"vector",
|
|
||||||
"apex",
|
|
||||||
"monobook",
|
|
||||||
"minerva",
|
|
||||||
"blueprint"
|
|
||||||
],
|
|
||||||
"VisualEditorParsoidPrefix": "localhost",
|
"VisualEditorParsoidPrefix": "localhost",
|
||||||
"VisualEditorParsoidDomain": "localhost",
|
"VisualEditorParsoidDomain": "localhost",
|
||||||
"VisualEditorDisableForAnons": false,
|
"VisualEditorDisableForAnons": false,
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
( function () {
|
( function () {
|
||||||
var conf, tabMessages, uri, pageExists, viewUri, veEditUri, veEditSourceUri, isViewPage, isEditPage,
|
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,
|
tabPreference, userPrefEnabled, userPrefPreferShow, initialWikitext, oldid,
|
||||||
isLoading,
|
isLoading,
|
||||||
editModes = {
|
editModes = {
|
||||||
|
@ -755,6 +755,18 @@
|
||||||
veEditUri.extend( { oldid: oldid } );
|
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,
|
// Whether VisualEditor should be available for the current user, page, wiki, mediawiki skin,
|
||||||
// browser etc.
|
// browser etc.
|
||||||
init.isAvailable = (
|
init.isAvailable = (
|
||||||
|
@ -764,7 +776,7 @@
|
||||||
( ( 'vewhitelist' in uri.query ) || !$.client.test( init.blacklist, null, true ) ) &&
|
( ( 'vewhitelist' in uri.query ) || !$.client.test( init.blacklist, null, true ) ) &&
|
||||||
|
|
||||||
// Only in supported skins
|
// Only in supported skins
|
||||||
conf.skins.indexOf( mw.config.get( 'skin' ) ) !== -1 &&
|
requiredSkinElements &&
|
||||||
|
|
||||||
// Not on pages which are outputs of the Translate extensions
|
// Not on pages which are outputs of the Translate extensions
|
||||||
// TODO: Allow the Translate extension to do this itself
|
// TODO: Allow the Translate extension to do this itself
|
||||||
|
|
Loading…
Reference in a new issue