// Sleeky Admin Theme // 2019 Flynn Tesoriero console.log("DarkSleeky Admin Theme Running"); $( document ).ready(function() { // Get the theme URL var url; if ($('meta[name=pluginURL]').attr("content")) { url = $('meta[name=pluginURL]').attr("content"); } else { // If for some reason we can't find the URL attribute url = "/user/plugins/ds-backend"; } // Detect theme var theme; if ($('meta[name=sleeky_theme]').attr("content") == 'light') { theme = "light"; } else if ($('meta[name=sleeky_theme]').attr("content") == 'dark') { theme = "dark"; } console.log("Theme is", theme) // Update favicon $('link[rel="shortcut icon"]').attr('href', url + "/frontend/assets/img/favicon-16.webp"); // Update meta viewport $('head').append(''); // Detect pages if ($("body").hasClass("login")) { // Login page console.log("Login page"); if (theme == "light") { $("#login").prepend(``); } else if (theme == "dark") { $("#login").prepend(``); } } else if ($("body").hasClass("index")) { // Index page console.log("Index page"); handleNav() // Hide YOURLS new URL section $("#new_url").hide(); // Grab the nonce id var nonce = $("#nonce-add").val(); // Remove the YOURLS new URL Section $("#new_url").remove(); // Create the sleeky new URL section from the template $("nav").append($('
" + $(this).html() + "
"); $(this).remove(); } else if (/Powered by/.test($(this).text())) { // Update footer var content = $(this).html(); var i = 77 var updated_content = 'Running YOURLS &' + ' Dark Sleeky' + content.slice(i-1) $(this).html(updated_content); } }); });