Skip to content

Commit

Permalink
settings for showrating and streaminglinks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Sep 18, 2023
1 parent d0a7e84 commit d22181f
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 89 deletions.
6 changes: 6 additions & 0 deletions chrome/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,11 @@
},
"RatingSwitchDescription": {
"message": "Zeigt die IMDB Bewertung für jeden film/serie an"
},
"StreamLinksSwitch": {
"message": "Streaming links:"
},
"StreamLinksDescription": {
"message": "Zeigt streaming links für filme an, die auf anderen plaformen oder anderen ländern verfügbar sind"
}
}
6 changes: 6 additions & 0 deletions chrome/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,11 @@
},
"RatingSwitchDescription": {
"message": "Adding the IMDB rating to every movie and series"
},
"StreamLinksSwitch": {
"message": "Streaming links:"
},
"StreamLinksDescription": {
"message": "Zeigt streaming links für filme an, die auf anderen plaformen oder anderen ländern verfügbar sind"
}
}
21 changes: 14 additions & 7 deletions chrome/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ <h2 id="openVideoSettings" i18n>SharedPageTitle</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>RatingSwitch</p>
<label class="switch" style="margin-left: 5px">
<input type="checkbox" id="VideoShowRating" />
<span class="slider round"></span>
</label>
</div>
<div class="line" style="width: 350px"><i18n>gotoIndividual</i18n><a href="settings.html" target="_blank" style="color: white" i18n>extendedSettings</a></div>
</div>
</div>
Expand Down Expand Up @@ -162,6 +155,13 @@ <h2 id="openAmazonSettings" i18n>PageSpecificTitle;Prime Video</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>StreamLinksSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonStreamLinks" />
<span class="slider round"></span>
</label>
</div>
</div>
</div>

Expand Down Expand Up @@ -212,6 +212,13 @@ <h2 id="openNetflixSettings" i18n>PageSpecificTitle;Netflix</h2>
<p id="profileName" style="text-transform: capitalize"></p>
<img id="profilePicture" class="hidden" style="margin-left: auto; height: 40px; border-radius: 4px; margin-right: 8px" />
</div>
<div class="line flex">
<p i18n>RatingSwitch</p>
<label class="switch">
<input type="checkbox" id="NetflixShowRating" />
<span class="slider round"></span>
</label>
</div>
</div>
</div>
<div class="categoryDisney">
Expand Down
26 changes: 17 additions & 9 deletions chrome/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,6 @@ <h2 i18n>SharedPageTitle</h2>
</label>
</div>
<p class="description" i18n>FullscreenSwitchDescription</p>
<hr />
<div class="line flex">
<p i18n>RatingSwitch</p>
<label class="switch" style="margin-left: 5px">
<input type="checkbox" id="VideoShowRating" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>RatingSwitchDescription</p>
<div style="margin-top: 5%"></div>
</div>
<div class="categoryPrime hidden" style="margin-top: 0; background-color: unset" id="AmazonSettings">
Expand Down Expand Up @@ -414,6 +405,15 @@ <h2 i18n>PageSpecificTitle;Prime Video</h2>
<p class="description" i18n>PaidContentDescription</p>
<hr />

<div class="line flex">
<p i18n>StreamLinksSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonStreamLinks" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>StreamLinksDescription</p>

