Skip to content

Commit

Permalink
Update Rotten_Tomatoes_Decimal_Rating.user.js
Browse files Browse the repository at this point in the history
Update for the recent RT html changes
  • Loading branch information
darkred committed Jun 2, 2023
1 parent fc88919 commit e8253c1
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// ==UserScript==
// @name Rotten Tomatoes Decimal Rating
// @namespace darkred
// @version 6.0.3
// @date 2022.5.15
// @version 7
// @date 2023.6.3
// @description Changes base-5 Rating of Rotten Tomatoes to base-10
// @author wOxxOm, darkred
// @license MIT
Expand Down Expand Up @@ -76,8 +76,8 @@ scoreBoard.onclick = function(event) {

audienceScorex2();

let buttonVerifiedAudience = document.querySelector('#mainColumn > overlay-base > score-details > score-details-audience > filter-chip:nth-child(2)');
let buttonAllAudience = document.querySelector('#mainColumn > overlay-base > score-details > score-details-audience > filter-chip:nth-child(3)');
let buttonVerifiedAudience = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-audience > filter-chip:nth-child(2)');
let buttonAllAudience = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-audience > filter-chip:nth-child(3)');
[ buttonVerifiedAudience, buttonAllAudience ].forEach(function(element) {
if (element) {
element.addEventListener('click', function() {
Expand All @@ -89,13 +89,13 @@ scoreBoard.onclick = function(event) {


// the '?' buttons for the two descriptive texts
let buttonQuestionmarkTomatometer = document.querySelector('#mainColumn > overlay-base > score-details > score-details-critics > tool-tip');
let buttonQuestionmarkAudienceScore = document.querySelector('#mainColumn > overlay-base > score-details > score-details-audience > tool-tip');
let buttonQuestionmarkTomatometer = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-critics > tool-tip');
let buttonQuestionmarkAudienceScore = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-audience > tool-tip');


buttonQuestionmarkTomatometer.addEventListener('click', function(){

let descriptiveTextTomatometer = document.querySelector('#mainColumn > overlay-base > score-details > score-details-critics > tool-tip').shadowRoot.querySelector('.description');
let descriptiveTextTomatometer = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-critics > tool-tip').shadowRoot.querySelector('.description');
if (!descriptiveTextTomatometer.textContent.includes('review (6 stars or higher)')) {
descriptiveTextTomatometer.innerHTML = descriptiveTextTomatometer.innerHTML.replace('review', 'review (6 stars or higher)');
}
Expand All @@ -106,7 +106,7 @@ scoreBoard.onclick = function(event) {
buttonQuestionmarkAudienceScore.addEventListener('click', function(){

// There are now two occurrences of '3.5 stars or higher' in the AUDIENCE descriptive text overlay, hence the querySelectorAll()
let descriptiveTextAudienceScode = document.querySelector('#mainColumn > overlay-base > score-details > score-details-audience > tool-tip').shadowRoot.querySelectorAll('.description');
let descriptiveTextAudienceScode = document.querySelector('#topSection > div.thumbnail-scoreboard-wrap > overlay-base > score-details > score-details-audience > tool-tip').shadowRoot.querySelectorAll('.description');
/*
descriptiveTextAudienceScode.innerHTML = descriptiveTextAudienceScode.innerHTML.replace(/([\d.]+)( stars)/g, function (m, s1, s2) {
return 2 * s1 + s2;
Expand Down

0 comments on commit e8253c1

Please sign in to comment.