1077 lines
38 KiB
JavaScript
1077 lines
38 KiB
JavaScript
|
|
// Jan
|
||
|
|
// ! Functions
|
||
|
|
function wrapElements(wrapper, elements) {
|
||
|
|
const wrapperElement = document.createElement("div")
|
||
|
|
wrapperElement.classList.add(`${wrapper}`)
|
||
|
|
const elementList = elements.split(",").map((element) => element.trim())
|
||
|
|
if (document.querySelector(`${elementList[0]}`)) {
|
||
|
|
const firstElement = document.querySelector(`${elementList[0]}`)
|
||
|
|
firstElement.insertAdjacentElement("beforebegin", wrapperElement)
|
||
|
|
elementList.forEach((elementId) => {
|
||
|
|
const element = document.querySelectorAll(`${elementId}`)
|
||
|
|
if (!element.length == 0) {
|
||
|
|
element.forEach((el) => {
|
||
|
|
wrapperElement.insertAdjacentElement("beforeend", el)
|
||
|
|
})
|
||
|
|
} else {
|
||
|
|
// console.log(`diese elemnt nicht da ${elementId} `)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
} else {
|
||
|
|
// console.log(`diese elemnt nicht da ${elementList[0]}`)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function insertElements(targetElement, elements, position) {
|
||
|
|
targetElement = document.querySelector(`${targetElement}`)
|
||
|
|
const elementList = elements.split(",").map((element) => element.trim())
|
||
|
|
if (position == "afterbegin" || position == "afterend") {
|
||
|
|
elementList.reverse()
|
||
|
|
}
|
||
|
|
elementList.forEach((elementId) => {
|
||
|
|
const element = document.querySelectorAll(`${elementId}`)
|
||
|
|
if (!element.length == 0) {
|
||
|
|
element.forEach((el) => {
|
||
|
|
targetElement.insertAdjacentElement(position, el)
|
||
|
|
})
|
||
|
|
} else {
|
||
|
|
// console.log(`ÃÂûõüõýт ${elementId} ýõ ýðùôõý ýð ÑÂтрðýøцõ`)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
function wrapEachElements(container, wrapper, elements) {
|
||
|
|
allContainer = document.querySelectorAll(`${container}`)
|
||
|
|
allContainer.forEach((container) => {
|
||
|
|
const wrapperElement = document.createElement("div")
|
||
|
|
wrapperElement.classList.add(`${wrapper}`)
|
||
|
|
const elementList = elements.split(",").map((element) => element.trim())
|
||
|
|
if (container.querySelector(`${elementList[0]}`)) {
|
||
|
|
const firstElement = container.querySelector(`${elementList[0]}`)
|
||
|
|
firstElement.insertAdjacentElement("beforebegin", wrapperElement)
|
||
|
|
elementList.forEach((elementId) => {
|
||
|
|
const element = container.querySelectorAll(`${elementId}`)
|
||
|
|
if (!element.length == 0) {
|
||
|
|
element.forEach((el) => {
|
||
|
|
wrapperElement.insertAdjacentElement("beforeend", el)
|
||
|
|
})
|
||
|
|
} else {
|
||
|
|
// console.log(`ÃÂûõüõýт ${elementId} ýõ ýðùôõý ýð ÑÂтрðýøцõ`)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
} else {
|
||
|
|
// console.log(
|
||
|
|
// `ßõрòыù ÑÂûõüõýт ${elementList[0]} ýõ ýðùôõý ýð ÑÂтрðýøцõ`
|
||
|
|
// )
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
let currentUrl = document.location.href;
|
||
|
|
|
||
|
|
if (document.querySelector(".close")) {
|
||
|
|
document.querySelector(".close").addEventListener("click", function() {
|
||
|
|
char = "?action";
|
||
|
|
if (currentUrl.indexOf("?action") !== -1) {
|
||
|
|
let str = document.location.href;
|
||
|
|
let index = str.indexOf(char);
|
||
|
|
let newStr = str.substring(0, index);
|
||
|
|
document.location.href = newStr;
|
||
|
|
};
|
||
|
|
})
|
||
|
|
}
|
||
|
|
// ! Functions END
|
||
|
|
|
||
|
|
// Ansichtswechsel Klick Funktion
|
||
|
|
$('.input_change_list_card_form').on('click', function() {
|
||
|
|
$('.contact_group').toggleClass('list_form');
|
||
|
|
});
|
||
|
|
|
||
|
|
// $('.mandant_switch').addClass('show_mandants');
|
||
|
|
// $('.toggle_mandant_switch').addClass('clicked');
|
||
|
|
|
||
|
|
// Mandantenansichtswechsel
|
||
|
|
$('.toggle_mandant_switch').on('click', function() {
|
||
|
|
$('.mandant_switch').toggleClass('show_mandants');
|
||
|
|
$(this).toggleClass('clicked');
|
||
|
|
});
|
||
|
|
|
||
|
|
//Zeigt im Profil nicht mehr die Top Restaurants wenn es keine gibt
|
||
|
|
if ($('.restaurant_list').is(':empty')) {
|
||
|
|
$('.restaurant_list').parent().parent().hide();
|
||
|
|
}
|
||
|
|
|
||
|
|
//Zeigt im Profil nicht mehr die Skills wenn es keine gibt
|
||
|
|
if ($('.skill_group').is(':empty')) {
|
||
|
|
$('.skill_group').parent().hide();
|
||
|
|
}
|
||
|
|
|
||
|
|
$(".collection_list.stellen .collection_container").each(function() {
|
||
|
|
for (var i = 1; i <= 4; i++) {
|
||
|
|
var linkContainer = $(this).children(".collection_content.stellen_verlinkung_" + i);
|
||
|
|
var link = linkContainer.find("a");
|
||
|
|
|
||
|
|
if (link.is(':empty')) {
|
||
|
|
linkContainer.addClass('empty');
|
||
|
|
link.text('Link zur Stellenausschreibung'); // Textinhalt auf 'Zur Stelle' mit dem href-Wert setzen
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
if ($("div").hasClass("kc_current_category")) {
|
||
|
|
var currentCategory = $('.kc_current_category').html();
|
||
|
|
$('.breadcrumb > span').append('<div class="chevron_right"></div><span class="current">' + currentCategory + '</span>');
|
||
|
|
$(".kc_current_category").hide();
|
||
|
|
}
|
||
|
|
|
||
|
|
//Sorgt dafuer, dass das Vorschaubild der News ganz oben in der News Full Ansicht ist
|
||
|
|
$(".collection_list.stellen .collection_container").each(function(index) {
|
||
|
|
$(this).children(".collection_content.stellen_art").prependTo(this);
|
||
|
|
});
|
||
|
|
$(".collection_list.stellen .collection_container").each(function(index) {
|
||
|
|
$(this).children(".stellenbilder").prependTo(this);
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
$('.dashboard .news_dashboard div#filter-element').hide();
|
||
|
|
$('.dashboard .news_dashboard .filter_display').hide();
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
var noResultsMessage = $('.no_results_message');
|
||
|
|
|
||
|
|
$('#searchbar_contacts').on('input', function() {
|
||
|
|
var searchTerm = $(this).val().toLowerCase();
|
||
|
|
var foundResults = false; // Flag, um festzustellen, ob Ergebnisse gefunden wurden
|
||
|
|
|
||
|
|
$('.contact_row').each(function() {
|
||
|
|
var contactName = $(this).find('.contact_link_new').text().toLowerCase();
|
||
|
|
if (contactName.includes(searchTerm)) {
|
||
|
|
$(this).show();
|
||
|
|
foundResults = true; // Es wurden Ergebnisse gefunden
|
||
|
|
} else {
|
||
|
|
$(this).hide();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
// Zeige oder verstecke die Nachricht je nachdem, ob Ergebnisse gefunden wurden
|
||
|
|
if (foundResults) {
|
||
|
|
noResultsMessage.hide();
|
||
|
|
} else {
|
||
|
|
noResultsMessage.show();
|
||
|
|
console.log('No results found for: ' + searchTerm); // Gib den gesuchten Begriff in der Konsole aus
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
$("#overlayPDF").prependTo("body");
|
||
|
|
$('button.closePDF').click(function() {
|
||
|
|
$(this).hide();
|
||
|
|
$("div#pspdfkit").hide();
|
||
|
|
$(".overlayContent").hide();
|
||
|
|
});
|
||
|
|
|
||
|
|
$("#overlayPDF").prependTo("body");
|
||
|
|
$("div#closeOverlay").click(function() {
|
||
|
|
$("#overlayPDF").hide();
|
||
|
|
});
|
||
|
|
|
||
|
|
// Zeitgt im Profil einen Text an wenn keine Profilbeschreibung gepflegt wurde
|
||
|
|
$(document).ready(function() {
|
||
|
|
// Finde alle p-Tags mit der Klasse profil_desc
|
||
|
|
var profil_desc = $('p.profil_desc');
|
||
|
|
|
||
|
|
// Schleife durch alle p-Tags
|
||
|
|
profil_desc.each(function() {
|
||
|
|
// Überprüfe, ob der Text des aktuellen p-Tags leer ist
|
||
|
|
if ($(this).text().trim().length == 0) {
|
||
|
|
// Wenn ja, blende den p-Tag aus
|
||
|
|
$(this).hide();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
// Deleted alle empty collection contents
|
||
|
|
$(".collection_content:empty").remove();
|
||
|
|
|
||
|
|
//Plattformen
|
||
|
|
$(".collection_list.plattformen .collection_container").each(function(index) {
|
||
|
|
$(this).children(".title, .collection_content.plattform_teaser").wrapAll("<div class='collection_content plattform_text_group'></div>");
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$(".collection_content.ob_projektverlauf .collection_list.projektverlauf .collection_container").each(function(index) {
|
||
|
|
$(this).children("h3.collection_content.projektverlauf__title.title.custom, .collection_content.pv_text ").wrapAll("<div class='collection_content ob_text'></div>");
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$(".onboarding_left").append("<button id='open_ob_overlay'>Zu Ihrem Demozugang</button>");
|
||
|
|
$(".onboarding_left").append("<span class='tooltip_button'>Sie haben Fragen? Zögern Sie nicht mich direkt zu kontaktieren.</span>");
|
||
|
|
$(".onboarding_left").append("<div class='ob_footer'><img class='bc_logo' src='https://2023.breadcrumb-online.de/userdata/images/bc_logo.svg'></img><div><a href='https://www.breadcrumb-solutions.de/bc/de/info/impressum/'>Impressum</a><a href='https://www.breadcrumb-solutions.de/bc/de/info/datenschutz/'>Datenschutz</a></div></div>");
|
||
|
|
|
||
|
|
$(".onboarding_content").prependTo("body");
|
||
|
|
$(".onboarding_content").wrapAll("<div class='onboarding_container'></div>");
|
||
|
|
$(".onboarding_container").prepend("<div class='onboarding_container_header'><span>Ihre Zugangsdaten</span><button id='close_overlay'>x</button></div>");
|
||
|
|
$(".onboarding_container").wrapAll("<div class='onboarding_overlay'></div>");
|
||
|
|
$(".onboarding_content").prepend("<div class='onboarding_content_title'><img class='mysyde_icon' src='/userdata/images/mysyde_icon.png'></img><div><span>Zugangsdaten</span><h2>Demo System</h2></div></div>");
|
||
|
|
$(".onboarding_content").append("<div class='link_login'>Link: <a target='_blank'href='https://demo-intranet.breadcrumb-online.de/'>demo-intranet.breadcrumb-online.de</a></div>");
|
||
|
|
$(".onboarding_left").prependTo("body");
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
// Overlay öffnen
|
||
|
|
$("#open_ob_overlay").click(function() {
|
||
|
|
$(".onboarding_overlay").css("display", "flex");
|
||
|
|
});
|
||
|
|
|
||
|
|
// Overlay schließen
|
||
|
|
$("#close_overlay").click(function() {
|
||
|
|
$(".onboarding_overlay").css("display", "none");
|
||
|
|
});
|
||
|
|
|
||
|
|
// Overlay mit ESC-Taste schließen
|
||
|
|
$(document).keyup(function(e) {
|
||
|
|
if (e.key === "Escape" && $(".onboarding_overlay").css("display") === "flex") {
|
||
|
|
$(".onboarding_overlay").css("display", "none");
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
$(".collection_content.ob_termin").each(function() {
|
||
|
|
var $div = $(this);
|
||
|
|
var $span = $div.find(".field_description_title");
|
||
|
|
var $nextElements = $span.nextAll();
|
||
|
|
|
||
|
|
if ($nextElements.length === 0) {
|
||
|
|
$div.hide();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
$(".collection_content.ob_user").click(function() {
|
||
|
|
const textToCopy = $(this).text();
|
||
|
|
|
||
|
|
navigator.clipboard.writeText(textToCopy)
|
||
|
|
.then(function() {
|
||
|
|
// Erfolgreich kopiert
|
||
|
|
alert("Text wurde in die Zwischenablage kopiert");
|
||
|
|
})
|
||
|
|
.catch(function(err) {
|
||
|
|
// Fehler beim Kopieren
|
||
|
|
console.error("Fehler beim Kopieren des Textes:", err);
|
||
|
|
});
|
||
|
|
});
|
||
|
|
});
|
||
|
|
$(document).ready(function() {
|
||
|
|
$(".collection_content.ob_pw").click(function() {
|
||
|
|
const textToCopy = $(this).text();
|
||
|
|
|
||
|
|
navigator.clipboard.writeText(textToCopy)
|
||
|
|
.then(function() {
|
||
|
|
// Erfolgreich kopiert
|
||
|
|
alert("Text wurde in die Zwischenablage kopiert");
|
||
|
|
})
|
||
|
|
.catch(function(err) {
|
||
|
|
// Fehler beim Kopieren
|
||
|
|
console.error("Fehler beim Kopieren des Textes:", err);
|
||
|
|
});
|
||
|
|
});
|
||
|
|
});
|
||
|
|
//Knowledgecenter Beiträge
|
||
|
|
$(".collection_full.knowledgecenter-post .collection_container").each(function(index) {
|
||
|
|
$(this).children("h3.collection_content.knowledgecenter-post__title.title.custom, .collection_content.kc_image, .collection_content.kc_teaser, .collection_content.kc_article, .collection_content.kc_video, .collection_content.kc_gallery, .collection_content.formular").wrapAll("<div class='content_left col-sm-12 col-md-12 col-lg-8'></div>");
|
||
|
|
});
|
||
|
|
|
||
|
|
$(".collection_full.knowledgecenter-post .collection_container").each(function(index) {
|
||
|
|
$(this).append("<div class='content_right'></div>");
|
||
|
|
$(this).children(".content_right").addClass("col-xs-12 col-sm-12 col-md-12 col-lg-4");
|
||
|
|
$(this).children(".collection_content.kc_img, .collection_content.kc_files").prependTo(".content_right");
|
||
|
|
});
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
function parseDate(dateStr) {
|
||
|
|
let parts = dateStr.split('.');
|
||
|
|
return new Date(parts[2], parts[1] - 1, parts[0]);
|
||
|
|
}
|
||
|
|
|
||
|
|
function formatDate(date) {
|
||
|
|
let day = ("0" + date.getDate()).slice(-2);
|
||
|
|
let month = ("0" + (date.getMonth() + 1)).slice(-2);
|
||
|
|
let year = date.getFullYear();
|
||
|
|
return `${day}.${month}.${year}`;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Aktuelles Datum
|
||
|
|
const today = new Date();
|
||
|
|
today.setHours(0, 0, 0, 0); // Nur das Datum vergleichen, keine Zeit
|
||
|
|
|
||
|
|
let termins = [];
|
||
|
|
|
||
|
|
// Alle Termine durchlaufen und sammeln
|
||
|
|
$('.termine').each(function() {
|
||
|
|
let dateText = $(this).find('.termin_date').text();
|
||
|
|
let terminDate = parseDate(dateText);
|
||
|
|
|
||
|
|
// Nur zukünftige oder heutige Termine sammeln
|
||
|
|
if (terminDate >= today) {
|
||
|
|
termins.push({element: $(this), date: terminDate});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
// Termine nach Datum sortieren
|
||
|
|
termins.sort(function(a, b) {
|
||
|
|
// Heutiges Datum nach oben sortieren
|
||
|
|
if (a.date.getTime() === today.getTime()) return -1;
|
||
|
|
if (b.date.getTime() === today.getTime()) return 1;
|
||
|
|
|
||
|
|
// Nach Datum sortieren (aufsteigend)
|
||
|
|
return a.date - b.date;
|
||
|
|
});
|
||
|
|
|
||
|
|
// Termine gruppieren und in die Wrapper einfügen
|
||
|
|
let lastDate = null;
|
||
|
|
let $wrapper = $('.termine_wrapper').empty(); // Vorherige Inhalte löschen
|
||
|
|
|
||
|
|
$.each(termins, function(index, termin) {
|
||
|
|
let formattedDate = formatDate(termin.date);
|
||
|
|
|
||
|
|
// Neues Datum-Div einfügen, wenn das Datum sich ändert
|
||
|
|
if (formattedDate !== lastDate) {
|
||
|
|
$wrapper.append(`<div class="date-group"><div class="date_title">Termine am ${formattedDate}</div></div>`);
|
||
|
|
lastDate = formattedDate;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Termin in die aktuelle Datum-Gruppe einfügen
|
||
|
|
$wrapper.find('.date-group').last().append(termin.element);
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
$(".collection_content.accept_certificate").appendTo(".collection_full");
|
||
|
|
|
||
|
|
$(".sitepart_16").prepend("<h2>Heute in der Kantine</h2>");
|
||
|
|
$(".highlight_news").prepend("<h2>Highlight des Monats</h2>");
|
||
|
|
$(".collection_content.ob_documents").prepend("<div class='title_with_img'><h2>Ihre Dokumente</h2><img src='/userdata/images/icon_files.png'></img></div>");
|
||
|
|
$(".collection_content.ob_projektverlauf").prepend("<div class='title_with_img'><h2>Typischer Projektverlauf<span>bei einer Standard Intranet Einführung</span></h2><img src='/userdata/images/icon_files.png'></img></div>");
|
||
|
|
|
||
|
|
$("body.dashboard-mandant").addClass("dashboard");
|
||
|
|
$("body.dashboard-mandant").addClass("warm");
|
||
|
|
$("body.dashboard-mandant").removeClass("dashboard-mandant");
|
||
|
|
|
||
|
|
$(".warm .infoboard_boxes").prepend("<h2>Abwesend in meiner Schicht</h2>");
|
||
|
|
|
||
|
|
|
||
|
|
function prependElementsToBody(...selectors) {
|
||
|
|
selectors.forEach(selector => {
|
||
|
|
const element = $(selector);
|
||
|
|
element.prependTo("body");
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
// Verwende die Funktion, um die Elemente zum Body hinzuzufügen
|
||
|
|
prependElementsToBody(".my_bookmarks", "div#overlayContent", ".create_collection_wrapper", ".learning_success_modal", "div#requestbox");
|
||
|
|
$("a.button.bookmark").prependTo(".sidebuttons");
|
||
|
|
|
||
|
|
//Kontaktformular schließen
|
||
|
|
$(".close").click(function() {
|
||
|
|
$("#requestbox").addClass("hide");
|
||
|
|
});
|
||
|
|
|
||
|
|
$('#show_bookmarks').on('click', function() {
|
||
|
|
$(".my_bookmarks").toggle("slide");
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// Macht Sachen im E-Learning Bereich
|
||
|
|
$('button.to_the_questions').on('click', function() {
|
||
|
|
|
||
|
|
if (window.confirm('Sicher, dass Sie zu den Fragen wollen? Danach können Sie das Video nicht mehr ansehen und müssen erst alle Fragen einmal beantworten?')) {
|
||
|
|
|
||
|
|
$(".certificate_frame").remove();
|
||
|
|
$(".certificate_questions").slideToggle();
|
||
|
|
$(this).remove();
|
||
|
|
|
||
|
|
} else {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
// Essensbestellung Liste anzeigen
|
||
|
|
$('div#food .title_with_icon').on('click', function() {
|
||
|
|
$(".food_list").slideToggle();
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
$( document ).on( 'keydown', function ( e ) {
|
||
|
|
if ( e.keyCode === 27 ) { // ESC
|
||
|
|
$( ".learning_success_modal" ).hide();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
$('a#close_overlay').on('click', function() {
|
||
|
|
$(".learning_success_modal").hide();
|
||
|
|
});
|
||
|
|
$('.close').on('click', function() {
|
||
|
|
$(".my_bookmarks").toggle("slide");
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
//Sorgt dafuer, dass das Vorschaubild der News ganz oben in der News Full Ansicht ist
|
||
|
|
$(".collection_list.news .collection_container").each(function(index) {
|
||
|
|
$(this).children(".collection_content.date").prependTo(this);
|
||
|
|
});
|
||
|
|
$(".collection_full.ankuendigungen .collection_container").each(function(index) {
|
||
|
|
$(this).children(".collection_content.date").prependTo(this);
|
||
|
|
});
|
||
|
|
$(".collection_list.news .collection_container").each(function(index) {
|
||
|
|
$(this).children(".collection_content.vorschaubild").prependTo(this);
|
||
|
|
});
|
||
|
|
// $(".collection_full.news .collection_container").each(function(index) {
|
||
|
|
// var $container = $(this);
|
||
|
|
// var $teaser = $container.children(".collection_content.teaser");
|
||
|
|
// var $subtitle = $container.children(".collection_content.news_subtitle");
|
||
|
|
// var $about = $container.children(".collection_content.about_person");
|
||
|
|
// var $date = $container.children(".collection_content.date");
|
||
|
|
// var $readingTime = $container.children(".collection_content.reading_time");
|
||
|
|
// var $author = $container.children(".collection_content.author");
|
||
|
|
// var $title = $container.children(".title");
|
||
|
|
|
||
|
|
// $teaser.prependTo($container);
|
||
|
|
// $about.prependTo($container);
|
||
|
|
// $readingTime.prependTo($container);
|
||
|
|
// $author.prependTo($container);
|
||
|
|
// $subtitle.prependTo($container);
|
||
|
|
// $title.prependTo($container);
|
||
|
|
// $date.prependTo($container);
|
||
|
|
|
||
|
|
// var $details = $("<div class='articel_details'></div>");
|
||
|
|
// $readingTime.wrapAll("<div class='date_time'></div>");
|
||
|
|
// $author.add($readingTime).wrapAll($details);
|
||
|
|
|
||
|
|
// var $contentFull = $("<div class='collection_content_full'></div>");
|
||
|
|
// $title.add($subtitle).add($author).add($date).add($about).add($readingTime).wrapAll($contentFull);
|
||
|
|
|
||
|
|
// var $author_about = $("<div class='collection_content author_about'></div>");
|
||
|
|
// $author.add($about).wrapAll($author_about);
|
||
|
|
|
||
|
|
// });
|
||
|
|
|
||
|
|
|
||
|
|
$(".collection_list.content_guide").wrapAll("<div class='content_guide_collections'></div>");
|
||
|
|
|
||
|
|
// Changelog Kollektion
|
||
|
|
$(".collection_list.changelog .collection_container").each(function(index) {
|
||
|
|
$(this).children("h3.collection_content.changelog__title.title.custom, .collection_content.changelog_category, .collection_content.changelog_date").wrapAll("<div class='collection_content changelog_info'></div>");
|
||
|
|
});
|
||
|
|
|
||
|
|
$(".collection_content.changelog_category:contains(' Design')").addClass("design");
|
||
|
|
$(".collection_content.changelog_category:contains(' Funktion')").addClass("funktion");
|
||
|
|
|
||
|
|
$("li.level_1 a[href='/intranet/de/dashboard/']").attr('href', '/');
|
||
|
|
|
||
|
|
|
||
|
|
//Wrapped Terminüberschrift mit Termin Kollektion
|
||
|
|
var svgCode = '<div class="svg_content"><svg id="calendar" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"> \
|
||
|
|
<path id="Pfad_114" data-name="Pfad 114" d="M2.25,9V31.5A2.25,2.25,0,0,0,4.5,33.75h27a2.25,2.25,0,0,0,2.25-2.25V9ZM4.5,2.25A4.5,4.5,0,0,0,0,6.75V31.5A4.5,4.5,0,0,0,4.5,36h27A4.5,4.5,0,0,0,36,31.5V6.75a4.5,4.5,0,0,0-4.5-4.5Z" fill-rule="evenodd"/> \
|
||
|
|
<path id="Pfad_115" data-name="Pfad 115" d="M7.875,0A1.125,1.125,0,0,1,9,1.125V2.25a1.125,1.125,0,0,1-2.25,0V1.125A1.125,1.125,0,0,1,7.875,0Zm20.25,0A1.125,1.125,0,0,1,29.25,1.125V2.25a1.125,1.125,0,0,1-2.25,0V1.125A1.125,1.125,0,0,1,28.125,0Z" fill-rule="evenodd"/> \
|
||
|
|
</svg></div>';
|
||
|
|
|
||
|
|
$(".termine_headline .textcontent").append(svgCode);
|
||
|
|
$(".dashboard .plattformen_wrapper").prepend("<h2>Plattformen</h2>");
|
||
|
|
$(".termine_headline, .termine_collection").wrapAll("<div class='group'></div>");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// Individuelle Dinge Ende
|
||
|
|
|
||
|
|
// ! Login Bildergalerie
|
||
|
|
|
||
|
|
$(".component.login_hintergrund .owl-carousel.gallery-style").owlCarousel({
|
||
|
|
items: 1,
|
||
|
|
center: true,
|
||
|
|
margin: 0,
|
||
|
|
stagePadding: 0,
|
||
|
|
nav: false,
|
||
|
|
autoplay:true,
|
||
|
|
autoplayTimeout:5000,
|
||
|
|
autoplayHoverPause:true,
|
||
|
|
dots: true,
|
||
|
|
loop: true
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$(document).ready(function(){
|
||
|
|
if ($(".visitenkarten_betriebsrat").length) {
|
||
|
|
$(".visitenkarten_betriebsrat").addClass("owl_visitkarten owl-theme owl-carousel");
|
||
|
|
}
|
||
|
|
|
||
|
|
$('.owl_visitkarten').owlCarousel({
|
||
|
|
items: 1,
|
||
|
|
margin: 0,
|
||
|
|
autoplay: true,
|
||
|
|
nav: true,
|
||
|
|
center: true,
|
||
|
|
dots: false,
|
||
|
|
loop: true,
|
||
|
|
// onInitialized: function(event) {
|
||
|
|
|
||
|
|
// $(".visitenkarten_betriebsrat").css('visibility', 'visible');
|
||
|
|
// }
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// ! Login Bildergalerie ende
|
||
|
|
|
||
|
|
|
||
|
|
// ! Ankündigungen Bildergalerie
|
||
|
|
|
||
|
|
$(document).ready(function(){
|
||
|
|
if ($(".ankuendingungen_collection").length) {
|
||
|
|
$(".ankuendingungen_collection").addClass("owl_ank owl-theme owl-carousel")
|
||
|
|
}
|
||
|
|
|
||
|
|
$('.owl_ank').owlCarousel({
|
||
|
|
|
||
|
|
items: 1,
|
||
|
|
margin: 30,
|
||
|
|
autoplay: true,
|
||
|
|
nav: false,
|
||
|
|
center: true,
|
||
|
|
// autoplay: true,
|
||
|
|
dots: false,
|
||
|
|
loop: true
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
// ! Ankündigungen Bildergalerie ende
|
||
|
|
|
||
|
|
// ! Historie Bildergalerie
|
||
|
|
|
||
|
|
$(document).ready(function(){
|
||
|
|
if ($(".history_collection").length) {
|
||
|
|
$(".history_collection").addClass("owl_history owl-theme owl-carousel")
|
||
|
|
}
|
||
|
|
|
||
|
|
$('.owl_history').owlCarousel({
|
||
|
|
|
||
|
|
items: 1,
|
||
|
|
margin: 0,
|
||
|
|
animateOut: 'fadeOut',
|
||
|
|
nav: true,
|
||
|
|
mouseDrag: false,
|
||
|
|
center: true,
|
||
|
|
// autoplay: true,
|
||
|
|
dots: true,
|
||
|
|
loop: true
|
||
|
|
});
|
||
|
|
$(".history_collection .owl-nav, .history_collection .owl-dots").wrapAll("<div class='owl-navigation'></div>");
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ! Historie Bildergalerie ende
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// ! Knowledgecenter auf Dashboard Bildergalerie
|
||
|
|
|
||
|
|
$(document).ready(function(){
|
||
|
|
if ($(".dashboard .kc_category_line_list").length) {
|
||
|
|
$(".kc_category_line_list").addClass("owl_kc owl-theme owl-carousel")
|
||
|
|
}
|
||
|
|
|
||
|
|
$('.owl_kc').owlCarousel({
|
||
|
|
|
||
|
|
items: 3,
|
||
|
|
margin: 10,
|
||
|
|
nav: true,
|
||
|
|
center: false,
|
||
|
|
dots: false,
|
||
|
|
loop: true,
|
||
|
|
responsive: {
|
||
|
|
0: {
|
||
|
|
items: 1,
|
||
|
|
|
||
|
|
},
|
||
|
|
600: {
|
||
|
|
items: 1,
|
||
|
|
|
||
|
|
},
|
||
|
|
1000: {
|
||
|
|
items: 2,
|
||
|
|
},
|
||
|
|
1500: {
|
||
|
|
items: 3,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
// ! Knowledgecenter auf Dashboard Bildergalerie
|
||
|
|
|
||
|
|
// Knowledgecenter auf dem Dashboard braucht eine Überschrift
|
||
|
|
$(".firmenwiki_link_dashboard").prependTo(".kc_group_container");
|
||
|
|
$(".firmenwiki_title_dashboard").prependTo(".kc_group_container");
|
||
|
|
|
||
|
|
$(".firmenwiki_link_dashboard, .firmenwiki_title_dashboard").wrapAll("<div class='headline'></div>");
|
||
|
|
|
||
|
|
$(".collection_content.date").prependTo(".collection_full.news h3.collection_content.news__title.title.custom");
|
||
|
|
$("button#backButton").prependTo(".collection_full.news h3.collection_content.news__title.title.custom");
|
||
|
|
|
||
|
|
$(".collection_full.news .collection_container").each(function(index) {
|
||
|
|
$(this).children(".title, .collection_content.author, .collection_content.reading_time, .date, .collection_content.date,.news_subtitle, .teaser, .artikeltext, .youtube_video, .Video, .news_link, .contactform, .about_person ").wrapAll("<div class='collection_content news_content_right'></div>");
|
||
|
|
});
|
||
|
|
$(".collection_full.news .collection_container").each(function(index) {
|
||
|
|
$(this).children(".vorschaubild, .bilduntertitel, .gallery, .video").wrapAll("<div class='collection_content news_content_left'></div>");
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
// Schreibt mit den News Titel in die erste Collection List News
|
||
|
|
$(".news_title, .news_link").prependTo(".news_dashboard .collection_list.news:nth-child(1) .collection_container");
|
||
|
|
// ! Standard Bildergalerie
|
||
|
|
|
||
|
|
|
||
|
|
if (document.querySelector("body.betriebsrat-news") && document.querySelector(".owl-carousel")) {
|
||
|
|
console.log(document.querySelectorAll(".owl-carousel img"));
|
||
|
|
console.log("test")
|
||
|
|
if (document.querySelectorAll(".owl-carousel.gallery-style a").length > 1) {
|
||
|
|
$(".owl-carousel.gallery-style").owlCarousel({
|
||
|
|
items: 3,
|
||
|
|
center: true,
|
||
|
|
nav: true,
|
||
|
|
dots: true,
|
||
|
|
loop: true
|
||
|
|
|
||
|
|
});
|
||
|
|
} else {
|
||
|
|
document.querySelector(".owl-carousel").style.display = "block";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
$(".owl-carousel.owl-theme.owl-two.gallery-style").owlCarousel({
|
||
|
|
items: 3,
|
||
|
|
center: false,
|
||
|
|
nav: false,
|
||
|
|
dots: false,
|
||
|
|
loop: false
|
||
|
|
|
||
|
|
})
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// ! Standard Bildergalerie ende
|
||
|
|
|
||
|
|
|
||
|
|
// Suche ---
|
||
|
|
|
||
|
|
$('#searchbar').keypress(function(event) {
|
||
|
|
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||
|
|
if (keycode == '13') { // Enter key
|
||
|
|
var input = document.getElementById('searchbar').value;
|
||
|
|
|
||
|
|
// Ersetzungen für Umlaute und ß
|
||
|
|
// input = input.replace(/ä/g, 'ae');
|
||
|
|
// input = input.replace(/ö/g, 'oe');
|
||
|
|
// input = input.replace(/ü/g, 'ue');
|
||
|
|
// input = input.replace(/Ä/g, 'Ae');
|
||
|
|
// input = input.replace(/Ö/g, 'Oe');
|
||
|
|
// input = input.replace(/Ü/g, 'Ue');
|
||
|
|
// input = input.replace(/ß/g, 'ss');
|
||
|
|
|
||
|
|
// Verwende encodeURIComponent, um Leerzeichen und andere Sonderzeichen zu behandeln
|
||
|
|
input = encodeURIComponent(input);
|
||
|
|
|
||
|
|
var origin = window.location.origin;
|
||
|
|
var url = origin + "/intranet/de/knowledgecenter/?search=" + input;
|
||
|
|
window.location = url;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
$('.collection_content.about_person, .collection_content.author').contents().filter(function() {
|
||
|
|
return this.nodeType === 3; // Filter nur Textknoten
|
||
|
|
}).remove(); // Entferne die Textknoten
|
||
|
|
|
||
|
|
// Optional: Wenn du sicherstellen möchtest, dass nur Links in der div bleiben
|
||
|
|
$('.collection_content.about_person, .collection_content.author').children().each(function() {
|
||
|
|
if ($(this).is(':not(.person_links)')) {
|
||
|
|
$(this).remove(); // Entferne alles außer den Links
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
$('#searchbar_2').keypress(function(event){
|
||
|
|
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||
|
|
if(keycode == '13'){
|
||
|
|
var input = document.getElementById('searchbar_2').value;
|
||
|
|
// input = input.replace(/ä/g, 'ae');
|
||
|
|
// input = input.replace(/ö/g, 'oe');
|
||
|
|
// input = input.replace(/ü/g, 'ue');
|
||
|
|
// input = input.replace(/ /g, '-');
|
||
|
|
var origin = window.location.origin;
|
||
|
|
var url = origin+"/intranet/de/knowledgecenter/?search="+input;
|
||
|
|
window.location = url;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
$(".tdnn").on("click", function() {
|
||
|
|
$(".moon").toggleClass("sun");
|
||
|
|
$(this).toggleClass("day");
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// Mobile Header
|
||
|
|
$('#toggle_navigation').click(function() {
|
||
|
|
$(this).toggleClass('active');
|
||
|
|
$(".hamburger-menu").slideToggle("fast");
|
||
|
|
});
|
||
|
|
|
||
|
|
// Wenn scrollt dann backroung für Header
|
||
|
|
$(window).scroll(function() {
|
||
|
|
if ($(window).scrollTop() >= 10) {
|
||
|
|
$('.header-wrapper').addClass('fixed-header');
|
||
|
|
} else {
|
||
|
|
$('.header-wrapper').removeClass('fixed-header');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
// Global
|
||
|
|
if ($("div").hasClass("collection_full")) {
|
||
|
|
$("body").addClass("full_preview");
|
||
|
|
}
|
||
|
|
|
||
|
|
// Überprüft ob im Layout Bereich Content ist wenn ja, einblenden
|
||
|
|
$('.content-selector').each(function() {
|
||
|
|
var $this = $(this);
|
||
|
|
if ($this.find('div').length > 1) { //if looking for direct descendants then do .children('div').length
|
||
|
|
$this.show();
|
||
|
|
} else {
|
||
|
|
$this.remove();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
//Kontaktformular schließen
|
||
|
|
$(".close").click(function() {
|
||
|
|
$("#requestbox").addClass("hide");
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
//Save Scroll Position
|
||
|
|
if ($(".page-scroll-save").length) {
|
||
|
|
$(window).scroll(function() {
|
||
|
|
//set scroll position in session storage
|
||
|
|
sessionStorage.scrollPos = $(window).scrollTop();
|
||
|
|
});
|
||
|
|
var init = function() {
|
||
|
|
//get scroll position in session storage
|
||
|
|
$(window).scrollTop(sessionStorage.scrollPos || 0)
|
||
|
|
};
|
||
|
|
window.onload = init;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//Anker Elemente
|
||
|
|
var ankerelement = document.getElementsByClassName("anker-element");
|
||
|
|
for (let j = 0; j < ankerelement.length; j++) {
|
||
|
|
ankerelement[j].setAttribute("id", "anker-element" + j);
|
||
|
|
}
|
||
|
|
|
||
|
|
var ankerelement = document.getElementsByClassName("anker-button");
|
||
|
|
for (let j = 0; j < ankerelement.length; j++) {
|
||
|
|
ankerelement[j].setAttribute("id", "anker-button" + j);
|
||
|
|
}
|
||
|
|
|
||
|
|
var buttonList2 = $('.anker-button');
|
||
|
|
var popupList2 = $('.anker-element');
|
||
|
|
|
||
|
|
var popupList_to_remove2 = $('.anker-element');
|
||
|
|
var buttonList_to_remove2 = $('.anker-button');
|
||
|
|
|
||
|
|
var loc2 = document.location.toString().split('#')[0];
|
||
|
|
|
||
|
|
for (let i = 0; i < buttonList2.length; i++) {
|
||
|
|
(function(i) {
|
||
|
|
buttonList2[i].onclick = function() {
|
||
|
|
$('html,body').animate({
|
||
|
|
scrollTop: ($(popupList2[i]).offset().top - 130)
|
||
|
|
}, 'slow');
|
||
|
|
}
|
||
|
|
})(i);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Popup Element automatisches öffnen
|
||
|
|
var popupButton = document.getElementsByClassName("pop-up-button");
|
||
|
|
for (let i = 0; i < popupButton.length; i++) {
|
||
|
|
popupButton[i].setAttribute("data-button", i);
|
||
|
|
}
|
||
|
|
|
||
|
|
var popupElement = document.getElementsByClassName("pop-up-element");
|
||
|
|
$(".pop-up-element").hide();
|
||
|
|
for (let i = 0; i < popupElement.length; i++) {
|
||
|
|
popupElement[i].setAttribute("data-element", i);
|
||
|
|
}
|
||
|
|
$(".current_element").show();
|
||
|
|
|
||
|
|
$(".pop-up-button").on('click', function() {
|
||
|
|
|
||
|
|
let buttonID = this.getAttribute("data-button");
|
||
|
|
|
||
|
|
$(".pop-up-element").each(function() {
|
||
|
|
|
||
|
|
let elementID = this.getAttribute("data-element");
|
||
|
|
$(".pop-up-button").removeClass('current');
|
||
|
|
$(".pop-up-element").removeClass('current_element');
|
||
|
|
|
||
|
|
if (buttonID == elementID) {
|
||
|
|
$(this).show();
|
||
|
|
} else {
|
||
|
|
$(this).hide();
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
$(this).addClass('current');
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
$(".pop-up-element:first-child").show();
|
||
|
|
$(".pop-up-button:first-child").addClass("current");
|
||
|
|
$(".pop-up-element:first-child").addClass("current");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//Animation Pop Collection
|
||
|
|
function animatePopping(selector) {
|
||
|
|
$(selector).each(function(i) {
|
||
|
|
|
||
|
|
setTimeout(function() {
|
||
|
|
$(selector).eq(i).addClass("popping");
|
||
|
|
}, i * 30)
|
||
|
|
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Blendet Infoboard Einträge aus der keine Personen zugeordnet sind
|
||
|
|
$(".infoboard_count:contains('0')").parent().hide();
|
||
|
|
|
||
|
|
//Abschnitt Extra Javascript
|
||
|
|
$(".faq_question_box").click(function() {
|
||
|
|
$(this).toggleClass("active"),
|
||
|
|
$(this).next(".faq_answer_box").slideToggle("slow")
|
||
|
|
})
|
||
|
|
|
||
|
|
setTimeout(function () {
|
||
|
|
if (document.querySelector("body.betriebsrat .person_card_container")) {
|
||
|
|
document.querySelector("body.betriebsrat .person_card_container").style.opacity = "1"
|
||
|
|
}
|
||
|
|
}, 1000)
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
wrapEachElements("body.dashboard .collection_list.news", "news__underwrapper", ".date, .news__title, .teaser");
|
||
|
|
wrapEachElements("body.betriebsrat .collection_list.news", "news__underwrapper", ".date, .betriebsrat__title, .teaser");
|
||
|
|
|
||
|
|
if (document.querySelector("body.betriebsrat .collection_list.news")) {
|
||
|
|
document.querySelectorAll(".collection_list.news").forEach(el => {
|
||
|
|
if (el.querySelector(".collection_content.vorschaubild")) {
|
||
|
|
|
||
|
|
} else {
|
||
|
|
el.querySelector(".collection_container").insertAdjacentHTML("afterbegin", '<div class="collection_content vorschaubild no-cover"><img alt="Mandant Logo" src="/userdata/intranet/mandant/1_1726750078__awo_logo_landesverband_hamburg.svg"></div>')
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function createICSFile(eventName, eventDate, eventTime) {
|
||
|
|
// Форматируем дату и время для iCalendar (формат: YYYYMMDDTHHMMSSZ)
|
||
|
|
const date = new Date(`${eventDate}T${eventTime}:00`);
|
||
|
|
const formattedDate = date.toISOString().replace(/-|:|\.\d{3}/g, "");
|
||
|
|
|
||
|
|
const icsData = `BEGIN:VCALENDAR
|
||
|
|
VERSION:2.0
|
||
|
|
PRODID:-//Your Product//EN
|
||
|
|
BEGIN:VEVENT
|
||
|
|
UID:${new Date().getTime()}@yourdomain.com
|
||
|
|
DTSTAMP:${formattedDate}
|
||
|
|
DTSTART:${formattedDate}
|
||
|
|
SUMMARY:${eventName}
|
||
|
|
END:VEVENT
|
||
|
|
END:VCALENDAR`;
|
||
|
|
|
||
|
|
// Создаем blob-объект из данных
|
||
|
|
const blob = new Blob([icsData], { type: 'text/calendar' });
|
||
|
|
|
||
|
|
// Создаем ссылку для скачивания файла
|
||
|
|
const link = document.createElement('a');
|
||
|
|
link.href = URL.createObjectURL(blob);
|
||
|
|
link.download = 'event.ics';
|
||
|
|
|
||
|
|
// Автоматически кликаем по ссылке для загрузки файла
|
||
|
|
document.body.appendChild(link);
|
||
|
|
link.click();
|
||
|
|
|
||
|
|
// Удаляем ссылку после загрузки
|
||
|
|
document.body.removeChild(link);
|
||
|
|
}
|
||
|
|
function formatDate(inputDate) {
|
||
|
|
// Разделяем строку по точкам
|
||
|
|
const [day, month, year] = inputDate.split('.');
|
||
|
|
|
||
|
|
// Формируем новую строку в формате YYYY-MM-DD
|
||
|
|
return `${year}-${month}-${day}`;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Пример использования
|
||
|
|
// createICSFile('Nächste Präsiudiumssitzung', '2024-10-16', '16:00');
|
||
|
|
|
||
|
|
if (document.querySelector(".collection_list.termine ")) {
|
||
|
|
document.querySelectorAll(".collection_list.termine").forEach(el => {
|
||
|
|
let calendarButtun = document.createElement("button");
|
||
|
|
calendarButtun.classList.add("calendarButtun")
|
||
|
|
calendarButtun.insertAdjacentHTML("afterbegin", "In Kalender speichern")
|
||
|
|
el.querySelector(".collection_container").insertAdjacentElement("beforeend", calendarButtun)
|
||
|
|
|
||
|
|
el.querySelector(".calendarButtun").addEventListener("click", function() {
|
||
|
|
let name = el.querySelector(".termine__title").innerText
|
||
|
|
let date = formatDate(el.querySelector(".termin_date").innerText)
|
||
|
|
let time = el.querySelector(".collection_content.time").innerText
|
||
|
|
|
||
|
|
createICSFile(name, date, time);
|
||
|
|
})
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function previewPdfInBrowser() {
|
||
|
|
var firstPdf = $('.full_preview .filegallery_content_file a').first();
|
||
|
|
var pdfPath = firstPdf.attr('data-path');
|
||
|
|
// Prüfe, ob ein gültiger PDF-Pfad vorhanden ist
|
||
|
|
if (pdfPath) {
|
||
|
|
// Prüfe, ob der Pfad relativ ist und baue eine vollständige URL
|
||
|
|
if (!pdfPath.startsWith('http://') && !pdfPath.startsWith('https://')) {
|
||
|
|
var fullUrl = window.location.protocol + '//' + window.location.host + pdfPath;
|
||
|
|
pdfPath = fullUrl;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Zeige das PDF je nach Gerät an
|
||
|
|
if (isMobile()) {
|
||
|
|
showGoogleDriveViewer(pdfPath);
|
||
|
|
} else {
|
||
|
|
showEmbedViewer(pdfPath);
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
// console.error("data-path is undefined");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Funktion zum Anzeigen des Embed Viewers für Desktop
|
||
|
|
function showEmbedViewer(pdfPath) {
|
||
|
|
var embedHtml = '<embed id="pdf-viewer" src="' + pdfPath + '" type="application/pdf" width="100%" height="600px">';
|
||
|
|
// var fallbackHtml = '<p>Falls die Vorschau nicht funktioniert, können Sie die PDF <a href="' + pdfPath + '" target="_blank">hier herunterladen</a>.</p>';
|
||
|
|
var fallbackHtml = '';
|
||
|
|
$('#pdf-preview').html(embedHtml + fallbackHtml);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Funktion zum Anzeigen des Google Drive Viewers für mobile Geräte
|
||
|
|
function showGoogleDriveViewer(pdfPath) {
|
||
|
|
var driveViewerUrl = 'https://drive.google.com/viewerng/viewer?embedded=true&url=' + encodeURIComponent(pdfPath);
|
||
|
|
var embedHtml = '<iframe id="pdf-viewer" src="' + driveViewerUrl + '" width="100%" height="600px"></iframe>';
|
||
|
|
// var fallbackHtml = '<p>Falls die Vorschau nicht funktioniert, können Sie die PDF <a href="' + pdfPath + '" target="_blank">hier herunterladen</a>.</p>';
|
||
|
|
var fallbackHtml = '';
|
||
|
|
$('#pdf-preview').html(embedHtml + fallbackHtml);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Fallback-Funktion
|
||
|
|
function showFallbackLink(pdfPath) {
|
||
|
|
var fallbackHtml = '<p>Ihr Browser unterstützt die direkte PDF-Vorschau möglicherweise nicht. <a href="' + pdfPath + '" target="_blank">PDF hier herunterladen</a></p>';
|
||
|
|
$('#pdf-preview').html(fallbackHtml);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Prüfen, ob das Gerät mobil ist
|
||
|
|
function isMobile() {
|
||
|
|
return window.innerWidth <= 1200;
|
||
|
|
}
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
if (document.querySelector(".awo.knowledgecenter-post.full_preview")) {
|
||
|
|
document.querySelector(".content_left h3.collection_content.knowledgecenter-post__title.title.custom").insertAdjacentElement("beforeend", document.querySelector("#pdf-preview"))
|
||
|
|
previewPdfInBrowser();
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
if (document.querySelector(".awo.betriebsrat-news.full_preview")) {
|
||
|
|
// console.log("test")
|
||
|
|
if (document.querySelector(".collection_content.data-upload")) {
|
||
|
|
document.querySelector(".news_content_right").insertAdjacentElement("beforeend", document.querySelector(".collection_content.data-upload"))
|
||
|
|
}
|
||
|
|
|
||
|
|
document.querySelector(".news_content_right").insertAdjacentHTML("beforeend", "<div id='pdf-preview'></div>")
|
||
|
|
|
||
|
|
previewPdfInBrowser();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
document.addEventListener('DOMContentLoaded', function () {
|
||
|
|
const pdfEl = document.querySelector(
|
||
|
|
'body.awo.organigramm_temp .textcontent embed[type="application/pdf"], ' +
|
||
|
|
'body.awo.organigramm_temp .textcontent iframe[type="application/pdf"]'
|
||
|
|
);
|
||
|
|
|
||
|
|
if (!pdfEl) return;
|
||
|
|
|
||
|
|
const isSmallScreen = window.matchMedia('(max-width: 700px)').matches;
|
||
|
|
|
||
|
|
if (isSmallScreen) {
|
||
|
|
const src = pdfEl.getAttribute('src');
|
||
|
|
if (!src) return;
|
||
|
|
|
||
|
|
pdfEl.style.display = 'none';
|
||
|
|
|
||
|
|
const parent = pdfEl.parentNode;
|
||
|
|
|
||
|
|
const hint = document.createElement('p');
|
||
|
|
hint.className = 'orga-pdf-hint';
|
||
|
|
hint.textContent = 'Open PDF presentation on mobile devices:';
|
||
|
|
|
||
|
|
const link = document.createElement('a');
|
||
|
|
link.className = 'orga-pdf-link';
|
||
|
|
link.href = src;
|
||
|
|
link.target = '_blank';
|
||
|
|
link.rel = 'noopener';
|
||
|
|
link.textContent = 'Open Organigramm PDF';
|
||
|
|
|
||
|
|
parent.appendChild(hint);
|
||
|
|
parent.appendChild(link);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
|