Skip to content
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
523c0d2
asd
May 4, 2021
ca08362
Merge pull request #1 from hollo6/hollo-tinkering
May 4, 2021
9873b26
src only
May 4, 2021
8314fef
Merge pull request #2 from hollo6/hollo-tinkering
May 4, 2021
c4fc49a
formatting
May 4, 2021
a41423c
Merge pull request #3 from hollo6/hollo-tinkering
May 5, 2021
90357bc
.
May 6, 2021
bdd6d6b
Merge branch 'master' into hollo
May 6, 2021
61f9f1c
Merge pull request #4 from hollo6/hollo
May 6, 2021
149877f
Delete launch.json
May 6, 2021
b572724
Delete .suo
May 6, 2021
3e1ae72
Delete ProjectSettings.json
May 6, 2021
f8cd860
Delete VSWorkspaceState.json
May 6, 2021
c211cf7
Delete slnx.sqlite
May 6, 2021
c0bf1d9
Delete package-lock.json
May 6, 2021
a137c96
Delete .web-extension-id
May 6, 2021
f33a529
Delete manifest.json
May 6, 2021
4bb7243
Delete updates.json
May 6, 2021
728d18b
Delete pmmg_beautifier-0.4.1-an+fx.xpi
May 6, 2021
ab4cf65
Delete pmmg_beautifier-0.4.1.xpi
May 6, 2021
4c4742d
Delete pmmg_beautifier-0.4.2-an+fx.xpi
May 6, 2021
7535b0d
Delete pmmg_beautifier-0.4.2.xpi
May 6, 2021
5b3b71a
Delete pmmg_beautifier-0.4.2.zip
May 6, 2021
8d94265
Delete pmmg_beautifier-0.4.3.1-an+fx.xpi
May 6, 2021
9ce6b22
undo delete
May 6, 2021
76b0070
revert manifest
May 6, 2021
fc7e945
shorten DB
May 7, 2021
17a540b
CX orders table stuff WIP
May 8, 2021
10ac685
shipping ads shorter
May 8, 2021
326df0e
shipping ad even shorter, nicer
May 8, 2021
1246da7
fix missing space
May 8, 2021
3c8572e
CXOB:
May 9, 2021
68b1082
refactored material name shortener
May 10, 2021
127cda3
added FIN shortening
May 13, 2021
6d8ae6a
fix PROD screen bug when no capacity
May 16, 2021
5b7c51d
Delete manifest.json
May 18, 2021
ba5e3ac
add FXOB to company name shortening
May 19, 2021
a12de43
Merge branch 'master' of https://github.com/hollo6/PMMGBeautifier
May 19, 2021
ec2b3a2
Revert "Delete manifest.json"
May 19, 2021
557f491
trying to fix clash between shipping and buying ads
May 19, 2021
3386e09
trying to fix shipping/other ads clash round 2
May 21, 2021
2d60efb
gitignore fix
May 21, 2021
5ac9747
fix class selector
May 21, 2021
0bffb75
Delete manifest.json
May 21, 2021
992668b
trying to fix indent
May 21, 2021
757d779
Merge branch 'master' of https://github.com/hollo6/PMMGBeautifier
May 21, 2021
fa2599d
Delete .gitignore
May 21, 2021
e8d96fc
added all MMs
May 23, 2021
84602cc
Merge branch 'master' of https://github.com/hollo6/PMMGBeautifier
May 23, 2021
8abdbf6
fix MM names
May 24, 2021
0a2f82b
fix spacing
May 24, 2021
a53cb3d
fix order ETA if input is missing
May 27, 2021
cc05e8c
fix order ETA, should work with both no capacity and input missing
May 27, 2021
6e6d292
Add files via upload
Jun 11, 2021
53c404a
added main.js
Jun 11, 2021
5e8ca87
Delete main.js
Jun 11, 2021
73ca3c5
merge feature:
Jun 11, 2021
8fb1103
merged CXOS ticker link change into general CXOS worker
Jun 11, 2021
f1f7567
ticker link debugged
Jun 11, 2021
290505c
fixed no capacity + input missing again
Jun 13, 2021
2f47f87
removed order eta printout spam
Jun 14, 2021
7f412e3
added manifest.json and .gitignore back
Jun 14, 2021
c29e25f
trying to fix order ETA update clash
Jun 15, 2021
7651ab2
revert CXOB link (not needed anymore)
Jun 24, 2021
3ad5d3c
removed unnecessary imported function
Jun 24, 2021
690c7a9
prod ETA bug fix try #336
Jun 26, 2021
add08e7
fixed recurring order ETA
Jun 26, 2021
0604049
ETA debug
Jun 26, 2021
dbdc85a
order ETA fix
Jun 27, 2021
fd343e7
removed leftover code
Jun 27, 2021
31d0a08
fix flight plan ETA bug
Jun 28, 2021
17fba00
order ETA fix
Jun 29, 2021
f692b45
order ETA - input missing is now accounted for as if it was possible …
Jul 15, 2021
4d68542
fix 0 LM fee
Jul 15, 2021
4fbc5de
added NAB
Jul 15, 2021
5d961d4
fix NCS
Jul 15, 2021
bd5472c
narrow prodline
Sep 9, 2021
eeb672c
finally found out how to show prod in progress eta at the right place
Sep 19, 2021
76b427c
disabling narrow prodline
Sep 22, 2021
fcbd6a5
fix for new version CXOS + FLT ETA
Nov 2, 2021
196b4e9
new version fix #2
Nov 2, 2021
7a62f05
patch fix 3
Nov 3, 2021
d7b6bfd
patch fix
Nov 3, 2021
6b5e3bc
fix CXOS weirdness with changed/unchanged class names
Nov 4, 2021
7b8b3da
fix CXOS vs. FLT clash
Nov 4, 2021
59fcab7
fix CXOS for when it's in a buffer
Nov 4, 2021
7682e30
fix CXOS header if multiple instances are open
Nov 4, 2021
4c0659a
fix CXOS header if multiple instances are open
Nov 4, 2021
f271709
.
Nov 4, 2021
e54243b
revert accidental push
Nov 4, 2021
e0b45f6
fix post ad
Nov 4, 2021
c70cb06
refactor buffer selection + fix FIN
Nov 5, 2021
ad074aa
handle lowercase cmd buffers
Nov 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/main.js
node_modules

