jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/373031 )

Change subject: Make base URL configurable and use i18n in embed for edit link
......................................................................


Make base URL configurable and use i18n in embed for edit link

Bug: T173778
Change-Id: I0740ae2cb3a37ec8c448e87dbdd333413c9dedaa
---
M embed.html
M i18n/en.json
M i18n/qqq.json
M wikibase/config.js
4 files changed, 15 insertions(+), 5 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Jonas Kress (WMDE): Looks good to me, approved
  Lucas Werkmeister (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/embed.html b/embed.html
index 62cc520..b130807 100644
--- a/embed.html
+++ b/embed.html
@@ -153,7 +153,7 @@
                        <div class="panel-body">
                        </div>
                </div>
-       <a class="link edit-link" target="_blank" title="Wikidata Query Service 
SPARQL"><small>Edit on query.Wikidata.org</small></a>
+       <a class="link edit-link" target="_blank" 
data-i18n="[title]wdqs-embed-button-edit-query-title"><small 
data-i18n="wdqs-embed-button-edit-query"></small></a>
        <a href="#" class="edit edit-link" data-toggle="popover"><span 
class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
 
        <!-- JS files -->
@@ -270,10 +270,10 @@
                                renderEdit( query, function( q ){
                                        resultView.draw( q );
                                        window.location.hash = '#' + 
encodeURIComponent( q )
-                                       $( '.edit-link' ).attr( 'href', 
'https://query.wikidata.org/' + window.location.hash )
+                                       $( '.edit-link' ).attr( 'href', 
config.location.index + window.location.hash )
                                } );
 
-                               $( '.edit-link' ).attr( 'href', 
'https://query.wikidata.org/' + window.location.hash )
+                               $( '.edit-link' ).attr( 'href', 
config.location.index + window.location.hash )
                        } );
 
                } );
diff --git a/i18n/en.json b/i18n/en.json
index cfd81c0..549fb83 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -78,5 +78,7 @@
     "wdqs-action-server-error": "Server error",
     "wdqs-action-unknow-error": "Unknown error",
     "wdqs-action-preview": "Result preview",
-    "wdqs-result-map-layers-all": "All layers"
+    "wdqs-result-map-layers-all": "All layers",
+    "wdqs-embed-button-edit-query": "Edit this query",
+    "wdqs-embed-button-edit-query-title": "Edit this query with the SPARQL 
editor"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 6c5d889..85ccf29 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -80,5 +80,7 @@
        "wdqs-action-server-error": "Label for progressbar displaying server 
error",
        "wdqs-action-unknow-error": "Label for progressbar displaying unknown 
error",
        "wdqs-action-preview": "Label for progressbar displaying preview",
-       "wdqs-result-map-layers-all": "Label for all layers in layer control on 
map view"
+       "wdqs-result-map-layers-all": "Label for all layers in layer control on 
map view",
+    "wdqs-embed-button-edit-query": "Label for button in embed",
+    "wdqs-embed-button-edit-query-title": "Title for button in embed"
 }
diff --git a/wikibase/config.js b/wikibase/config.js
index 27d769b..1911906 100644
--- a/wikibase/config.js
+++ b/wikibase/config.js
@@ -38,6 +38,9 @@
                brand: {
                        logo: 'logo.svg',
                        title: 'Wikidata Query'
+               },
+               location: {
+                       index: 'https://query.wikidata.org/'
                }
        };
 
@@ -55,6 +58,9 @@
                },
                brand: {
                        title: 'Localhost'
+               },
+               location: {
+                       index: './index.html'
                }
        } );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/373031
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0740ae2cb3a37ec8c448e87dbdd333413c9dedaa
Gerrit-PatchSet: 3
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Siebrand <[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

Reply via email to