summaryrefslogtreecommitdiffstats
path: root/assets/js/watched_indicator.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/watched_indicator.js')
-rw-r--r--assets/js/watched_indicator.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/assets/js/watched_indicator.js b/assets/js/watched_indicator.js
new file mode 100644
index 00000000..e971cd80
--- /dev/null
+++ b/assets/js/watched_indicator.js
@@ -0,0 +1,24 @@
+'use strict';
+var save_player_pos_key = 'save_player_pos';
+
+function get_all_video_times() {
+ return helpers.storage.get(save_player_pos_key) || {};
+}
+
+document.querySelectorAll('.watched-indicator').forEach(function (indicator) {
+ var watched_part = get_all_video_times()[indicator.dataset.id];
+ var total = parseInt(indicator.dataset.length, 10);
+ if (watched_part === undefined) {
+ watched_part = total;
+ }
+ var percentage = Math.round((watched_part / total) * 100);
+
+ if (percentage < 5) {
+ percentage = 5;
+ }
+ if (percentage > 90) {
+ percentage = 100;
+ }
+
+ indicator.style.width = percentage + '%';
+});
'2021-07-10 15:34:29 +0200'>2021-07-10Add redirect for Norwegian Google TranslateTim HÄrek Andreassen 2021-07-10Bump version & update dependencies.v1.1.48SimonBrazell 2021-07-10Closes #242: remove "new" tag from SimplyTranslate.SimonBrazell 2021-06-16Fixes #238SimonBrazell 2021-06-16Redirect Twitter "video" subdomain & update dev dependencies.SimonBrazell 2021-06-16Fixed license linkGaurang Tandon 2021-06-16Added reddit.artemislena.euFantasyCookie17 2021-06-12Only append autoplay parameter if necessarybopol