Merge pull request #14025 from tschaub/latest-check
New URL to check for latest release
This commit is contained in:
@@ -278,11 +278,11 @@ $(function () {
|
|||||||
|
|
||||||
// warn about outdated version
|
// warn about outdated version
|
||||||
const currentVersion = document.getElementById('package-version').innerHTML;
|
const currentVersion = document.getElementById('package-version').innerHTML;
|
||||||
const packageUrl = 'https://raw.githubusercontent.com/openlayers/openlayers.github.io/build/package.json';
|
const releaseUrl = 'https://api.github.com/repos/openlayers/openlayers/releases/latest';
|
||||||
fetch(packageUrl).then(function(response) {
|
fetch(releaseUrl).then(function(response) {
|
||||||
return response.json();
|
return response.json();
|
||||||
}).then(function(json) {
|
}).then(function(json) {
|
||||||
const latestVersion = json.version;
|
const latestVersion = json.name.replace(/^v/, '');
|
||||||
document.getElementById('latest-version').innerHTML = latestVersion;
|
document.getElementById('latest-version').innerHTML = latestVersion;
|
||||||
const url = window.location.href;
|
const url = window.location.href;
|
||||||
const branchSearch = url.match(/\/([^\/]*)\/apidoc\//);
|
const branchSearch = url.match(/\/([^\/]*)\/apidoc\//);
|
||||||
|
|||||||
@@ -186,11 +186,11 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
const packageUrl = 'https://raw.githubusercontent.com/openlayers/openlayers.github.io/build/package.json';
|
const releaseUrl = 'https://api.github.com/repos/openlayers/openlayers/releases/latest';
|
||||||
fetch(packageUrl).then(function(response) {
|
fetch(releaseUrl).then(function(response) {
|
||||||
return response.json();
|
return response.json();
|
||||||
}).then(function(json) {
|
}).then(function(json) {
|
||||||
const latestVersion = json.version;
|
const latestVersion = json.name.replace(/^v/, '');
|
||||||
document.getElementById('latest-version').innerHTML = latestVersion;
|
document.getElementById('latest-version').innerHTML = latestVersion;
|
||||||
const url = window.location.href;
|
const url = window.location.href;
|
||||||
const branchSearch = url.match(/\/([^\/]*)\/examples\//);
|
const branchSearch = url.match(/\/([^\/]*)\/examples\//);
|
||||||
|
|||||||
Reference in New Issue
Block a user