Skip to content

Commit

Permalink
Merge pull request #45 from Gwenillia/staging
Browse files Browse the repository at this point in the history
Update Readme
  • Loading branch information
Gwenillia authored Jan 8, 2023
2 parents 5b21028 + 43911f9 commit d82dbe0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ Extension chrome pour Equideow qui permet d'obtenir plus facilement les
différentes informations du jeux comme le blup, le PG, les compétences mais
aussi d'afficher un coefficient de victoire pour mieux gérer ses blups notamment

Il s'agit la des nouvelles et anciennes version de l'extension trouvable en stores.
Ainsi que de la version vX.Y.Z qui est ma version personnel (incluant des features de l'abonnement VIP).
La version vX.Y.Z n'arrivera jamais dans les store et est buggué et non fiable.
---
## Better Howrse
Small chrome extension for Howrse that allow you to get more informations about
your horses and competition difficulties.

Here are available all recents and pasts updates of the browser extension that you can find on the stores.
There is also the vX.Y.Z which is my personnal version of the extension (that adds some VIP sub features).
The vX.Y.Z will never made it to the stores and is buggy and unreliable

---
[![Last Version](https://img.shields.io/badge/last%20version-v1.4.0-informational)](#)
[![DeepScan grade](https://deepscan.io/api/teams/17688/projects/21040/branches/592899/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=17688&pid=21040&bid=592899)
Expand Down
42 changes: 42 additions & 0 deletions foodSelect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2022. Gwen Tripet-Costet
* This file is part of Better Equideow (Better Howrse).
* Better Equideow (Better Howrse) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* Better Equideow (Better Howrse) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

class FoodSelect {
constructor() {
this.feedingBtn = document.getElementById("boutonNourrir");
this.haySlider = document.getElementById("haySlider"); // entire bloc containing ol, script, li, span
this.haySelectors = this.haySlider.getElementsByTagName("span"); // all span selectors from 0 to 20
this.oatsSlider = document.getElementById("oatsSlider");
this.oatsSelectors = this.oatsSlider.getElementsByTagName("span");
}

selectFeedAmount() {
// will get the value eg: XX/20 for hay and X/16 for oats.
const fourrageNode = document.getElementsByClassName(
"section-fourrage section-fourrage-target"
);
const avoineNode = document.getElementsByClassName(
"section-avoine section-avoine-target"
);

const fourrageValue = fourrageNode[0].innerHTML;
const avoineValue = avoineNode[0].innerHTML;

const fourrageIndex = parseInt(fourrageValue);
const avoineIndex = parseInt(avoineValue);

this.haySelectors[fourrageIndex].click();
this.oatsSelectors[avoineIndex].click();
}
}

const foodSelect = new FoodSelect();

foodSelect.feedingBtn.addEventListener("click", () => {
foodSelect.selectFeedAmount();
});
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "fr",
"version": "1.4.0",
"version": "x.y.z",
"manifest_version": 3,
"action": {
"default_title": "Click to see your horse sells",
Expand All @@ -19,7 +19,7 @@
{
"matches": ["*://*.equideow.com/*", "*://*.howrse.com/*"],
"run_at": "document_end",
"js": ["moreInfos.js", "competitionsDiffDisplay.js"]
"js": ["moreInfos.js", "competitionsDiffDisplay.js", "foodSelect.js"]
}
]
}

0 comments on commit d82dbe0

Please sign in to comment.