Permalink
Browse files

FIX: Metacritit user score CSS bug

- fixed a repeating image background image on metracritic score box
- removed unnecessary image
- adjusted CSS for "User Score"
  • Loading branch information...
1 parent 6c193e2 commit 535209a9528251fc49d9f2e93383901cb428b209 @JoiNNN JoiNNN committed Nov 24, 2016
Showing with 26 additions and 6 deletions.
  1. +15 −0 css/enhancedsteam.css
  2. +10 −5 enhancedsteam.js
  3. BIN img/metacritic_bg.png
  4. +1 −0 localization/en/strings.json
  5. +0 −1 manifest.json
View
@@ -2069,3 +2069,18 @@ input[type=checkbox].es_dlc_selection:checked + label {
#es_permalink_div .count_link_label {
color: #EBEBEB;
}
+
+/***************************************
+ * Apps Store pages
+ * add_metacritic_userscore()
+ **************************************/
+#game_area_userscore {
+ color: #4a617c
+}
+#game_area_userscore span {
+ color: #7e96a3;
+}
+#game_area_metascore.es_area_userscore .metacritic {
+ margin-top: -4px !important;
+}
+
View
@@ -4226,13 +4226,18 @@ function add_metacritic_userscore() {
storage.get(function(settings) {
if (settings.showmcus === undefined) { settings.showmcus = true; storage.set({'showmcus': settings.showmcus}); }
if (settings.showmcus) {
- if ($("#game_area_metascore")) {
- var metalink = $("#game_area_metalink").find("a").attr("href");
+ if ($("#game_area_metascore").length) {
storePageData.get("metacritic", function(data) {
if (data.userscore) {
- var metauserscore = data.userscore*10;
- var newmeta = '<div id="game_area_metascore" style="background-image: url(' + chrome.extension.getURL("img/metacritic_bg.png") + ');"><span>' + metauserscore + '</span><span class="ms_slash">/</span><span class="ms_base">100</span></div>';
- if (!isNaN(metauserscore)) $("#game_area_metascore").after(newmeta);
+ var metauserscore = data.userscore * 10;
+ if (!isNaN(metauserscore)) {
+ $("#game_area_metascore").addClass("es_area_userscore");
+ $("#game_area_metalink").after(`
+ <div id="game_area_userscore">
+ ${ localized_strings.user_score }: <span>${ metauserscore }/100</span>
+ </div>
+ `);
+ }
}
});
}
View
Deleted file not rendered
@@ -242,6 +242,7 @@
"tag_short": "Use short tags to save space",
"no_price_data": "No price data available",
"exclude_tags": "Exclude tags",
+ "user_score": "User Score",
"achievements": {
"option": "Show achievements on store pages",
"achievements": "Achievements",
View
@@ -17,7 +17,6 @@
"web_accessible_resources": [
"img/game_area_warning.png",
"img/line_chart.png",
- "img/metacritic_bg.png",
"img/birthday_logo_bg.gif",
"img/birthday_bg.png",
"img/ico/steamgifts.png",

0 comments on commit 535209a

Please sign in to comment.