aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Priyansh <[email protected]>2020-07-17 21:55:48 +0530
committerKumar Priyansh <[email protected]>2020-07-17 21:55:48 +0530
commit672dc896b139801bf454c51c9e61e2dd61932712 (patch)
tree0911f47917d60827617d0b3dc3baba23c6e357ac
parent431512a9625dea403afea32bb4d9b6f426fed4a5 (diff)
downloadauthorr-672dc896b139801bf454c51c9e61e2dd61932712.tar.xz
authorr-672dc896b139801bf454c51c9e61e2dd61932712.zip
Function to load Template URLs in Window
-rw-r--r--src/main.js1
-rw-r--r--src/scripts/starterWindow.js18
-rw-r--r--src/views/index.html2
-rw-r--r--src/views/templates/blank.html11
4 files changed, 28 insertions, 4 deletions
diff --git a/src/main.js b/src/main.js
index 93e29c7..9cc58cb 100644
--- a/src/main.js
+++ b/src/main.js
@@ -11,7 +11,6 @@ function createWindow () {
height: 600,
frame: false,
// transparent: true,
- vibrancy: 'dark',
titleBarStyle: 'hidden',
webPreferences: {
nodeIntegration: true
diff --git a/src/scripts/starterWindow.js b/src/scripts/starterWindow.js
index 0f20eca..dd21624 100644
--- a/src/scripts/starterWindow.js
+++ b/src/scripts/starterWindow.js
@@ -1,4 +1,9 @@
+const remote = require('electron').remote;
+
$(document).ready(function () {
+ var monitorWidth = screen.width;
+ var monitorHeight = screen.height;
+
$('.nav-group').on('click', 'span', function () {
$('.nav-group span.active').removeClass('active');
$(this).addClass('active');
@@ -25,13 +30,22 @@ $(document).ready(function () {
else {
showError('No Template Selected!', 'No template was selected. Please Select a template to get started!')
}
- })
+ });
+ $('#cancelSelected').click(function () {
+ var window = remote.getCurrentWindow();
+ window.close();
+ });
function showError(heading, message) {
const { remote } = window.require('electron')
const dialog = remote.dialog
dialog.showErrorBox(heading, message);
}
function start(id) {
- alert('This would start the ' + id + ' template');
+ var templateURL = 'file://' + __dirname + `/templates/${id}.html`;
+ var window = remote.getCurrentWindow();
+
+ window.setSize(monitorWidth * 0.75, monitorHeight * 0.75, false);
+ window.center();
+ window.loadURL(templateURL);
}
}) \ No newline at end of file
diff --git a/src/views/index.html b/src/views/index.html
index aa35cef..29e250a 100644
--- a/src/views/index.html
+++ b/src/views/index.html
@@ -35,7 +35,7 @@
<footer class="titlebar statusbar">
<div class="toolbars">
<button id="startSelected" class="button button-blue pull-right">Create</button>
- <button class="button button-default pull-right">Cancel</button>
+ <button id="cancelSelected" class="button button-default pull-right">Cancel</button>
</div>
</footer>
</div>
diff --git a/src/views/templates/blank.html b/src/views/templates/blank.html
new file mode 100644
index 0000000..7a07207
--- /dev/null
+++ b/src/views/templates/blank.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Document</title>
+</head>
+<body>
+ <h1>The Blank Template</h1>
+</body>
+</html> \ No newline at end of file