Permalink
Browse files

offline splash in tourneys

  • Loading branch information...
Manuel-777 committed Jan 23, 2019
1 parent fcf4716 commit b677a8d277035fa6632e4bd3f8a1fd0c1230d2fe
Showing with 25 additions and 9 deletions.
  1. +6 −1 window_background/background.js
  2. +2 −0 window_main/index.css
  3. +17 −8 window_main/renderer.js
@@ -495,7 +495,12 @@ ipc.on('request_course', function (event, arg) {
});

ipc.on('request_tou_list', function () {
httpApi.httpTournamentList();
if (playerUsername == '') {
ipc_send("offline", 1);
}
else {
httpApi.httpTournamentList();
}
});

ipc.on('tou_get', function (event, arg) {
@@ -14,6 +14,7 @@ span i {
}

.top_status_pop {
font-size: 14px;
pointer-events: none;
display: grid;
padding: 12px;
@@ -643,6 +644,7 @@ a:hover {
}

.message_center {
top: 48px;
position: absolute;
left: 0;
width: 100%;
@@ -629,12 +629,16 @@ ipc.on('log_ok', function () {

//
ipc.on('offline', function () {
showOfflineSplash();
});

function showOfflineSplash() {
document.body.style.cursor = "auto";
$('#ux_0').html('<div class="message_center" style="display: flex; position: fixed;"><div class="message_unlink"></div><div class="message_big red">Oops, you are offline!</div><div class="message_sub_16 white">You can <a class="signup_link">sign up</a> to access online features.</div></div>');
$(".signup_link").click(function() {
shell.openExternal('https://mtgatool.com/signup/');
});
});
}

//
ipc.on('log_read', function () {
@@ -786,14 +790,19 @@ $(document).ready(function() {

if ($(this).hasClass("ith")) {
sidebarActive = -1;
$("#ux_0").html('<div class="loading_bar ux_loading"><div class="loading_color loading_w"></div><div class="loading_color loading_u"></div><div class="loading_color loading_b"></div><div class="loading_color loading_r"></div><div class="loading_color loading_g"></div></div>');

if (discordTag == null) {
open_tournaments_tab(null, true);
if (offlineMode) {
showOfflineSplash();
}
else {
document.body.style.cursor = "progress";
ipc_send('request_tou_list', true);
$("#ux_0").html('<div class="loading_bar ux_loading"><div class="loading_color loading_w"></div><div class="loading_color loading_u"></div><div class="loading_color loading_b"></div><div class="loading_color loading_r"></div><div class="loading_color loading_g"></div></div>');

if (discordTag == null) {
open_tournaments_tab(null, true);
}
else {
document.body.style.cursor = "progress";
ipc_send('request_tou_list', true);
}
}
}
if ($(this).hasClass("it0")) {
@@ -1912,7 +1921,7 @@ function open_settings(openSection) {
var sliderScaleInput = $('<input type="range" min="10" max="200" step="10" value="'+overlayScale+'" class="slider sliderD" id="scaleRange">');
sliderScaleInput.appendTo(sliderScale);

$('<div class="button_simple centered resetOverlayPos" onclick="resetOverlay(this)">Reset Position</div>').appendTo(section);
$('<div class="button_simple centered resetOverlayPos">Reset Position</div>').appendTo(section);

//
section = $('<div class="settings_section ss3"></div>');

0 comments on commit b677a8d

Please sign in to comment.