J has uploaded a new change for review.

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


Change subject: (bug 44978) loop over authors instead of setting same url
......................................................................

(bug 44978) loop over authors instead of setting same url

instead of setting all author links to the same url,
loop over all links and fix each url.

Bug: 44978
Change-Id: I7da8899c9bf757179e21adca774b8f648a9b21da
---
M resources/mw.MediaWikiPlayerSupport.js
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/96/66396/1

diff --git a/resources/mw.MediaWikiPlayerSupport.js 
b/resources/mw.MediaWikiPlayerSupport.js
index 3b41139..c901462 100644
--- a/resources/mw.MediaWikiPlayerSupport.js
+++ b/resources/mw.MediaWikiPlayerSupport.js
@@ -144,11 +144,12 @@
                                // Update link to be absolute per page url 
context:
                                var $links = $authorText.find('a');
                                if( $links.length ) {
-                                       var authUrl = 
$authorText.find('a').attr('href');
-                                       authUrl = mw.absoluteUrl( authUrl,  
articleUrl );
-                                       $authorText.find('a').attr('href',
-                                               authUrl
-                                       )
+                                       $links.each(function(i, authorLink) {
+                                               var $authorLink = $(authorLink);
+                                               var authUrl = 
$authorLink.attr('href');
+                                               authUrl = mw.absoluteUrl( 
authUrl,  articleUrl );
+                                               $authorLink.attr('href', 
authUrl);
+                                       });
                                }
                                $creditLine.append( $( '<br />' ),
                                        mw.msg('mwe-embedplayer-credit-author', 
$authorText.html() )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7da8899c9bf757179e21adca774b8f648a9b21da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: J <[email protected]>

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

Reply via email to