Daniel Werner has submitted this change and it was merged.
Change subject: Remove use of 2 deprecated js methods
......................................................................
Remove use of 2 deprecated js methods
site.getGlobalSiteId()
and
wikibase.getSiteByGlobalId()
Change-Id: I709c91169cc98a1d683982cdbf4649447c12c422
---
M client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
M lib/resources/wikibase.ui.PropertyEditTool.EditableSiteLink.js
M repo/resources/wikibase.special/wikibase.special.itemByTitle.js
3 files changed, 10 insertions(+), 10 deletions(-)
Approvals:
Daniel Werner: Looks good to me, approved
jenkins-bot: Verified
diff --git a/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
b/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
index 75afd48..27f5e8a 100644
--- a/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
+++ b/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
@@ -181,7 +181,7 @@
sites = wb.getSitesOfGroup( siteGroup );
for( site in sites ) {
- if ( sites[ site ].getGlobalSiteId() !== currentSiteId
) {
+ if ( sites[ site ].getId() !== currentSiteId ) {
linkableSites[ site ] = sites[ site ];
}
}
@@ -327,7 +327,7 @@
*/
_onSecondStep: function() {
if ( $( '#wbclient-linkItem-Site' ).siteselector(
'getSelectedSite' ) ) {
- this.targetSite = $( '#wbclient-linkItem-Site'
).siteselector( 'getSelectedSite' ).getGlobalSiteId();
+ this.targetSite = $( '#wbclient-linkItem-Site'
).siteselector( 'getSelectedSite' ).getId();
} else {
// This should never happen because the button
shouldn't be enabled if the site isn't valid
// ...keeping this for sanity and paranoia
@@ -390,7 +390,7 @@
.find( 'table' )
.append(
this._siteLinkRow(
- wb.getSiteByGlobalId(
entity.sitelinks[ i ].site ),
+ wb.getSite(
entity.sitelinks[ i ].site ),
entity.sitelinks[ i ]
)
);
diff --git a/lib/resources/wikibase.ui.PropertyEditTool.EditableSiteLink.js
b/lib/resources/wikibase.ui.PropertyEditTool.EditableSiteLink.js
index d4741cc..7ed347e 100644
--- a/lib/resources/wikibase.ui.PropertyEditTool.EditableSiteLink.js
+++ b/lib/resources/wikibase.ui.PropertyEditTool.EditableSiteLink.js
@@ -129,7 +129,7 @@
*/
_getValueFromApiResponse: function( response ) {
var siteId = this._interfaces.siteId.getSelectedSite().getId(),
- normalizedTitle = response[ this.API_VALUE_KEY ][
this._interfaces.siteId.getSelectedSite().getGlobalSiteId() ].title;
+ normalizedTitle = response[ this.API_VALUE_KEY ][
this._interfaces.siteId.getSelectedSite().getId() ].title;
return [ siteId, normalizedTitle ];
},
@@ -138,7 +138,7 @@
* @see
wikibase.ui.PropertyEditTool.EditableValue._setRevisionIdFromApiResponse
*/
_setRevisionIdFromApiResponse: function( response ) {
- wb.getRevisionStore().setSitelinksRevision( response.lastrevid,
this._interfaces.siteId.getSelectedSite().getGlobalSiteId() );
+ wb.getRevisionStore().setSitelinksRevision( response.lastrevid,
this._interfaces.siteId.getSelectedSite().getId() );
return true;
},
@@ -213,7 +213,7 @@
site = wb.getSite(
self._interfaces.siteId.getValue() );
if( page !== '' && site !== null ) {
- var url = response.entity.sitelinks[
site.getGlobalSiteId() ].url,
+ var url = response.entity.sitelinks[
site.getId() ].url,
oldFn = site.getUrlTo;
self._interfaces.siteId.setOption(
'siteId', site.getId() );
@@ -243,8 +243,8 @@
queryApi: function( apiAction ) {
return this._api.setSitelink(
mw.config.get( 'wbEntityId' ),
- wb.getRevisionStore().getSitelinksRevision(
this.siteIdInterface.getSelectedSite().getGlobalSiteId() ),
-
this.siteIdInterface.getSelectedSite().getGlobalSiteId(),
+ wb.getRevisionStore().getSitelinksRevision(
this.siteIdInterface.getSelectedSite().getId() ),
+ this.siteIdInterface.getSelectedSite().getId(),
( apiAction === this.API_ACTION.REMOVE || apiAction ===
this.API_ACTION.SAVE_TO_REMOVE ) ? '' : this.getValue()[1]
);
},
diff --git a/repo/resources/wikibase.special/wikibase.special.itemByTitle.js
b/repo/resources/wikibase.special/wikibase.special.itemByTitle.js
index c38630a..1436ef1 100644
--- a/repo/resources/wikibase.special/wikibase.special.itemByTitle.js
+++ b/repo/resources/wikibase.special/wikibase.special.itemByTitle.js
@@ -30,8 +30,8 @@
// On submit, replace human readable value like "English (en)"
with actual sitename ("enwiki")
$( '#wb-itembytitle-form1' ).submit( function() {
var langID = String( $( '#wb-itembytitle-sitename'
).val().replace(/.*\(|\).*/gi,'') );
- if ( wb._siteList[langID].getGlobalSiteId() !==
undefined ) {
- $( '#wb-itembytitle-sitename' ).val(
wb._siteList[langID].getGlobalSiteId() );
+ if ( wb._siteList[langID].getId() !== undefined ) {
+ $( '#wb-itembytitle-sitename' ).val(
wb._siteList[langID].getId() );
}
});
} );
--
To view, visit https://gerrit.wikimedia.org/r/88046
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I709c91169cc98a1d683982cdbf4649447c12c422
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Daniel Werner <[email protected]>
Gerrit-Reviewer: Henning Snater <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits