Skip to content

Commit

Permalink
Search Version
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunate authored and rmunate committed Oct 2, 2023
1 parent c512ae8 commit c7d5cc7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
25 changes: 24 additions & 1 deletion docs/assets/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,30 @@ const sidebarLinks = document.querySelectorAll('#docs-sidebar .scrollto');

/* ===== Responsive Sidebar ====== */
window.onload = function () {
responsiveSidebar();

//-------------------
//---- VERSION ------
//-------------------
const url = "https://repo.packagist.org/p2/rmunate/php2js.json";
fetch(url)
.then(response => response.json())
.then(data => {
const version = data.packages["rmunate/php2js"][0].version;
const fecha = data.packages["rmunate/php2js"][0].time.split("T")[0];
document.getElementById("idversion").textContent = version;
document.getElementById("idversion").title = fecha;
})
.catch(error => {
document.getElementById("idversion").textContent = "PHP2JS";
document.getElementById("idversion").title = "PHP2JS";
});

//Slidebar
try {
responsiveSidebar();
} catch (error) {
console.clear();
}
};

window.onresize = function () {
Expand Down
4 changes: 1 addition & 3 deletions docs/en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ <h1 class="page-heading single-col-max mx-auto title-php2js">
<p class="description-three-php2js">
It has arrived to streamline the creation of monolithic projects easily.
</p>

<div class="text-center mb-3">
<code>v3.8.11 | 2023-10-02</code>
<code id="idversion"></code>
</div>

<a class="btn btn-secondary btn-php2js" href="manual.html">
Documentation
<i class="fa fa-arrow-circle-right"></i>
Expand Down
5 changes: 4 additions & 1 deletion docs/en/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
</div>
<div class="docs-top-utilities d-flex justify-content-end align-items-center">
<ul class="social-list list-inline mx-md-3 mx-lg-5 mb-0 d-none d-lg-flex">
<li style="width: 100px !important;">
<code id="idversion"></code>
</li>
<li class="list-inline-item list_lang">
<a href="../es/manual.html" class="item_lang">
ES
Expand All @@ -48,7 +51,7 @@
</a>
</li>
</ul>
<a href="https://github.com/rmunate" class="btn d-none d-lg-flex btn-paquetes">Paquetes</a>
<a href="https://github.com/rmunate" class="btn d-none d-lg-flex btn-paquetes">Packages</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/es/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h1 class="page-heading single-col-max mx-auto title-php2js">
Ha llegado para agilizar la creación de proyectos monolíticos facilmente.
</p>
<div class="text-center mb-3">
<code>v3.8.11 | 2023-10-02</code>
<code id="idversion"></code>
</div>
<a class="btn btn-secondary btn-php2js" href="manual.html">
Documentación
Expand Down
3 changes: 3 additions & 0 deletions docs/es/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
</div>
<div class="docs-top-utilities d-flex justify-content-end align-items-center">
<ul class="social-list list-inline mx-md-3 mx-lg-5 mb-0 d-none d-lg-flex">
<li style="width: 100px !important;">
<code id="idversion"></code>
</li>
<li class="list-inline-item list_lang">
<a href="../en/manual.html" class="item_lang">
EN
Expand Down

0 comments on commit c7d5cc7

Please sign in to comment.