mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 12:46:54 +00:00
feature/ redirect API-Explorer url in dynamic endpoint
This commit is contained in:
parent
a361cd4225
commit
0062385156
@ -27,7 +27,7 @@
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="form-group" cols="1" rows="1">
|
||||
{% if api_collection.api_collection_id %}
|
||||
<a class="api_collection_id btn btn-primary" onclick="api_explorer_url_locale('{{api_collection.collection_on_api_explorer_url}}')" value="{{api_collection.api_collection_id}}">Try It</a>
|
||||
<a class="api_collection_id btn btn-primary" onclick="redirect_api_explorer_url('{{api_collection.collection_on_api_explorer_url}}')" value="{{api_collection.api_collection_id}}">Try It</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
$(document).ready(function($) {
|
||||
var currentURL = window.location.href;
|
||||
const element = document.getElementById('uk')
|
||||
const element = document.getElementById('gb')
|
||||
element.addEventListener("click", () => {
|
||||
if (currentURL.includes("/es/")) {
|
||||
location.href = currentURL.split("/es/")[0] + "/en/" + currentURL.split("/es/")[1]
|
||||
@ -20,7 +20,7 @@ $(document).ready(function($) {
|
||||
});
|
||||
});
|
||||
|
||||
function api_explorer_url_locale(api_explorer_url) {
|
||||
function redirect_api_explorer_url(api_explorer_url) {
|
||||
var currentURL = window.location.href.split("/");
|
||||
if (currentURL[3] == "en") {
|
||||
location.href = api_explorer_url + "&locale=en_GB";
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="language-select language_underline_format"><a style="color:#fff; text-decoration: none !important;">Language
|
||||
<span id="uk">EN</span>
|
||||
<span id="gb">EN</span>
|
||||
|
|
||||
<span id="es">ES</span></a></li>
|
||||
</ul>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="form-group" cols="1" rows="1">
|
||||
{% if dynamic_endpoint.dynamicendpoint_on_api_explorer_url %}
|
||||
<a class="dynamic_endpoint_id btn btn-primary" onclick="api_explorer_url_locale('{{dynamic_endpoint.dynamicendpoint_on_api_explorer_url}}')" value="{{dynamic_endpoint.dynamic_endpoint_id}}">Try It</a>
|
||||
<a class="dynamic_endpoint_id btn btn-primary" onclick="redirect_api_explorer_url('{{dynamic_endpoint.dynamicendpoint_on_api_explorer_url}}')" value="{{dynamic_endpoint.dynamic_endpoint_id}}">Try It</a>
|
||||
{% else %}
|
||||
<span>{{dynamic_endpoint.dynamic_endpoint_id}}</span>
|
||||
{% endif %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user