jenkins-bot has submitted this change and it was merged.

Change subject: TWN: Use own message for terms of use link in license warning 
(editor and talk)
......................................................................


TWN: Use own message for terms of use link in license warning (editor and talk)

The Terms of use link message may have another grammar as the link label used
in editor or talk (in sentence).

Also: Removed useless set of options in talk.js (licenseMsg).

Change-Id: I2d4029456c69e126e7343811a979204f9e5df964
See: 
https://translatewiki.net/w/i.php?title=Thread:Support/MediaWiki:Mobile-frontend-editor-licensing-with-terms/en
---
M i18n/en.json
M i18n/qqq.json
M includes/Resources.php
M javascripts/modules/editor/EditorOverlayBase.js
M javascripts/modules/talk/TalkSectionAddOverlay.js
M javascripts/modules/talk/talk.js
6 files changed, 22 insertions(+), 22 deletions(-)

Approvals:
  Kaldari: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 4a523b7..5a52bbc 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -78,6 +78,7 @@
        "mobile-frontend-editor-keep-editing": "Keep editing",
        "mobile-frontend-editor-licensing": "By saving changes, you agree to 
release your contribution under the $1 license.",
        "mobile-frontend-editor-licensing-with-terms": "By saving changes, you 
agree to the $1 and agree to release your contribution under the $2 license.",
+       "mobile-frontend-editor-terms-link": "[$1 Terms of Use]",
        "mobile-frontend-editor-new-page-confirm": "{{GENDER:$1|Are you sure 
you want to create}} a new page on {{SITENAME}}?",
        "mobile-frontend-editor-newpage-prompt": "This page doesn't exist. Why 
not be bold and create it?",
        "mobile-frontend-editor-placeholder": "This section is empty. Be the 
first to expand it!",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 67c06a1..8e6d63d 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -105,7 +105,8 @@
        "mobile-frontend-editor-error-preview": "Error message for when a 
preview fails to load for an unknown reason",
        "mobile-frontend-editor-keep-editing": "Caption for a button that takes 
you back to editing from edit preview screen.",
        "mobile-frontend-editor-licensing": "Text notifying user of license 
that text will be published under.\nParameters:\n* $1 - link to license",
-       "mobile-frontend-editor-licensing-with-terms": "Text notifying user of 
license that text will be published under.\nParameters:\n* $1 - link to terms 
of service\n* $2 - link to license",
+       "mobile-frontend-editor-licensing-with-terms": "Text notifying user of 
license that text will be published under.\nParameters:\n* $1 - link to terms 
of service, see {{mw-msg|Mobile-frontend-editor-terms-text}}\n* $2 - link to 
license",
+       "mobile-frontend-editor-terms-link": "Terms of Use link used in 
{{mw-msg|Mobile-frontend-editor-licensing-with-terms}}.\nParameters:\n* $1 - 
link target",
        "mobile-frontend-editor-new-page-confirm": "Question asking user if 
they are positive they want to create a new page.\nParameters:\n* $1 - the user 
name for GENDER",
        "mobile-frontend-editor-newpage-prompt": "Message shown when a page 
doesn't exist.",
        "mobile-frontend-editor-placeholder": "Placeholder text for empty 
sections.",
diff --git a/includes/Resources.php b/includes/Resources.php
index 1eb7cd4..9970126 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -472,6 +472,7 @@
                        'mobile-frontend-editor-keep-editing',
                        'mobile-frontend-editor-licensing',
                        'mobile-frontend-editor-licensing-with-terms',
+                       'mobile-frontend-editor-terms-link',
                        'mobile-frontend-editor-placeholder',
                        'mobile-frontend-editor-placeholder-new-page',
                        'mobile-frontend-editor-summary',
@@ -680,6 +681,7 @@
                        'mobile-frontend-editor-licensing-with-terms',
                        'mobile-frontend-editor-error',
                        'mobile-frontend-editor-error-conflict',
+                       'mobile-frontend-editor-terms-link',
                ),
        ),
 
