From 7206c6e7d68103454b6fb4e55d323768dbaf2a71 Mon Sep 17 00:00:00 2001 From: Theo Diamantidis Date: Fri, 23 Mar 2018 01:09:08 +0200 Subject: [PATCH] Enabled test mode on live stream info too --- app/Http/Controllers/CurrentEventController.php | 2 +- public/js/home-animations.js | 3 +++ resources/assets/js/home-animations.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/CurrentEventController.php b/app/Http/Controllers/CurrentEventController.php index 0724fc5..cf4d0d2 100644 --- a/app/Http/Controllers/CurrentEventController.php +++ b/app/Http/Controllers/CurrentEventController.php @@ -42,7 +42,7 @@ public function index(Request $request) { $where = [['visible', true]]; } - if(date('Y-m-d') == '2018-03-24') { + if($request->testLive == "yes" || date('Y-m-d') == '2018-03-24') { $events = Schedule :: where(array_merge($where, [['type', '!=', 'workshop']])) -> orderBy('hour', 'asc') -> get(); diff --git a/public/js/home-animations.js b/public/js/home-animations.js index 0848f6d..ae6d6ec 100644 --- a/public/js/home-animations.js +++ b/public/js/home-animations.js @@ -119,12 +119,15 @@ window.homeAnimations = function () { }, 5000); } + var testLiveVal = typeof window.URL === "function" ? new URL(location.href).searchParams.get("testLive") : undefined; + var update = function update() { if ($("#live").length > 0) { $.ajax({ type: "GET", url: "/currentEvent", dataType: "html", + data: { testLive: testLiveVal }, success: function success(data) { if (data != $("#hero .liveInfo").html()) { $("#hero .liveInfo").fadeOut(200, function () { diff --git a/resources/assets/js/home-animations.js b/resources/assets/js/home-animations.js index a569f60..f9c754d 100644 --- a/resources/assets/js/home-animations.js +++ b/resources/assets/js/home-animations.js @@ -41,12 +41,15 @@ window.homeAnimations = function() { }, 5000) } + let testLiveVal = typeof(window.URL) === "function" ? new URL(location.href).searchParams.get("testLive") : undefined + let update = function() { if($("#live").length > 0) { $.ajax({ type: "GET", url: "/currentEvent", dataType: "html", + data: {testLive: testLiveVal}, success: function(data) { if(data != $("#hero .liveInfo").html()) { $("#hero .liveInfo").fadeOut(200, function() {