This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 947
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #352 from mgilangjanuar/staging
patch1
- Loading branch information
Showing
32 changed files
with
5,865 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"cli": { | ||
"version": ">= 0.52.0" | ||
}, | ||
"build": { | ||
"development": { | ||
"developmentClient": true, | ||
"distribution": "internal" | ||
}, | ||
"preview": { | ||
"distribution": "internal" | ||
}, | ||
"production": {} | ||
}, | ||
"submit": { | ||
"production": {} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
ignore: | ||
- dependency-name: electron | ||
versions: | ||
- 11.2.1 | ||
- 11.2.2 | ||
- 12.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
release-builds | ||
package-lock.json | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* No topbar */ | ||
|
||
#webview { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
display: inline-flex !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* Main */ | ||
|
||
body { | ||
margin: 0; | ||
padding: 0; | ||
-webkit-user-select: none; | ||
-webkit-app-region: drag; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* Topbar */ | ||
|
||
#controls { | ||
padding: 5px; | ||
border-bottom: solid 1px #ccc; | ||
background-color: #f8f8f8; | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const getControlsHeight = () => { | ||
const controls = document.querySelector("#controls"); | ||
if (controls) { | ||
return controls.offsetHeight; | ||
} | ||
return 0; | ||
}; | ||
|
||
function calculateLayoutSize() { | ||
const webview = document.querySelector("webview"); | ||
const windowWidth = document.documentElement.clientWidth; | ||
const windowHeight = document.documentElement.clientHeight; | ||
const controlsHeight = getControlsHeight(); | ||
const webviewHeight = windowHeight - controlsHeight; | ||
|
||
webview.style.width = windowWidth + "px"; | ||
webview.style.height = webviewHeight + "px"; | ||
} | ||
|
||
const homeButton = () => { | ||
document.querySelector("#home").onclick = () => { | ||
const home = document.getElementById("webview").getAttribute("data-home"); | ||
document.querySelector("webview").src = home; | ||
}; | ||
}; | ||
|
||
window.onload = () => { | ||
calculateLayoutSize(); | ||
homeButton(); | ||
}; | ||
|
||
window.onresize = calculateLayoutSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="assets/css/style.css" /> | ||
<link rel="stylesheet" href="assets/css/topbar.css" /> | ||
<!-- <link rel="stylesheet" href="assets/css/no-topbar.css"> --> | ||
<script defer src="assets/js/renderer.js"></script> | ||
<meta | ||
http-equiv="Content-Security-Policy" | ||
content="default-src 'self'; style-src 'self' 'unsafe-inline';" | ||
/> | ||
</head> | ||
<body> | ||
<!-- Topbar --> | ||
<div id="controls"> | ||
<button id="home" title="Go Home">Home</button> | ||
|
||
</div> | ||
<!-- End topbar --> | ||
|
||
<!-- Webview --> | ||
<webview | ||
id="webview" | ||
autosize="on" | ||
src="https://teledrive-web.vercel.app/startup" | ||
data-home="https://teledrive-web.vercel.app/startup" | ||
></webview> | ||
|
||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Electron | ||
const { app, Menu } = require("electron"); | ||
const remoteMain = require("@electron/remote/main"); | ||
remoteMain.initialize(); | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
app.allowRendererProcessReuse = true; | ||
app.on("ready", () => { | ||
// Main window | ||
const window = require("./src/window"); | ||
mainWindow = window.createBrowserWindow(app); | ||
remoteMain.enable(mainWindow.webContents); | ||
|
||
// Option 1: Uses Webtag and load a custom html file with external content | ||
mainWindow.loadURL(`file://${__dirname}/index.html`); | ||
|
||
// Option 2: Load directly an URL if you don't need interface customization | ||
//mainWindow.loadURL("https://github.com"); | ||
|
||
// Option 3: Uses BrowserView to load an URL | ||
//const view = require("./src/view"); | ||
//view.createBrowserView(mainWindow); | ||
|
||
// Display Dev Tools | ||
//mainWindow.openDevTools(); | ||
|
||
// Menu (for standard keyboard shortcuts) | ||
const menu = require("./src/menu"); | ||
const template = menu.createTemplate(app.name); | ||
const builtMenu = Menu.buildFromTemplate(template); | ||
Menu.setApplicationMenu(builtMenu); | ||
}); | ||
|
||
// Quit when all windows are closed. | ||
app.on("window-all-closed", () => { | ||
app.quit(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "electron-webview", | ||
"productName": "Electron webview", | ||
"version": "1.0.0", | ||
"description": "A simple Electron webview application", | ||
"main": "main.js", | ||
"scripts": { | ||
"start": "electron .", | ||
"package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=release-builds", | ||
"package-win": "electron-packager . --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Electron Webview\"", | ||
"package-linux": "electron-packager . --overwrite --platform=linux --arch=x64 --icon=assets/icons/png/1024x1024.png --prune=true --out=release-builds", | ||
"create-installer-mac": "electron-installer-dmg ./release-builds/Electron\\ webview-darwin-x64/Electron\\ webview.app electron-webview --out=release-builds --overwrite --icon=assets/icons/mac/icon.icns" | ||
}, | ||
"repository": "https://github.com/cba85/electron-webview", | ||
"keywords": [ | ||
"Electron", | ||
"webview", | ||
"tutorial", | ||
"demo" | ||
], | ||
"author": "GitHub", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@electron/remote": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"electron": "^18.0.0", | ||
"electron-installer-dmg": "^3.0.0", | ||
"electron-packager": "^15.5.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { BrowserWindow } = require("@electron/remote"); | ||
|
||
window.addEventListener("DOMContentLoaded", () => { | ||
// Print function | ||
document.getElementById("print_button").addEventListener("click", () => { | ||
const url = document.querySelector("webview").getAttribute("src"); | ||
|
||
let printWindow = new BrowserWindow({ "auto-hide-menu-bar": true }); | ||
printWindow.loadURL(url); | ||
|
||
printWindow.webContents.on("did-finish-load", () => { | ||
printWindow.webContents.print(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
bb19df9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
teledrive-web – ./
teledrive-web-git-main-restfire-studio.vercel.app
teledrive-web.vercel.app
teledrive-web-restfire-studio.vercel.app