diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout.php b/emhttp/plugins/dynamix/include/DefaultPageLayout.php index ee4ab10ff..d8513f31a 100644 --- a/emhttp/plugins/dynamix/include/DefaultPageLayout.php +++ b/emhttp/plugins/dynamix/include/DefaultPageLayout.php @@ -1111,6 +1111,38 @@ $(function() { } $('form').append($('').attr({type:'hidden', name:'csrf_token', value:csrf_token})); }); + +$('body').on("click","a", function(e) { + href = $(this).attr("href").trim(); + target = $(this).attr("target"); + + if ( href ) { + if ( href.indexOf("/") == 0 ) { // all internal links start with "/" + return; + } + if ( href.match('https://[^\.]*.(my)?unraid.net/') || href.indexOf("https://unraid.net/") == 0 || href == "https://unraid.net" ) { + return; + } else { + if (href !== "#" && href.indexOf("javascript") !== 0) { + e.preventDefault(); + swal({ + title: "", + text: "

"+href, + html: true, + type: 'warning', + showCancelButton: true, + showConfirmButton: true, + cancelButtonText: "", + confirmButtonText: "" + },function(isConfirm) { + if (isConfirm) { + window.open(href,target); + } + }); + } + } + } +});