This commit is contained in:
MLH
2024-12-09 02:03:47 +01:00
parent 05f7a3aab9
commit 1cd0f4482f
3 changed files with 175 additions and 34 deletions

View File

@@ -2,7 +2,7 @@
start_directory: '.' # Startverzeichnis für die Suche start_directory: '.' # Startverzeichnis für die Suche
modifications: modifications:
- file_pattern: 'session-login-index-html\..*\.bundle\.js' - file_pattern: 'session-login-index-html..*.bundle.js'
insert_rules: insert_rules:
- after_text: '<div class="padded-left padded-right padded-bottom-page margin-auto-y">' - after_text: '<div class="padded-left padded-right padded-bottom-page margin-auto-y">'
insert_text: '<img id="login-logo" src="/web/assets/img/banner-dark.png" width=350px style="padding: 0px;display:block; margin-left: auto; margin-right: auto;">' insert_text: '<img id="login-logo" src="/web/assets/img/banner-dark.png" width=350px style="padding: 0px;display:block; margin-left: auto; margin-right: auto;">'
@@ -10,9 +10,51 @@ modifications:
# Instancename, Jellyseer I-Frame # Instancename, Jellyseer I-Frame
- file_pattern: 'index.html' - file_pattern: 'index.html'
insert_rules: insert_rules:
- before_text: '<link href="{*}" rel="stylesheet">' # Page title and requests tab
insert_text: 'New content to insert' - before_text: '<link href=".*" rel="stylesheet">'
insert_text: >
<script>
document.addEventListener("DOMContentLoaded", function () {
// Check if the title is "Jellyfin" before changing it
if (document.title === "Jellyfin") {
document.title = "SpaceCloud - Cinema";
}
// Create a MutationObserver to prevent any changes to the title
const observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.type === 'childList') {
// Only change the title if it's set to "Jellyfin"
if (document.title === "Jellyfin") {
document.title = "SpaceCloud - Cinema";
}
}
});
});
// Observe the document title for changes
observer.observe(document.querySelector('title'), { childList: true });
// Set up a fallback in case of attempts to change the title through direct assignment
Object.defineProperty(document, 'title', {
set: function (value) {
// Only allow the title to change if the new value is "Jellyfin"
if (value === "Jellyfin") {
document.querySelector('title').textContent = "SpaceCloud - Cinema";
} else {
document.querySelector('title').textContent = value;
}
},
get: function () {
return document.querySelector('title').textContent;
}
});
});
</script>
<script>const createRequestTab = () => {const title = document.createElement("div");title.classList.add("emby-button-foreground");title.innerText = "Anfragen";const button = document.createElement("button");button.type = "button";button.is = "empty-button";button.classList.add("emby-tab-button", "emby-button", "lastFocused");button.setAttribute("data-index", "2");button.setAttribute("id", "requestTab");button.appendChild(title);(function e() {const tabb = document.querySelector(".emby-tabs-slider");tabb ? !document.querySelector("#requestTab") && tabb.appendChild(button) : setTimeout(e, 500)})();}</script>
replace_rules: replace_rules:
# Page title
- old_text: '<title>Jellyfin</title>' - old_text: '<title>Jellyfin</title>'
new_text: '<title>SpaceCloud - Cinema</title>' new_text: '<title>SpaceCloud - Cinema</title>'
@@ -29,19 +71,15 @@ modifications:
- file_pattern: 'another-file-pattern\.js' - file_pattern: 'home-html..*.chunk.js'
insert_rules: insert_rules:
- before_text: 'specific-text-to-search-for' # featured iframe and requests iframe style
insert_text: 'Neuer Inhalt vor dem Zieltext' - after_text: 'data-backdroptype="movie,series,book">'
insert_text: >
- after_text: 'another-specific-text' <style> .featurediframe {width: 95vw; height: 24em; display: block; border: 0; margin: -1em auto 0;} @media (min-width: 2100px) {.featurediframe {height: 33em;}} @media (max-width: 1599px) {.featurediframe {margin-top: 1.2em;}} @media (max-width: 800px) {.featurediframe {margin-top: 0.8em; height: 25em;}} </style> <iframe class="featurediframe" src="/web/ui/spotlight.html"></iframe>
insert_text: 'Neuer Inhalt nach dem Zieltext' <style>:root { --save-gut: max(env(safe-area-inset-left), .3%) } .requestIframe { margin: 0 .4em; padding: 0 var(--save-gut); width: calc(100% - (.4em * 2) - (var(--save-gut) * 2)); height: 90vh; border: none; position: absolute; top: 5.3em } @media (max-width: 1599px) { .requestIframe { height: 83vh; top: 8.2em; } }</style><script>setTimeout(() => { createRequestTab() }, 500)</script>
# request tab on main page
- after_text: 'id="favoritesTab" data-index="1"> <div class="sections"></div> </div>'
insert_text: '<div class="tabContent pageTabContent" id="requestsTab" data-index="2"> <div class="sections"><iframe class="requestIframe" src="https://jellyseerr.mahom03-spacecloud.de"></iframe></div> </div>'
- file_pattern: '\.js$'
replace_rules:
- old_text: 'const version = '
new_text: 'const version = '
insert_rules:
- before_text: 'function initializeApp() {'
insert_text: '// Neue Initialisierungsvorbereitungen'

