-
Notifications
You must be signed in to change notification settings - Fork 17
LM, CX, ETA - shortening, coloring, fixing, nicening #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hollo6
wants to merge
93
commits into
YarekTyshchenko:master
Choose a base branch
from
hollo6:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
93 commits
Select commit
Hold shift + click to select a range
523c0d2
asd
ca08362
Merge pull request #1 from hollo6/hollo-tinkering
9873b26
src only
8314fef
Merge pull request #2 from hollo6/hollo-tinkering
c4fc49a
formatting
a41423c
Merge pull request #3 from hollo6/hollo-tinkering
90357bc
.
bdd6d6b
Merge branch 'master' into hollo
61f9f1c
Merge pull request #4 from hollo6/hollo
149877f
Delete launch.json
b572724
Delete .suo
3e1ae72
Delete ProjectSettings.json
f8cd860
Delete VSWorkspaceState.json
c211cf7
Delete slnx.sqlite
c0bf1d9
Delete package-lock.json
a137c96
Delete .web-extension-id
f33a529
Delete manifest.json
4bb7243
Delete updates.json
728d18b
Delete pmmg_beautifier-0.4.1-an+fx.xpi
ab4cf65
Delete pmmg_beautifier-0.4.1.xpi
4c4742d
Delete pmmg_beautifier-0.4.2-an+fx.xpi
7535b0d
Delete pmmg_beautifier-0.4.2.xpi
5b3b71a
Delete pmmg_beautifier-0.4.2.zip
8d94265
Delete pmmg_beautifier-0.4.3.1-an+fx.xpi
9ce6b22
undo delete
76b0070
revert manifest
fc7e945
shorten DB
17a540b
CX orders table stuff WIP
10ac685
shipping ads shorter
326df0e
shipping ad even shorter, nicer
1246da7
fix missing space
3c8572e
CXOB:
68b1082
refactored material name shortener
127cda3
added FIN shortening
6d8ae6a
fix PROD screen bug when no capacity
5b7c51d
Delete manifest.json
ba5e3ac
add FXOB to company name shortening
a12de43
Merge branch 'master' of https://github.com/hollo6/PMMGBeautifier
ec2b3a2
Revert "Delete manifest.json"
557f491
trying to fix clash between shipping and buying ads
3386e09
trying to fix shipping/other ads clash round 2
2d60efb
gitignore fix
5ac9747
fix class selector
0bffb75
Delete manifest.json
992668b
trying to fix indent
757d779
Merge branch 'master' of https://github.com/hollo6/PMMGBeautifier
fa2599d
Delete .gitignore
e8d96fc
added all MMs
84602cc
Merge branch 'master' of https://github.com/hollo6/PMMGBeautifier
8abdbf6
fix MM names
0a2f82b
fix spacing
a53cb3d
fix order ETA if input is missing
cc05e8c
fix order ETA, should work with both no capacity and input missing
6e6d292
Add files via upload
53c404a
added main.js
5e8ca87
Delete main.js
73ca3c5
merge feature:
8fb1103
merged CXOS ticker link change into general CXOS worker
f1f7567
ticker link debugged
290505c
fixed no capacity + input missing again
2f47f87
removed order eta printout spam
7f412e3
added manifest.json and .gitignore back
c29e25f
trying to fix order ETA update clash
7651ab2
revert CXOB link (not needed anymore)
3ad5d3c
removed unnecessary imported function
690c7a9
prod ETA bug fix try #336
add08e7
fixed recurring order ETA
0604049
ETA debug
dbdc85a
order ETA fix
fd343e7
removed leftover code
31d0a08
fix flight plan ETA bug
17fba00
order ETA fix
f692b45
order ETA - input missing is now accounted for as if it was possible …
4d68542
fix 0 LM fee
4fbc5de
added NAB
5d961d4
fix NCS
bd5472c
narrow prodline
eeb672c
finally found out how to show prod in progress eta at the right place
76b427c
disabling narrow prodline
fcbd6a5
fix for new version CXOS + FLT ETA
196b4e9
new version fix #2
7a62f05
patch fix 3
d7b6bfd
patch fix
6b5e3bc
fix CXOS weirdness with changed/unchanged class names
7b8b3da
fix CXOS vs. FLT clash
59fcab7
fix CXOS for when it's in a buffer
7682e30
fix CXOS header if multiple instances are open
4c0659a
fix CXOS header if multiple instances are open
f271709
.
e54243b
revert accidental push
e0b45f6
fix post ad
c70cb06
refactor buffer selection + fix FIN
ad074aa
handle lowercase cmd buffers
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| dist/main.js | ||
| node_modules | ||
| ################################################################################ | ||
| # This .gitignore file was automatically created by Microsoft(R) Visual Studio. | ||
| ################################################################################ | ||
|
|
||
| /.vs | ||
| /node_modules | ||
| *.js | ||
| /dist/main.js | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.5.0", | ||
| "icons": { | ||
| "128": "icon128.png" | ||
| }, | ||
|
|
@@ -18,5 +18,11 @@ | |
| "main.js" | ||
| ] | ||
| } | ||
| ] | ||
| ], | ||
| "applications": { | ||
| "gecko": { | ||
| "id": "[email protected]", | ||
| "update_url": "https://dummy.json" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| import { Selector } from "./Selector"; | ||
| import { genericCleanup, shorten, toFixed, getBuffers } from "./util"; | ||
|
|
||
| export class CXFX { | ||
| private tag = "pb-cx"; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All files should be indented with 2 spaces, not 4.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be fixed |
||
| cleanup() { | ||
| genericCleanup(this.tag); | ||
| } | ||
| run() { | ||
| var CXOBBuffers = getBuffers("CXOB"); | ||
| var FXOBBuffers = getBuffers("FXOB"); | ||
| var CXOSBuffers = getBuffers("CXOS"); | ||
|
|
||
| CXOBBuffers.forEach(buffer => { | ||
| const traderNames = buffer.querySelectorAll(Selector.CXOBTable + " > tbody > tr > td > span"); | ||
| traderNames.forEach(name => { | ||
| if (name.classList.contains('_3ifriA33o8WAhdFSaIgqWi')) { | ||
| shortenCompanyName(name); | ||
| } | ||
| else { | ||
| shortenMMName(name); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| FXOBBuffers.forEach(buffer => { | ||
| const traderNames = buffer.querySelectorAll(Selector.CXOBTable + " > tbody > tr > td > span[class='_3ifriA33o8WAhdFSaIgqWi']"); | ||
| traderNames.forEach(name => { | ||
| shortenCompanyName(name); | ||
| }) | ||
| }); | ||
|
|
||
| CXOSBuffers.forEach(buffer => { | ||
| workCXOSHeader(buffer, this.tag); | ||
| workCXOSRows(buffer, this.tag); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| function shortenMMName(name) { | ||
| const text = name.textContent; | ||
| const matches = text && text.match(/^(NEO Charter Exploration|Antares Initiative|Insitor Cooperative|Castillo-Ito Mercantile) Market Maker$/); | ||
| if (matches) { | ||
| name.textContent = shorten(text); | ||
| } | ||
| } | ||
|
|
||
| function shortenCompanyName(name) { | ||
| const text = name.textContent; | ||
| if (text!.length > 23) { | ||
| name.textContent = text!.substring(0, 23) + "\*"; | ||
| } | ||
| } | ||
|
|
||
| const hideMatNameColumn: boolean = true; | ||
| const addOrderValueColumn: boolean = true; | ||
|
|
||
| function workCXOSHeader(buffer, tag) { | ||
| const CXOSHeader = buffer.querySelector("thead > tr")!; | ||
| if (CXOSHeader) { | ||
| const orderAmountHeader = CXOSHeader.querySelector("th:nth-of-type(5)"); | ||
| if (orderAmountHeader.textContent) { | ||
| orderAmountHeader.textContent = "Amount \(i\)"; | ||
| } | ||
| if (hideMatNameColumn) { | ||
| const orderMatNameHeader = CXOSHeader.querySelector("th:nth-of-type(4)"); | ||
| 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(buffer, tag) { | ||
| const orderRows = buffer.querySelectorAll("tbody > tr") as HTMLElement[]; | ||
| Array.from(orderRows).forEach((row) => { | ||
| const exchangeNameCell = row.querySelector("td:nth-of-type(1) > span"); | ||
| if (exchangeNameCell) { | ||
| const text = exchangeNameCell.textContent; | ||
| if (text && text.match(/Station Commodity Exchange$/)) { | ||
| exchangeNameCell.textContent = shorten(text); | ||
| } | ||
| } | ||
| if (hideMatNameColumn) { | ||
| const matNameCell = row.querySelector("td:nth-of-type(4)") as HTMLElement; | ||
| if (matNameCell) { | ||
| matNameCell.style.display = "None"; | ||
| } | ||
| } | ||
| const orderStatusCell = row.querySelector("td:nth-of-type(7)"); | ||
| if (orderStatusCell) { | ||
| const orderStatusText = orderStatusCell.querySelector("span"); | ||
| if (orderStatusText) { | ||
| orderStatusText.childNodes[0].parentElement!.removeAttribute("style"); | ||
| if (orderStatusText.textContent == "partially filled" || orderStatusText.textContent == "part fill") { | ||
| orderStatusText.textContent = "part fill"; | ||
| orderStatusText.childNodes[0].parentElement!.style.color = "#d77342"; | ||
| } | ||
| } | ||
| } | ||
| if (addOrderValueColumn) { | ||
| 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); | ||
| } | ||
| } | ||
| }); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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