6 Commits

Author SHA1 Message Date
cdanesi de6070459a feat: background and navbar 2023-06-07 09:24:23 -04:00
cdanesi 70c0facad3 refactor overrides.js 2023-06-07 09:07:54 -04:00
cdanesi ab518bd281 override annoying userid popup
minor style tweaks
added overrides.js
manifest updated
2023-04-28 12:57:18 -04:00
cdanesi fe80210c8d minor style tweaks 2023-04-13 07:44:12 -04:00
cdanesi 2d04dca0ac change color of ugly contract button 2022-03-05 15:19:30 -05:00
cdanesi 1eaacb7ce1 add error checking to Warranty Highlight feature
refactor code
2021-10-12 21:14:54 -04:00
4 changed files with 109 additions and 43 deletions
+6 -4
View File
@@ -4,7 +4,7 @@
"name": "ServiceHub+", "name": "ServiceHub+",
"author": "Charles Danesi", "author": "Charles Danesi",
"homepage_url": "https://charlesdanesi.net", "homepage_url": "https://charlesdanesi.net",
"version": "0.1.3", "version": "0.1.4",
"description": "Improvements to Service Hub for TRG techs", "description": "Improvements to Service Hub for TRG techs",
"content_scripts": [ "content_scripts": [
@@ -20,12 +20,14 @@
"resources": [ "resources": [
"fonts/MaterialIcons-Regular.ttf", "fonts/MaterialIcons-Regular.ttf",
"fonts/MaterialIconsOutlined-Regular.otf", "fonts/MaterialIconsOutlined-Regular.otf",
"img/autorenew.png" "img/autorenew.png",
"overrides.js"
], ],
"matches": ["<all_urls>"], "matches": ["<all_urls>"],
"extensions": ["lmeeejhdmpakenhgdfmgjcbdmeppjpam"] "extensions": ["lmeeejhdmpakenhgdfmgjcbdmeppjpam"],
"run_at": "document_end"
} }
], ],
"permissions": ["storage", "activeTab", "scripting"] "permissions": ["storage", "activeTab", "scripting", "nativeMessaging"]
} }
+23
View File
@@ -0,0 +1,23 @@
// Fix that annoying BS where the ID takes focus CONSTANTLY
console.log("Injection succeeded!");
function checkLoc() {
var sLoc = document.getElementById("txtTRG_Loc").value;
var sUsr = document.getElementById("txtTRG_User").value;
if (sLoc.length == 0) {
alert("You need to enter a location.");
sLoc.focus();
} else {
if (sUsr.length == 0) {
//alert("We suck at writing proper code.");
console.log("Override successful");
document.getElementById("txtTRG_User").value = "20539";
// document.querySelectorAll["txtTRG_User"].focus();
}
}
resetTimeout();
}
var bfTest = document.getElementById("txtTRG_Bin");
bfTest.onfocus();
+48 -10
View File
@@ -1,28 +1,66 @@
"use strict"; "use strict";
/* /*
TODO: insert a reset button into search form TODO style individual buttons
TODO: style menubar and keep it sticky on the window TODO options page (set UID)
TODO: style/move the location scan to float with the RO TODO move parts list buttons top or bottom (form name='frmPartsSelection'), btnSave, btnCancel
TODO: implement facebook-style notifications NOTE color themes?
BUG close button on photo pages is styled along with the btnCancel
NOTE display tiny images next to parts list?
TODO shrink navbar/header/location on scroll
TODO fancy button animations
TODO choose file on upload window
TODO insert a reset button into search form
TODO style menubar and keep it sticky on the window
TODO style/move the location scan to float with the RO
TODO color bg to bin color
*/ */
// temporarily override stupid alerts that happen randomly all day long
//document.getElementById("txtTRG_User").value = "20539";
// Warranty Highlight // Warranty Highlight
const isWarranty = document.getElementById("chkWarrantee"); const isWarranty = document.getElementById("chkWarrantee");
isWarranty.addEventListener("change", updateBackground); if (isWarranty != null) {
updateBackground(); isWarranty.addEventListener("change", updateBackground);
function updateBackground() { updateBackground();
function updateBackground() {
isWarranty.nextElementSibling.style.backgroundColor = isWarranty.checked isWarranty.nextElementSibling.style.backgroundColor = isWarranty.checked
? "red" ? "red"
: "transparent"; : "transparent";
isWarranty.nextElementSibling.style.color = isWarranty.checked isWarranty.nextElementSibling.style.color = isWarranty.checked
? "white" ? "white"
: "black"; : "black";
}
} }
// TODO highlight change case label if SN updated
const newSN = document.getElementById("txtNewBoardSN"); // this is the new SN field
const snWasUpdated = document.getElementById("chkCaseSNUpdate"); // this is the checkbox
// if (newSN.length != null) {
// newSN.addEventListener("change", updateSNBackground, false);
// updateSNBackground();
// }
// function updateSNBackground() {
// alert("test");
// }
// TODO add current location to a floating modal (or something)
// Notification system // Notification system
// TODO implement facebook-style notifications
// https://portal.trgrepair.com/task_manager.asp?rnd=0.9996227368620352 // https://portal.trgrepair.com/task_manager.asp?rnd=0.9996227368620352
const notifCountStr = document.getElementById("lblTask").innerText; // const notifCountStr = document.getElementById("lblTask").innerText;
const notifCount = parseInt(notifCountStr.split(" ")[2]); // Total task count // const notifCount = parseInt(notifCountStr.split(" ")[2]); // Total task count
const notifCountNew = parseInt(notifCountStr.split(" ")[5].slice(1)); // New task count // const notifCountNew = parseInt(notifCountStr.split(" ")[5].slice(1)); // New task count
// Code injection
var s = document.createElement("script");
s.src = chrome.runtime.getURL("overrides.js");
(document.head || document.documentElement).appendChild(s);
s.onload = function () {
this.remove();
};
+26 -23
View File
@@ -1,18 +1,3 @@
/*
TODO float buttons on bottom of RO
TODO float location entry on RO (sidebar?)
TODO style individual buttons
TODO options page
- move parts list buttons top or bottom
- color themes?
BUG close button on photo pages is styled along with the btnCancel
HACK display tiny images next to parts list?
TODO shrink navbar/header/location on scroll
TODO fancy button animations
TODO choose file on upload window
*/
@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");
@font-face { @font-face {
@@ -41,6 +26,24 @@
} }
/* General Styles */ /* General Styles */
body {
background-color: #303030;
}
/* Navbar */
#td_nav1,
#td_nav2,
#td_nav3,
#td_nav4,
#td_nav5,
#td_nav6,
#td_nav7,
#td_nav8,
#td_nav9,
.nav_btn_td {
background-color: #606060;
color: #C0C0C0;
}
/* Buttons */ /* Buttons */
@@ -73,7 +76,7 @@ input[name="btnCancel"] + input[name="btnSave"] {
} }
input[name="btnCancel"] { input[name="btnCancel"] {
background-color: lightcoral; background-color: var(--lightblue);
color: var(--white); color: var(--white);
position: fixed; position: fixed;
bottom: 20px; bottom: 20px;
@@ -102,8 +105,8 @@ input[name="btnIssue4Eval"] {
input[name="btnContract"] { input[name="btnContract"] {
padding: 0.3em 0; padding: 0.3em 0;
background-color: var(--green); background-color: var(--darkgray);
color: var(--darkgray); color: var(--white);
} }
input[name="btnExpandRepairHistory"] { input[name="btnExpandRepairHistory"] {
@@ -129,7 +132,11 @@ input[value="Remove Repair"] {
} }
label { label {
transition: background-color 250ms ease; transition: background-color 250ms ease-in, color 250ms ease-in;
}
label[for="chkWarrantee"] {
padding: 0.35em;
} }
/* Images */ /* Images */
@@ -152,7 +159,3 @@ img[id="Img3"] {
outline: none; outline: none;
border: none; border: none;
} }
label[for="chkWarrantee"] {
padding: 0.35em;
}