<!-- <h2 i18n>sharedSettings</h2>
<p class="description" i18n>sharedSettingsDescription;Prime Video</p>
<div class="line flex">
Expand Down Expand Up @@ -494,6 +494,14 @@ <h2 i18n>PageSpecificTitle;Netflix</h2>
<img id="profilePicture" class="hidden" style="margin-left: auto; height: 40px; border-radius: 4px; margin-right: 8px" />
</div>
<hr />
<div class="line flex">
<p i18n>RatingSwitch</p>
<label class="switch" style="margin-left: 5px">
<input type="checkbox" id="NetflixShowRating" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>RatingSwitchDescription</p>
<!-- <h2 i18n>sharedSettings</h2>
<p class="description" i18n>sharedSettingsDescription;Netflix</p>
<div class="line flex">
Expand Down
44 changes: 21 additions & 23 deletions chrome/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ if (url.includes("#")) Menu(url.split("#")[1]);
// global variables in localStorage
const defaultSettings = {
settings: {
Amazon: { skipIntro: true, skipCredits: true, watchCredits: false, skipAd: true, blockFreevee: true, speedSlider: true, filterPaid: false },
Netflix: { skipIntro: true, skipRecap: true, skipCredits: true, watchCredits: false, skipBlocked: true, NetflixAds: true, speedSlider: true, profile: true },
Amazon: { skipIntro: true, skipCredits: true, watchCredits: false, skipAd: true, blockFreevee: true, speedSlider: true, filterPaid: false, showRating: true, streamLinks: true },
Netflix: { skipIntro: true, skipRecap: true, skipCredits: true, watchCredits: false, skipBlocked: true, NetflixAds: true, speedSlider: true, profile: true, showRating: true },
Disney: { skipIntro: true, skipCredits: true, watchCredits: false, speedSlider: true },
Video: { playOnFullScreen: true, showRating: true },
Video: { playOnFullScreen: true },
Statistics: { AmazonAdTimeSkipped: 0, NetflixAdTimeSkipped: 0, IntroTimeSkipped: 0, RecapTimeSkipped: 0, SegmentsSkipped: 0 },
General: { profileName: null, profilePicture: null, sliderSteps: 1, sliderMin: 5, sliderMax: 20 },
},
Expand Down Expand Up @@ -146,9 +146,7 @@ function setCheckboxesToSettings() {
settings?.Netflix.speedSlider &&
settings?.Disney.speedSlider &&
// playOnFullScreen
settings?.Video.playOnFullScreen &&
// showRating
settings?.Video.showRating;
settings?.Video.playOnFullScreen;
button = document.querySelector("#VideoIntro");
if (button) button.checked = settings?.Amazon.skipIntro && settings?.Netflix.skipIntro && settings?.Disney.skipIntro;
button = document.querySelector("#VideoCredits");
Expand All @@ -163,16 +161,14 @@ function setCheckboxesToSettings() {
if (button) button.checked = settings?.Amazon.speedSlider && settings?.Netflix.speedSlider && settings?.Disney.speedSlider;
button = document.querySelector("#VideoFullScreen");
if (button) button.checked = settings?.Video.playOnFullScreen;
button = document.querySelector("#VideoShowRating");
if (button) button.checked = settings?.Video.showRating;

// ------------- Default ---------------------------------------
button = document.querySelector("#DefaultSkips");
if (button) button.checked = settings?.Amazon.filterPaid;

// ------------- Amazon ---------------------------------------
button = document.querySelector("#AmazonSkips");
if (button) button.checked = settings?.Amazon.skipAd && settings?.Amazon.filterPaid;
if (button) button.checked = settings?.Amazon.skipAd && settings?.Amazon.filterPaid && settings?.Amazon.streamLinks;
button = document.querySelector("#AmazonIntro");
if (button) button.checked = settings?.Amazon.skipIntro;
button = document.querySelector("#AmazonCredits");
Expand All @@ -189,10 +185,12 @@ function setCheckboxesToSettings() {
for (const b of button) {
b.checked = settings?.Amazon.filterPaid;
}
button = document.querySelector("#AmazonStreamLinks");
if (button) button.checked = settings?.Amazon.streamLinks;

// ------------- Netflix ---------------------------------------
button = document.querySelector("#NetflixSkips");
if (button) button.checked = settings?.Netflix.skipRecap && settings?.Netflix.skipBlocked && settings?.Netflix.profile;
if (button) button.checked = settings?.Netflix.skipRecap && settings?.Netflix.skipBlocked && settings?.Netflix.profile && settings?.Netflix.showRating;
button = document.querySelector("#NetflixIntro");
if (button) button.checked = settings?.Netflix.skipIntro;
button = document.querySelector("#NetflixRecap");
Expand All @@ -209,6 +207,8 @@ function setCheckboxesToSettings() {
if (button) button.checked = settings?.Netflix.speedSlider;
button = document.querySelector("#NetflixProfile");
if (button) button.checked = settings?.Netflix.profile;
button = document.querySelector("#NetflixShowRating");
if (button) button.checked = settings?.Netflix.showRating;

button = document.querySelector("#profileName");
if (button) button.textContent = settings?.General.profileName;
Expand Down Expand Up @@ -345,9 +345,7 @@ function listenForClicks() {
settings?.Netflix.speedSlider &&
settings?.Disney.speedSlider &&
// playOnFullScreen
settings?.Video.playOnFullScreen &&
// showRating
settings?.Video.showRating
settings?.Video.playOnFullScreen
);
settings.Amazon.skipIntro =
settings.Netflix.skipIntro =
Expand All @@ -365,8 +363,6 @@ function listenForClicks() {
settings.Disney.speedSlider =
// playOnFullScreen
settings.Video.playOnFullScreen =
// showRating
settings.Video.showRating =
VideoSkips;
if (VideoSkips) settings.Amazon.watchCredits = settings.Netflix.watchCredits = settings.Disney.watchCredits = false;
setSettings("All VideoSkips");
Expand Down Expand Up @@ -399,9 +395,6 @@ function listenForClicks() {
} else if (e.target.id === "VideoFullScreen") {
settings.Video.playOnFullScreen = !settings.Video.playOnFullScreen;
setSettings("playOnFullScreen");
} else if (e.target.id === "VideoShowRating") {
settings.Video.showRating = !settings.Video.showRating;
setSettings("showRating");
}

// ------------- Default ---------------------------------------
Expand All @@ -412,9 +405,8 @@ function listenForClicks() {
}
// ------------- Amazon ---------------------------------------
else if (e.target.id === "AmazonSkips") {
const AmazonSkips = !(settings.Amazon.skipAd && settings.Amazon.filterPaid);
settings.Amazon.skipAd = AmazonSkips;
settings.Amazon.filterPaid = AmazonSkips;
const AmazonSkips = !(settings.Amazon.skipAd && settings.Amazon.filterPaid && settings.Amazon.streamLinks);
settings.Amazon.skipAd = settings.Amazon.filterPaid = settings.Amazon.streamLinks = AmazonSkips;
setSettings("All AmazonSkips");
} else if (e.target.id === "AmazonCredits") {
settings.Amazon.skipCredits = !settings.Amazon.skipCredits;
Expand Down Expand Up @@ -443,11 +435,14 @@ function listenForClicks() {
} else if (e.target.id === "AmazonfilterPaid") {
settings.Amazon.filterPaid = !settings.Amazon.filterPaid;
setSettings("filterPaid");
} else if (e.target.id === "AmazonStreamLinks") {
settings.Amazon.streamLinks = !settings.Amazon.streamLinks;
setSettings("streamLinks");
}
// ------------- Netflix ---------------------------------------
else if (e.target.id === "NetflixSkips") {
const NetflixSkips = !(settings?.Netflix.skipRecap && settings?.Netflix.skipBlocked && settings?.Netflix.profile);
settings.Netflix.skipRecap = settings.Netflix.skipBlocked = settings.Netflix.profile = NetflixSkips;
const NetflixSkips = !(settings?.Netflix.skipRecap && settings?.Netflix.skipBlocked && settings?.Netflix.profile && settings?.Netflix.showRating);
settings.Netflix.skipRecap = settings.Netflix.skipBlocked = settings.Netflix.profile = settings.Netflix.showRating = NetflixSkips;
setSettings("All NetflixSkips");
} else if (e.target.id === "NetflixIntro") {
settings.Netflix.skipIntro = !settings.Netflix.skipIntro;
Expand Down Expand Up @@ -479,6 +474,9 @@ function listenForClicks() {
} else if (e.target.id === "NetflixProfile") {
settings.Netflix.profile = !settings.Netflix.profile;
setSettings("profile");
} else if (e.target.id === "NetflixShowRating") {
settings.Netflix.showRating = !settings.Netflix.showRating;
setSettings("showRating");
}
// ------------- Disney ---------------------------------------
else if (e.target.id === "DisneySkips") {
Expand Down
6 changes: 6 additions & 0 deletions firefox/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,11 @@
},
"RatingSwitchDescription": {
"message": "Zeigt die IMDB Bewertung für jeden film/serie an"
},
"StreamLinksSwitch": {
"message": "Streaming links:"
},
"StreamLinksDescription": {
"message": "Zeigt streaming links für filme an, die auf anderen plaformen oder anderen ländern verfügbar sind"
}
}
6 changes: 6 additions & 0 deletions firefox/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,11 @@
},
"RatingSwitchDescription": {
"message": "Adding the IMDB rating to every movie and series"
},
"StreamLinksSwitch": {
"message": "Streaming links:"
},
"StreamLinksDescription": {
"message": "Zeigt streaming links für filme an, die auf anderen plaformen oder anderen ländern verfügbar sind"
}
}
43 changes: 25 additions & 18 deletions firefox/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ <h2 id="openVideoSettings" i18n>SharedPageTitle</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>RatingSwitch</p>
<label class="switch">
<input type="checkbox" id="VideoShowRating" />
<span class="slider round"></span>
</label>
</div>
<div class="line" style="width: 350px"><i18n>gotoIndividual</i18n><a href="settings.html" target="_blank" style="color: white" i18n>extendedSettings</a></div>
</div>
</div>
Expand Down Expand Up @@ -157,6 +150,13 @@ <h2 id="openAmazonSettings" i18n>PageSpecificTitle;Prime Video</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>StreamLinksSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonStreamLinks" />
<span class="slider round"></span>
</label>
</div>
</div>
</div>

Expand Down Expand Up @@ -207,24 +207,31 @@ <h2 id="openNetflixSettings" i18n>PageSpecificTitle;Netflix</h2>
<p id="profileName" style="text-transform: capitalize"></p>
<img id="profilePicture" class="hidden" style="margin-left: auto; height: 40px; border-radius: 4px; margin-right: 8px" />
</div>
<div class="line flex">
<p i18n>RatingSwitch</p>
<label class="switch">
<input type="checkbox" id="NetflixShowRating" />
<span class="slider round"></span>
</label>
</div>
</div>
</div>
<div class="categoryDisney">
<div class="flex flex-between" id="openDisneySettings" style="padding: 5px 5px">
<h2 id="openDisneySettings" i18n>PageSpecificTitle;Disney+</h2>
<div class="flex">
<!-- <div class="line flex-align" id="openDisneySettings">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 20" height="1em" id="openDisneySettings" class="DisneyDownArrow">
<path d="M0 0 40 0 20 20 0 0" fill="white" id="openDisneySettings" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 20" height="1em" id="openDisneySettings" class="DisneyUpArrow hidden">
<path d="M20 0 40 20 0 20 20 0" fill="white" id="openDisneySettings" />
</svg>
</div>
<label class="switch">
<input type="checkbox" id="DisneySkips" />
<span class="slider round"></span>
</label> -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 20" height="1em" id="openDisneySettings" class="DisneyDownArrow">
<path d="M0 0 40 0 20 20 0 0" fill="white" id="openDisneySettings" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 20" height="1em" id="openDisneySettings" class="DisneyUpArrow hidden">
<path d="M20 0 40 20 0 20 20 0" fill="white" id="openDisneySettings" />
</svg>
</div>
<label class="switch">
<input type="checkbox" id="DisneySkips" />
<span class="slider round"></span>
</label> -->
</div>
</div>
<!-- show on click -->
Expand Down
26 changes: 17 additions & 9 deletions firefox/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,6 @@ <h2 i18n>SharedPageTitle</h2>
</label>
</div>
<p class="description" i18n>FullscreenSwitchDescription</p>
<hr />
<div class="line flex">
<p i18n>RatingSwitch</p>
<label class="switch" style="margin-left: 5px">
<input type="checkbox" id="VideoShowRating" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>RatingSwitchDescription</p>
<div style="margin-top: 5%"></div>
</div>
<div class="categoryPrime hidden" style="margin-top: 0; background-color: unset" id="AmazonSettings">
Expand Down Expand Up @@ -409,6 +400,15 @@ <h2 i18n>PageSpecificTitle;Prime Video</h2>
<p class="description" i18n>PaidContentDescription</p>
<hr />

<div class="line flex">
<p i18n>StreamLinksSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonStreamLinks" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>StreamLinksDescription</p>

<!-- <h2 i18n>sharedSettings</h2>
<p class="description" i18n>sharedSettingsDescription;Prime Video</p>
<div class="line flex">
Expand Down Expand Up @@ -489,6 +489,14 @@ <h2 i18n>PageSpecificTitle;Netflix</h2>
<img id="profilePicture" class="hidden" style="margin-left: auto; height: 40px; border-radius: 4px; margin-right: 8px" />
</div>
<hr />
<div class="line flex">
<p i18n>RatingSwitch</p>
<label class="switch" style="margin-left: 5px">
<input type="checkbox" id="NetflixShowRating" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>RatingSwitchDescription</p>
<!-- <h2 i18n>sharedSettings</h2>
<p class="description" i18n>sharedSettingsDescription;Netflix</p>
<div class="line flex">
Expand Down
Loading

0 comments on commit d22181f

Please sign in to comment.