View File

@@ -0,0 +1,37 @@
# Zielverzeichnis für Operationen
destination_directory: './target_directory'
# Kopierregeln
copy_rules:
- sources:
- './source_folder' # Gesamter Ordner
- './specific_file.txt' # Einzelne Datei
- './source_directory/*.js' # Alle JS-Dateien
mode: 'replace' # Überschreibt vorhandene Dateien/Ordner
- sources:
- './source_folder' # Gesamter Ordner
- './specific_file.txt' # Einzelne Datei
- './source_directory/*.js' # Alle JS-Dateien
mode: 'copy' # Kopiert Dateien/Ordner
# Modifikationsregeln
modification_rules:
- file_pattern: '\.html$'
# Einfügeregeln
insert_rules:
- after_text: '<body>'
insert_text: '<div class="new-banner">Zusätzlicher Inhalt</div>'
# Ersetzungsregeln
replace_rules:
- old_text: '<title>Ein Titel</title>'
new_text: '<title>Cinema</title>'
- file_pattern: '\.js$'
replace_rules:
- old_text: 'const version = "1.0.0";'
new_text: 'const version = "2.0.0";'
insert_rules:
- before_text: 'function initializeApp() {'
insert_text: '// Neue Initialisierungsvorbereitungen'

View File

@@ -8,25 +8,91 @@ copy_rules:
- './specific_file.txt' # Einzelne Datei - './specific_file.txt' # Einzelne Datei
- './source_directory/*.js' # Alle JS-Dateien - './source_directory/*.js' # Alle JS-Dateien
mode: 'replace' # Überschreibt vorhandene Dateien/Ordner mode: 'replace' # Überschreibt vorhandene Dateien/Ordner
- sources:
- './seasonal'
- './img/background.png'
- './source_directory/*.js' # Alle JS-Dateien
mode: 'copy' # Kopiert Dateien/Ordner
# Modifikationsregeln # Modifikationsregeln
modification_rules: modification_rules:
- file_pattern: '\.html$' - file_pattern: 'session-login-index-html..*.bundle.js'
# Einfügeregeln
insert_rules: insert_rules:
- after_text: '<body>' - after_text: '<div class="padded-left padded-right padded-bottom-page margin-auto-y">'
insert_text: '<div class="new-banner">Zusätzlicher Inhalt</div>' insert_text: '<img id="login-logo" src="/web/assets/img/banner-dark.png" width=350px style="padding: 0px;display:block; margin-left: auto; margin-right: auto;">'
# Ersetzungsregeln # Instancename, Jellyseer I-Frame
replace_rules: - file_pattern: 'index.html'
- old_text: '<title>Ein Titel</title>'
new_text: '<title>Cinema</title>'
- file_pattern: '\.js$'
replace_rules:
- old_text: 'const version = "1.0.0";'
new_text: 'const version = "2.0.0";'
insert_rules: insert_rules:
- before_text: 'function initializeApp() {' # Page title and requests tab
insert_text: '// Neue Initialisierungsvorbereitungen' - before_text: '<link href=".*" rel="stylesheet">'
insert_text: >
<script>
document.addEventListener("DOMContentLoaded", function () {
// Check if the title is "Jellyfin" before changing it
if (document.title === "Jellyfin") {
document.title = "SpaceCloud - Cinema";
}
// Create a MutationObserver to prevent any changes to the title
const observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.type === 'childList') {
// Only change the title if it's set to "Jellyfin"
if (document.title === "Jellyfin") {
document.title = "SpaceCloud - Cinema";
}
}
});
});
// Observe the document title for changes
observer.observe(document.querySelector('title'), { childList: true });
// Set up a fallback in case of attempts to change the title through direct assignment
Object.defineProperty(document, 'title', {
set: function (value) {
// Only allow the title to change if the new value is "Jellyfin"
if (value === "Jellyfin") {
document.querySelector('title').textContent = "SpaceCloud - Cinema";
} else {
document.querySelector('title').textContent = value;
}
},
get: function () {
return document.querySelector('title').textContent;
}
});
});
</script>
<script>const createRequestTab = () => {const title = document.createElement("div");title.classList.add("emby-button-foreground");title.innerText = "Anfragen";const button = document.createElement("button");button.type = "button";button.is = "empty-button";button.classList.add("emby-tab-button", "emby-button", "lastFocused");button.setAttribute("data-index", "2");button.setAttribute("id", "requestTab");button.appendChild(title);(function e() {const tabb = document.querySelector(".emby-tabs-slider");tabb ? !document.querySelector("#requestTab") && tabb.appendChild(button) : setTimeout(e, 500)})();}</script>
replace_rules:
# Page title
- old_text: '<title>Jellyfin</title>'
new_text: '<title>SpaceCloud - Cinema</title>'
# Instancename, Jellyseer I-Frame
- file_pattern: 'main.jellyfin.bundle.js'
replace_rules:
# Set limit on how many days items should be in the next up section (last number)
- old_text: 't("maxDaysForNextUp",e.toString(),!1);var t=parseInt(this.get("maxDaysForNextUp",!1),10);return 0===t?0:t||365}}'
new_text: 't("maxDaysForNextUp",e.toString(),!1);var t=parseInt(this.get("maxDaysForNextUp",!1),10);return 0===t?0:t||28}}'
# Default user page size (last number), 99 fits perfect on most desktops
- old_text: 'this.get("libraryPageSize",!1),10);return 0===t?0:t||100}'
new_text: 'this.get("libraryPageSize",!1),10);return 0===t?0:t||99}'
- file_pattern: 'home-html..*.chunk.js'
insert_rules:
# featured iframe and requests iframe style
- after_text: 'data-backdroptype="movie,series,book">'
insert_text: >
<style> .featurediframe {width: 95vw; height: 24em; display: block; border: 0; margin: -1em auto 0;} @media (min-width: 2100px) {.featurediframe {height: 33em;}} @media (max-width: 1599px) {.featurediframe {margin-top: 1.2em;}} @media (max-width: 800px) {.featurediframe {margin-top: 0.8em; height: 25em;}} </style> <iframe class="featurediframe" src="/web/ui/spotlight.html"></iframe>
<style>:root { --save-gut: max(env(safe-area-inset-left), .3%) } .requestIframe { margin: 0 .4em; padding: 0 var(--save-gut); width: calc(100% - (.4em * 2) - (var(--save-gut) * 2)); height: 90vh; border: none; position: absolute; top: 5.3em } @media (max-width: 1599px) { .requestIframe { height: 83vh; top: 8.2em; } }</style><script>setTimeout(() => { createRequestTab() }, 500)</script>
# request tab on main page
- after_text: 'id="favoritesTab" data-index="1"> <div class="sections"></div> </div>'
insert_text: '<div class="tabContent pageTabContent" id="requestsTab" data-index="2"> <div class="sections"><iframe class="requestIframe" src="https://jellyseerr.mahom03-spacecloud.de"></iframe></div> </div>'