Skip to content

Commit 9b09d36

Browse files
author
meow
committed
add variable declarations
1 parent 12ab114 commit 9b09d36

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

assets/js/community.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ String.prototype.supplant = function (o) {
1111
function hide_youtube_replies(event) {
1212
var target = event.target;
1313

14-
sub_text = target.getAttribute('data-inner-text');
15-
inner_text = target.getAttribute('data-sub-text');
14+
var sub_text = target.getAttribute('data-inner-text');
15+
var inner_text = target.getAttribute('data-sub-text');
1616

17-
body = target.parentNode.parentNode.children[1];
17+
var body = target.parentNode.parentNode.children[1];
1818
body.style.display = 'none';
1919

2020
target.innerHTML = sub_text;
@@ -26,10 +26,10 @@ function hide_youtube_replies(event) {
2626
function show_youtube_replies(event) {
2727
var target = event.target;
2828

29-
sub_text = target.getAttribute('data-inner-text');
30-
inner_text = target.getAttribute('data-sub-text');
29+
var sub_text = target.getAttribute('data-inner-text');
30+
var inner_text = target.getAttribute('data-sub-text');
3131

32-
body = target.parentNode.parentNode.children[1];
32+
var body = target.parentNode.parentNode.children[1];
3333
body.style.display = '';
3434

3535
target.innerHTML = sub_text;

assets/js/notifications.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function get_subscriptions(callback, retries) {
1818
xhr.onreadystatechange = function () {
1919
if (xhr.readyState === 4) {
2020
if (xhr.status === 200) {
21-
subscriptions = xhr.response;
21+
var subscriptions = xhr.response;
2222
callback(subscriptions);
2323
}
2424
}

assets/js/player.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function isMobile() {
145145
if (isMobile()) {
146146
player.mobileUi();
147147

148-
buttons = ['playToggle', 'volumePanel', 'captionsButton'];
148+
var buttons = ['playToggle', 'volumePanel', 'captionsButton'];
149149

150150
if (video_data.params.quality !== 'dash') buttons.push('qualitySelector');
151151

@@ -158,24 +158,24 @@ if (isMobile()) {
158158
buttons.slice(1).forEach(function (child) {operations_bar.addChild(child);});
159159

160160
// Remove operation buttons from primary control bar
161-
primary_control_bar = player.getChild('controlBar');
161+
var primary_control_bar = player.getChild('controlBar');
162162
buttons.forEach(function (child) {primary_control_bar.removeChild(child);});
163163

164-
operations_bar_element = operations_bar.el();
164+
var operations_bar_element = operations_bar.el();
165165
operations_bar_element.className += ' mobile-operations-bar';
166166
player.addChild(operations_bar);
167167

168168
// Playback menu doesn't work when it's initialized outside of the primary control bar
169-
playback_element = document.getElementsByClassName('vjs-playback-rate')[0];
169+
var playback_element = document.getElementsByClassName('vjs-playback-rate')[0];
170170
operations_bar_element.append(playback_element);
171171

172172
// The share and http source selector element can't be fetched till the players ready.
173173
player.one('playing', function () {
174-
share_element = document.getElementsByClassName('vjs-share-control')[0];
174+
var share_element = document.getElementsByClassName('vjs-share-control')[0];
175175
operations_bar_element.append(share_element);
176176

177177
if (video_data.params.quality === 'dash') {
178-
http_source_selector = document.getElementsByClassName('vjs-http-source-selector vjs-menu-button')[0];
178+
var http_source_selector = document.getElementsByClassName('vjs-http-source-selector vjs-menu-button')[0];
179179
operations_bar_element.append(http_source_selector);
180180
}
181181
});
@@ -766,13 +766,13 @@ if (window.location.pathname.startsWith('/embed/')) {
766766
let watch_on_invidious_button = new Button(player);
767767

768768
// Create hyperlink for current instance
769-
redirect_element = document.createElement('a');
769+
var redirect_element = document.createElement('a');
770770
redirect_element.setAttribute('href', location.pathname.replace('/embed/', '/watch?v='));
771771
redirect_element.appendChild(document.createTextNode('Invidious'));
772772

773773
watch_on_invidious_button.el().appendChild(redirect_element);
774774
watch_on_invidious_button.addClass('watch-on-invidious');
775775

776-
cb = player.getChild('ControlBar');
776+
var cb = player.getChild('ControlBar');
777777
cb.addChild(watch_on_invidious_button);
778778
}

assets/js/watch.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ String.prototype.supplant = function (o) {
99
};
1010

1111
function toggle_parent(target) {
12-
body = target.parentNode.parentNode.children[1];
12+
var body = target.parentNode.parentNode.children[1];
1313
if (body.style.display === null || body.style.display === '') {
1414
target.innerHTML = '[ + ]';
1515
body.style.display = 'none';
@@ -21,7 +21,7 @@ function toggle_parent(target) {
2121

2222
function toggle_comments(event) {
2323
var target = event.target;
24-
body = target.parentNode.parentNode.parentNode.children[1];
24+
var body = target.parentNode.parentNode.parentNode.children[1];
2525
if (body.style.display === null || body.style.display === '') {
2626
target.innerHTML = '[ + ]';
2727
body.style.display = 'none';
@@ -44,10 +44,10 @@ function swap_comments(event) {
4444
function hide_youtube_replies(event) {
4545
var target = event.target;
4646

47-
sub_text = target.getAttribute('data-inner-text');
48-
inner_text = target.getAttribute('data-sub-text');
47+
var sub_text = target.getAttribute('data-inner-text');
48+
var inner_text = target.getAttribute('data-sub-text');
4949

50-
body = target.parentNode.parentNode.children[1];
50+
var body = target.parentNode.parentNode.children[1];
5151
body.style.display = 'none';
5252

5353
target.innerHTML = sub_text;
@@ -59,10 +59,10 @@ function hide_youtube_replies(event) {
5959
function show_youtube_replies(event) {
6060
var target = event.target;
6161

62-
sub_text = target.getAttribute('data-inner-text');
63-
inner_text = target.getAttribute('data-sub-text');
62+
var sub_text = target.getAttribute('data-inner-text');
63+
var inner_text = target.getAttribute('data-sub-text');
6464

65-
body = target.parentNode.parentNode.children[1];
65+
var body = target.parentNode.parentNode.children[1];
6666
body.style.display = '';
6767

6868
target.innerHTML = sub_text;
@@ -118,7 +118,7 @@ function number_with_separator(val) {
118118

119119
function get_playlist(plid, retries) {
120120
if (retries === undefined) retries = 5;
121-
playlist = document.getElementById('playlist');
121+
var playlist = document.getElementById('playlist');
122122

123123
if (retries <= 0) {
124124
console.log('Failed to pull playlist');
@@ -212,7 +212,7 @@ function get_playlist(plid, retries) {
212212

213213
function get_reddit_comments(retries) {
214214
if (retries === undefined) retries = 5;
215-
comments = document.getElementById('comments');
215+
var comments = document.getElementById('comments');
216216

217217
if (retries <= 0) {
218218
console.log('Failed to pull comments');
@@ -289,7 +289,7 @@ function get_reddit_comments(retries) {
289289

290290
function get_youtube_comments(retries) {
291291
if (retries === undefined) retries = 5;
292-
comments = document.getElementById('comments');
292+
var comments = document.getElementById('comments');
293293

294294
if (retries <= 0) {
295295
console.log('Failed to pull comments');
@@ -463,7 +463,7 @@ window.addEventListener('load', function (e) {
463463
} else if (video_data.params.comments[1] === 'reddit') {
464464
get_reddit_comments();
465465
} else {
466-
comments = document.getElementById('comments');
466+
var comments = document.getElementById('comments');
467467
comments.innerHTML = '';
468468
}
469469
});

0 commit comments

Comments
 (0)