Lucas Werkmeister (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/384524 )
Change subject: WIP: Add wb-indicator span to snaks ...................................................................... WIP: Add wb-indicator span to snaks This alters the DOM structure of snaks to turn the wikibase-snakview-value into an inline span (instead of a block div), add a wb-indicator inline span next to it, and wrap them both in a new wikibase-snakview-value-line block div. The wb-indicator element is a container where any external code can append elements belonging to the snak without any unwanted interaction between those elements and Wikibase’s own elements. TODO: * the -line suffix is just something I made up in two minutes, there might be something better * the -value element on qualifiers and references has a lot of padding-right, which now manifests itself as a lot of space between value and indicators and instead needs to be on the surrounding block * input fields when editing qualifiers and references also look very weird if the wikibase-snakview-value is a span instead of a div * wb-indicator or wb-indicators? * this needs VERY THOROUGH TESTING * also this needs DISCUSSION with the community of user script / gadget authors, who will be affected by this change (it’s something that helps them – e. g. the EasyQuery gadget is also affected by T167869 – but at first it will break their stuff) Bug: T95403 Change-Id: I1399233617581eb3b600fb23ea1de1058ebe4811 --- M view/resources/jquery/wikibase/jquery.wikibase.statementview.js M view/resources/jquery/wikibase/snakview/snakview.variations.Value.js M view/resources/templates.php M view/resources/wikibase/wikibase.less 4 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/24/384524/1 diff --git a/view/resources/jquery/wikibase/jquery.wikibase.statementview.js b/view/resources/jquery/wikibase/jquery.wikibase.statementview.js index b2edacb..29a8fdc 100644 --- a/view/resources/jquery/wikibase/jquery.wikibase.statementview.js +++ b/view/resources/jquery/wikibase/jquery.wikibase.statementview.js @@ -640,6 +640,10 @@ // FIXME: Should not be necessary if _setOption would do the right thing for values this._recreateReferences(); + if ( !dropValue ) { + this.element.find( '.wb-indicator' ).empty(); + } + this._stopEditingQualifiers( dropValue ); return $.when( this._mainSnakSnakView.stopEditing( dropValue ), diff --git a/view/resources/jquery/wikibase/snakview/snakview.variations.Value.js b/view/resources/jquery/wikibase/snakview/snakview.variations.Value.js index f3b8b43..abab13e 100644 --- a/view/resources/jquery/wikibase/snakview/snakview.variations.Value.js +++ b/view/resources/jquery/wikibase/snakview/snakview.variations.Value.js @@ -364,7 +364,7 @@ this._valueView = null; this.$viewPort.empty(); } - $valueViewDom = this.$viewPort.wrapInner( '<div/>' ).children(); + $valueViewDom = this.$viewPort.wrapInner( '<span/>' ).children(); // Can't choose a view for displaying empty value without indication by data type // definition which kind of value should be creatable by the new valueview. diff --git a/view/resources/templates.php b/view/resources/templates.php index d1cd90b..99ffbfd 100644 --- a/view/resources/templates.php +++ b/view/resources/templates.php @@ -80,7 +80,10 @@ </div> <div class="wikibase-snakview-value-container" dir="auto"> <div class="wikibase-snakview-typeselector"></div> - <div class="wikibase-snakview-value $2">$3</div> + <div class="wikibase-snakview-value-line $2"> + <span class="wikibase-snakview-value">$3</span> + <span class="wb-indicator"></span> + </div> </div> </div> HTML; diff --git a/view/resources/wikibase/wikibase.less b/view/resources/wikibase/wikibase.less index 18f1b7e..14d7dc0 100644 --- a/view/resources/wikibase/wikibase.less +++ b/view/resources/wikibase/wikibase.less @@ -365,6 +365,10 @@ width: 100%; } +.wb-edit .wb-indicator { + display: none; +} + /***** /EDIT/NEW CLAIM *****/ /***** QUALIFIERS *****/ -- To view, visit https://gerrit.wikimedia.org/r/384524 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1399233617581eb3b600fb23ea1de1058ebe4811 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) <lucas.werkmeis...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits