Tony CHEMIT pushed to branch pages at ultreiaio / ird-observe Commits: a091b7b1 by Tony Chemit at 2021-09-11T15:53:23+02:00 Site checkin for project ObServe (version 9.0.0-RC-11-SNAPSHOT) - - - - - 2 changed files: - index.html - + index.js Changes: ===================================== index.html ===================================== @@ -26,6 +26,7 @@ <meta charset="UTF-8"> <title>Observe documentation</title> <link rel="stylesheet" href="index.css"/> + <script type="application/javascript" src="index.js"></script> </head> <body> <ul class="breadcrumb" id="top"> @@ -33,7 +34,8 @@ </ul> <h1>Available versions</h1> -<ul> + +<ul id="versions"> <li><a href="./latest">Latest documentation</a></li> <li><a href="./stable">Stable documentation</a></li> </ul> @@ -56,6 +58,6 @@ </li> </ul> </div> - +<script type="application/javascript">loadContent("versions");</script> </body> </html> ===================================== index.js ===================================== @@ -0,0 +1,44 @@ +/*- + * #%L + * ObServe Server :: Runner + * %% + * Copyright (C) 2008 - 2021 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +function loadContent(file) { + let target = document.getElementById(file); + if (target) { + let oReq = new XMLHttpRequest(); + oReq.addEventListener("load", + function responseListener() { + let json = JSON.parse(this.responseText); + let content = ""; + for (var key in json) { + if (json.hasOwnProperty(key)) { + let date = json[key]; + content += '<li><a href="./' + key + '">' + key + '</a> ( last update: ' + date + ' )</li>'; + } + } + content += ""; + target.innerHTML = content; + } + ); + oReq.open("GET", file + ".json"); + oReq.send(); + } +} View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/a091b7b1b62dad66deadb816e0... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/a091b7b1b62dad66deadb816e0... You're receiving this email because of your account on gitlab.com.