Commit Graph

38 Commits

Author SHA1 Message Date
Ealhad bcec17a0a2 Add optional parameters object to `getPeertubeVideoURL`
At first I just wanted to make the isEmbed optional (default `false`), but I
thought it would be more future-proof to wrap it in an object. Now when it's not
needed, it's not there, and when it is, it's clear what it does.
2019-02-18 16:17:37 +01:00
Ealhad 104598477e Use lodash's `contains` function instead of checking indexOf
Because I love not having to think what code does. Functions rule.
2019-02-18 15:38:58 +01:00
Booteille a465394457
Use indexOf instead of strict equality to match the host 2019-02-17 20:34:14 +01:00
Booteille c9d01c17a0
use body instead of classname, fix styling of the banner on invidious 2019-02-17 20:26:49 +01:00
Booteille d57f95fba6
use body instead of classname, fix styling of the banner on invidious 2019-02-17 20:26:21 +01:00
Booteille 8eca34b755
Add support for Invidious 2019-02-17 20:07:50 +01:00
Booteille 9a4ebae563
Ajoute la redirection automatique des vidéos embed 2019-02-17 18:23:10 +01:00
Booteille 029de08d4d Add option to resume video through multiple instances 2018-11-22 15:09:35 +00:00
Ealhad 25b6e7949a Use Preferences abstraction instead of manual localStorage interaction
Default values and localStorage manipulation should be implemented in the
Prefereces class.
2018-11-15 00:38:41 +01:00
Ealhad 8049d4671e Add license header to new files 2018-11-15 00:32:56 +01:00
Ealhad 66893b5015 Remove superfluous function 2018-11-15 00:29:55 +01:00
Ealhad 3c4317504e Export functions instead of using class with only static members
Theres's no need to use a class all members are static and we never instantiate
it — it's not Java :D
2018-11-15 00:08:09 +01:00
Booteille 2385b5f5c8
Use type casting instead of Promise 2018-11-13 23:49:40 +01:00
Booteille 2614a3fc11
Refactor Automatic Peertube redirection to redirect before loading the page 2018-11-12 23:05:06 +01:00
Booteille 5c35ce031d
Refactor PeertubeAPI usage 2018-11-12 21:34:43 +01:00
Booteille bf87557b84
Rename method preventYoutube to redirectYoutube 2018-11-12 20:15:06 +01:00
Ealhad 3cbed317cd Redirect before calling Youtube
Implements #6
2018-11-12 15:56:58 +00:00
Ealhad 82c068f8f3 Make `fetchAPI` method private 2018-11-12 15:55:09 +00:00
Ealhad 0d7312d0c2 Make some small style improvements
-    let data = await InvidiousAPI.getVideo(id);
+    const data = await InvidiousAPI.getVideo(id);

I try to use `const` whenever I don't have to use `let`. While it's not a
guarantee as strong as what e.g. Rust can provide, I think it helps reducing
cognitive load — we know that the symbol will always reference the same piece of data.

-    if (prefs.redirectYoutube === 'Auto') {
+    if (prefs.redirectYoutube == RedirectType.Auto) {

Me nitpicking again. The string value of the RedirectYoutube enum is mainly
there for the radio buttons in the options page; in the code, it's better to use
the actual RedirectType.Auto symbol.

-    return {};
+    throw new Error('No results.');

Under the hood, an `async` function returns a promise, which resolves on return
and is rejected on throw.
2018-11-12 15:54:49 +01:00
Ealhad 633fa729df Correct formatting 2018-11-12 15:24:12 +01:00
Booteille 622eeed1a2
Remove unused function 2018-11-11 16:59:23 +01:00
Booteille c676af242a
Redirect before calling Youtube
Add the ability to call Invidious API and use it to prevent any call to youtube servers.
Refactor some methods and move them in util.js.
2018-11-11 16:29:38 +01:00
Ealhad 65cf25e0ff Make search case-insensitive 2018-11-09 17:08:37 +01:00
Ealhad 9c9707705f Implement #1: allow to redirect automatically 2018-11-09 14:40:41 +01:00
Ealhad 02005a0ef8 Add Preferences class to handle localStorage 2018-11-09 13:59:12 +01:00
Ealhad e46c61828d Specify thumbnail height in banner
It appears some videos have a *big* thumbnail, which made the banner a big mess
hiding all the page.
2018-11-04 09:14:45 +01:00
Ealhad 8602c34825 Enable webpack code splitting to drastically reduce package size
4x lodash was a bit too much, I think.
2018-11-04 09:06:02 +01:00
Ealhad f197253e52 Add the possibility to display a link when on another PeerTube instance 2018-09-15 18:31:00 +02:00
Ealhad ef98bb2885 Actually search for a video with the exact same title 2018-08-28 23:26:59 +02:00
Ealhad 67beeca09d Remove video link even if search fail (duh)
The bar was just staying there after having been displayed once.
2018-08-28 23:23:06 +02:00
Ealhad 863e33f3b9 Change default instance
Now using https://peertube.social thanks to Nutomic
2018-08-27 20:21:15 +02:00
Ealhad 7877257edd Add polyfill to run on chromium browsers 2018-08-14 12:43:26 +02:00
Ealhad 3cb749e8b3 Add missing license notice 2018-08-13 20:04:24 +02:00
Ealhad a806ba0d4b Go all TypeScript 2018-08-13 20:03:42 +02:00
Ealhad 66f9b3a391 Add options page 2018-08-11 23:48:55 +02:00
Ealhad 62800befd4 Display link in a bottom banner rather than in the page flow 2018-08-11 00:29:24 +02:00
Ealhad d2e9d13634 Remove loose colon 2018-08-10 18:55:58 +02:00
Ealhad 7d97eb5885 v0.2: use webpack, and DOM mutations to properly handle YT navigation 2018-08-10 15:45:07 +02:00