Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/109917
Change subject: Register experts for URL and commons in Wikibase ...................................................................... Register experts for URL and commons in Wikibase This should fix the issue with not linking URL and commons values. This is temporary and will be refactored in ValueView 0.2. Change-Id: I0d5d0b75ea52bfeb8fd4dcb1fc3033e94c1c9b61 --- M lib/resources/Resources.php M lib/resources/wikibase.dataTypes/wikibase.dataTypes.js 2 files changed, 25 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/17/109917/1 diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php index 64a517a..205bac5 100644 --- a/lib/resources/Resources.php +++ b/lib/resources/Resources.php @@ -73,6 +73,10 @@ 'wikibase', 'dataTypes', 'mw.config.values.wbDataTypes', + 'mw.ext.valueView', + 'jquery.valueview.experts', + 'jquery.valueview.experts.urltype', + 'jquery.valueview.experts.commonsmediatype', ), ), diff --git a/lib/resources/wikibase.dataTypes/wikibase.dataTypes.js b/lib/resources/wikibase.dataTypes/wikibase.dataTypes.js index 145164c..32b83e0 100644 --- a/lib/resources/wikibase.dataTypes/wikibase.dataTypes.js +++ b/lib/resources/wikibase.dataTypes/wikibase.dataTypes.js @@ -4,7 +4,7 @@ * @licence GNU GPL v2+ * @author Daniel Werner < daniel.wer...@wikimedia.de > */ -wikibase.dataTypes = ( function( $, mediaWiki, dataTypes ) { +wikibase.dataTypes = ( function( $, mw, dataTypes, vv ) { 'use strict'; var dataTypeDefinitions = mediaWiki.config.get( 'wbDataTypes' ) || {}; @@ -13,10 +13,29 @@ dataTypes.registerDataType( dataTypes.DataType.newFromJSON( dtTypeId, dtDefinition ) ); } ); + // Experts for values for certain data types: + // Those data types might not be defined, so check for them first. + var commonsMediaType = dataTypes.getDataType( 'commonsMedia' ); + if( commonsMediaType ) { + //if( commonsMediaType ) { + vv.prototype.options.expertProvider.registerExpert( + commonsMediaType, + vv.experts.CommonsMediaType + ); + } + + var urlType = dataTypes.getDataType( 'url' ); + if( urlType ) { + vv.prototype.options.expertProvider.registerExpert( + urlType, + vv.experts.UrlType + ); + } + /** * TODO: dataTypes should not be a singleton, instead we should replace it with a instantiable * factory, so we can use our own instance just for WB data types here. */ return dataTypes; -}( jQuery, mediaWiki, dataTypes ) ); +}( jQuery, mediaWiki, dataTypes, jQuery.valueview ) ); -- To view, visit https://gerrit.wikimedia.org/r/109917 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d5d0b75ea52bfeb8fd4dcb1fc3033e94c1c9b61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf6 Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits