Adrian Lang has uploaded a new change for review.

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

Change subject: Render title attribute for links to properties
......................................................................

Render title attribute for links to properties

This reflects what the PHP Linker::link() method does.

Change-Id: I8306a383a1f68063c3ac05c8ef315a1da384ab2a
---
M lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
M lib/resources/wikibase.utilities/wikibase.utilities.ui.js
3 files changed, 7 insertions(+), 6 deletions(-)


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

diff --git 
a/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
index 3b9d0e3..37889b7 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
@@ -210,7 +210,7 @@
                                // Default: Create a link to the property to be 
used as group title.
                                $title = wb.utilities.ui.buildLinkToEntityPage(
                                        property.getContent(),
-                                       property.getTitle().getUrl()
+                                       property.getTitle()
                                );
                        } else {
                                // The claims group features a property that 
has been deleted.
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
index db7e3fa..baae07c 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js
@@ -729,7 +729,7 @@
                if( this.options.locked.property || !this.isInEditMode() ) {
                        // property set and can't be changed afterwards, only 
display label
                        $propertyDom = property
-                               ? wb.utilities.ui.buildLinkToEntityPage( 
property, title.getUrl() )
+                               ? wb.utilities.ui.buildLinkToEntityPage( 
property, title )
                                // shouldn't usually happen, only in non-edit 
mode, while no Snak is set:
                                : wb.utilities.ui.buildMissingEntityInfo( 
propertyId, wb.Property );
                } else {
diff --git a/lib/resources/wikibase.utilities/wikibase.utilities.ui.js 
b/lib/resources/wikibase.utilities/wikibase.utilities.ui.js
index e98d264..9bc60d1 100644
--- a/lib/resources/wikibase.utilities/wikibase.utilities.ui.js
+++ b/lib/resources/wikibase.utilities/wikibase.utilities.ui.js
@@ -32,17 +32,18 @@
        /**
         * Creates a pretty link to an entity's page. If the label is not yet 
set, then the link will
         * show the entity's ID and some explanatory text describing that the 
label hast not been set
-        * yet. Requires an URL to the wikipage or equivalent, on which the 
Entity is represented.
+        * yet. Requires a Title object.
         *
         * @since 0.4
         *
         * @param {wb.Entity} entity
-        * @param {string} url
+        * @param {mw.Title} title
         * @return {jQuery} An 'a' element
         */
-       wb.utilities.ui.buildLinkToEntityPage = function( entity, url ) {
+       wb.utilities.ui.buildLinkToEntityPage = function( entity, title ) {
                return $( '<a>' )
-                       .attr( 'href', url )
+                       .attr( 'href', title.getUrl() )
+                       .attr( 'title', title.getPrefixedText() )
                        .append( wb.utilities.ui.buildPrettyEntityLabel( entity 
) );
        };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8306a383a1f68063c3ac05c8ef315a1da384ab2a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Adrian Lang <adrian.l...@wikimedia.de>

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

Reply via email to