This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcustomJSS.min.js
9 lines (9 loc) · 7.38 KB
/
customJSS.min.js
1
2
3
4
5
6
7
8
9
// ==UserScript==
// @name Owen's JSS Customizations - Generic
// @namespace https://jss.
// @version 0.1
// @description JSS customizations - Generic
// @include *://jss.*
// @include https://*.jamfcloud.com*
// ==/UserScript==
var jssURL=window.location.protocol+"//"+window.location.host,customFileDirectory="https://opragel.github.io/customJSS/custom/",customLogoURL=customFileDirectory+"osimp.png",customCSSURL=customFileDirectory+"customJSS.min.css",font="<link href='https://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>",customCSS="<link href='"+customCSSURL+"' rel='stylesheet' type='text/css'>",createMenuItem=function(a,b){return'<li class=" "><a href="'+a+'">'+b+"</a></li>"},createMenuItemID=function(a,b,c){return'<li class=" " id="'+c+'"><a href="'+a+'">'+b+"</a></li>"};$("head").append(font+customCSS),$("#settings").attr("class",""),$("#logo-dash .hidemobile").attr("src",customLogoURL);var ologo="<img src='"+customLogoURL+"' id='simplogo' alt='JAMF JSS'>";if($("#login-panel").length)$("#login-wrapper").prepend(ologo),$("#emptyVerticalCenteringFloat, #login-icon, #copyright-text").remove();else{var scriptURL=createMenuItem("scripts.html","Scripts"),packagesURL=createMenuItem("packages.html","Packages"),extensionsURL=createMenuItem("computerExtensionAttributes.html","Extension Attributes"),extensionsMobileURL=createMenuItem("mobileDeviceExtensionAttributes.html","Extension Attributes"),settingsURL=createMenuItemID("settings.html","Settings","settingsconsole"),advCompSearchURL=createMenuItemID("advancedComputerSearches.html?id=-1&o=c","Advanced Search","advancedSearch"),advMobileSearchURL=createMenuItemID("advancedMobileDeviceSearches.html?id=-1&o=c","Advanced Search","advancedSearch"),advUserSearchURL=createMenuItemID("advancedUserSearches.html?id=-1&o=c","Advanced Search","advancedSearch"),policiesURL=createMenuItemID("policies.html","Computer Policies","policies"),printersURL=createMenuItem("printers.html","Printers"),accountsURL=createMenuItem("accounts.html","JSS Accounts"),computersURL=createMenuItem("computers.html","Computers"),mobileURL=createMenuItem("mobileDevices.html","Mobile Devices"),JSSusersURL=createMenuItem("accounts.html","JSS Users & Groups"),JSSlogsURL=createMenuItem("logging.html","JSS System Logs"),JSSsummaryURL=createMenuItem("summary.html","JSS Summary"),allComputersURL=createMenuItem("computers.html?queryType=Computers&query=*","All Computers"),allUsersURL=createMenuItem("users.html?query=*","All Users"),divider="<li class='divider'></li>";if($("#sidebar-nav,#logo-dash").addClass("sidebar-whole"),$("#sidebar").prepend("<img class='expandButton' id='bottomExpandButton' src='"+jssURL+"/images/navigation/arrow-active.png'><img class='expandButton' id='topExpandButton' src='"+jssURL+"/images/navigation/arrow-active.png'>"),$("#settings").attr("href","settings.html"),$('li:contains("Management Settings")').remove(),$(".searchLabel").remove(),$("li:contains('JSS Information')").length?($("#sidebar-nav").prepend(computersURL,mobileURL,divider),$("#sidebar-nav").append(accountsURL,JSSlogsURL,JSSsummaryURL,divider,allComputersURL,allUsersURL,policiesURL,extensionsURL,packagesURL,printersURL,scriptURL),$(".settings-row h5").append("<img src='"+jssURL+"/images/navigation/down-arrow.png' width='9px' height='8px' alt='Expand'>"),$(function(){$(".settings-row").click(function(){$(this).find("li").toggle()}),$(".settings-row .settings-item, .settings-row .summary-item input, .settings-row .check").click(function(a){a.stopPropagation()})})):$('li:contains("Managed Preferences")').length?($('#sidebar-nav li:contains("Search Inventory")').after(allComputersURL,advCompSearchURL),$("#sidebar-nav").append(extensionsURL,packagesURL,printersURL,scriptURL),$('h2:contains("Policies")').length&&($(".policiesTable.dataTable thead tr").append("<th class='header' style='width: 15px;'>Logs</th>"),$('.policiesTable.dataTable tbody tr:not(".group")').each(function(){var a=$(this).find("td a").attr("href");a=a.replace(/o=r/,"o=l"),$(this).append("<td printf><a class='cancelButton' href='"+a+"'>Logs</a>")})),$("h2:contains('Advanced Computer Searches')").length&&($(".search-wrapper").append("<a id='advSearch' href='advancedComputerSearches.html?id=-1&o=c'>Advanced Search</a>"),$("h2").insertBefore("#content-inside form"),$("#table-top").hide(),$("#DataTables_Table_0 thead tr").append("<th class='header'>Details</th><th class='header'>Edit</th>"),$("#DataTables_Table_0 tbody tr").each(function(){var a=$(this).find(".view").attr("href"),b=a.replace(/o=r/,"o=v");$(this).find(".view").attr("href",b),$(this).append("<td><a href='"+a+"'>View</a>"),$(this).append("<td><a href='"+a.replace(/o=r/,"o=u")+"'>Edit</a>")})),$("h2:contains('Computer Groups')").length&&($(".standardDataTable thead tr").append("<th class='header'>Details</th><th class='header'>Edit</th>"),$(".standardDataTable tbody tr").each(function(){var a=$(this).find(".view").attr("href"),b=a.replace(/o=r/,"o=v");$(this).find(".view").attr("href",b),$(this).append("<td><a href='"+a+"'>View</a>"),$(this).append("<td printf><a href='"+a.replace(/o=r/,"o=u")+"'>Edit</a>")}))):$('li:contains("Smart Mobile Device Groups")').length&&($("h2:contains('Advanced Mobile Device Searches')").length&&($(".standardDataTable thead tr").append("<th class='header'>Details</th><th class='header'>Edit</th>"),$("h2").insertBefore("#content-inside form"),$("#table-top").hide(),$(".standardDataTable tbody tr").each(function(){var a=$(this).find(".view").attr("href"),b=a.replace(/o=r/,"o=v");$(this).find(".view").attr("href",b),$(this).append("<td printf><a href='"+a+"'>View</a>"),$(this).append("<td printf><a class='cancelButton' href='"+a+"'>Edit</a>")})),$('#sidebar-nav li:contains("Search Inventory")').after(advMobileSearchURL),$("#sidebar-nav").append(extensionsMobileURL)),$('li:contains("Smart User Groups")').length&&($('#sidebar-nav li:contains("Search Users")').after(allUsersURL,advUserSearchURL),$("#sidebar-nav").append(JSSusersURL)),$("#dashboard-header").length);else{if($("#sidebar-nav").append(divider,settingsURL),$("#sidebar-nav, #logo-dash").addClass("sidebar-whole"),$(function(){$(".sidebar-whole").click(function(){$(".sidebar-whole").toggle(),$("#navigation").css("left","28px"),$("#content-inside").css("margin-left","15px"),$("#sites-link").css("margin-left","15px"),$(".expandButton").css("display","inline"),$("#footer").css("display","none")}),$(".sidebar-whole a").click(function(a){a.stopPropagation()}),$(".expandButton").click(function(){$(".sidebar-whole").toggle(),$("#navigation").css("left","236px"),$("#content-inside").css("margin-left","236px"),$("#site-links").css("margin-top","15px"),$("#sites-link").css("margin-left","auto"),$(".expandButton").css("display","none"),$(window).height()>400&&$("#footer").css("display","block")})}),$("#Display_Pane").length&&$("input#save-button").length){var checkAllButton="<input type='button' id='checkAllButton' class='cancelButton' value='Check All'>",clearAllButton="<input type='button' id='clearAllButton' class='cancelButton' value='Clear All'>";$("#displayFieldsPane7").after(checkAllButton,clearAllButton),$("input#checkAllButton").click(function(){$("input#FIELD_DISPLAY").filter(":visible").not(this).prop("checked",!0)}),$("input#clearAllButton").click(function(){$("input#FIELD_DISPLAY").filter(":visible").not(this).prop("checked",!1)})}$(window).on("resize",function(){var a=$(this);a.height()>=400?$("#footer").css("display","block"):$("#footer").css("display","none")})}}