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 108 deletions
+4 -6
View File
@@ -4,7 +4,7 @@
"name": "ServiceHub+",
"author": "Charles Danesi",
"homepage_url": "https://charlesdanesi.net",
"version": "0.1.4",
"version": "0.1.3",
"description": "Improvements to Service Hub for TRG techs",
"content_scripts": [
@@ -20,14 +20,12 @@
"resources": [
"fonts/MaterialIcons-Regular.ttf",
"fonts/MaterialIconsOutlined-Regular.otf",
"img/autorenew.png",
"overrides.js"
"img/autorenew.png"
],
"matches": ["<all_urls>"],
"extensions": ["lmeeejhdmpakenhgdfmgjcbdmeppjpam"],
"run_at": "document_end"
"extensions": ["lmeeejhdmpakenhgdfmgjcbdmeppjpam"]
}
],
"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();
+13 -47
View File
@@ -1,66 +1,32 @@
"use strict";
/*
TODO style individual buttons
TODO options page (set UID)
TODO move parts list buttons top or bottom (form name='frmPartsSelection'), btnSave, btnCancel
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
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: implement facebook-style notifications
*/
// temporarily override stupid alerts that happen randomly all day long
//document.getElementById("txtTRG_User").value = "20539";
// Warranty Highlight
const isWarranty = document.getElementById("chkWarrantee");
if (isWarranty != null) {
isWarranty.addEventListener("change", updateBackground);
updateBackground();
function updateBackground() {
isWarranty.addEventListener("change", updateBackground);
updateBackground();
function updateBackground() {
isWarranty.nextElementSibling.style.backgroundColor = isWarranty.checked
? "red"
: "transparent";
isWarranty.nextElementSibling.style.color = isWarranty.checked
? "white"
: "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
// TODO implement facebook-style notifications
// https://portal.trgrepair.com/task_manager.asp?rnd=0.9996227368620352
// const notifCountStr = document.getElementById("lblTask").innerText;
// const notifCount = parseInt(notifCountStr.split(" ")[2]); // Total task count
// const notifCountNew = parseInt(notifCountStr.split(" ")[5].slice(1)); // New task count
const notifCountStr = document.getElementById("lblTask").innerText;
const notifCount = parseInt(notifCountStr.split(" ")[2]); // Total 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();
};
// Insert notification button
const insertButton = document.getElementById("exitBtn");
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>`;
+76 -26
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");
@font-face {
@@ -26,24 +41,6 @@
}
/* 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 */
@@ -76,7 +73,7 @@ input[name="btnCancel"] + input[name="btnSave"] {
}
input[name="btnCancel"] {
background-color: var(--lightblue);
background-color: lightcoral;
color: var(--white);
position: fixed;
bottom: 20px;
@@ -105,8 +102,8 @@ input[name="btnIssue4Eval"] {
input[name="btnContract"] {
padding: 0.3em 0;
background-color: var(--darkgray);
color: var(--white);
background-color: var(--green);
color: var(--darkgray);
}
input[name="btnExpandRepairHistory"] {
@@ -132,11 +129,7 @@ input[value="Remove Repair"] {
}
label {
transition: background-color 250ms ease-in, color 250ms ease-in;
}
label[for="chkWarrantee"] {
padding: 0.35em;
transition: background-color 250ms ease;
}
/* Images */
@@ -159,3 +152,60 @@ img[id="Img3"] {
outline: 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>