Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Commit

Permalink
Ooops! Add unsuscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
dewiweb committed Jun 24, 2020
1 parent e8b426b commit d130d73
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 13 deletions.
11 changes: 10 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ function createWindow () {
// et charger le fichier index.html de l'application.
win.loadFile('index.html')



// Ouvre les DevTools.
//win = null

Expand Down Expand Up @@ -195,6 +197,12 @@ function createWindow () {

console.log('OSC --> EMBER+ : ', (rOrArgs*sFactor).toFixed(0));
})
ipcMain.on("deleteConnection",async function(event, ePath, oAddr, myRow, eVarType, sFactor){
const req = await c.getElementByPath(ePath)
c.unsubscribe(req)
console.log('unsuscribe to ', ePath);

})
})
})
}
Expand All @@ -205,7 +213,8 @@ function createWindow () {
// win.setAutoHideMenuBar(true)
win.autoHideMenuBar = "true"
win.menuBarVisible = "false"
win.w
// win.webContents.send('blur', event);
// win.webContents.send('focus', event);
//end of create window
}

Expand Down
58 changes: 51 additions & 7 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ var ipcRenderer = require('electron').ipcRenderer
var oscAddr = new Array("/Channels")


//ipcRenderer.on('blur', function(event){
// console.log('blur');
// window.blur();
//})

//ipcRenderer.on('focus', function(event){
// console.log('focus');
// window.focus();
//})

ipcRenderer.on('udpportOK', function(event){
var dot2 = document.getElementById("dot2");
dot2.style.color = "green";
Expand Down Expand Up @@ -494,23 +504,57 @@ function modifyOscAddr(event){

function SomeDeleteRowFunction(o) {
var table = document.getElementById("tableOfConnection");
if(typeof o == "number"){
table.deleteRow(o)}
console.log("TYPE OF O", typeof(o));

if(typeof(o) == "number"){
var myRow = o;
var ePath = table.rows[myRow].cells[0].innerHTML;
var oAddr = table.rows[myRow].cells[4].innerHTML;
var eVarFactor = table.rows[myRow].cells[2].innerHTML;
var eVarType = table.rows[myRow].cells[6].innerHTML;

console.log("ePath",ePath);
console.log("oAddr",oAddr);

ipcRenderer.send('deleteConnection', ePath, oAddr, myRow, eVarType, eVarFactor);
table.deleteRow(o)
console.log("delete Row", o);
}
else{
//no clue what to put here?
var p=o.parentNode.parentNode;
p.parentNode.removeChild(p);
//p.parentNode.removeChild(p);
myRow = p.rowIndex;
console.log(myRow);
//sFactor = factor;
var ePath = table.rows[myRow].cells[0].innerHTML;
var oAddr = table.rows[myRow].cells[4].innerHTML;
var eVarFactor = table.rows[myRow].cells[2].innerHTML;
var eVarType = table.rows[myRow].cells[6].innerHTML;

console.log("ePath",ePath);
console.log("oAddr",oAddr);

ipcRenderer.send('deleteConnection', ePath, oAddr, myRow, eVarType, eVarFactor);
p.parentNode.removeChild(p);
console.log("delete row", myRow);

}
}
}


function deleteAllRows(o) {
var table = document.getElementById("tableOfConnection");
var numOfConn = table.rows.length;
for (var x=numOfConn-1; x>1; x--) {
table.deleteRow(x);
}
for (let x=numOfConn-1; x>1 ; x--) {
setTimeout(() => {
SomeDeleteRowFunction((table.rows.length)-1);
}, x*25)
}
}



function sendConnection(o){
var table = document.getElementById("tableOfConnection");
if(typeof o == "number"){
Expand Down
37 changes: 32 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
/*Scrollbar*/

::-webkit-scrollbar {
display: none;
::-webkit-scrollbar { /* Scrollbars */
width: .875em;
height: .875em;
background: #282C34;
}



::-webkit-scrollbar-track-piece { /* Fond */
background: transparent none;
border: solid .25em transparent;
border-right-width: .5em;
margin: .25em;
box-shadow: inset .0625em .0625em 0 0 rgb(137,131,117), inset -.0625em -.0625em 0 0 rgb(224,220,210);
}
::-webkit-scrollbar-thumb { /* Barre */
border: solid 0 transparent;
border-right-width: .25em;
border-radius: .3125em;
box-shadow: inset 0 0 0 .0625em rgb(79,79,79), inset 0 0 0 .375em rgb(102,102,102);
}
::-webkit-scrollbar-thumb:hover { /* Barre */
box-shadow: inset 0 0 0 .0625em rgb(90,90,90), inset 0 0 0 .375em rgb(110,110,110);
}

::-webkit-scrollbar-corner { /* Coin de la fenêtre */
background: #bfb6a3 ;
}

/*---------------------*/


@media (prefers-color-scheme: dark) {
body {
background-color: #282C34;
Expand Down Expand Up @@ -163,7 +192,5 @@ caption{

#menu .button {
margin-bottom: 15px;
margin-top: 15px;


margin-top: 15px;
}

0 comments on commit d130d73

Please sign in to comment.