From 39229c99a3fc6f41de1d33d3d60984c2d19fe572 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 28 Apr 2020 21:25:28 +0200 Subject: [PATCH 1/8] not all numbers are dates --- source/UI/js/Core/URL.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/UI/js/Core/URL.js b/source/UI/js/Core/URL.js index c802d353..814044d0 100644 --- a/source/UI/js/Core/URL.js +++ b/source/UI/js/Core/URL.js @@ -618,6 +618,16 @@ Ox.URL = function(options) { }); } + function isDate(str) { + var values = /^(-?\d+)-?(\d+)?-?(\d+)? ?(\d+)?:?(\d+)?:?(\d+)?\.?(\d+)?$/ + .exec(str); + return Boolean( + values && + parseInt(values[1]) <= 9999 && + (!values[2] || parseInt(values[2]) <= 12) && + (!values[3] || parseInt(values[3]) <= 31) + ) + } function getSpanType(str, types) { Ox.Log('Core', 'getSpanType', str, types) @@ -633,7 +643,7 @@ Ox.URL = function(options) { : canBeLocation && length == 4 ? 'location' // leaves us with [-]D[.D][,[-]D[.D]] : canBeDuration ? 'duration' - : canBeDate && !/\./.test(str) && !/^\d{7}$/.test(str) && !/^\d{8}$/.test(str) ? 'date' + : canBeDate && isDate(str) ? 'date' : canBeLocation && length == 2 ? 'location' : canBeNumber && /^\d+$/.test(str) ? 'number' : canBeString && str.length ? 'string' From cebfedfdd4fbb615f2b4dfa533cefb07a9619596 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 28 Apr 2020 21:26:22 +0200 Subject: [PATCH 2/8] keep a minimum of 8px --- source/UI/js/List/TableList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/UI/js/List/TableList.js b/source/UI/js/List/TableList.js index 63320f03..d72a7f06 100644 --- a/source/UI/js/List/TableList.js +++ b/source/UI/js/List/TableList.js @@ -206,7 +206,7 @@ Ox.TableList = function(options, self) { .addClass('OxHead') .css({ right: self.options.scrollbarVisible - ? Ox.UI.SCROLLBAR_SIZE + 'px' : 0 + ? Math.max(Ox.UI.SCROLLBAR_SIZE, 8) + 'px' : 0 }) .appendTo(that.$bar); that.$head.$content.addClass('OxTitles'); From bd7aedb1161aa16b92449db672d92e14eb3315be Mon Sep 17 00:00:00 2001 From: j Date: Tue, 28 Apr 2020 21:27:36 +0200 Subject: [PATCH 3/8] toggle playback rate 100% -> 200% -> 50% -> 100% --- source/UI/js/Video/VideoAnnotationPanel.js | 4 +++- source/UI/js/Video/VideoPlayer.js | 5 +++++ source/UI/js/Video/VideoPlayerPanel.js | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/source/UI/js/Video/VideoAnnotationPanel.js b/source/UI/js/Video/VideoAnnotationPanel.js index 4700b283..a3935b1e 100644 --- a/source/UI/js/Video/VideoAnnotationPanel.js +++ b/source/UI/js/Video/VideoAnnotationPanel.js @@ -237,7 +237,9 @@ Ox.VideoAnnotationPanel = function(options, self) { setPoint('in', self.options.position); }, key_k: function togglePlaybackRate() { - that.options({playbackRate: self.options.playbackRate == 1 ? 2 : 1}); + that.options({ + playbackRate: self.options.playbackRate == 1 ? 2 : self.options.playbackRate == 2 ? 0.5 : 1 + }); }, key_l: toggleLoop, key_left: function() { diff --git a/source/UI/js/Video/VideoPlayer.js b/source/UI/js/Video/VideoPlayer.js index 0ffaab2b..36c2822b 100644 --- a/source/UI/js/Video/VideoPlayer.js +++ b/source/UI/js/Video/VideoPlayer.js @@ -321,6 +321,11 @@ Ox.VideoPlayer = function(options, self) { key_g: function() { goToNext('result', 1); }, + key_k: function togglePlaybackRate() { + that.options({ + playbackRate: self.options.playbackRate == 1 ? 2 : self.options.playbackRate == 2 ? 0.5 : 1 + }); + }, key_l: toggleLoop, key_left: function() { setPosition(self.options.position - self.secondsPerFrame); diff --git a/source/UI/js/Video/VideoPlayerPanel.js b/source/UI/js/Video/VideoPlayerPanel.js index d59d4862..1b376d81 100644 --- a/source/UI/js/Video/VideoPlayerPanel.js +++ b/source/UI/js/Video/VideoPlayerPanel.js @@ -16,6 +16,7 @@ Ox.VideoPlayerPanel VideoPlayerPanel Object key_* key_* muted muted paused paused + playbackRate: playback rate position position resizecalendar resizecalendar resolution resolution @@ -62,6 +63,7 @@ Ox.VideoPlayerPanel = function(options, self) { muted: false, out: 0, paused: true, + playbackRate: 1, playInToOut: false, position: 0, poster: '', @@ -106,6 +108,11 @@ Ox.VideoPlayerPanel = function(options, self) { paused: function() { self.$video.options({paused: self.options.paused}); }, + playbackRate: function() { + self.$video.options({ + playbackRate: self.options.playbackRate + }); + }, position: function() { self.$video.options({position: self.options.position}); self.$timeline.options({position: self.options.position}); @@ -167,6 +174,11 @@ Ox.VideoPlayerPanel = function(options, self) { self.$annotationPanel.options({selected: ''}); setPoint('in', self.options.position, false, true); }, + key_k: function togglePlaybackRate() { + that.options({ + playbackRate: self.options.playbackRate == 1 ? 2 : self.options.playbackRate == 2 ? 0.5 : 1 + }); + }, key_l: toggleLoop, key_left: function() { movePositionBy(-1 / self.options.fps); From b017ba5ba14bde237e0fc57fed79c223dfae5ecd Mon Sep 17 00:00:00 2001 From: j Date: Tue, 28 Apr 2020 21:34:23 +0200 Subject: [PATCH 4/8] also toggle playbackRate in timeline --- source/UI/js/Video/VideoTimelinePanel.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/UI/js/Video/VideoTimelinePanel.js b/source/UI/js/Video/VideoTimelinePanel.js index 7e51d077..917b32c3 100644 --- a/source/UI/js/Video/VideoTimelinePanel.js +++ b/source/UI/js/Video/VideoTimelinePanel.js @@ -106,6 +106,11 @@ Ox.VideoTimelinePanel = function(options, self) { key_equal: function() { self.$video.changeVolume(0.1); }, + key_k: function togglePlaybackRate() { + that.options({ + playbackRate: self.options.playbackRate == 1 ? 2 : self.options.playbackRate == 2 ? 0.5 : 1 + }); + }, key_minus: function() { self.$video.changeVolume(-0.1); }, From ae12acda2ae47df66a11e97d4a9e7348e0e41dc8 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 28 Apr 2020 21:39:51 +0200 Subject: [PATCH 5/8] pass playbackRate in Ox.VideoTimelinePlayer --- source/UI/js/Video/VideoTimelinePlayer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/UI/js/Video/VideoTimelinePlayer.js b/source/UI/js/Video/VideoTimelinePlayer.js index 73887e92..7262cf76 100644 --- a/source/UI/js/Video/VideoTimelinePlayer.js +++ b/source/UI/js/Video/VideoTimelinePlayer.js @@ -34,6 +34,7 @@ Ox.VideoTimelinePlayer = function(options, self) { muted: false, out: 0, paused: false, + playbackRate: 1, position: 0, showMilliseconds: false, smallTimelineURL: '', @@ -52,6 +53,9 @@ Ox.VideoTimelinePlayer = function(options, self) { self.options.paused = !self.options.paused; togglePaused(); }, + playbackRate: function() { + self.$video.options({playbackRate: self.options.playbackRate}); + }, position: setPosition, timeline: function() { self.$menuButton.checkItem('timelines_' + self.options.timeline); From 9c9d3a8e2ff5802523b8606c8c600af678bcd6ac Mon Sep 17 00:00:00 2001 From: j Date: Wed, 29 Apr 2020 14:18:18 +0200 Subject: [PATCH 6/8] one more playbackRate --- source/UI/js/Video/VideoTimelinePlayer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/UI/js/Video/VideoTimelinePlayer.js b/source/UI/js/Video/VideoTimelinePlayer.js index 7262cf76..2dd8583c 100644 --- a/source/UI/js/Video/VideoTimelinePlayer.js +++ b/source/UI/js/Video/VideoTimelinePlayer.js @@ -199,6 +199,11 @@ Ox.VideoTimelinePlayer = function(options, self) { key_enter: function() { scrollToPosition(); }, + key_k: function togglePlaybackRate() { + that.options({ + playbackRate: self.options.playbackRate == 1 ? 2 : self.options.playbackRate == 2 ? 0.5 : 1 + }); + }, key_left: function() { self.options.position -= self.videoWidth / self.fps; setPosition(); From 48a3043a79fabc39bcb683259d5f5083906d77f8 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 29 Apr 2020 14:22:01 +0200 Subject: [PATCH 7/8] initial playback rate --- source/UI/js/Video/VideoTimelinePlayer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/source/UI/js/Video/VideoTimelinePlayer.js b/source/UI/js/Video/VideoTimelinePlayer.js index 2dd8583c..dacf864d 100644 --- a/source/UI/js/Video/VideoTimelinePlayer.js +++ b/source/UI/js/Video/VideoTimelinePlayer.js @@ -402,6 +402,7 @@ Ox.VideoTimelinePlayer = function(options, self) { height: self.tileHeight, muted: self.options.muted, paused: self.options.paused, + playbackRate: self.options.playbackRate, position: self.options.position, scaleToFill: true, video: self.options.video, From ffeee38d7d263727e95c151e317778399a1f6922 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 31 May 2020 10:49:50 +0200 Subject: [PATCH 8/8] remove facebook spam from url --- source/UI/js/Core/URL.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/UI/js/Core/URL.js b/source/UI/js/Core/URL.js index 814044d0..784e27ec 100644 --- a/source/UI/js/Core/URL.js +++ b/source/UI/js/Core/URL.js @@ -809,7 +809,10 @@ Ox.URL = function(options) { } function parseURL(str, callback) { + // remove facebook spam + str = str.replace(/\?fbclid=[A-Za-z0-9_]+/, '') // fixme: removing trailing slash makes it impossible to search for '/' + var split = str.split('#'), parts = split.shift().replace(/(^\/|\/$)/g, '').split('/'), state = split.length && split[0].length