1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 20:30:05 +02:00

18 Commits

Author SHA1 Message Date
dependabot[bot]
bd469bcee6 Bump electron from 13.1.2 to 18.3.7
Bumps [electron](https://github.com/electron/electron) from 13.1.2 to 18.3.7.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](https://github.com/electron/electron/compare/v13.1.2...v18.3.7)

---
updated-dependencies:
- dependency-name: electron
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 14:23:24 +00:00
s2
44b4183597 2.0.16 2021-06-19 00:44:18 +02:00
s2
cfce0edaa9 update node modules 2021-06-19 00:43:58 +02:00
s2
5edd143318 2.0.15 2021-05-07 15:54:10 +02:00
s2
e576161518 update node modules 2021-05-07 15:53:54 +02:00
s2
7a63056ef3 2.0.14 2021-01-29 09:43:45 +01:00
s2
efd9d13454 update node modules 2021-01-29 09:43:28 +01:00
s2
9836f5c918 2.0.13 2021-01-13 15:57:32 +01:00
s2
6c9787fea1 add homepage link 2021-01-13 15:57:21 +01:00
s2
16138409f9 2.0.12 2020-12-11 12:34:12 +01:00
s2
f604749ce8 update electron 2020-12-11 12:33:55 +01:00
s2
a259bd3e14 2.0.11 2020-10-16 12:01:12 +02:00
s2
e3ed1c6e44 update node modules 2020-10-16 12:00:49 +02:00
s2
5d60c8baac 2.0.10 2020-09-13 12:53:00 +02:00
s2
8afc7fdac1 update node modules 2020-09-13 12:52:30 +02:00
s2
e934617a03 ask if the update should be downloaded 2020-09-13 12:52:22 +02:00
s2
9f696e12f9 2.0.9 2020-09-13 10:24:36 +02:00
s2
b326c45593 update node modules 2020-09-13 10:24:23 +02:00
5 changed files with 1372 additions and 758 deletions

View File

@@ -3,6 +3,7 @@
const remote = require('electron').remote; const remote = require('electron').remote;
const electronFind = require('electron-find'); const electronFind = require('electron-find');
const dialog = remote.require('electron').dialog; const dialog = remote.require('electron').dialog;
const shell = require('electron').shell;
let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents()); let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents());
@@ -13,15 +14,18 @@
//update stuff //update stuff
ipcRenderer.on('update', (event, state) => { ipcRenderer.on('update', (event, state) => {
if (state.event === 'updateAvailable') { if (state.event === 'updateAvailable') {
$('.js-updatenotice').text(`New version ${state.version} available. Downloading...`); $('.js-updatenotice').text(`New version ${state.version} available. Click here to download.`);
$('.js-updatenotice').prop('disabled', true);
$('.js-updatenotice').show(); $('.js-updatenotice').show();
$('.js-updatenotice').prop('disabled', false);
$('.js-updatenotice').prop('state', 'ready-to-download');
$('.js-updatenotice').data('asset', state.asset);
} }
if (state.event === 'updateReadyToInstall') { if (state.event === 'updateReadyToInstall') {
$('.js-updatenotice').text(`New version ready to install. Click here to start installer.`); $('.js-updatenotice').text(`New version ready to install. Click here to start installer.`);
$('.js-updatenotice').show(); $('.js-updatenotice').show();
$('.js-updatenotice').prop('disabled', false); $('.js-updatenotice').prop('disabled', false);
$('.js-updatenotice').prop('state', 'ready-to-install');
$('.js-updatenotice').data('file', state.file); $('.js-updatenotice').data('file', state.file);
} }
}); });
@@ -31,9 +35,16 @@
if ($('.js-updatenotice').prop('disabled')) { if ($('.js-updatenotice').prop('disabled')) {
return; return;
} }
$('.js-updatenotice').prop('disabled', true);
$('.js-updatenotice').text(`Launching installer...`); if ($('.js-updatenotice').prop('state') === 'ready-to-download') {
ipcRenderer.send('installUpdate', $('.js-updatenotice').data('file')); $('.js-updatenotice').prop('disabled', true);
$('.js-updatenotice').text(`Downloading new version...`);
ipcRenderer.send('downloadUpdate', $('.js-updatenotice').data('asset'));
} else if ($('.js-updatenotice').prop('state') === 'ready-to-install') {
$('.js-updatenotice').prop('disabled', true);
$('.js-updatenotice').text(`Launching installer...`);
ipcRenderer.send('installUpdate', $('.js-updatenotice').data('file'));
}
}); });
//end update stuff //end update stuff
@@ -134,6 +145,11 @@
}); });
}); });
$(document).on('click', 'a[href^="http"]', function(event) {
event.preventDefault();
shell.openExternal(this.href);
});
$(document).on('keypress', (ev) => { $(document).on('keypress', (ev) => {
//ctrl + f //ctrl + f
if (ev.ctrlKey && ev.charCode == 6) { if (ev.ctrlKey && ev.charCode == 6) {

View File

@@ -26,9 +26,9 @@ if (process.platform === 'win32') {
gau.onUpdateAvailable = (version, asset) => { gau.onUpdateAvailable = (version, asset) => {
win.webContents.send('update', { win.webContents.send('update', {
event: 'updateAvailable', event: 'updateAvailable',
version: version version: version,
asset: asset
}); });
gau.downloadNewVersion(asset);
}; };
gau.onNewVersionReadyToInstall = (file) => { gau.onNewVersionReadyToInstall = (file) => {
@@ -38,6 +38,10 @@ if (process.platform === 'win32') {
}); });
}; };
ipcMain.on('downloadUpdate', (event, asset) => {
gau.downloadNewVersion(asset);
});
ipcMain.on('installUpdate', (event, file) => { ipcMain.on('installUpdate', (event, file) => {
gau.executeUpdate(file); gau.executeUpdate(file);
win.webContents.send('update', { win.webContents.send('update', {

View File

@@ -6,4 +6,7 @@
<a class="btn btn-primary btn-lg js-open-folder" href="javascript:///">Open git repository folder</a> <a class="btn btn-primary btn-lg js-open-folder" href="javascript:///">Open git repository folder</a>
<input type="file" style="display: none" class="js-open-folder-input" webkitdirectory /> <input type="file" style="display: none" class="js-open-folder-input" webkitdirectory />
</div> </div>
<p>
<a href="https://github.com/S2-/gitlit">Homepage</a>
</p>
</div> </div>

2077
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "gitlit", "name": "gitlit",
"version": "2.0.8", "version": "2.0.16",
"description": "", "description": "",
"main": "app/main.js", "main": "app/main.js",
"build": { "build": {
@@ -27,14 +27,14 @@
} }
}, },
"dependencies": { "dependencies": {
"animate.css": "^4.1.0", "animate.css": "^4.1.1",
"bootstrap": "^4.5.0", "bootstrap": "^4.6.0",
"ejs": "^3.1.3", "ejs": "^3.1.6",
"ejs-render-remote": "^1.0.13", "ejs-render-remote": "^1.0.13",
"electron-find": "^1.0.6", "electron-find": "^1.0.6",
"electron-localshortcut": "^3.2.1", "electron-localshortcut": "^3.2.1",
"github-app-updater": "^1.0.4", "github-app-updater": "^1.0.5",
"jquery": "^3.5.1", "jquery": "^3.6.0",
"material-design-icons": "^3.0.1", "material-design-icons": "^3.0.1",
"minimist": "^1.2.5", "minimist": "^1.2.5",
"nonblockjs": "^1.0.8", "nonblockjs": "^1.0.8",
@@ -42,8 +42,8 @@
"popper.js": "^1.16.1" "popper.js": "^1.16.1"
}, },
"devDependencies": { "devDependencies": {
"electron": "^9.1.1", "electron": "^18.3.7",
"electron-builder": "^22.7.0" "electron-builder": "^22.11.7"
}, },
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",