// ==UserScript== // @name FASTER Web - Maintenance - Work Order / Direct Charge Header Height // @namespace https://github.com/cityssm/userscripts // @match https://*.fasterwebcloud.com/FASTER/Domains/Maintenance/DirectCharge*/* // @match https://*.fasterwebcloud.com/FASTER/Domains/Maintenance/WorkOrder*/* // @grant none // @version 1.1.0 // @author The Corporation of the City of Sault Ste. Marie // @description Stops the header from changing sizes between work order and direct charge tabs. // @run-at document-end // @downloadURL https://raw.githubusercontent.com/cityssm/userscripts/main/fasterWeb/workOrderHeaderHeight.user.js // @supportURL https://github.com/cityssm/userscripts/issues // @homepageURL https://cityssm.github.io/userscripts/ // @icon https://cityssm.github.io/img/header-cityssm.png // ==/UserScript== ; (() => { /* * Validate that the page is a direct charge / work order page */ var _a, _b; const validPathNames = [ 'workordermaster.aspx', 'directchargemaster.aspx', 'repairdetail.aspx', 'labordetail.aspx', 'partsissuedetail.aspx', 'partlist.aspx', 'subletdetail.aspx', 'othercostmaster.aspx', 'maintnotedetail.aspx', 'attachments.aspx', 'workorderdowntime.aspx' ]; const currentPathName = window.location.pathname .slice(window.location.pathname.lastIndexOf('/') + 1) .toLowerCase(); let isValidPathName = false; for (const validPathName of validPathNames) { if (currentPathName === validPathName) { isValidPathName = true; break; } } if (!isValidPathName) { return; } /* * Remove height from header containers. */ const elementSelectorsWithHeight = [ '#RAD_SPLITTER_PANE_CONTENT_ctl00_ContentPlaceHolder_Content_TopRadPane', '#RAD_SPLITTER_PANE_CONTENT_ctl00_ContentPlaceHolder_Content_panetop' ]; for (const elementSelectorWithHeight of elementSelectorsWithHeight) { const heightElement = document.querySelector(elementSelectorWithHeight); if (heightElement !== null) { heightElement.style.height = ''; } } /* * Remove empty elements taking up space. */ const emptyPaddingElement = document.querySelector('#ctl00_RadPane_Content .workOrderHeader'); if (emptyPaddingElement !== null && ((_a = emptyPaddingElement.textContent) !== null && _a !== void 0 ? _a : '').trim() === '') { emptyPaddingElement.remove(); } /* * Ensure padding is consistent. */ const cellPaddingElement = (_b = document.querySelector('#ctl00_ContentPlaceHolder_Content_DetailMenu_WorkOrderDetailMenuPanel')) === null || _b === void 0 ? void 0 : _b.parentElement; if (cellPaddingElement !== null && cellPaddingElement !== undefined) { cellPaddingElement.style.paddingTop = '5px'; } })();