mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Let the feedback tool be configured for a remote wiki
Bug: T92661 Change-Id: Id48729c89db208714f67fec1eabafe577a834b51
This commit is contained in:
parent
29f33a57d5
commit
705199753c
|
@ -587,6 +587,8 @@ class VisualEditorHooks {
|
|||
'specialBooksources' => urldecode( SpecialPage::getTitleFor( 'Booksources' )->getPrefixedURL() ),
|
||||
'restbaseUrl' => $coreConfig->get( 'VisualEditorRestbaseURL' ),
|
||||
'fullRestbaseUrl' => $coreConfig->get( 'VisualEditorFullRestbaseURL' ),
|
||||
'feedbackApiUrl' => $veConfig->get( 'VisualEditorFeedbackAPIURL' ),
|
||||
'feedbackTitle' => $veConfig->get( 'VisualEditorFeedbackTitle' ),
|
||||
);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
},
|
||||
"VisualEditorRestbaseURL": false,
|
||||
"VisualEditorFullRestbaseURL": false,
|
||||
"VisualEditorFeedbackAPIURL": false,
|
||||
"VisualEditorFeedbackTitle": false,
|
||||
"VisualEditorSerializationCacheTimeout": 3600,
|
||||
"VisualEditorUseChangeTagging": true,
|
||||
"VisualEditorSupportedSkins": [
|
||||
|
|
|
@ -179,14 +179,26 @@ ve.ui.MWHelpPopupTool.prototype.onFeedbackClick = function () {
|
|||
this.popup.toggle( false );
|
||||
if ( !this.feedbackPromise ) {
|
||||
this.feedbackPromise = mw.loader.using( 'mediawiki.feedback' ).then( function () {
|
||||
var feedbackConfig, veConfig;
|
||||
|
||||
// This can't be constructed until the editor has loaded as it uses special messages
|
||||
return new mw.Feedback( {
|
||||
title: new mw.Title( ve.msg( 'visualeditor-feedback-link' ) ),
|
||||
feedbackConfig = {
|
||||
bugsLink: new mw.Uri( 'https://phabricator.wikimedia.org/maniphest/task/create/?projects=VisualEditor' ),
|
||||
bugsListLink: new mw.Uri( 'https://phabricator.wikimedia.org/maniphest/query/eSHgNozkIsuv/' ),
|
||||
showUseragentCheckbox: true,
|
||||
useragentCheckboxMandatory: true
|
||||
} );
|
||||
};
|
||||
|
||||
// If so configured, tell mw.feedback that we're posting to a remote wiki and set the title
|
||||
veConfig = mw.config.get( 'wgVisualEditorConfig' );
|
||||
if ( veConfig.feedbackApiUrl ) {
|
||||
feedbackConfig.apiUrl = veConfig.feedbackApiUrl;
|
||||
feedbackConfig.title = new mw.Title( veConfig.feedbackTitle );
|
||||
} else {
|
||||
feedbackConfig.title = new mw.Title( ve.msg( 'visualeditor-feedback-link' ) );
|
||||
}
|
||||
|
||||
return new mw.Feedback( feedbackConfig );
|
||||
} );
|
||||
}
|
||||
this.feedbackPromise.done( function ( feedback ) {
|
||||
|
|
Loading…
Reference in a new issue