Skip to content

Commit

Permalink
Streamline HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
proginosko committed Dec 28, 2017
1 parent 32e5aff commit dd27dbd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
14 changes: 9 additions & 5 deletions blocked.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>

<html id="leechblockBlockingPage">
<html id="lbBlockingPage">

<head>
<meta charset="utf-8">
Expand All @@ -25,13 +25,17 @@ <h1>The page you're trying to access has been blocked by <a href="http://www.pro

<!-- blocked site info -->
<div>
<a id="leechblockBlockedURLLink" target="_self"><span id="leechblockBlockedURL"></span></a>
(<span id="leechblockBlockedSet">Block Set</span>)
<p>The page will be unblocked at: <strong><span id="leechblockUnblockTime">the end of time</span></strong></p>
<a id="lbBlockedURLLink" target="_self"><span id="lbBlockedURL"></span></a>
(<span id="lbBlockedSet">Block Set</span>)
<p>The page will be unblocked at: <strong><span id="lbUnblockTime">the end of time</span></strong></p>
</div>

<!-- support info -->
<div class="support">If LeechBlock has improved your life, please consider supporting<br>its continued development by <a href="https://www.paypal.me/JamesNAnderson">making a contribution</a> or <a href="https://addons.mozilla.org/en-US/firefox/addon/leechblock-ng/">writing a review</a>.</div>
<div class="support">
If LeechBlock has improved your life, please consider supporting<br>its continued development by
<a href="https://www.paypal.me/JamesNAnderson">making a contribution</a> or
<a href="https://addons.mozilla.org/en-US/firefox/addon/leechblock-ng/">writing a review</a>.
</div>

<script src="blocked.js"></script>

Expand Down
14 changes: 7 additions & 7 deletions blocked.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
function processBlockInfo(info) {
if (!info) return;

let blockedURL = document.getElementById("leechblockBlockedURL");
let blockedURL = document.getElementById("lbBlockedURL");
if (info.blockedURL && blockedURL) {
if (info.blockedURL.length > 60) {
blockedURL.innerText = info.blockedURL.substring(0, 57) + "...";
Expand All @@ -16,12 +16,12 @@ function processBlockInfo(info) {
}
}

let blockedURLLink = document.getElementById("leechblockBlockedURLLink");
let blockedURLLink = document.getElementById("lbBlockedURLLink");
if (info.blockedURL && blockedURLLink) {
blockedURLLink.setAttribute("href", info.blockedURL);
}

let blockedSet = document.getElementById("leechblockBlockedSet");
let blockedSet = document.getElementById("lbBlockedSet");
if (info.blockedSet && info.blockedSetName && blockedSet) {
if (info.blockedSetName) {
blockedSet.innerText = info.blockedSetName;
Expand All @@ -30,12 +30,12 @@ function processBlockInfo(info) {
}
}

let unblockTime = document.getElementById("leechblockUnblockTime");
let unblockTime = document.getElementById("lbUnblockTime");
if (info.unblockTime && unblockTime) {
unblockTime.innerText = info.unblockTime;
}

let delaySecs = document.getElementById("leechblockDelaySeconds");
let delaySecs = document.getElementById("lbDelaySeconds");
if (info.delaySecs && delaySecs) {
delaySecs.innerText = info.delaySecs;

Expand All @@ -58,7 +58,7 @@ function onCountdownTimer(countdown) {
window.clearInterval(countdown.interval);

// Strike through countdown text
let countdownText = document.getElementById("leechblockCountdownText");
let countdownText = document.getElementById("lbCountdownText");
if (countdownText) {
countdownText.style.textDecoration = "line-through";
}
Expand All @@ -69,7 +69,7 @@ function onCountdownTimer(countdown) {
countdown.delaySecs--;

// Update countdown seconds on page
let delaySecs = document.getElementById("leechblockDelaySeconds");
let delaySecs = document.getElementById("lbDelaySeconds");
if (delaySecs) {
delaySecs.innerText = countdown.delaySecs;
}
Expand Down
14 changes: 9 additions & 5 deletions delayed.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>

<html id="leechblockDelayingPage">
<html id="lbDelayingPage">

<head>
<meta charset="utf-8">
Expand All @@ -25,13 +25,17 @@ <h1>The page you're trying to access has been temporarily blocked by <a href="ht

<!-- blocked site info -->
<div>
<a id="leechblockBlockedURLLink" target="_self"><span id="leechblockBlockedURL"></span></a>
(<span id="leechblockBlockedSet">Block Set</span>)
<p id="leechblockCountdownText">The page will be loaded in <strong><span id="leechblockDelaySeconds">0</span></strong> second(s).</p>
<a id="lbBlockedURLLink" target="_self"><span id="lbBlockedURL"></span></a>
(<span id="lbBlockedSet">Block Set</span>)
<p id="lbCountdownText">The page will be loaded in <strong><span id="lbDelaySeconds">0</span></strong> second(s).</p>
</div>

<!-- support info -->
<div class="support">If LeechBlock has improved your life, please consider supporting<br>its continued development by <a href="https://www.paypal.me/JamesNAnderson">making a contribution</a> or <a href="https://addons.mozilla.org/en-US/firefox/addon/leechblock-ng/">writing a review</a>.</div>
<div class="support">
If LeechBlock has improved your life, please consider supporting<br>its continued development by
<a href="https://www.paypal.me/JamesNAnderson">making a contribution</a> or
<a href="https://addons.mozilla.org/en-US/firefox/addon/leechblock-ng/">writing a review</a>.
</div>

<script src="blocked.js"></script>

Expand Down

0 comments on commit dd27dbd

Please sign in to comment.