Permalink
Browse files

Output log dialog

  • Loading branch information...
Manuel-777 committed Nov 23, 2018
1 parent b1ac22d commit 47d4ebda5bf0f1ce397bde8df7af588b41e430a0
Showing with 95 additions and 26 deletions.
  1. +8 −0 main.js
  2. +3 −5 window_main/index.css
  3. +3 −2 window_main/index.html
  4. +81 −19 window_main/renderer.js
@@ -88,6 +88,10 @@ app.on('ready', () => {
break;
// to renderer
case 'log_ok':
mainWindow.webContents.send("log_ok", arg);
break;
case 'too_slow':
mainWindow.webContents.send("too_slow", arg);
console.log("Something went wrong loading", arg);
@@ -216,6 +220,10 @@ app.on('ready', () => {
break;
// to background
case 'set_log':
background.webContents.send("set_log", arg);
break;
case 'delete_course':
background.webContents.send("delete_course", arg);
break;
@@ -1635,9 +1635,7 @@ a:hover {
text-align: center;
}
.share_dialog_wrapper {
.dialog_wrapper {
pointer-events: none;
z-index: 50;
display: hidden;
@@ -1649,7 +1647,7 @@ a:hover {
-webkit-transition: all .15s cubic-bezier(1, 0.35, 0.35, 1);
}
.share_dialog {
.dialog {
z-index: 40;
display: flex;
position: relative;
@@ -1665,7 +1663,7 @@ a:hover {
-webkit-transition: all .15s cubic-bezier(1, 0.35, 0.35, 1);
}
.share_dialog_container {
.dialog_container {
margin: 16px;
}
@@ -17,10 +17,11 @@
<body>
<div class="outer_wrapper">
<div class="main_wrapper main_bg_image">
<div class="share_dialog_wrapper">
<div class="share_dialog">
<div class="dialog_wrapper">
<div class="dialog">
</div>
</div>
<div class="top">
<div class="flex_item">
<div class="top_logo"></div>
@@ -422,13 +422,75 @@ ipc.on('initialize', function (event, arg) {
});
//
var logDialogOpen = false;
ipc.on('no_log', function (event, arg) {
if (loggedIn) {
$('.top_nav').addClass('hidden');
$('.overflow_ux').addClass('hidden');
$('.message_center').css('display', 'flex');
$('.message_center').html('<div class="message_big red">No Log Found</div><div class="message_sub_16 white">check if it exists at '+arg+'</div><div class="message_sub_16 white">if it does, try closing MTG Arena and deleting it.</div>');
}
else if (!logDialogOpen) {
logDialogOpen = true;
$('.dialog_wrapper').css('opacity', 1);
$('.dialog_wrapper').css('pointer-events', 'all');
$('.dialog_wrapper').show();
$('.dialog').css('width', '600px');
$('.dialog').css('height', '200px');
$('.dialog').css('top', 'calc(50% - 100px)');
$('.dialog_wrapper').on('click', function(e) {
logDialogOpen = false;
console.log('.dialog_wrapper on click')
//e.stopPropagation();
$('.dialog_wrapper').css('opacity', 0);
$('.dialog_wrapper').css('pointer-events', 'none');
setTimeout(function() {
$('.dialog_wrapper').hide();
$('.dialog').css('width', '500px');
$('.dialog').css('height', '160px');
$('.dialog').css('top', 'calc(50% - 80px)');
}, 250);
});
$('.dialog').on('click', function(e) {
e.stopPropagation();
console.log('.dialog on click')
});
var dialog = $('.dialog');
dialog.html('');
var cont = $('<div class="dialog_container"></div>');
cont.append('<div class="share_title">Enter output_log.txt location:</div>');
var icd = $('<div class="share_input_container"></div>');
var sin = $('<input style="border-radius: 3px; height: 28px;font-size: 14px;" id="log_input" onClick="this.setSelectionRange(0, this.value.length)" autofocus autocomplete="off" value="'+arg+'" />');
var but = $('<div class="button_simple">Save</div>');
sin.appendTo(icd);
icd.appendTo(cont);
cont.appendTo(dialog);
but.appendTo(dialog);
but.click(function () {
ipc_send('set_log', document.getElementById("log_input").value);
});
}
});
ipc.on('log_ok', function (event, arg) {
logDialogOpen = false;
$('.dialog_wrapper').css('opacity', 0);
$('.dialog_wrapper').css('pointer-events', 'none');
setTimeout(function() {
$('.dialog_wrapper').hide();
$('.dialog').css('width', '500px');
$('.dialog').css('height', '160px');
$('.dialog').css('top', 'calc(50% - 80px)');
}, 250);
});
//
@@ -1783,34 +1845,34 @@ function addShare(_match) {
$('.'+_match.id+'dr').on('click', function(e) {
currentId = _match.id;
e.stopPropagation();
$('.share_dialog_wrapper').css('opacity', 1);
$('.share_dialog_wrapper').css('pointer-events', 'all');
$('.share_dialog_wrapper').show();
$('.share_dialog').css('width', '500px');
$('.share_dialog').css('height', '200px');
$('.share_dialog').css('top', 'calc(50% - 100px)');
$('.share_dialog_wrapper').on('click', function(e) {
console.log('.share_dialog_wrapper on click')
$('.dialog_wrapper').css('opacity', 1);
$('.dialog_wrapper').css('pointer-events', 'all');
$('.dialog_wrapper').show();
$('.dialog').css('width', '500px');
$('.dialog').css('height', '200px');
$('.dialog').css('top', 'calc(50% - 100px)');
$('.dialog_wrapper').on('click', function(e) {
console.log('.dialog_wrapper on click')
//e.stopPropagation();
$('.share_dialog_wrapper').css('opacity', 0);
$('.share_dialog_wrapper').css('pointer-events', 'none');
$('.dialog_wrapper').css('opacity', 0);
$('.dialog_wrapper').css('pointer-events', 'none');
setTimeout(function() {
$('.share_dialog_wrapper').hide();
$('.share_dialog').css('width', '400px');
$('.share_dialog').css('height', '160px');
$('.share_dialog').css('top', 'calc(50% - 80px)');
$('.dialog_wrapper').hide();
$('.dialog').css('width', '400px');
$('.dialog').css('height', '160px');
$('.dialog').css('top', 'calc(50% - 80px)');
}, 250);
});
$('.share_dialog').on('click', function(e) {
$('.dialog').on('click', function(e) {
e.stopPropagation();
console.log('.share_dialog on click')
console.log('.dialog on click')
});
var dialog = $('.share_dialog');
var dialog = $('.dialog');
dialog.html('');
var cont = $('<div class="share_dialog_container"></div>');
var cont = $('<div class="dialog_container"></div>');
cont.append('<div class="share_title">Link For sharing:</div>');
var icd = $('<div class="share_input_container"></div>');

0 comments on commit 47d4ebd

Please sign in to comment.