/.vs
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This belongs in your global gitignore file

10 changes: 8 additions & 2 deletions dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "PMMG Beautifier",
"description": "Improve and tweak the interface elements of PrUn website",
"version": "0.4.1",
"version": "0.4.1.1",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.5.0 please

Copy link
Author

@hollo6 hollo6 May 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already deleted this file, didn't want any mismatch... no idea how it creeped back in here

"icons": {
"128": "icon128.png"
},
Expand All @@ -18,5 +18,11 @@
"main.js"
]
}
]
],
"applications": {
"gecko": {
"id": "[email protected]",
"update_url": "https://your_server_location_where_you_host_zips/updates.json"
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this section

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already removed

}
113 changes: 113 additions & 0 deletions src/CX.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import { Selector } from "./Selector";
import { genericCleanup, shorten, toFixed } from "./util";

export class CX {
private tag = "pb-cx";
cleanup() {
genericCleanup(this.tag);
}
run() {
// CXOB
const elements = document.querySelectorAll(Selector.CXOBTable + " > tbody > tr > td");
for (let i = 0; i < elements.length; i++) {
const element = elements[i];
const text = element.textContent;
const matches = text && text.match(/^NEO Charter Exploration Market Maker$/);
if (matches) {
element.textContent = shorten(text);
}
}

const companies = document.querySelectorAll(Selector.CXOBTable + " > tbody > tr > td > span");
for (let i = 0; i < companies.length; i++) {
const element = companies[i];
const text = element.textContent;
if (text!.length > 25) {
element.textContent = text!.substring(0, 23) + "\*";
}
}

// CXOS
const orderCX = document.querySelectorAll(Selector.CXOrdersExchangeName);
for (let i = 0; i < orderCX.length; i++) {
const element = orderCX[i];
const text = element.textContent;
const matches = text && text.match(/Station Commodity Exchange$/);
if (matches) {
element.textContent = shorten(text);
}
}

const orderAmountColumn = document.querySelectorAll(Selector.CXOrdersTable + " > thead > tr > th");
for (let i = 0; i < orderAmountColumn.length; i++) {
const element = orderAmountColumn[i];
const text = element.textContent;
const matches = text && text.match(/^Amount \(initial\)$/);
if (matches) {
element.textContent = "Amount \(i\)";
}
}

const orderStatus = document.querySelectorAll(Selector.CXOrdersTable + " > tbody > tr > td:nth-of-type(7) > span");
for (let i = 0; i < orderStatus.length; i++) {
orderStatus[i].childNodes[0].parentElement!.removeAttribute("style");
if (orderStatus[i].textContent == "partially filled" || orderStatus[i].textContent == "part fill") {
orderStatus[i].textContent = "part fill";
orderStatus[i].childNodes[0].parentElement!.style.color = "#d77342";
}
}

workCXOSHeader(this.tag);
workCXOSRows(this.tag);
}
}

const hideMatNameColumn: boolean = true;
const addOrderValueColumn: boolean = true;

function workCXOSHeader(tag) {
const CXOSHeader = document.querySelector(Selector.CXOrdersTable + " > thead > tr")!;
if (CXOSHeader) {
if (hideMatNameColumn) {
const orderMatNameHeader = CXOSHeader.querySelector("th:nth-of-type(4)") as HTMLElement;
orderMatNameHeader.style.display = "None";
}
if (addOrderValueColumn) {
const orderStatusHeader = CXOSHeader.querySelector("th:nth-of-type(7)");
const newHeader = document.createElement("th");
newHeader.classList.add(tag);
newHeader.textContent = "Value";
CXOSHeader.insertBefore(newHeader, orderStatusHeader);
}
}
}

function workCXOSRows(tag) {
const orderRows = document.querySelectorAll(Selector.CXOrdersTable + " > tbody > tr");
Array.from(orderRows).forEach((row) => {
//console.warn(row);
if (hideMatNameColumn) {
const matNameCell = row.querySelector("td:nth-of-type(4)") as HTMLElement;
matNameCell.style.display = "None";
}
if (addOrderValueColumn) {
const orderStatusCell = row.querySelector("td:nth-of-type(7)");
if (orderStatusCell!.childElementCount) {
const amount = parseInt(row.querySelector("td:nth-of-type(5)")!.childNodes[0].textContent!.replace(/[,.]/g, ''));
const unitPrice = parseInt(row.querySelector("td:nth-of-type(6)")!.childNodes[0].textContent!.replace(/[,.]/g, '')) / 100;
const type = row.querySelector("td:nth-of-type(2)")!.textContent;
const newCell = document.createElement("td");
newCell.classList.add(tag);
newCell.textContent = toFixed(amount * unitPrice, 2);
newCell.style.textAlign = "right";
if (type == "BUY") {
newCell.style.color = "#50c878";
}
if (type == "SELL") {
newCell.style.color = "#d0312d";
}
row.insertBefore(newCell, orderStatusCell);
}
}
});
}
Loading