jenkins-bot has submitted this change and it was merged.
Change subject: Insert example query title as SPARQL comment
......................................................................
Insert example query title as SPARQL comment
Change-Id: Ib032314f5a98ed330cfed1394258f019fa014dfd
---
M wikibase/queryService/ui/App.js
M wikibase/queryService/ui/QueryExampleDialog.js
2 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
Smalyshev: Looks good to me, approved
jenkins-bot: Verified
diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js
index c3ce269..d79296d 100644
--- a/wikibase/queryService/ui/App.js
+++ b/wikibase/queryService/ui/App.js
@@ -123,12 +123,12 @@
**/
SELF.prototype._initExamples = function() {
var self = this;
- new wikibase.queryService.ui.QueryExampleDialog( $(
'#QueryExamples' ), this._querySamplesApi, function( query ){
+ new wikibase.queryService.ui.QueryExampleDialog( $(
'#QueryExamples' ), this._querySamplesApi, function( query, title ){
if ( !query || !query.trim() ) {
return;
}
- self._editor.setValue( query );
+ self._editor.setValue( '#' + title + '\n' + query );
} );
};
diff --git a/wikibase/queryService/ui/QueryExampleDialog.js
b/wikibase/queryService/ui/QueryExampleDialog.js
index c159510..ced5f3c 100644
--- a/wikibase/queryService/ui/QueryExampleDialog.js
+++ b/wikibase/queryService/ui/QueryExampleDialog.js
@@ -200,7 +200,7 @@
var self = this;
var link = $( '<a title="Select this query"
data-dismiss="modal">' ).text(title).attr( 'href', '#' ).click( function(){
- self._callback( query );
+ self._callback( query, title );
} ),
edit = $( '<a title="Edit this Query">' ).attr( 'href',
href ).attr( 'target', '_blank' )
.append( '<span
class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>' ),
--
To view, visit https://gerrit.wikimedia.org/r/276717
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib032314f5a98ed330cfed1394258f019fa014dfd
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits