From f3ace9cc3924cfa50a5905427e32c261ef1b2a27 Mon Sep 17 00:00:00 2001 From: aONe Date: Thu, 16 Jul 2020 10:48:06 +0200 Subject: [PATCH 1/2] MotoGP support --- src/common/scripts/motogp.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/common/scripts/motogp.js diff --git a/src/common/scripts/motogp.js b/src/common/scripts/motogp.js new file mode 100644 index 0000000..3db7c07 --- /dev/null +++ b/src/common/scripts/motogp.js @@ -0,0 +1,33 @@ +export const domain = 'motogp'; + +export const resource = { + buttonStyle: (` + width: 3em; + height: 3em; + color: white; + background: transparent; + position: relative; + border: none; + outline: none; + border-radius: 0; + cursor: pointer; + -webkit-appearance: none; + z-index: 1; + `), + buttonHoverStyle: (` + background: radial-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0)) !important; + `), + buttonInsertBefore: function(parent) { + const fullScreenButton = document.querySelector('.vjs-fullscreen-control'); + if (fullScreenButton) { + return fullScreenButton; + } + return parent.lastChild; + }, + buttonParent: function() { + return document.querySelector('.vjs-control-bar'); + }, + videoElement: function() { + return document.querySelector('video[class="vjs-tech"]'); + } +}; From bf73a021e2fa6296a98e108b1b755371f9b535cf Mon Sep 17 00:00:00 2001 From: aone Date: Fri, 18 Jun 2021 10:29:51 +0200 Subject: [PATCH 2/2] Fix for Motogp script --- src/common/scripts/{ => resources}/motogp.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename src/common/scripts/{ => resources}/motogp.js (81%) diff --git a/src/common/scripts/motogp.js b/src/common/scripts/resources/motogp.js similarity index 81% rename from src/common/scripts/motogp.js rename to src/common/scripts/resources/motogp.js index 3db7c07..43cdf2f 100644 --- a/src/common/scripts/motogp.js +++ b/src/common/scripts/resources/motogp.js @@ -17,11 +17,11 @@ export const resource = { buttonHoverStyle: (` background: radial-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0)) !important; `), - buttonInsertBefore: function(parent) { - const fullScreenButton = document.querySelector('.vjs-fullscreen-control'); - if (fullScreenButton) { + buttonInsertBefore: function(/** Element */ parent) { + const fullScreenButton = document.querySelector('.vjs-fullscreen-control'); + if (fullScreenButton) { return fullScreenButton; - } + } return parent.lastChild; }, buttonParent: function() {