mirror of
https://github.com/S2-/gitlit
synced 2025-08-02 12:20:05 +02:00
update to latest electron version
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
const ipcRenderer = require('electron').ipcRenderer;
|
||||
const remote = require('electron').remote;
|
||||
const electronFind = require('electron-find');
|
||||
const dialog = remote.require('electron').dialog;
|
||||
|
||||
let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents());
|
||||
|
||||
let firstRun = true;
|
||||
@@ -121,12 +123,15 @@
|
||||
|
||||
$(document).on('click', '.js-open-folder', (ev) => {
|
||||
ev.preventDefault();
|
||||
$('.js-open-folder-input').trigger('click');
|
||||
});
|
||||
|
||||
$(document).on('change', '.js-open-folder-input', (ev) => {
|
||||
ev.preventDefault();
|
||||
ipcRenderer.send('restart', $('.js-open-folder-input')[0].files[0].path);
|
||||
dialog.showOpenDialog({
|
||||
properties: ['openDirectory']
|
||||
})
|
||||
.then((path) => {
|
||||
if (path && path.filePaths.length > 0) {
|
||||
ipcRenderer.send('restart', path.filePaths[0]);
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('keypress', (ev) => {
|
||||
|
10
app/main.js
10
app/main.js
@@ -162,7 +162,15 @@ function loadRepoPage() {
|
||||
|
||||
function createWindow() {
|
||||
// Create the browser window.
|
||||
win = new BrowserWindow({title: 'gitlit v' + app.getVersion(), width: 800, height: 700});
|
||||
win = new BrowserWindow({
|
||||
title: 'gitlit v' + app.getVersion(),
|
||||
width: 800,
|
||||
height: 700,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
enableRemoteModule: true
|
||||
}
|
||||
});
|
||||
win.setMenu(null);
|
||||
|
||||
// and load the index.html of the app.
|
||||
|
@@ -1,4 +1,3 @@
|
||||
<div class="text-center">
|
||||
<a class="btn btn-primary js-open-folder" href="javascript:///">Open another folder</a>
|
||||
<input type="file" style="display: none" class="js-open-folder-input" webkitdirectory />
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user