0% found this document useful (0 votes)
44 views45 pages

Rodeo Plus

The document describes a user script named 'Rodeo Plus' that enhances the functionality of the Rodeo platform with multiple add-ons. It includes features such as customizable options for various tools, the ability to modify links for shipment IDs and ASINs, and integration with external APIs for additional data. The script also provides a user interface for managing these options and displays relevant information based on user interactions.

Uploaded by

ryanlopez1299
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views45 pages

Rodeo Plus

The document describes a user script named 'Rodeo Plus' that enhances the functionality of the Rodeo platform with multiple add-ons. It includes features such as customizable options for various tools, the ability to modify links for shipment IDs and ASINs, and integration with external APIs for additional data. The script also provides a user interface for managing these options and displays relevant information based on user interactions.

Uploaded by

ryanlopez1299
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

// ==UserScript==

// @name Rodeo Plus

// @namespace com.amazon.shocklp

// @version 1.10.18.1

// @description Multiple add-ons that improve the functionality of Rodeo.

// @author Phillip Shockley | shocklp

// @match https://rodeo-iad.amazon.com/*

// @downloadURL https://axzile.corp.amazon.com/-/carthamus/download_script/rodeo-plus.user.js

// @updateURL https://axzile.corp.amazon.com/-/carthamus/download_script/rodeo-plus.user.js

// @icon https://rodeo-iad.amazon.com//resources/images/rodeo-favicon.gif

// @grant GM_setClipboard

// @grant GM_addStyle

// @grant GM_info

// @run-at document-end

// @grant GM_xmlhttpRequest

// @require https://code.jquery.com/jquery-3.3.1.js

// @require https://raw.githubusercontent.com/pamelafox/lscache/master/lscache.js

// @require https://axzile.corp.amazon.com/-/carthamus/download_script/read-cookie.user.js

// ==/UserScript==

// v1.10.17 updated to fix links to updates, a cookies script and media

/* global $, readCookie */

/* eslint-disable no-multi-spaces */

// media

//Script version control

// document.addEventListener('DOMContentLoaded', (event) => {

var currentVersion = GM_info.script.version;

document.getElementsByClassName("fcpn-logo")[0].title = `Rodeo Plus ver. ${currentVersion}`


//Determine Fulfillment Center

var FC; //Get FC

// Retrieve url info

var urlmatch = document.URL.match(/https:\/\/fanyv88.com:443\/https\/rodeo-(.*?).amazon.com\/([A-Z]{3,}\d)\/?(.*)?/);

