3 Commits

Author SHA1 Message Date
cdanesi f260108ebf merge changes from master 2021-10-07 21:09:45 -04:00
cdanesi 955bc54290 add initial styling for fancy notifications 2021-10-07 20:33:51 -04:00
cdanesi eac6b51863 begin work on fancy notifications
add taskList.html for task list popup
2021-10-07 20:31:10 -04:00
5 changed files with 110 additions and 90 deletions
+4 -6
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.4", "version": "0.1.3",
"description": "Improvements to Service Hub for TRG techs", "description": "Improvements to Service Hub for TRG techs",
"content_scripts": [ "content_scripts": [
@@ -20,14 +20,12 @@
"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", "nativeMessaging"] "permissions": ["storage", "activeTab", "scripting"]
} }
-23
View File
@@ -1,23 +0,0 @@
// 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();
+10 -44
View File
@@ -1,27 +1,14 @@
"use strict"; "use strict";
/* /*
TODO style individual buttons TODO: insert a reset button into search form
TODO options page (set UID) TODO: style menubar and keep it sticky on the window
TODO move parts list buttons top or bottom (form name='frmPartsSelection'), btnSave, btnCancel TODO: style/move the location scan to float with the RO
NOTE color themes? TODO: implement facebook-style notifications
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");
if (isWarranty != null) {
isWarranty.addEventListener("change", updateBackground); isWarranty.addEventListener("change", updateBackground);
updateBackground(); updateBackground();
function updateBackground() { function updateBackground() {
@@ -32,35 +19,14 @@ if (isWarranty != null) {
? "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 // Insert notification button
var s = document.createElement("script"); const insertButton = document.getElementById("exitBtn");
s.src = chrome.runtime.getURL("overrides.js"); insertButton.innerHTML = `<div id='newBtn'><a href='#' id='notification-button'><span class='material-icons-outlined notification-icon'>notifications</span></a><span id='notification-badge'>${notifCountNew}</span></div>`;
(document.head || document.documentElement).appendChild(s);
s.onload = function () {
this.remove();
};
+76 -8
View File
@@ -1,3 +1,18 @@
/*
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 {
@@ -58,7 +73,7 @@ input[name="btnCancel"] + input[name="btnSave"] {
} }
input[name="btnCancel"] { input[name="btnCancel"] {
background-color: var(--lightblue); background-color: lightcoral;
color: var(--white); color: var(--white);
position: fixed; position: fixed;
bottom: 20px; bottom: 20px;
@@ -87,8 +102,8 @@ input[name="btnIssue4Eval"] {
input[name="btnContract"] { input[name="btnContract"] {
padding: 0.3em 0; padding: 0.3em 0;
background-color: var(--darkgray); background-color: var(--green);
color: var(--white); color: var(--darkgray);
} }
input[name="btnExpandRepairHistory"] { input[name="btnExpandRepairHistory"] {
@@ -114,11 +129,7 @@ input[value="Remove Repair"] {
} }
label { label {
transition: background-color 250ms ease-in, color 250ms ease-in; transition: background-color 250ms ease;
}
label[for="chkWarrantee"] {
padding: 0.35em;
} }
/* Images */ /* Images */
@@ -141,3 +152,60 @@ img[id="Img3"] {
outline: none; outline: none;
border: none; border: none;
} }
label[for="chkWarrantee"] {
padding: 0.35em;
}
/* Fancy Notifications */
#div_task {
display: none;
visibility: hidden;
}
#newBtn {
position: relative;
}
.material-icons-outlined {
font-family: "Material Icons Outlined";
}
#notification-button {
position: relative;
color: var(--lightblue);
cursor: pointer;
text-decoration: none;
outline: none;
}
#notification-button:hover {
color: var(--lightgray);
}
.notification-icon {
font-size: 2.5em;
position: absolute;
top: 5;
right: 3;
}
#notification-badge {
position: absolute;
top: 0;
right: 0;
}
/* Top bar */
#div_location {
/* position: relative;
width: 80%; */
}
#frmLocation {
/* position: absolute;
top: -40;
right: 370; */
}
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Tasks for {username}</title>
</head>
<body></body>
</html>