Remaking open on browser logic.

This commit is contained in:
Tristan Roux
2019-03-28 20:25:30 +01:00
parent e5f693e78c
commit b9994d640a
14 changed files with 792 additions and 87 deletions

3
.vscode/tasks.json vendored
View File

@@ -22,7 +22,8 @@
"label": "Build Typescript",
"type": "shell",
"command": "npx webpack",
"group": "build"
"group": "build",
"problemMatcher": []
},
{
"label": "Watch Typescript",

View File

@@ -6,5 +6,8 @@
{
"path": "../EAU-Backend"
}
]
],
"settings": {
"liveServer.settings.multiRootWorkspaceName": "EAU"
}
}

4
dist/html/fragments/settings.html vendored Normal file
View File

@@ -0,0 +1,4 @@
<div class="container">
<p>Steam</p>
<button><a class="browser" href="http://eau.raccoon-sdg.fr/steamLog.php">Steam sign in</a></button>
</div>

View File

@@ -3,14 +3,15 @@
<head>
<title>EAU</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="dist/css/custom.css" type="text/css">
<link rel="stylesheet" href="../css/custom.css" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<script>if (typeof module === 'object') { window.module = module; module = undefined; }</script>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="../../node_modules/jquery/dist/jquery.min.js"></script>
<script>if (window.module) module = window.module;</script>
<script src="dist/js/index.js"></script>
<script src="../js/electron-specific.js"></script> <!--Using this script because electrons scripts cant be compiled-->
<script src="../js/index.js"></script>
</head>
<body>
<header>

View File

@@ -1,4 +0,0 @@
<div class="container">
<p>Steam</p>
<button id="steamLogBtn">Steam sign in</button>
</div>

10
dist/js/electron-specific.js vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strick";
const { shell } = require("electron");
$(".browser").click((event) =>
{
console.log("Steam log clicked");
event.preventDefault();
console.log(shell);
shell.openExternal(event.target.href);
});

4
dist/js/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -5,9 +5,9 @@ var win;
function createWindow()
{
win = new BrowserWindow({ width: 1080, height: 720 });
win.loadFile("index.html");
win.loadFile("dist/html/index.html");
win.setMenu(null);
win.webContents.openDevTools();
win.on("closed", () =>
{
win = null;
@@ -25,7 +25,7 @@ app.on("ready", () =>
console.log("callback: " + callback.name);
}, (error) =>
{
console.log(error.name);
console.log(error);
});
});

818
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,7 @@
"@types/jquery": "^3.3.29",
"bootstrap": "^4.3.1",
"electron": "^4.1.1",
"fs": "0.0.1-security",
"gulp": "^4.0.0",
"gulp-sass": "^4.0.2",
"jquery": "^3.3.1",

View File

@@ -12,7 +12,7 @@ $(function ()
function home()
{
$("#content").load("dist/html/home.html", () =>
$("#content").load("fragments/home.html", () =>
{
setup()
populateGrid();
@@ -30,13 +30,9 @@ function openSearch()
function openSettings()
{
$("#content").load("dist/html/settings.html", () =>
$("#content").load("fragments/settings.html", () =>
{
document.getElementById("steamLogBtn").onclick = (event) =>
{
event.preventDefault();
require("electron").shell.openExternal("eau.raccoon-sdg.fr");
};
//Do things when the settings has been loaded.
});
document.getElementById("title").innerHTML = "<i class='icon fas fa-arrow-left'></i> Settings";
}

View File

@@ -1,5 +1,5 @@
const path = require("path");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: [
@@ -23,5 +23,6 @@ module.exports = {
filename: "index.js",
path: path.resolve(__dirname, "dist/js")
},
mode: "production"
};
mode: "production",
target: "electron-renderer"
};