-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/open_detail_window' into develop
- Loading branch information
Showing
6 changed files
with
87 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const { contextBridge, ipcRenderer } = require('electron') | ||
const path = require('path') | ||
|
||
const publicPath = | ||
process.env.NODE_ENV === 'development' | ||
? './public' | ||
: path.join(process.resourcesPath, 'public'); | ||
const imagesPath = path.join(publicPath, "assets", "images"); | ||
|
||
function selectTopDiv(ele) { | ||
while (!ele.classList.contains('device') && ele.tagName != "INPUT") { | ||
ele = ele.parentElement; | ||
} | ||
return ele; | ||
} | ||
|
||
function enableDoubleClick(ele) { | ||
ele.ondblclick = function (ev) { | ||
current = selectTopDiv(ev.target); | ||
} | ||
} | ||
|
||
function enableRightClick(ele) { | ||
ele.oncontextmenu = function (ev) { | ||
current = selectTopDiv(ev.target); | ||
} | ||
} | ||
|
||
ipcRenderer.on('type', (event, arg) => { | ||
console.log(arg) | ||
document.getElementById("canvas").innerHTML += "<div id='0' class='device detail " + arg + "' style='top: 0px; left: 0px;'><img class='detail' draggable='false' src='" + path.join(imagesPath, arg + ".svg") + "'></div>"; | ||
}); |
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,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script> | ||
window.$ = window.jQuery = require("jquery"); | ||
</script> | ||
<link rel="stylesheet" href="./style.css"> | ||
<title>Device detail</title> | ||
</head> | ||
<body> | ||
<!--<h1>Mixers routing tool</h1> | ||
<p>👋</p> | ||
<p id="info"></p> | ||
<button type="button" onclick="document.getElementById('demo').innerHTML = Date()">Click Me!</button> | ||
<p id="demo"></p>--> | ||
<div id="canvas"> | ||
</div> | ||
</body> | ||
<script src="./device-detail-renderer.js"></script> | ||
</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
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 |
---|---|---|
|
@@ -30,4 +30,9 @@ html, body { | |
} | ||
.sd16 img { | ||
width: 200px; | ||
} | ||
|
||
.detail { | ||
width: 100% !important; | ||
height: 100% !important; | ||
} |