Skip to content

Commit

Permalink
Merge pull request #575 from NicolasConstant/develop
Browse files Browse the repository at this point in the history
1.3.0 PR
  • Loading branch information
NicolasConstant authored Apr 24, 2023
2 parents 4599d64 + f46d7d4 commit b00c52f
Show file tree
Hide file tree
Showing 27 changed files with 387 additions and 2,105 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ It is strongly focused on the following points:

It is released as a **browser webapp** and also packaged as an **cross-platform desktop application** (Mac, Windows, and Linux).

The Electron code isn't hosted here anymore, and you'll find it [here](https://github.com/NicolasConstant/sengi-electron).

## Official project page

[Discover Sengi](https://nicolasconstant.github.io/sengi/)
Expand Down
28 changes: 20 additions & 8 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1 class="header__download-box--title">Discover Sengi</h1>

<div class="header__download-box--buttons">
<p>
<h4 class="header__download-box--subtitle">Try it in your browser!</h4>
<h4 class="header__download-box--subtitle">Use it in your browser!</h4>
<a href="#" class="download-button download-button__web"
title="what are you waiting for? click!"
onClick="window.open('https://sengi.nicolas-constant.com'+'?qt='+ (new Date()).getTime(),'Sengi','toolbar=no,location=no,status=no,menubar=no,scrollbars=no, resizable=yes,width=377,height=800'); return false;"
Expand All @@ -43,7 +43,7 @@ <h4 class="header__download-box--subtitle">Try it in your browser!</h4>
<br />
<br />

<h4 class="header__download-box--subtitle">Or download the desktop client:</h4>
<h4 class="header__download-box--subtitle">Or download the desktop client <span id="electron-version"></span>:</h4>
<div id="download-buttons" style="display: none;">
<a id="windows" href class="download-button" title="download client for windows">
<i class="fab fa-windows"></i>
Expand Down Expand Up @@ -75,7 +75,7 @@ <h4 class="header__download-box--subtitle">Or download the desktop client:</h4>

</div>
<div>
<a class="header__old-releases" href="https://github.com/NicolasConstant/sengi/releases/"
<a class="header__old-releases" href="https://github.com/NicolasConstant/sengi-electron/releases/"
title="browse previous releases">browse previous releases</a>
</div>
</div>
Expand Down Expand Up @@ -215,6 +215,12 @@ <h3 class="footer__title">Let's keep in touch!</h3>
return myJson;
}

const getLastElectronRelease = async () => {
const response = await fetch('https://api.github.com/repos/NicolasConstant/sengi-electron/releases/latest');
const myJson = await response.json();
return myJson;
}

function getOS() {
var userAgent = window.navigator.userAgent,
platform = window.navigator.platform,
Expand Down Expand Up @@ -242,19 +248,25 @@ <h3 class="footer__title">Let's keep in touch!</h3>
let lastRelease = await getLastRelease();
let version = lastRelease.tag_name;

let lastElectronRelease = await getLastElectronRelease();
let electronVersion = lastElectronRelease.tag_name;

var downloadButtons = document.getElementById('download-buttons');
downloadButtons.style.display = 'block';

var downloadButtonsNojs = document.getElementById('download-buttons-nojs');
downloadButtonsNojs.style.display = 'none';

var sengiVersion = document.getElementById('sengi-version');
sengiVersion.textContent = `Current version: ${version}`;
sengiVersion.textContent = `Current version: v${version}`;

var htmlElectronVersion = document.getElementById('electron-version');
htmlElectronVersion.textContent = `(${electronVersion})`;

document.getElementById('windows').href = `https://github.com/NicolasConstant/sengi/releases/download/${version}/Sengi-${version}-win.exe`;
document.getElementById('mac').href = `https://github.com/NicolasConstant/sengi/releases/download/${version}/Sengi-${version}-mac.dmg`;
document.getElementById('deb').href = `https://github.com/NicolasConstant/sengi/releases/download/${version}/Sengi-${version}-linux.deb`;
document.getElementById('appimage').href = `https://github.com/NicolasConstant/sengi/releases/download/${version}/Sengi-${version}-linux.AppImage`;
document.getElementById('windows').href = `https://github.com/NicolasConstant/sengi-electron/releases/download/${electronVersion}/Sengi-${electronVersion.replace('v', '')}-win.exe`;
document.getElementById('mac').href = `https://github.com/NicolasConstant/sengi-electron/releases/download/${electronVersion}/Sengi-${electronVersion.replace('v', '')}-mac.dmg`;
document.getElementById('deb').href = `https://github.com/NicolasConstant/sengi-electron/releases/download/${electronVersion}/Sengi-${electronVersion.replace('v', '')}-linux.deb`;
document.getElementById('appimage').href = `https://github.com/NicolasConstant/sengi-electron/releases/download/${electronVersion}/Sengi-${electronVersion.replace('v', '')}-linux.AppImage`;


let userOs = getOS();
Expand Down
238 changes: 0 additions & 238 deletions main-electron.js

This file was deleted.

Loading

0 comments on commit b00c52f

Please sign in to comment.