Skip to content

Commit

Permalink
possibly fixed update page not showing?
Browse files Browse the repository at this point in the history
  • Loading branch information
ktg5 committed Nov 3, 2023
1 parent c792f48 commit c90e32a
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ assignees: ''

**Describe the bug**
A clear and concise description of what the bug is.
Make sure that you've also tested the same issue with disabling any extra extensions that may effect YouTube.

**Screenshots**
If applicable, add screenshots to help explain your problem.
Expand Down
27 changes: 12 additions & 15 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@ var storage = browser.storage.sync;
var extension = browser.extension;
var runtime = browser.runtime;

function handleInstalled(reason) {
// On extension update
runtime.onInstalled.addListener(reason => {
storage.get(['PTConfig'], function(result) {
if (Object.keys(result).length > 0 && !result.PTConfig.releaseNote) {
return;
} else if (reason == "update") {
browser.tabs.create({
url: `./html/release-note.html`
});
} else {
browser.tabs.create({
url: `./html/${reason}.html`
});
var userConfig = result.PTConfig;
// Check to see if user would like to get release notes
if (userConfig.showReleaseNotes !== false) {
// Check if previous version is not equal to current version
if (reason.previousVersion !== runtime.getManifest().version) {
// Create tab lol
browser.tabs.create({
url: `./html/${reason.reason}.html`
});
}
}
});
}

runtime.onInstalled.addListener(reason => {
handleInstalled(reason.reason);
});
5 changes: 5 additions & 0 deletions html/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ var runtime = browser.runtime;
var version = runtime.getManifest().version;

setTimeout(() => {
// Add version number to page title
var pageName = document.getElementById('page-name').innerHTML;
document.title = `PlayerTube v${version} : ${pageName}`;

// Add version number to document
var slides = document.getElementsByClassName("showVersion");
for (var i = 0; i < slides.length; i++) {
slides.item(i).innerHTML += "v" + version;
Expand Down
4 changes: 4 additions & 0 deletions html/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<head>
<link rel="stylesheet" type="text/css" href="base.css">
<script src="base.js"></script>
<title>PlayerTube : Welcome!</title>
<link rel="shortcut icon" type="image/png" href="../img/playertube/icon.png">

<div id="page-name" style="display: none;">Welcome!</div>
</head>


Expand Down
6 changes: 3 additions & 3 deletions html/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ var runtime = browser.runtime;

// Default config
var def_pt_config = {
// First-time ppl & release note checking.
releaseNote: 0,

// Basic settings.
year: '2015',
showReleaseNotes: true,
darkMode: false,
fullyExtendBar: false,
toggleFadeOut: false,
Expand Down Expand Up @@ -289,6 +287,8 @@ async function start(userConfig) {
${makeMenuOption(`selection`, `year`, `Change year of Player`, yearOptions)}
${makeMenuOption('toggle', 'showReleaseNotes', 'Toggle Release Notes when reloading or updating PlayerTube')}
<div id="menu-if-dark-mode"></div>
${makeMenuOption('toggle', 'toggleRoundedCorners', 'Toggle rounded corners around a YouTube video')}
Expand Down
27 changes: 20 additions & 7 deletions html/release-note.html → html/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<head>
<link rel="stylesheet" type="text/css" href="base.css">
<script src="base.js"></script>
<title>PlayerTube : Update Log</title>
<link rel="shortcut icon" type="image/png" href="../img/playertube/icon.png">

<div id="page-name" style="display: none;">Update Log</div>
</head>


Expand All @@ -18,20 +22,29 @@ <h2>Important notice for those running CustomTube!</h2>
<p>
If by any chance you encounter issues when it comes to the look and
feel of the YouTube player with PlayerTube & CustomTube enabled,
please make sure to set "Use current player" in the "Watch Page"
tab in the CustomTube settings.
<b>
please make sure to set "Use current player" in the "Watch Page"
tab in the CustomTube settings.
</b>
</p>
<img src="../img/customtube-settings.png" style="display: block;margin: auto;" alt="Go to the 'Watch Page' tab in CustomTube's settings, scroll down to 'Video Player Style' and set it to 'Use current player'.">
<p>
This alert will be removed sometime soon but will be accessable to
new users.
</p>


<h2 class="showVersion">PlayerTube has been updated to </h2>
<li><b>2010 now does not fully extend the progress bar by default. This can be re-enabled by using one of the new settings under, "Fully extend the Progress Bar's height at all times"</b></li>
<li>Possibly fixed extension pages to actually show?</li>
<li>In the extension popup, some opinions have links to information about what the setting will target.</li>
<li>Fixed some link & embed issues with 2012 & 2015</li>
<li>Improved on 2010's top buttons</li>
<li>Added the ability to toggle the Paid Content popups on videos</li>
<li>Added the ability to toggle Info Cards</li>
<li>Added the ability to fully extend the progress bar</li>
<li>Added the ability to toggle the fade in & out animation instead of moving the controls down</li>
<li>(This was added in 1.4 but) When a feature is not in someone's config, the toggle button will flash orange.</li>
<li>Added the ability to toggle the Paid Content popups on videos (Disabled by default)</li>
<li>Added the ability to toggle Info Cards (Enabled by default)</li>
<li>Added the ability to fully extend the progress bar (Disabled by default)</li>
<li>Added the ability to toggle the fade in & out animation instead of moving the controls down (Disabled by default)</li>
<li>(This was added in 1.4 but) When a feature is not in the user's config, the toggle button will flash orange.</li>
</div>

<br>
Expand Down
4 changes: 1 addition & 3 deletions setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ var runtime = browser.runtime;

// Default config
var def_pt_config = {
// First-time ppl & release note checking.
releaseNote: 0,

// Basic settings.
year: '2015',
showReleaseNotes: true,
darkMode: false,
autoplayButton: false,
heatMapToggle: false,
Expand Down

0 comments on commit c90e32a

Please sign in to comment.