Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/180144
Change subject: Renamed wb.experts.EntityIdInput to wb.experts.Entity ...................................................................... Renamed wb.experts.EntityIdInput to wb.experts.Entity Change-Id: I0691153b60531125c360f8da3b952a17dd3e6e5f --- R repo/resources/experts/Entity.js M repo/resources/experts/getStore.js M repo/resources/experts/resources.php R repo/tests/qunit/experts/Entity.tests.js M repo/tests/qunit/resources.php 5 files changed, 23 insertions(+), 31 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/44/180144/1 diff --git a/repo/resources/experts/EntityIdInput.js b/repo/resources/experts/Entity.js similarity index 69% rename from repo/resources/experts/EntityIdInput.js rename to repo/resources/experts/Entity.js index d2c8f1b..ceabd41 100644 --- a/repo/resources/experts/EntityIdInput.js +++ b/repo/resources/experts/Entity.js @@ -1,7 +1,3 @@ -/** - * @licence GNU GPL v2+ - * @author Daniel Werner < [email protected] > - */ ( function( mw, wb, $, vv ) { 'use strict'; @@ -11,22 +7,20 @@ 'P': 'property' }; - var MODULE = wb.experts; - var PARENT = vv.experts.StringValue; + var MODULE = wb.experts, + PARENT = vv.experts.StringValue; /** - * Valueview expert for wb.datamodel.EntityId. This is a simple expert, only handling the input, - * based on the StringValue input but with the jQuery.wikibase.entityselector for convenience. - * - * @since 0.4 - * - * @constructor + * `valueview` `Expert` for specifying a reference to a Wikibase `Entity`. + * @class wikibase.experts.Entity * @extends jQuery.valueview.experts.StringValue + * @since 0.4 + * @licence GNU GPL v2+ + * @author Daniel Werner < [email protected] > */ - MODULE.EntityIdInput = vv.expert( 'wikibaseentityidinput', PARENT, { - + MODULE.Entity = vv.expert( 'wikibaseentity', PARENT, { /** - * @see Query.valueview.experts.StringValue._init + * @inheritdoc */ _init: function() { PARENT.prototype._init.call( this ); @@ -44,8 +38,8 @@ selectOnAutocomplete: true } ); - var value = this.viewState().value(); - var entityId = value && value.getPrefixedId( WB_ENTITIES_PREFIXMAP ); + var value = this.viewState().value(), + entityId = value && value.getPrefixedId( WB_ENTITIES_PREFIXMAP ); this.$input.data( 'entityselector' ).selectedEntity( entityId ); $input @@ -59,7 +53,7 @@ }, /** - * @see jQuery.valueview.Expert.destroy + * @inheritdoc */ destroy: function() { // Prevent error when issuing destroy twice: @@ -75,9 +69,9 @@ }, /** - * @see jQuery.valueview.Expert.rawValue + * @inheritdoc * - * @return string + * @return {string} */ rawValue: function() { var entitySelector = this.$input.data( 'entityselector' ), @@ -85,7 +79,6 @@ return selectedEntity ? selectedEntity.id : ''; } - } ); }( mediaWiki, wikibase, jQuery, jQuery.valueview ) ); diff --git a/repo/resources/experts/getStore.js b/repo/resources/experts/getStore.js index 02d933e..4e45357 100644 --- a/repo/resources/experts/getStore.js +++ b/repo/resources/experts/getStore.js @@ -14,7 +14,7 @@ var expertStore = new vv.ExpertStore( vv.experts.UnsupportedValue ); expertStore.registerDataValueExpert( - wb.experts.EntityIdInput, + wb.experts.Entity, wb.datamodel.EntityId.TYPE ); diff --git a/repo/resources/experts/resources.php b/repo/resources/experts/resources.php index 6987418..d9d6871 100644 --- a/repo/resources/experts/resources.php +++ b/repo/resources/experts/resources.php @@ -40,13 +40,13 @@ 'jquery.valueview.experts.UnsupportedValue', 'wikibase.datamodel.EntityId', 'wikibase.experts.__namespace', - 'wikibase.experts.EntityIdInput', + 'wikibase.experts.Entity', ), ), - 'wikibase.experts.EntityIdInput' => $moduleTemplate + array( + 'wikibase.experts.Entity' => $moduleTemplate + array( 'scripts' => array( - 'EntityIdInput.js', + 'Entity.js', ), 'dependencies' => array( 'jquery.event.special.eachchange', @@ -54,7 +54,6 @@ 'jquery.valueview.experts.StringValue', 'jquery.wikibase.entityselector', 'mw.config.values.wbRepo', - 'mediawiki.util', 'wikibase.experts.__namespace', ), ), diff --git a/repo/tests/qunit/experts/EntityIdInput.tests.js b/repo/tests/qunit/experts/Entity.tests.js similarity index 71% rename from repo/tests/qunit/experts/EntityIdInput.tests.js rename to repo/tests/qunit/experts/Entity.tests.js index dab9e06..1903f68 100644 --- a/repo/tests/qunit/experts/EntityIdInput.tests.js +++ b/repo/tests/qunit/experts/Entity.tests.js @@ -7,10 +7,10 @@ var testExpert = valueview.tests.testExpert; - QUnit.module( 'wikibase.experts.EntityIdInput' ); + QUnit.module( 'wikibase.experts.Entity' ); testExpert( { - expertConstructor: wb.experts.EntityIdInput + expertConstructor: wb.experts.Entity } ); }( QUnit, jQuery.valueview, wikibase ) ); diff --git a/repo/tests/qunit/resources.php b/repo/tests/qunit/resources.php index 7db7af2..48bda24 100644 --- a/repo/tests/qunit/resources.php +++ b/repo/tests/qunit/resources.php @@ -101,12 +101,12 @@ ), ), - 'wikibase.experts.EntityIdInput.tests' => $moduleBase + array( + 'wikibase.experts.Entity.tests' => $moduleBase + array( 'scripts' => array( - 'experts/EntityIdInput.tests.js', + 'experts/Entity.tests.js', ), 'dependencies' => array( - 'wikibase.experts.EntityIdInput', + 'wikibase.experts.Entity', 'wikibase.tests.qunit.testrunner', ), ), -- To view, visit https://gerrit.wikimedia.org/r/180144 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0691153b60531125c360f8da3b952a17dd3e6e5f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: wmf/1.25wmf12c Gerrit-Owner: Aude <[email protected]> Gerrit-Reviewer: Henning Snater <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
