[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Show toast when auto completion is available
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/365071 ) Change subject: Show toast when auto completion is available .. Show toast when auto completion is available Bug:T170542 Change-Id: Ifb4718c6260f0bcca1aeec89315b7b07509fb0a4 --- M index.html M wikibase/queryService/ui/App.js 2 files changed, 8 insertions(+), 3 deletions(-) Approvals: Lucas Werkmeister (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/index.html b/index.html index c2bb2d6..7e3e6ca 100644 --- a/index.html +++ b/index.html @@ -148,9 +148,6 @@ - - - diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js index 85443ba..a20cfb1 100644 --- a/wikibase/queryService/ui/App.js +++ b/wikibase/queryService/ui/App.js @@ -151,6 +151,14 @@ SELF.prototype._initEditor = function() { this._editor.fromTextArea( this._$element.find( '.queryEditor' )[0] ); + this._editor.registerCallback( 'change', function( editor, changeObj ) { + if ( changeObj.text[0] === ':' ) { + var $help = $( 'https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help/SPARQL_Editor#Code_Completion;>' ) + .append( $.i18n( 'wdqs-app-footer-help' ) ); + $.toast( $help[0].outerHTML ); + } + } ); + // if(window.history.pushState) {//this works only in modern browser // this._editor.registerCallback( 'change', $.proxy( this._updateQueryUrl, this) ); // } -- To view, visit https://gerrit.wikimedia.org/r/365071 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifb4718c6260f0bcca1aeec89315b7b07509fb0a4 Gerrit-PatchSet: 4 Gerrit-Project: wikidata/query/gui Gerrit-Branch: master Gerrit-Owner: Jonas Kress (WMDE)Gerrit-Reviewer: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Smalyshev Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Show toast when auto completion is available
Jonas Kress (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/365071 ) Change subject: Show toast when auto completion is available .. Show toast when auto completion is available Bug:T170542 Change-Id: Ifb4718c6260f0bcca1aeec89315b7b07509fb0a4 --- M index.html M wikibase/queryService/ui/App.js 2 files changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui refs/changes/71/365071/1 diff --git a/index.html b/index.html index c2bb2d6..7e3e6ca 100644 --- a/index.html +++ b/index.html @@ -148,9 +148,6 @@ - - - diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js index d7930b1..6b92f7f 100644 --- a/wikibase/queryService/ui/App.js +++ b/wikibase/queryService/ui/App.js @@ -149,8 +149,18 @@ * @private */ SELF.prototype._initEditor = function() { + var self = this; + this._editor.fromTextArea( this._$element.find( '.queryEditor' )[0] ); + this._editor.registerCallback( 'change', function( editor, changeObj ) { + if ( changeObj.text[0] === ':' ) { + var $help = $( 'https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help/SPARQL_Editor#Code_Completion;>' ) + .append( $.i18n( 'wdqs-app-footer-help' ) ); + $.toast( $help[0].outerHTML ); + } + } ); + // if(window.history.pushState) {//this works only in modern browser // this._editor.registerCallback( 'change', $.proxy( this._updateQueryUrl, this) ); // } -- To view, visit https://gerrit.wikimedia.org/r/365071 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifb4718c6260f0bcca1aeec89315b7b07509fb0a4 Gerrit-PatchSet: 1 Gerrit-Project: wikidata/query/gui Gerrit-Branch: master Gerrit-Owner: Jonas Kress (WMDE)___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits