Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revisionBoth sides next revision | ||
admin:online-platform-cms:3rd-party-scripts:content-hidder-script [2022/10/31 11:55] – created ignas-bogusis | admin:online-platform-cms:3rd-party-scripts:content-hidder-script [2022/11/23 08:06] – ignas-bogusis | ||
---|---|---|---|
Line 9: | Line 9: | ||
< | < | ||
Here you can add specific website parts to be hidden. Class / ID has to be unique, otherwise it will hide all content that match written class/ | Here you can add specific website parts to be hidden. Class / ID has to be unique, otherwise it will hide all content that match written class/ | ||
+ | </ | ||
+ | **REDIRECT_TO_MAIN_PAGE_AFTER_REGISTRATION** | ||
+ | < | ||
+ | Set this to " | ||
</ | </ | ||
**HIDDEN_GAMES** | **HIDDEN_GAMES** | ||
< | < | ||
Here you can add games that you want to be hidden in header. If you pass `' | Here you can add games that you want to be hidden in header. If you pass `' | ||
- | |||
</ | </ | ||
- | == Available games == | + | == Available games : == |
- dogs | - dogs | ||
- prematch | - prematch | ||
Line 27: | Line 30: | ||
- roulette | - roulette | ||
- greyhounds | - greyhounds | ||
+ | - pragmatic | ||
+ | - agtslots | ||
+ | - roulette-live | ||
+ | - dogs | ||
+ | - betgames-rng-wheel | ||
- undefined (hides every expandable header menu) | - undefined (hides every expandable header menu) | ||
+ | |||
=== HIDDER SCRIPT === | === HIDDER SCRIPT === | ||
< | < | ||
- | const SUB_DOMAIN = ''; | + | const SUB_DOMAIN = 'example'; |
+ | const REDIRECT_TO_MAIN_PAGE_AFTER_REGISTRATION = true; | ||
const HIDDEN_CONTENT = [ | const HIDDEN_CONTENT = [ | ||
- | ' | + | ' |
- | ' | + | |
- | ' | + | |
- | '# | + | |
- | ' | + | |
]; | ]; | ||
const HIDDEN_GAMES = [ | const HIDDEN_GAMES = [ | ||
Line 62: | Line 68: | ||
getElement(element).then((selector) => { | getElement(element).then((selector) => { | ||
selector.forEach((elem) => { | selector.forEach((elem) => { | ||
- | elem.style.display = ' | + | elem.remove(); |
}) | }) | ||
}) | }) | ||
Line 69: | Line 75: | ||
getElement(' | getElement(' | ||
selector.forEach((elem) => { | selector.forEach((elem) => { | ||
- | elem.style.display = ' | + | elem.remove(); |
}) | }) | ||
}) | }) | ||
Line 75: | Line 81: | ||
} | } | ||
- | function | + | function |
+ | const meta = document.createElement(" | ||
+ | meta.name = " | ||
+ | meta.content = " | ||
+ | document.head.appendChild(meta); | ||
+ | } | ||
+ | |||
+ | function getParsedSubDomain() { | ||
const host = window.location.host; | const host = window.location.host; | ||
- | | + | |
+ | } | ||
+ | |||
+ | function redirectToMainPage() { | ||
+ | const host = window.location.origin; | ||
+ | const newURL = host.replace(SUB_DOMAIN + ' | ||
+ | window.location.assign(newURL); | ||
+ | } | ||
+ | |||
+ | function startHider() { | ||
+ | const parsedSubDomain = getParsedSubDomain(); | ||
if (parsedSubDomain !== SUB_DOMAIN) return; | if (parsedSubDomain !== SUB_DOMAIN) return; | ||
console.log(' | console.log(' | ||
+ | addMeta(); | ||
hidePageContent(); | hidePageContent(); | ||
window.addEventListener(' | window.addEventListener(' | ||
document.addEventListener(' | document.addEventListener(' | ||
+ | document.addEventListener(' | ||
+ | if (REDIRECT_TO_MAIN_PAGE_AFTER_REGISTRATION) { | ||
+ | document.body.addEventListener(' | ||
+ | } | ||
} | } | ||
startHider(); | startHider(); | ||
</ | </ |