override annoying userid popup
minor style tweaks added overrides.js manifest updated
This commit is contained in:
+6
-4
@@ -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"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.");
|
||||||
|
document.all["txtTRG_Loc"].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();
|
||||||
@@ -1,22 +1,24 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODO float buttons on bottom of RO
|
|
||||||
TODO float location entry on RO (sidebar?)
|
|
||||||
TODO style individual buttons
|
TODO style individual buttons
|
||||||
TODO options page
|
TODO options page (set UID)
|
||||||
- move parts list buttons top or bottom
|
TODO move parts list buttons top or bottom (form name='frmPartsSelection'), btnSave, btnCancel
|
||||||
- color themes?
|
NOTE color themes?
|
||||||
BUG close button on photo pages is styled along with the btnCancel
|
BUG close button on photo pages is styled along with the btnCancel
|
||||||
HACK display tiny images next to parts list?
|
NOTE display tiny images next to parts list?
|
||||||
TODO shrink navbar/header/location on scroll
|
TODO shrink navbar/header/location on scroll
|
||||||
TODO fancy button animations
|
TODO fancy button animations
|
||||||
TODO choose file on upload window
|
TODO choose file on upload window
|
||||||
TODO insert a reset button into search form
|
TODO insert a reset button into search form
|
||||||
TODO style menubar and keep it sticky on the window
|
TODO style menubar and keep it sticky on the window
|
||||||
TODO style/move the location scan to float with the RO
|
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");
|
||||||
if (isWarranty != null) {
|
if (isWarranty != null) {
|
||||||
@@ -33,10 +35,18 @@ if (isWarranty != null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO highlight change case label if SN updated
|
// 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
|
||||||
|
|
||||||
// TODO color bg to bin color
|
// if (newSN.length != null) {
|
||||||
|
// newSN.addEventListener("change", updateSNBackground, false);
|
||||||
|
// updateSNBackground();
|
||||||
|
// }
|
||||||
|
// function updateSNBackground() {
|
||||||
|
// alert("test");
|
||||||
|
// }
|
||||||
|
|
||||||
// TODO add current location to top of page somewhere
|
// TODO add current location to a floating modal (or something)
|
||||||
|
|
||||||
// Notification system
|
// Notification system
|
||||||
// TODO implement facebook-style notifications
|
// TODO implement facebook-style notifications
|
||||||
@@ -45,3 +55,12 @@ if (isWarranty != null) {
|
|||||||
// 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();
|
||||||
|
};
|
||||||
|
|||||||
@@ -58,7 +58,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;
|
||||||
@@ -141,47 +141,3 @@ img[id="Img3"] {
|
|||||||
outline: none;
|
outline: none;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#div_task {
|
|
||||||
width: 892px;
|
|
||||||
position: absolute;
|
|
||||||
top: 75px;
|
|
||||||
left: 0px;
|
|
||||||
text-align: right;
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
#frmTask {
|
|
||||||
display: block;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-block-end: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this is for the task msg */
|
|
||||||
center:first-child {
|
|
||||||
background-color: transparent;
|
|
||||||
text-align: center;
|
|
||||||
height: 30px;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.taskMsg {
|
|
||||||
width: 98%;
|
|
||||||
text-align: right;
|
|
||||||
background-color: transparent;
|
|
||||||
vertical-align: middle;
|
|
||||||
/* cursor: hand; */
|
|
||||||
cursor: pointer;
|
|
||||||
font-family: Lato;
|
|
||||||
font-size: 12pt;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #B3D234;
|
|
||||||
}
|
|
||||||
|
|
||||||
#imgTask {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
#lblTask {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user