function include(filename, onload) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.src = filename; script.type = 'text/javascript'; script.onload = script.onreadystatechange = function() { if (script.readyState) { if (script.readyState === 'complete' || script.readyState === 'loaded') { script.onreadystatechange = null; onload(); } } else { onload(); } }; head.appendChild(script); } include('https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js', function() { $(document).ready(function() { var external_js = [ "https://code.jquery.com/jquery-3.5.1.min.js", "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js", "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"]; for (var i = 0; i < external_js.length; i++) { var script = document.createElement("SCRIPT"); script.src = external_js[i]; script.type = 'text/javascript'; document.getElementsByTagName("head")[0].appendChild(script); } $(function() { function customAlert(message){ var dfrd1 = $.Deferred(); $('#RBAPAlertModal').modal('show',{backdrop: 'static', keyboard: false}); const Ok = document.getElementById('RBAP-Alert-Ok'); document.getElementById('RBAP-Alert-Message').innerHTML = message; Ok.onclick = () => { $('#RBAPAlertModal').modal('hide'); dfrd1.resolve(); } return dfrd1.promise(); } function ContentLinker() { $('.set-bg').each(function () { var bg = $(this).data('setbg'); $(this).css('background-image', 'url(' + bg + ')'); }); $('.unauthorized').on('click', function(event) { customAlert('RBAP is a private site you can only access pages once logged into RBAP. To login with discord you first need to join our discord. You can click the join discord button to get added to the discord once youve joined come back here and click login with discord to begin your RBAP experince!'); }) $('.Join-Discord-Link').click(function () { var win = window.open("https://discord.com/invite/hnAcKeV2gS", '_blank'); if (win) { win.focus(); } else { customAlert('Unable to redirect user. Please allow popups for this website'); } }) }; ContentLinker(); $('#content').fadeOut("fast", function(){ $('#content').load('./lib/content/home.php', {PI:"-1"}, function() { $('#content').fadeIn("fast"); ContentLinker(); }); }); }); }); });