JGonera has uploaded a new change for review.

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


Change subject: Use file name for images with descriptions with templates
......................................................................

Use file name for images with descriptions with templates

Strip File: and extension.

Change-Id: Ie1fc7f0591b6312fbdd45d9889895d74b25ded02
---
M javascripts/specials/uploads.js
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/javascripts/specials/uploads.js b/javascripts/specials/uploads.js
index 654f284..c0f93be 100644
--- a/javascripts/specials/uploads.js
+++ b/javascripts/specials/uploads.js
@@ -55,6 +55,10 @@
                index = text.indexOf( '== {{int:filedesc}} ==' );
                if ( index > - 1 ) {
                        summary = $.trim( text.substr( index ).split( '==' )[ 2 
] );
+                       // if description contains templates, don't use it 
(FIXME?)
+                       if ( summary.indexOf( '{{' ) !== -1 ) {
+                               summary = '';
+                       }
                }
                return summary;
        }
@@ -81,7 +85,7 @@
                        } );
                        $( pages ).each( function() {
                                imageData[ this.title ].description = 
extractDescription( this.revisions[0]['*'] ) ||
-                                       mw.msg( 
'mobile-frontend-listed-image-no-description' );
+                                       this.title.replace( /^File:/, '' 
).replace( /\.[^\.]+$/, '' );
                        } );
                        callback( imageData );
                } );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1fc7f0591b6312fbdd45d9889895d74b25ded02
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: JGonera <jgon...@wikimedia.org>

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

Reply via email to