diff --git a/javascripts/modules/editor/EditorOverlayBase.js 
b/javascripts/modules/editor/EditorOverlayBase.js
index a27c47e..47e43dc 100644
--- a/javascripts/modules/editor/EditorOverlayBase.js
+++ b/javascripts/modules/editor/EditorOverlayBase.js
@@ -164,7 +164,10 @@
                                if ( $( '#footer-places-terms-use' ).length > 0 
) {
                                        options.licenseMsg = mw.msg(
                                                
'mobile-frontend-editor-licensing-with-terms',
-                                               $( '#footer-places-terms-use' 
).html(),
+                                               mw.message(
+                                                       
'mobile-frontend-editor-terms-link',
+                                                       $( 
'#footer-places-terms-use a' ).attr( 'href' )
+                                               ).parse(),
                                                mw.config.get( 
'wgMFLicenseLink' )
                                        );
                                } else {
diff --git a/javascripts/modules/talk/TalkSectionAddOverlay.js 
b/javascripts/modules/talk/TalkSectionAddOverlay.js
index 33214a3..6602d1d 100644
--- a/javascripts/modules/talk/TalkSectionAddOverlay.js
+++ b/javascripts/modules/talk/TalkSectionAddOverlay.js
@@ -42,20 +42,6 @@
                } ),
                /** @inheritdoc */
                initialize: function ( options ) {
-                       // If terms of use is enabled, include it in the 
licensing message
-                       // FIXME cache this selector, it's used more than once.
-                       if ( $( '#footer-places-terms-use' ).length > 0 ) {
-                               options.licenseMsg = mw.msg(
-                                       
'mobile-frontend-editor-licensing-with-terms',
-                                       $( '#footer-places-terms-use' ).html(),
-                                       mw.config.get( 'wgMFLicenseLink' )
-                               );
-                       } else {
-                               options.licenseMsg = mw.msg(
-                                       'mobile-frontend-editor-licensing',
-                                       mw.config.get( 'wgMFLicenseLink' )
-                               );
-                       }
                        Overlay.prototype.initialize.apply( this, arguments );
                        this.title = options.title;
                        // Variable to indicate, if the overlay will be closed 
by the save function or by the user. If this is false and there is content in 
the input fields,
diff --git a/javascripts/modules/talk/talk.js b/javascripts/modules/talk/talk.js
index 458051a..853cf82 100644
--- a/javascripts/modules/talk/talk.js
+++ b/javascripts/modules/talk/talk.js
@@ -2,7 +2,6 @@
        var loader = M.require( 'loader' ),
                LoadingOverlay = M.require( 'LoadingOverlay' ),
                user = M.require( 'user' ),
-               licenseLink = mw.config.get( 'wgMFLicenseLink' ),
                $talk = $( '.talk' ),
                page = M.getCurrentPage(),
                overlayManager = M.require( 'overlayManager' ),
@@ -16,14 +15,22 @@
                                title: $talk.data( 'title' ) || mw.config.get( 
'wgPageName' )
                        };
 
-               // FIXME: cache this selector, it's used more than once
+               // If terms of use is enabled, include it in the licensing 
message
                if ( $( '#footer-places-terms-use' ).length > 0 ) {
-                       talkOptions.licenseMsg = mw.msg( 
'mobile-frontend-editor-licensing-with-terms',
-                               $( '#footer-places-terms-use' ).html(), 
licenseLink );
+                       talkOptions.licenseMsg = mw.msg(
+                                       
'mobile-frontend-editor-licensing-with-terms',
+                                       mw.message(
+                                               
'mobile-frontend-editor-terms-link',
+                                               $( '#footer-places-terms-use a' 
).attr( 'href' )
+                                       ).parse(),
+                                       mw.config.get( 'wgMFLicenseLink' )
+                               );
                } else {
-                       talkOptions.licenseMsg = mw.msg( 
'mobile-frontend-editor-licensing', licenseLink );
+                       talkOptions.licenseMsg = mw.msg(
+                               'mobile-frontend-editor-licensing',
+                               mw.config.get( 'wgMFLicenseLink' )
+                       );
                }
-
                loader.loadModule( 'mobile.talk.overlays' ).done( function () {
                        var Overlay;
                        if (  id === 'new' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/190831
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d4029456c69e126e7343811a979204f9e5df964
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de>
Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Kaldari <rkald...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to