Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobe De Peuter committed Jul 29, 2020
2 parents 3405a11 + ee43e65 commit 6c00e71
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TornTools (v4.6)
# TornTools (v4.9)
##### A browser extension for Torn.com
 
**Links**
Expand Down Expand Up @@ -27,6 +27,7 @@
- Info popup
- Player stats
- Gym Stats graph
- Quick Bust & Bail

**Smaller Features**:
- Friendly Fire
Expand Down Expand Up @@ -66,6 +67,7 @@
**Info popup**: Popup to show basic information like location, status, bars etc.
**Player stats**: Show stats like networth, xan used, etc. on their Profile page
**Gym Stats graph**: Keep track of your overall Gym Stats using TornStats
**Quick Bust & Bail**: One-click bust or bail someone out of jail

**Friendly Fire**: get a warning when you are on an ally faction player's profile (you have to add allies manually in settings)
**Shop profits**: Show item profits in shops (profit compared to market value)
Expand All @@ -90,6 +92,7 @@
**API requests**:
- 4 main requests once per minute. 1 request for user's data every 15 seconds
- 1 request per search in Market tab
- 1 request per person in Stakeouts
- 1 request to TornStats when fetching Player Stats (max 25/minute)
- 1 request to TornStats when fetching Gym Stats (max 25/minute)

Expand Down
6 changes: 4 additions & 2 deletions torntools/changelog.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
"v4.9 - xx.07.2020": {
"v4.9 - July, 29th. 2020": {
"Features": [
"Highlight good and bad blood bags on the item page and faction armory - DKK",
"Add a way to hide all chats - DKK",
Expand Down Expand Up @@ -27,7 +27,9 @@ export default {
"Fix Quick Items item dragging - DKK",
"Adjust Profile script to Torn's layout changes - DKK",
"Fix Badge issues - DKK",
"Fix Faction armory news - DKK"
"Fix Faction armory news - DKK",
"Fix Gym stats updating not showing all improved stats - Mephiles",
"Fix Travel Agency page artifacts on Mobile - Mephiles"
],
"Changes": [
"Add a loading icon for networth on the Home page - Mephiles",
Expand Down
4 changes: 4 additions & 0 deletions torntools/scripts/content/travel/ttTravel.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ input[type=number]::-webkit-outer-spin-button {
opacity: 1;
}

.travel-agency.tt-mobile .path {
display: none !important;
}

#ttTravelTable .top-row {
margin-top: 10px;
margin-bottom: 20px;
Expand Down
29 changes: 23 additions & 6 deletions torntools/scripts/content/travel/ttTravelHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,32 @@ requireDatabase().then(function(){
}

// Destination listeners
for(let destination of doc.findAll(`div[role='tabpanel'][aria-expanded='true']>div[role='button']`)){
destination.addEventListener("click", function(){
console.log(destination);
let country = destination.getAttribute("data-race")? destination.getAttribute("data-race").replace(/-/g, " ") : "all";
if(!mobile){
for(let destination of doc.findAll(`div[role='tabpanel'][aria-expanded='true']>div[role='button']`)){
destination.addEventListener("click", function(){
console.log(destination);
let country = destination.getAttribute("data-race")? destination.getAttribute("data-race").replace(/-/g, " ") : "all";
if(country == "cayman") country = "cayman islands";
if(country == "uk") country = "united kingdom";

doc.find(`#ttTravelTable .legend input[type='radio'][name='country'][_type='${country}']`).click();
});
}
} else {
for(let destination of doc.findAll(`.tab-menu-cont .travel-info-table li.travel-info-table-list`)){
let country = destination.find(".city-flag").classList[1].replace(/-/g, " ");
if(country == "cayman") country = "cayman islands";
if(country == "uk") country = "united kingdom";

doc.find(`#ttTravelTable .legend input[type='radio'][name='country'][_type='${country}']`).click();
});
destination.addEventListener("click", function(){
doc.find(`#ttTravelTable .legend input[type='radio'][name='country'][_type='${country}']`).click();
});
}
}

// mobile
if(mobile){
doc.find(".travel-agency").classList.add("tt-mobile");
}
});
});
Expand Down
11 changes: 10 additions & 1 deletion torntools/views/popup/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
var previous_chain_timer;
var initiated_pages = {
"info": false,
"market": false,
"stocks": false,
"calculator": false
}

window.addEventListener("load", function () {
loadingPlaceholder(doc.find("body"), true);
Expand Down Expand Up @@ -73,7 +79,10 @@ function loadPage(name) {
"calculator": mainCalculator,
"initialize": mainInitialize
}
dict[name]();
if(!initiated_pages[name]){
dict[name]();
initiated_pages[name] = true;
}
}

function mainInfo() {
Expand Down

0 comments on commit 6c00e71

Please sign in to comment.