2
1
Fork 0
foerderbarometer/input/static/dropdown/js/otrs_link.js

35 lines
996 B
JavaScript
Raw Permalink Normal View History

window.addEventListener("load", function() {
2025-02-19 12:59:42 +00:00
(function($) {
$(function() {
document.querySelectorAll("a").forEach(link => {
link.href = link.href.replace(/%3B/g, ";").replace(/%3D/g, "=");
});
/*
2025-02-19 12:59:42 +00:00
// let linkElement = document.querySelector(".field-otrs > div > p.url > a");
//let linkElement = document.querySelector(".field-otrs p.url a");
let linkElement = document.querySelector("a");
2025-02-19 12:59:42 +00:00
if (!linkElement) {
console.error("OTRS-Link not found!");
return;
}
2025-02-19 12:59:42 +00:00
let otrs_link = linkElement.href;
//console.log("Original link:", otrs_link);
//alert("Original link: " + otrs_link);
2025-02-19 12:59:42 +00:00
// Ersetze %3B mit ; und %3D mit =
let otrs_link_pretty = otrs_link.replace(/%3B/g, ";").replace(/%3D/g, "=");
//console.log("Modified link:", otrs_link_pretty);
linkElement.href = otrs_link_pretty;
*/
2025-02-19 12:59:42 +00:00
});
})(django.jQuery);
});
2025-02-19 12:59:42 +00:00