if (urlmatch){

var region = urlmatch[1];

FC = urlmatch[2];

//first value (ie 'dub') is used in rodeo link

//second value (ie 'eu') is used in fcresearch link

var region2 = {

'dub':'eu',

'iad':'na',

'nrt':'jp'

}[region];

var region3 = {

'dub':'eu',

'iad':'na',

'nrt':'ap'

}[region];

var login = readCookie('fcmenu-employeeLogin'),

emplID = readCookie('fcmenu-employeeId'),

remoteAddr = readCookie('fcmenu-remoteAddr');

(function(){

var searchContainer = document.getElementById('fcpn-toolbar')

var accoladeContainer = document.createElement('li')

var accoladeImg = document.createElement('img')


var accoladeOverlay = document.createElement('div')

var accoladeText = document.createElement('div')

accoladeContainer.append(accoladeImg)

//accoladeContainer.append(accoladeOverlay)

//accoladeOverlay.append(accoladeText)

accoladeContainer.classList.add('fcpn-head-item')

accoladeContainer.classList.add('accolade-container')

accoladeImg.classList.add('accolade-image')

accoladeOverlay.classList.add('accolade-overlay')

accoladeText.classList.add('accolade-text')

accoladeImg.src = 'https://m.media-amazon.com/images/G/01/Accolades/favicon-
32x32._CB422871708_.png'

accoladeImg.title = 'Love the script? Send an accolade.'

accoladeText.innerText = 'Love the script? Send an accolade.'

searchContainer.children[0].append(accoladeContainer)

accoladeContainer.addEventListener('click', function(){

window.open('https://accolades.corp.amazon.com/send/?user=shocklp', '_blank')

})

})()

console.log(`

-----------------------------

Rodeo Plus version: %c%s%c

Current FC: %c%s%c


-----------------------------`,

"color:#f90; border:1px solid #000; border-radius:10px; padding: 0 5px;", currentVersion,


"color:none",

"color:#f90; border:1px solid #000; border-radius:10px; padding: 0 5px;", FC,


"color:none"

);

//These are the titles that show next to the checkboxes under options

var optionsDefault = {

hitchLink:{ title: 'Hitch Link', on:true},

CPTHighlighter:{ title: 'CPT Highlighter', on:true}, //done

BADTote:{ title: 'Bad Tote Checker', on:true},

PADModifier:{ title: 'PAD Time Modifier', on:true}, //done

podConsole:{ title: 'POD Console Link', on:false}, //done

eagleEye:{ title: 'Eagle-Eye Link', on:false}, //done

podInfo:{ title: 'POD Info', on:true} //done

};

/*for(i=0;i<Object.keys(optionsDefault).length;i++){

console.log(Object.keys(optionsDefault)[i])

}*/

if(document.body.contains(document.getElementById('options-input'))){ // check for options menu

// Create Rodeo+ Options Header

var optionsMenu = document.getElementById('options-input'), // menu already created by


rodeo

optionHeader = document.createElement('div'), // new rodeo+ header

plusMinus = document.createElement('a'), // +/- on the header

rpOptionSet = document.createElement('div') // container for All options

optionHeader.innerText = 'Rodeo Plus Options';


optionHeader.classList.add('option-header');

optionHeader.addEventListener('click', collapseOptions );

rpOptionSet.classList.add('option-set');

plusMinus.innerText = "-";

plusMinus.href = '#';

plusMinus.classList.add('plus','minus')

optionHeader.append(plusMinus);

optionsMenu.prepend(rpOptionSet);

optionsMenu.prepend(optionHeader);

//-------------------------------------------------------------------------------

//attach each option and checkbox to the option menu

for(var i=0;i<Object.keys(optionsDefault).length;i++){

var rpOptionDiv = document.createElement('div'),

rpOptionCheckBox = document.createElement('input'), // new check box

rpOptionLabel = document.createElement('label'); // new label for check box

rpOptionCheckBox.type = 'checkbox';

rpOptionCheckBox.id = Object.keys(optionsDefault)[i];

rpOptionLabel.setAttribute('for', Object.keys(optionsDefault)[i]);

rpOptionLabel.innerText = optionsDefault[Object.keys(optionsDefault)[i]].title

rpOptionCheckBox.addEventListener('click',toggleOption) //when the checkbox is toggled

rpOptionSet.append(rpOptionDiv)

rpOptionDiv.append(rpOptionCheckBox, rpOptionLabel)

}
/*make [Rodeo Plus Options] collapsible*/

function collapseOptions(){

if(this.className == 'option-header'){

this.nextSibling.style.display = 'none'

this.classList.add('option-header-collapsed')

this.children[0].innerText = '+'

}else if(this.classList.contains('option-header-collapsed')){

this.nextSibling.style.display = 'block'

this.classList.remove('option-header-collapsed')

this.children[0].innerText = '-'

/*activate/deactivate add-ons*/

function toggleOption(){

const options = JSON.parse(localStorage.options) //parse the current localStorage so that we can


update individual keys

const key = this.id

if(this.checked){

options[key].on = true //change the value of 'on' within the key of the correctly
clicked checkbox

localStorage.setItem('options', JSON.stringify(options)) //apply the changed value back to


localStoarage

console.log(`${JSON.parse(localStorage.options)[key].title}: %cON`, "color:#fff; background-


color:green; border-radius:10px; padding: 0 5px; border: 1px solid #fff; float:right;")

}else{

options[key].on = false //change the value of 'on' within the key of the correctly
clicked checkbox
localStorage.setItem('options', JSON.stringify(options)) //apply the changed value back to
localStoarage

console.log(`${JSON.parse(localStorage.options)[key].title}: %cOFF`, "color:#fff; background-


color:red; border-radius:10px; padding: 0 5px; border: 1px solid #fff; float:right;")

/*

checkForStorage needs to:

-check if there is a storage value for each option

-create a value if there isn't one

-mark the checkbox under options if the option is turned on

-run the function that it is tied to.

*/

(window.checkForStorage = function(){

// console.log('Checking for storage...')

if(localStorage.options != null){ //if storage already exists

var options = JSON.parse(localStorage.options) // make the current options equal to what is


stored

// console.log('Stored options found!')

Object.keys(optionsDefault).forEach(function(key) { //for each key in the optionsDefault

if(JSON.parse(localStorage.options)[key] == undefined){ //when the matching key is undefined


in stored setting (ie. a new setting is introduced)

console.log(`options.${key} is undefined, adding the default to stored settings`)

options[key] = optionsDefault[key]; //make the key of options equal to the key of


optionsDefault

localStorage.options=JSON.stringify(options); //and save options into localStorage

})
Object.keys(JSON.parse(localStorage.options)).forEach(function(key){

if(optionsDefault[key] == undefined){

console.log(`setting found in storage that is not found in defaults...removing from storage`)

var del = JSON.parse(localStorage.options)

delete del[key] //delete the key that is in storage but not in defaults (removing an unused
setting)

localStorage.options = JSON.stringify(del) //store options without the newly removed


options.

})

}else{

console.log('Initializing storage for Rodeo Plus options')

localStorage.options = JSON.stringify(optionsDefault); //stored options based on the predefined


defaults

if(urlmatch[3] != null){

runRodeoPlusOptions()

})()

function runRodeoPlusOptions(){

Object.keys(JSON.parse(localStorage.options)).forEach(function(key){

//console.log(JSON.parse(localStorage.options)[key].on)

if(JSON.parse(localStorage.options)[key].on){

console.log(`${JSON.parse(localStorage.options)[key].title}: %cON`, "color:#fff; background-


color:green; border-radius:10px; padding: 0 5px; border: 1px solid #fff; float:right;")

document.getElementById(key).checked = true;

}else{
console.log(`${JSON.parse(localStorage.options)[key].title}: %cOFF`, "color:#fff; background-
color:red; border-radius:10px; padding: 0 5px; border: 1px solid #fff; float:right;")

document.getElementById(key).checked = false;

})

// Allow user to scan ship label QR codes in search bar and return sp00

$("#shipment-search").change( function(){

var input = $(this).val();

var output = input.replace(/\[.*\].*\:/, "").replace(" ", "").replace(/^S(?=\w{9}_001_v$)/,


"sp").replace(/^\d{4}-/, "").replace(/_001_v$/, "");

$("#shipment-search").val(output);

})

//Shipment ID ==> New Rodeo Tab

document.querySelectorAll('table a[href*=".hitch.aft"][href*="/shipment/"]')

.forEach((a) => {

const shipmentId = a.href.match(/\d+$/);

a.href = `https://rodeo-${region}.amazon.com/${FC}/Search?searchKey=${shipmentId}`; //assign


link to go to FCResearch instead of hitch

if(JSON.parse(localStorage.options).hitchLink.on == true && shipmentId){

var hitchLink = document.createElement('a'),

hitchImg = document.createElement('img')

hitchImg.src =
'https://drive.corp.amazon.com/view/GRR1%20TamperMonkey/media/hitch.png'

hitchLink.append(hitchImg)

hitchImg.classList.add('linkIcon')

hitchImg.title = "Hitch"
hitchLink.classList.add('eagleLink')

hitchLink.href = `https://${region2}.hitch.aft.amazon.dev/warehouse/${FC}/shipment/$
{shipmentId}`

hitchLink.target = '_blank'

a.append(hitchLink)

if(JSON.parse(localStorage.options).eagleEye.on == true && shipmentId){// adds a link to Eagle-


eye

var eagleLink = document.createElement('a'), // create the link and img elements

eagleImg = document.createElement('img')

eagleImg.src = 'https://eagleeye-na.amazon.com/img/eagle-eye-favicon.png'

eagleImg.title = "Eagle-Eye"

eagleLink.append(eagleImg)

eagleImg.classList.add('linkIcon')

eagleLink.classList.add('eagleLink')

eagleLink.href = `https://eagleeye-${region2}.amazon.com/search?type=Shipment&value=$
{shipmentId}`

eagleLink.target = '_blank'

a.append(eagleLink)

GM_xmlhttpRequest({

method: 'GET',

url: `https://hero.${region2}.picking.aft.a2z.com/api/fcs/${FC}/entities/type/
CUSTOMER_SHIPMENT/id/${shipmentId}/events`,

headers: {

'Accept':'application/json, text/javascript',

'Content-Type':'application/json; charset=UTF-8'

},

onload: function(response) {
var js = JSON.parse(response.responseText);

if (typeof js.EventList != 'undefined'){

var EventD1 = '';

var EventD2 = '';

for (i = js.EventList.length-1; i >= 0; i--){

if (js.EventList[i].eventType == 'CREATE_PACKAGE'){

EventD1 = js.EventList[i].eventDetailsKey;

EventD2 = js.EventList[i].requestId;

break;

if (EventD1 != '' && EventD2 != ''){

GM_xmlhttpRequest({

method: 'GET',

url: 'https://hero.' + region2 + '.picking.aft.a2z.com/api/fcs/' + FC +


'/entities/type/CUSTOMER_SHIPMENT/id/' + shipmentId + '/events/id/' + EventD2 + '/details/key/' +
EventD1,

headers: {

'Accept':'application/json, text/javascript',

'Content-Type':'application/json; charset=UTF-8'

},

onload: function(response) {

var js = JSON.parse(response.responseText);

if (typeof js.eventDetails != 'undefined'){

if (typeof js.eventDetails.message != 'undefined'){

var boxrec = js.eventDetails.message.match(/boxRecommendation=(.*?),/); //


recommended box code

// updateBoxRec(shipmentId, boxrec[1]);

// figure out how to display the box code on rodeo

}
}

});

});

});

//ASIN ==> FCResearch

document.querySelectorAll('table a[href*="&asin="]')

.forEach((a) => {

var ASIN = a.href.match(/[A-Z0-9]+$/);

a.href = `http://fcresearch-${region2}.aka.amazon.com/${FC}/results?s=${ASIN}`;

});

//location ==> FCResearch

document.querySelectorAll('table a[href*="&container="]')

.forEach((a) => {

var location = a.href.match(/[a-zA-Z0-9-_]+$/);

a.href = `http://fcresearch-${region2}.aka.amazon.com/${FC}/results?s=${location}`;

});

/* Define columns that will be used */

var allTh = document.querySelectorAll('th');

//console.log(allTh);

var shipTh = Array.from(allTh).find(th => th.innerText === 'Shipment ID' || th.innerText ===
'Transfer Request ID');
var scanTh = Array.from(allTh).find(th => th.innerText === 'Scannable ID');

var dateTh = Array.from(allTh).find(th => th.innerText === 'Expected Ship Date' || th.innerText
=== 'Need To Ship By Date');

var conditionTh = Array.from(allTh).find(th => th.innerText === 'Condition');

var asinTh = Array.from(allTh).find(th => th.innerText === 'FN SKU');

var outerTh = Array.from(allTh).find(th => th.innerText === 'Outer Scannable ID');

var quantityTh = Array.from(allTh).find(th => th.innerText === 'Quantity');

var pickBatchTh = Array.from(allTh).find(th => th.innerText === 'Pick Batch ID');

var workPoolTh = Array.from(allTh).find(th => th.innerText === 'Work Pool');

var shipOptionTh = Array.from(allTh).find(th => th.innerText === 'Ship Option');

//console.log(pickBatchTh);

// Get the index of that element with respect to its siblings (+1 because nodes are base 1 not base 0
like arrays)

if ( typeof shipTh !== 'undefined' ) {

var shipIndex = Array.from(shipTh.parentNode.children).indexOf(shipTh)+1;

var shipColumn = shipTh.closest('table').querySelectorAll(`td:nth-child(${shipIndex}) >


div.relative`);

};

if ( typeof scanTh !== 'undefined' ) {

var scanIndex = Array.from(scanTh.parentNode.children).indexOf(scanTh)+1;

var scanColumn = scanTh.closest('table').querySelectorAll(`td:nth-child(${scanIndex}) >


div.relative`);

};

if ( typeof dateTh !== 'undefined' ) {

var dateIndex = Array.from(dateTh.parentNode.children).indexOf(dateTh)+1;

var dateColumn = dateTh.closest('table').querySelectorAll(`td:nth-child(${dateIndex})`);

};

if ( typeof conditionTh !== 'undefined' ) {

var conditionIndex = Array.from(conditionTh.parentNode.children).indexOf(conditionTh)+1;


var conditionColumn = conditionTh.closest('table').querySelectorAll(`td:nth-child($
{conditionIndex}) > div`);

};

if ( typeof asinTh !== 'undefined' ) {

var asinIndex = Array.from(asinTh.parentNode.children).indexOf(asinTh)+1;

var asinColumn = asinTh.closest('table').querySelectorAll(`td:nth-child(${asinIndex}) > div`);

};

if ( typeof outerScan !== 'undefined' ) {

var outerIndex = Array.from(outerTh.parentNode.children).indexOf(outerTh)+1;

var outerColumn = outerTh.closest('table').querySelectorAll(`td:nth-child(${outerIndex}) > div`);

};

if (typeof quantityTh !== 'undefined'){

var quantityIndex = Array.from(quantityTh.parentNode.children).indexOf(quantityTh)+1;

var quantityColumn = quantityTh.closest('table').querySelectorAll(`td:nth-child($


{quantityIndex})`);

if (typeof pickBatchTh !== 'undefined'){

var pickBatchIndex = Array.from(pickBatchTh.parentNode.children).indexOf(pickBatchTh)+1;

var pickBatchColumn = pickBatchTh.closest('table').querySelectorAll(`td:nth-child($


{pickBatchIndex})`);

if (typeof workPoolTh !== 'undefined'){

var workPoolIndex = Array.from(workPoolTh.parentNode.children).indexOf(workPoolTh)+1;

var workPoolColumn = workPoolTh.closest('table').querySelectorAll(`td:nth-child($


{workPoolIndex})`);

if (typeof shipOptionTh !== 'undefined'){

var shipOptionIndex = Array.from(shipOptionTh.parentNode.children).indexOf(shipOptionTh)+1;

var shipOptionColumn = shipOptionTh.closest('table').querySelectorAll(`td:nth-child($


{shipOptionIndex})`);
}

//console.log(pickBatchColumn);

/* END define columns */

if (typeof quantityColumn !== 'undefined'){

var total = 0

for(var j=0;j<quantityColumn.length;j++){

var quant = parseInt(quantityColumn[j].innerText)

total += quant

if (quantityColumn[j].innerText !== '1'){

quantityColumn[j].classList.add('moreThan1') // flash cell for anything with more than 1 as a


quantity

};

};

quantityTh.innerText += ` (${total})`;

};

if(typeof workPoolColumn !=='undefined'){

for(j=0;j<workPoolColumn.length;j++){

if(workPoolColumn[j].innerText == 'PickingNotYetPickedHardCapped' ||

workPoolColumn[j].innerText == 'PickingNotYetPickedNonPickable'){

workPoolColumn[j].parentNode.classList.add('hardCapped');

};

if(typeof shipOptionColumn !== 'undefined'){

for(j=0;j<shipOptionColumn.length;j++){

if(shipOptionColumn[j].innerText == 'sss-us'||

shipOptionColumn[j].innerText == 'std-us-military'){

shipColumn[j].parentNode.classList.add('coldPrickly')
var coldPricklyImg = document.createElement('img')

coldPricklyImg.src =
"https://drive.corp.amazon.com/view/GRR1%20TamperMonkey/media/cold.png"

coldPricklyImg.title = "Cold Prickly"

coldPricklyImg.classList.add('linkIcon')

shipColumn[j].appendChild(coldPricklyImg)

function addClipboard(emplId, remoteAddr){

if ( typeof shipColumn !== 'undefined') {

for(j=0;j<shipColumn.length;j++){

shipColumn[j].innerHTML+=("<div class='relative'><img
src='https://drive.corp.amazon.com/view/GRR1%20TamperMonkey/media/copy.png' width='20px'
class='CopyBtn'><span class='tooltip tooltip--pos'>Copy Ship ID</span></div>");

//shipColumn[j].innerHTML+=("<span class='CopyBtn'>&#128203;</span>");

};

};

if ( typeof scanColumn !== 'undefined') {

for(j=0;j<scanColumn.length;j++){

if(scanColumn[j].innerText==''){

/*Do nothing to an empty cell*/

}else{

scanColumn[j].innerHTML+=("<div class='relative'><img
src='https://drive.corp.amazon.com/view/GRR1%20TamperMonkey/media/copy.png' width='20px'
class='CopyBtn'><span class='tooltip tooltip--pos'>Copy Scannable ID</span></div>");

//scanColumn[j].innerHTML+=("<span class='CopyBtn'>&#128203;</span>");

}
};

};

if ( typeof asinColumn !== 'undefined') {

for(j=0;j<asinColumn.length;j++){

if(asinColumn[j].innerText==''){

/*Do nothing to an empty cell*/

}else{

asinColumn[j].innerHTML+=("<div class='relative'><img
src='https://drive.corp.amazon.com/view/GRR1%20TamperMonkey/media/copy.png' width='20px'
class='CopyBtn'><span class='tooltip tooltip--pos'>Copy ASIN</span><img src='https://drive-
render.corp.amazon.com/view/shocklp@/media/print.png' width='20px' class='printBtn'></div>");

//asinColumn[j].innerHTML+=("<span class='CopyBtn'>&#128203;</span>");

};

};

// Activate the copy buttons:

$("table").on ("click", ".CopyBtn", zEvent => {

const link = $(zEvent.target).parent().siblings ("a")[0];

//console.log(link)

const range = document.createRange();

range.selectNode(link);

const selection = window.getSelection();

selection.removeAllRanges();

selection.addRange(range);

//navigator.clipboard.write(selection)

const successful = document.execCommand('copy')

selection.removeAllRanges()
//-- Get text of adjacent <div> and strip leading/trailing whitespace:

var targetDiv = $(zEvent.target).parent().siblings ("a");

// var textToCopy = targetDiv.text ().trim ();

// GM_setClipboard (textToCopy, "text/plain");

//-- Feedback to user:

$(".justCopied").removeClass ("justCopied")

targetDiv.parent().parent().addClass("justCopied")

} );

// Activate the print buttons:

$("table").on ("click", ".printBtn", zEvent => {

//-- Get text of adjacent <div> and strip leading/trailing whitespace:

var targetDiv = $(zEvent.target).parent().siblings ("a")

var textToCopy = targetDiv.text ().trim ()

//-- Feedback to user:

$(".justCopied").removeClass ("justCopied")

targetDiv.parent ().parent ().addClass ("justCopied")

printAsin(textToCopy, 1, emplId, remoteAddr)

})

function printAsin(asin, qty, emplId, remoteAddr) {

var params = `asin=${asin}&qty=${qty}&printerdpi=300&badgeid=${emplId}&printerip=$


{remoteAddr}&localprint=true`;

//var url = "https://fc-art.corp.amazon.com/process?";

GM_xmlhttpRequest({

url:"https://fc-art.corp.amazon.com/checkprinter",

method:"POST",
data:`printerip=${remoteAddr}&localprint=true`,

headers:{

Host: "fc-art.corp.amazon.com",

Referer: "https://fc-art.corp.amazon.com/",

"Content-Type": "application/x-www-form-urlencoded",

Origin: "https://fc-art.corp.amazon.com",

Connection: "keep-alive",

"Upgrade-Insecure-Requests": 1,

"Sec-Fetch-Dest": "document",

"Sec-Fetch-Mode": "navigate",

"Sec-Fetch-Site": "same-origin",

"Sec-Fetch-User": "?1",

},

onload:function(){

GM_xmlhttpRequest({

method: "POST",

url: "https://fc-art.corp.amazon.com/process?",

data: params,

headers: {

"Content-Type": "application/x-www-form-urlencoded"

})

})

//console.log(`${url}${params}`);

if(JSON.parse(localStorage.options).PADModifier.on == true){

dateTh.innerText = 'ExSD + PAD time'


var padTime = document.createElement('input');

var waaa = document.getElementById('shipment-list-highlight-delete-exception');

var minsNode = document.createTextNode("minutes");

var ptNode = document.createTextNode("PAD time: ");

waaa.appendChild(ptNode)

waaa.appendChild(padTime);

waaa.appendChild(minsNode);

padTime.classList.add("padtime");

padTime.maxLength=3;

if (!localStorage.padTime){

localStorage.padTime = 0;

}else if ( localStorage.padTime !== '' &&

localStorage.padTime > 0){

padTime.value = localStorage.padTime; //whatever is in storage will load into the text field

};

var ExSD=[]; /*stores the ExSD so that pad time can be manipulated many times

and it will still be calculated based off the actual ExSD and not

what is currently in the cell*/

for(var i=0; i<dateColumn.length; i++){

ExSD[i] = new Date (dateColumn[i].innerText) //get time from column and use to calculate pad
times

padTime.addEventListener('input', function updateValue(e){

localStorage.padTime = e.target.value; //set storage to whatever is in the text field

if(padTime.value==""){

localStorage.padTime = 0; //PAD time is zero if nothing is in the text field


}

newExsd(); //update displayed date after editing padTime

if(JSON.parse(localStorage.options).CPTHighlighter.on == true){

CPTHighlighter()

});

function newExsd(){

var PAD = JSON.parse(localStorage.padTime)

if ( typeof dateColumn !== 'undefined') {

for(var i=0; i<dateColumn.length; i++){

var tempDate = new Date ( ExSD[i] );

tempDate.setMinutes ( ExSD[i].getMinutes() - PAD);

//display the new PAD time in the column

dateColumn[i].innerText = `${tempDate.getFullYear()}-${tempDate.getMonth()+1}-$
{tempDate.getDate()} ${(tempDate.getHours()<10?'0':'')}${tempDate.getHours()}:$
{(tempDate.getMinutes()<10?'0':'')}${tempDate.getMinutes()}`;

newExsd() //run once to apply stored PAD time to page

if(JSON.parse(localStorage.options).CPTHighlighter.on == true){

CPTHighlighter()

if ( typeof conditionColumn !== 'undefined' ) {

for(var k=0;k<conditionColumn.length;k++){
conditionColumn[k].classList.remove('relative'); //remove .relative class from conditions cell so
the numbers stay centered

};

};

function CPTHighlighter(){

var PAD = JSON.parse(localStorage.padTime)

if(PAD == 0){PAD = 1} //set PAD to 1 for multiplying purposes below

//console.log(`padtime: ${PAD}`)

if ( typeof dateColumn !== 'undefined') {

for(var i=0; i<dateColumn.length; i++){

dateColumn[i].classList.remove("redcpt","yellowcpt","greencpt");

var timeLeft = new Date(dateColumn[i].innerText) - new Date();

if(timeLeft <= 0) {

dateColumn[i].classList.add("redcpt");

}else if( timeLeft > 0 && timeLeft <= PAD*60000){

dateColumn[i].classList.add("yellowcpt");

}else if(timeLeft > PAD*60000){

dateColumn[i].classList.add("greencpt");

}else{

};

};

};

};

/* CONDITIONS TOOLTIP */

function addConditions(){

var conditions=[]
conditions[0] ="Cancelled"

conditions[1] ="Pending Payment"

conditions[2] ="Shipment Paid"

conditions[3] ="Shipment Pending Bank"

conditions[4] ="Being Picked"

conditions[5] ="Sideline by FC"

conditions[6] ="Shipped"

conditions[7] ="Scanned"

conditions[8] ="Manifesting"

conditions[9] ="Resolve Pending"

conditions[11] ="Picking Giftwrap"

conditions[12] ="Giftwrapped"

conditions[13] ="Manifest Pending"

conditions[14] ="DC Complete"

conditions[15] ="Problem Solve"

conditions[21] ="Software Error"

conditions[22] ="Refund Pending"

conditions[25] ="Pending Partial Refund"

conditions[26] ="Partial Refund Complete"

conditions[27] ="Scanned Giftwrap"

conditions[29] ="Pending Picking"

conditions[32] ="Manifesting"

conditions[34] ="Cancelling Pending Bank"

conditions[35] ="Waiting for Ship Complete Reply"

conditions[36] ="DC Refund Pending Reply"

conditions[37] ="Pending Ship Confirm Email"

conditions[38] ="Pending FIFO Costs"

conditions[39] ="Waiting for Ship Complete Costed Reply"

conditions[42] ="Email Sent Pending Settlement Results"


conditions[43] ="Pending Confirm Email"

conditions[44] ="Pending Processing"

conditions[45] ="Hold Before Processing"

conditions[46] ="Waiting for Cow Reply"

conditions[50] ="Confirming Inventory"

conditions[51] ="Inventory Confirmed"

conditions[52] ="Requested Shipment Confirmed"

conditions[53] ="Service Number Acquired"

conditions[54] ="Shipment at Drop Shipper"

conditions[55] ="Drop Shipper Shipped"

conditions[56] ="Activating Service"

conditions[57] ="Service Activated"

conditions[58] ="Needs Manual Deposit Refund"

conditions[59] ="Canceled While Confirming Inventory"

conditions[60] ="Shipment Pending"

conditions[62] ="Drop Shipment ID Just Created"

conditions[63] ="Pending Delayed Payment"

conditions[99] =""

conditions[101]="Pending Shipment Creation"

conditions[102]="Pending Payment-Reverse"

conditions[104]="Pending Crossdock"

conditions[108]="AMTRAM Shipment Manifest"

conditions[121]="Generic Shipment Error"

conditions[202]="Virtual Bundle Shipment Paid"

conditions[215]="Virtual Bundle Child Pending Deletion"

conditions[222]="Shipment Pending Planning"

conditions[225]="Virtual Bundle Shipment Partial Refund Pending"

conditions[226]="Virtual Bundle Shipment Partial Refund Complete"

conditions[236]="Virtual Bundle Shipment FC Refund Pending Reply"


conditions[251]=""

conditions[351]="Pending Inventory Delete"

conditions[352]="Pending Inventory Cost"

conditions[603]=""

conditions[666]=""

conditions[704]="Pack in Progress"

conditions[707]="Shipment Packed"

conditions[1320]="Slammed Pending Shipping Label"

conditions[2667]="FCPickingRollbackService"

conditions[3010]=""

conditions[3603]=""

conditions[4665]="Customer Order Item ID Quantity Mismatch"

conditions[4666]="Unknown Shipment"

conditions[4667]="Undership"

conditions[4668]="Overship"

conditions[4669]="Shipment Not Paid"

if ( typeof conditionColumn !== 'undefined' ) {

for(k=0; k<conditionColumn.length; k++){

conditionColumn[k].classList.add('condition'); //add class to condition cell

var currentCond = conditionColumn[k].innerText;

if(currentCond == 11||

currentCond == 12||

currentCond == 27){

conditionColumn[k].innerHTML+=('&#127873;'); // little gift wrap icon

}else if (currentCond == 15){

conditionColumn[k].parentNode.classList.add('inProblemSolve');

}else{null};

conditionColumn[k].innerHTML+=(`<span class='conditiontip tooltip'>$


{conditions[currentCond]}</span>`); //add tooltip to cell
};

};

};

function scanIdChecker(){

/* Scannable ID CHECKER WHITELIST */

if(typeof scanColumn !== 'undefined'){

for(var l=0; l<scanColumn.length; l++){

//scannableColumn[l].parentElement.classList.add('scannable'); //add class to scannable cell

let currentScan = scanColumn[l].innerText;

//let bin = currentScan.match(/[PR]-\d-[A-Z]\d{2,3}[A-Z]\d{2,3}/); //ex: P-1-B173C553 P-7-


E073T979

if (currentScan.match(/tsX0[a-z0-9]{7}\b/) !== null) { //ex: tsX0388hygx

scanColumn[l].parentNode.classList.add('isTote')

}else if (currentScan.match(/tsAFE[0-9]pslv_?\d+/) !== null){ //ex: tsAFE1pslv_01, tsAFE1pslv2

scanColumn[l].parentNode.classList.add('hotpick');

}else if (currentScan.match(/ts(ps)?([A-Za-z]+)?(\d+)?(SLAM|CW)?_?([A-Z])?_?\d+_?(\d+)?/) !
== null){

scanColumn[l].parentNode.classList.add("inProblemSolve")

}else if (currentScan.match(/ch[PR]Afe\d+[A-Z]\d+/) !== null){ //ex: chRAfe082E012


chPAfe2104G047

}else if (currentScan.match(/st\d{7}/) !== null){ //ex: st9507389

}else if (currentScan.match(/tsps(AFE|OB)?CollA\d+/) !== null){ //ex: tspsCollA103 |


tspsOBCollA112

scanColumn[l].parentNode.classList.add("inProblemSolve")

}else if (currentScan.match(/^sp\w{9}/) !== null){ //ex: spGXxfrbvhz

scanColumn[l].parentNode.classList.add('isSp00')

}else if (currentScan.match(/[PR]-\d-[A-Z]\d{2,3}[A-Z]\d{2,3}/) !== null){ //ex: P-1-B173C553


P-7-E073T979

let bin = currentScan.slice(0,12)


if(JSON.parse(localStorage.options).podInfo.on == true){

let binCell = scanColumn[l]

var url = "https://roboscout.amazon.com/ipa/kpps/get_neighboring_bins/?building=" +


FC + "&bin_id=" + bin

GM_xmlhttpRequest({

method: "GET",

url: url,

onload: function(response) {

var json = JSON.parse(response.responseText)

var floor = json[bin].floor

var podID = json[bin].pod_id

//console.log(`${bin} : ${podID} : ${floor}`)

var newDiv = document.createElement('div')

var podLink = document.createElement('a')

podLink.innerText = podID

// pod console deprecation

podLink.href = "https://vantage.amazon.com/app/pod-portal/pod-details?
region=us-east-1&customer=AMZN&podId=" + podID

podLink.target = "_blank"

var arrmImg = document.createElement('img')

var arrmLink = document.createElement('a')

arrmImg.src =
'https://drive.corp.amazon.com/view/GRR1%20TamperMonkey/media/arm.png'

arrmLink.append(arrmImg)

arrmImg.classList.add('linkIcon')

arrmLink.href = `https://arrm-portal-${region3}-${region}.$
{region}.proxy.amazon.com/storage/snapshot?customer=AMZN&warehouse=${FC}&zone=$
{floor}&searchSelector=pod&searchInput=${podID}`
arrmLink.target = '_blank'

var message = document.createElement('span')

message.classList.add('podInfo')

message.innerText = `${floor} : `

message.append(podLink)

message.append(arrmLink)

newDiv.append(message)

binCell.parentNode.append(newDiv)

})

if(JSON.parse(localStorage.options).podConsole.on == true){ // adds a link to pod console


for pods only

var podLink = document.createElement('a'), // create the link and img elements

podImg = document.createElement('img')

podImg.src =
'https://drive.corp.amazon.com/view/GRR1%20TamperMonkey/media/pod_console_icon.png'

podLink.append(podImg)

podImg.classList.add('linkIcon')

podLink.href = `https://pod-console.corp.amazon.com/pods/AMZN/${FC}/none/none/$
{bin}` //slice so that we get just the pod location and not the extra stuff in the cell like 'copy scannable
ID'

podLink.target = '_blank'

scanColumn[l].append(podLink)

podLink.addEventListener("click",function(){

this.parentNode.parentNode.classList.add('visitedPod')
})

}else if (currentScan.match(/chPS(MAIN|AFE|SNG)[\d]?W\d+[A-Z]\d+/) !== null){ //ex:


chPSMAINW03E22 or chPSMAIN1W03E22 chPSAFE1W1B6

}else if (currentScan.match(/tsAfe\w{4,}/) !== null){ //ex: tsAfeRsG8

}else if (currentScan.match(/rb[A-Z]{2,3}\w*/) !== null){ //ex: rbMM2574A05

}else if (currentScan.match(/chPSGWW\d{2}[A-Z]\d+/) !== null){ //ex: chPSGWW01A2

}else if (currentScan.match(/rbbfall\d{3}[A-Z]\d{2}/) !== null){ //ex: rbbfall059B03

}else if (currentScan.match(/ch[PR]OOPS\w\d{3}/) !== null){ //ex: chPOOPSA014

}else if (currentScan.match(/tsEXCPRebin[0-9]{2}/) !== null){ //ex:tsEXCPRebin01

}else if (currentScan.match(/ch(MAIN|AFE|SNG|SLAM)\d?(SLAM)?OVG\d+/) !== null){ //ex:


chMAINOVG2 or chSNG1SLAMOVG1 chAFE1OVG4

}else if (currentScan.match(/tsps[Ll](ine)?\d+[-_]\d*/) !== null){ //ex: tspsL05-114 or


tspsline1_17

}else if (currentScan.match(/ch[A-Z]{3}[0-9][A-Z][0-9][A-Z][0-9]{2}[A-Z][0-9]{1,2}/) !== null)


{ //ex: chPSP2R4W01C4

}else if (currentScan.match(/csXP[a-zA-Z0-9]{7}/) !== null){ //ex: csXP25cXxz5

}else if (currentScan.match(/ts(cart|cage)\d+/) !== null){ // ex: tscart420

}else if (currentScan.match(/rb(lrg|small)\d*\w\d*/) !== null){ // ex: rbsmall231A13 or


rblrg205A03

}else if (currentScan.match(/\b[A-Z]\w{8}\b/) !== null){ // ex: DqVQgr8Bz, XsHYpLp1Z

//scanColumn[l].innerHTML+=("<span class='conditiontip tooltip'>Unfinished


Shipment</span>")

scanColumn[l].parentElement.classList.add('badScan')

scanColumn[l].classList.add('condition')

}else if (currentScan == ''){

}else{

scanColumn[l].innerHTML+=("<span class='conditiontip tooltip'>Bad Tote Scan</span>")

scanColumn[l].parentElement.classList.add('badScan')

scanColumn[l].classList.add('condition')

//scannableColumn[l].firstElementChild.classList.add('badScan');
}

addClipboard()

addConditions()

scanIdChecker()

/*Screen Barcode*/

// making DOM elements

var bar_cover=document.createElement("div")

bar_cover.classList.add("barcodes_cover")

let bar_panel = document.createElement("div")

bar_panel.classList.add("barcodes_panel")

var bar_label = document.createElement('p')

var bar_img = document.createElement('img')

bar_panel.appendChild(bar_label)

bar_panel.appendChild(bar_img)

bar_cover.appendChild(bar_panel)

bar_cover.onclick = function (event) { bar_cover.style.display="none" }

// some logic when to trigger

function altClickShowBar(event) {

if ( ! event.altKey ) return

if (event.target.innerText.length > 80 || event.target.innerText === "" ) return

let barcodeText = event.target.innerText.split('\n')[0].trim()

let barType="128"
if (barcodeText.length > 16) {

barType="qr"

showBarcodePage(barType,barcodeText);

// This is what make it all possible

// thanks to barcodeapi.org

function showBarcodePage(barcodeType,barcodeString) {

bar_label.innerText=barcodeString

bar_img.src = `https://barcodeapi.org/api/${barcodeType}/${barcodeString}?text=none`

bar_cover.style.display="grid"

// these last lines actually do something

//document.head.appendChild(barcodeShowStyle);

document.body.append(bar_cover)

document.body.addEventListener("click", altClickShowBar, false);

GM_addStyle ( `

.fcpn-sprite{

background-image: url("https://drive.corp.amazon.com/view/GRR1%20TamperMonkey/media/
rodeoPlus.png") !important;

#fcpn-header {

position:sticky;

top: 0;

z-index: 1000;
}

#fcpn-site-input{

color:#e47911 !important;

text-shadow:-1px 1px 0px #000 !important;

.result-table thead {

position: sticky;

top: 35px;

z-index: 60;

.highlight-header.tablesorter-header{

background-color:#fff !important;

#disabledScript {

left: 350px;

position: absolute;

padding: 0 10px;

border-radius: 10px;

z-index:1001;

animation: notify 3s ease-in-out infinite;

@keyframes notify {

0% {background-color: yellow;}

50% {background-color: gold;}

100%{background-color: yellow;}

#enabledScript{

left:350px;

position: absolute;
padding: 0 10px;

border-radius: 10px;

animation: notify2 3s ease-in-out infinite;

@keyframes notify2 {

0% {background-color: lightgreen;}

50% {background-color: limegreen;}

100%{background-color: lightgreen;}

.tooltip{

z-index:1001;

visibility: hidden;

opacity:0;

position:absolute;

background-color: #555;

color: #fff;

text-align: center;

border-radius: 6px;

padding: 5px;

text-indent: initial;

transition: opacity 0.3s;

border-color: #fff;

user-select:none;

.tooltip--pos{

bottom: 130%;

left:50%;

transform:translate(-50%,0);

}
.conditiontip {

bottom: 90%;

right: 50%;

margin-right: 12px;

.CopyBtn:hover + .tooltip,

.quickLink:hover + .tooltip,

.condition:hover > .tooltip{

opacity:1;

visibility: visible;

user-select:none;

.CopyBtn,

.printBtn{

opacity:0;

cursor: pointer;

text-indent:0;

user-select:none;

.CopyBtn:hover,

.printBtn:hover{

opacity:1;

cursor:pointer;

.tooltip--pos::after {

content: "";

position: absolute;

top: 100%;
left: 50%;

margin-left: -5px;

border-width: 5px;

border-style: solid;

border-color: #555 transparent transparent transparent;

.linkIcon {

height: 1rem;

user-select: none;

.podInfo {

color: #ff5733;

.quickLink {

opacity:0;

cursor: pointer;

text-indent:0;

.quickLink:hover {

opacity:1;

cursor:pointer;

.visitedPod {

background-color:#30D5C8;

.justCopied {

background-color:#FEDA15;

animation: copy 1s ease-in-out 1;

}
@keyframes copy {

50% { background-color: #0113DA;}

.justCopied a {

color:#0113DA;

animation: changeBlack 1s ease-in-out 1;

@keyframes changeBlack {

50% {color: #FEDA15;}

.badScan {

animation: blink 2s ease-in infinite;

@keyframes blink {

50% { background-color: #f00;}

.badScan a {

animation: whiteText 2s .5s ease-in infinite;

@keyframes whiteText {

50% { color: #fff;}

.fl-right {

float:right;

.moreThan1 {
animation: blink1 800ms ease-in infinite;

@keyframes blink1 {

50% {background-color: #10b7ff;

color:#fff;

.hardCapped {

background-color:#ff443366;

.coldPrickly {

background-color:#dcf3ff;

/*Pushes quicklinks right to make room for clipboard*/

.filterable.check .filter-link,

.non-filterable.check .filter-link {

right: -46px !important;

.filterable .euler-link,

.non-filterable .euler-link {

right: -13px !important;

.filterable .aps-link,

.non-filterable .aps-link {

right: -31px !important;

.filterable .hero-link,

.non-filterable .hero-link {

right: -19px !important;


}

.filterable.check,

.non-filterable.check {

padding-right: 48px !important;

.relative .filter-link {

right: -12px !important;

#disabledScript {

cursor:pointer;

.relative {

display: flex;

justify-content: space-between;

.condition {

position:relative;

#fcpn-update {

width: 24px;

height: 24px;

margin: 3.5px 4px;

display: block;

white-space: normal;

background-image:
url('https://drive-render.corp.amazon.com/view/shocklp@/media/update.png');

background-size: contain;

cursor:pointer;

}
#fcpn-update:hover > .fcpn-tooltip{

display:block;

.redcpt{

background-color:#ff1a00;

.yellowcpt{

background-color: #ff3;

.greencpt{

background-color: #26cc00;

.padtime{

text-align: center;

width: 36px;

border-radius: 20%;

.inProblemSolve{

box-shadow: -5px 0px 0px rgb(191, 128, 255) inset,-5px 2px 0px rgb(191, 128, 255) inset,-5px -2px
0px rgb(191, 128, 255) inset;

/*background-color: rgba(191, 128, 255, 0.1)*/

.isTote{

box-shadow: -5px 0px 0px rgb(255, 233, 0) inset,-5px 2px 0px rgb(255, 233, 0) inset,-5px -2px 0px
rgb(255, 233, 0) inset;

/*background-color: rgba(255, 233, 0, 0.1)*/

.isSp00{

box-shadow: -5px 0px 0px rgb(0, 200, 255) inset,-5px 2px 0px rgb(0, 200, 255) inset,-5px -2px 0px
rgb(0, 200, 255) inset;
/*background-color: rgba(255, 255, 255, 0.1)*/

color: #fff;

.hotpick{

background-color:#93ff93;

::selection {

color: #f90;

background: #146eb4;

.checkBox{

padding: 0 10px 0 10px;

.run {

background-color: #f90;

.run:hover{

background-color:#f00;

.run:after{

content: "";

display: block;

width: 2px;

height: 7px;

border: solid white;

border-width: 0 3px 3px 0;

-webkit-transform: rotate(45deg);

-ms-transform: rotate(45deg);

transform: rotate(45deg);
}

.run:hover:after{

content: "";

display: block;

color:white;

border:transparent;

transform: rotate(0deg);

.noRun{

background-color:#fff;

.noRun:hover{

background-color: #0f0;

.noRun:after{

content: "";

display: block;

width: 2px;

height: 7px;

border: solid transparent;

border-width: 0 3px 3px 0;

-webkit-transform: rotate(45deg);

-ms-transform: rotate(45deg);

transform: rotate(45deg);

.noRun:hover:after{

content: "";

display: block;

color:white;
border:transparent;

transform: rotate(0deg);

.checkBox:hover{

/*background-color: gray;*/

cursor:pointer;

.checkBox:active{

background-color: white;

.deleteCache{

color: #f00;

cursor: pointer;

.eagleLink{

text-indent:0;

user-select: none;

.barcodes_cover {

display: none;

position: fixed;

top: 0;

bottom: 0;

left: 0;

right: 0;

background-color: #f3f3f3cc;

z-index: 160;

align-items: center;

justify-items: center;
}

.barcodes_cover>.barcodes_panel {

display: grid;

width: 35%;

height: 42%;

background-color: #fff;

border: 1px solid #aaa;

border-radius: 5px;

min-width: 35rem;

min-height: 17rem;

grid-template-rows: 10% auto;

align-items: center;

justify-items: center;

box-shadow: 1px 1px 4px #999;

.barcodes_cover>.barcodes_panel>img {

display: block;

.barcodes_cover>.barcodes_panel>p {

display: block;

margin-top:1rem;

color:#444;

.accolade-container {

background-color: transparent;

transition: 0.5s ease;

width: 32px;

height: 32px;
cursor: pointer;

.accolade-container:hover{

width: 50%;

background-color: transparent;

right: 232px;

.accolade-overlay{

position: absolute;

bottom: 0;

right: 0;

left: 32px;

background-color: #007486;

overflow: hidden;

width: 0;

height: 100%;

transition: 0.5s ease;

.accolade-container:hover .accolade-overlay{

min-width:220%;

.accolade-text{

color: white;

font-size: auto;

position: absolute;
top: 50%;

left: 50%;

-webkit-transform: translate(-50%, -50%);

-ms-transform: translate(-50%, -50%);

transform: translate(-50%, -50%);

white-space: nowrap;

` );

// })

You might also like