Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/176248

Change subject: Show license text in EditorOverlay only, if there is a license
......................................................................

Show license text in EditorOverlay only, if there is a license

Not all wikis (e.g. thirdparty wikis) have set wgRightsText to license
the texts. Show license message in EditorOverlay only, if there is a license
to avoid confusing text.

Change-Id: I86e6dbfbc3097a086b38b5519f0fbf0c32e9cd41
---
M javascripts/modules/editor/EditorOverlayBase.js
M templates/modules/editor/EditorOverlayBase.hogan
2 files changed, 15 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/48/176248/1

diff --git a/javascripts/modules/editor/EditorOverlayBase.js 
b/javascripts/modules/editor/EditorOverlayBase.js
index 5a0b945..41b191f 100644
--- a/javascripts/modules/editor/EditorOverlayBase.js
+++ b/javascripts/modules/editor/EditorOverlayBase.js
@@ -139,18 +139,20 @@
                        if ( mw.config.get( 'wgNamespaceNumber' ) !== 0 ) {
                                options.summaryRequestMsg = mw.msg( 
'mobile-frontend-editor-summary' );
                        }
-                       // If terms of use is enabled, include it in the 
licensing message
-                       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' )
-                               );
+                       if ( mw.config.get( 'wgMFLicenseLink' ) ) {
+                               // If terms of use is enabled, include it in 
the licensing message
+                               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' )
+                                       );
+                               }
                        }
                        this.editCount = user.getEditCount();
                        this.isNewPage = options.isNewPage;
diff --git a/templates/modules/editor/EditorOverlayBase.hogan 
b/templates/modules/editor/EditorOverlayBase.hogan
index e7748f7..8e8f30b 100644
--- a/templates/modules/editor/EditorOverlayBase.hogan
+++ b/templates/modules/editor/EditorOverlayBase.hogan
@@ -27,7 +27,7 @@
                <div class="save-panel panel hideable hidden">
                        <p class="summary-request">{{{summaryRequestMsg}}}</p>
                        <textarea rows="2" class="mw-ui-input summary" 
placeholder="{{summaryMsg}}"></textarea>
-                       <p class="license">{{{licenseMsg}}}</p>
+                       {{#licenseMsg}}<p 
class="license">{{{licenseMsg}}}</p>{{/licenseMsg}}
                </div>
                <div class="captcha-panel panel hideable hidden">
                        <div class="captcha-box">

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86e6dbfbc3097a086b38b5519f0fbf0c32e9cd41
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to