Commit Graph

951 Commits

Author SHA1 Message Date
Mike Nolan 7cda82b68a Added TYTD Support 2022-10-26 01:36:05 -05:00
Emma 70baa873fb
Move `Dialog` functions to `utils/helpers` (#2752)
* Moving `FileFromDialog` helpers into helpers/utils

* Moving `showDialog` functions to `utils/helpers`

* Linting

* Update src/renderer/helpers/utils.js

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Update refs  `showSaveDialog` in `ft-video-player`

* Formatting long import to be multiline

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2022-10-25 16:44:18 +02:00
absidue 697bed23ed
Disable http disk cache and implempent in-memory image cache (#2498)
* Disable http disk cache and implempent in-memory image cache

* Add comment about removing URL scheme prefix

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* Add early return to clean up the code

* Rewrite cache expiry logic with fallbacks

* Move this change behind a CLI argument --experiments-disable-disk-cache

* Replace CLI flag with a GUI setting

* Improve warning message styling

* ! Fix incompatibility with latest settings code

* Use CSS instead of sass for the experimental settings

* Return the error as JSON instead of throwing it

* Inline restart prompt label and option names and values

* Mention crash risk and recommend backups in the warning

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2022-10-25 02:33:08 +00:00
Emma e43fb94a35
Improving touch input by bringing in `videojs-mobile-ui` (#2719)
* Adding videojs-mobile-ui as a dependency

- Using the beta because it fixes an issue
with multiple version of videojs loading
at once.

This is related to MarmadileManteater#56.

* Mapping defaultSkipInterval to seekSeconds

* Adding CSS to prevent showing duplicate buttons

- Added a new variable `usingTouch` to selectively hide
the existing `vjs-big-play-button` when the `touch-overlay`
is visible.

* Renaming CSS class to something more specific

* Adding text-shadow behind play / pause button

This should make it more visually distinct against a
light or colorful background.

* Enabling touch-overlay anytime a touch is detected

Disabling it whenever mouse input is detected

The default behavior of `videojs-mobile-ui` is to
only work in Android and iOS, but by
forcing the touch behavior to be enabled and selectively
showing it only when touch input is detected, it should work
on any device with touch input even if the browser doesn't
detect that it is running in Android or iOS.

* Removing unnecessary code

* Removing unintentionally leftover variable

* Removing an unnecessary assignment

Adding comments to explain why a flag called
`forceForTesting` is set to true

Disabling the `lockOnRotate` flag.

* Moving this flag and wrapper class

* Adding whitespace

* Making my comment a little more consistent

* Changing the punctuation of a comment

* Adjusting the CSS to fix a firefox discrepancy

* Adding a check for mobile firefox

For whatever reason, mobile firefox sometimes
triggers onmouseover when a touch occurs, and this
is unwanted behavior.

* Adding a drop-shadow to the ff and rw icons

This should make them easier to see on top of light
videos

* Hiding the mobile play button according to setting

- Added CSS to hide the videojs-mobile-ui play button
when the `Display Play Button In Video Player` setting is disabled.

* Replacing long computed string with class binding

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Adding newline at the end of videoJS.css

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
2022-10-24 13:49:52 -04:00
Emma 12cfe6a3fb
Convert Invidious comment publishText to locale (#2758) 2022-10-24 17:10:06 +02:00
Emma 6e693c6c37
Implement `getRegionData` in web (#2743)
* Implement `getRegionData` in web

- Adjust __dirname to be a more sensible value
- Add `process.env.GEOLOCATION_NAMES` for web builds to avoid having
to blindly try and fetch

* Reverting webpack changes

* Change `indexOf` to `includes`

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Adding a new helper `createWebURL`

It takes a given path to a resource, and it returns an
 easily fetch-able absolute path

* Using `createWebUrl` inside of the locale fetch

* Using `createWebURL` inside of `getRegionData`

* Removing an unnecessary leftover import

* Wait, no I was mistaken

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
2022-10-22 10:31:34 +02:00
absidue 76d7ecd163
More space for the title in watch-video-info (#2751) 2022-10-20 06:06:04 +00:00
absidue f33ad2e5f0
Fix double focus on the sidebar channels (#2749) 2022-10-20 06:04:49 +00:00
ChunkyProgrammer 2c5c654b66
move `toLocalePublicationString` to`utils/helper` (#2748)
* move toLocalePublicationString to helper

* remove unnecessary assignments

Co-Authored-By: absidue <48293849+absidue@users.noreply.github.com>

* Update src/renderer/components/ft-list-video/ft-list-video.js

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* fix linter issue

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2022-10-20 06:03:31 +00:00
ChunkyProgrammer 7819dcd99f
change `this.showToast` to `showToast` (#2746) 2022-10-19 07:50:09 +00:00
Emma 41b3af033b
Implenting `showSaveDialog` in web (#2741)
* Implementing the web callback for `showSaveDialog`

Using the native filesystem API when it is available

* Adding the `writeFileFromDialog` function

It normalizes the behavior of writing to a file handle
given by a file picker between web and electron

* Refactoring `exportFreeTubeSubscriptions`

Now, it should use the profile data stored in memory
rather than reading it from the file system (which may not
be present in web browsers), and it should also work in web
builds

* Refactoring exportYouTubeSubscriptions

Using the `writeFileFromDialog` function instead of `fs`

* Refactoring the rest of the subscription exports

Using the `writeFileFromDialog` function instead of `fs`

* Refactoring exportHistory

- Using the historyCache stored in memory instead of
reading from `fs` to get the history data
- Using `writeFileFromDialog` instead of `fs.writeFile`

* Refactoring exportPlaylists

Using `writeFileFromDialog` instead of `fs`

* Removing no longer needed `fs` import

* Removing something I was using to debug

* Fixing issue with mime types non populating in save picker

* Adding back an unintentionally removed line
2022-10-19 07:50:21 +02:00
absidue d39512db0a
Minor performance improvement in the general-settings component (#2723) 2022-10-19 09:25:13 +08:00
absidue d8f7d073ce
Remove unused ft-grid component and __static variable (#2744)
* Remove unused ft-grid component

* Remove unused __static variable
2022-10-19 09:09:49 +08:00
Emma a6b86fac9c
Adding filePaths to the web file picker response (#2739)
`filePaths` is now used to decide which `subscription.db`
type to parse, so this is needed here
2022-10-18 17:50:59 +02:00
Emma c26445a09d
Expanding the settings which are iterated in `grabUserSettings` (#2737)
Previously, only settings which have a user defined value would
be iterated on in this loop. Now, all settings that have a user defined
value or that have side effects will be iterated. This is important because
`currentLocale`'s side effect handler contains a call to `getRegionData`,
and if this side effect handler is never called, the `Region for Trending`
option in settings will never populate.
2022-10-18 17:50:40 +02:00
Emma b453b01b81
Adding web support to dev-runner (#2729)
* Adding ytpl and ytsr as externals in web.config

This should get rid of those two warnings that were
showing up on web builds

* Reducing discrepancies between dev and prod in web builds

* Removing  a line which would prevent hot reloading

`this.locales` is retained between hot reloads, so it shouldn't
be set to `null`.

* Adding a new flag to the dev runner

Adding a new command: `run dev:web`

* Running `loadLocale` in development web builds

* Adding a line back which was removed

* Removing a line which was added
2022-10-18 08:50:32 -04:00
absidue f970936d1e
Make copyToClipboard and openExternalLink helpers (#2722) 2022-10-18 08:15:28 +00:00
absidue 294df19f1b
Replace rss-parser with fetch and the native DomParser (#2726) 2022-10-17 16:09:06 +00:00
Emma b5c486bf1f
Fixing some leftover `showToast(obj)` (#2735) 2022-10-17 12:33:20 +00:00
absidue 62c70fbdd6
Fix fetching the comments from invidious (#2721) 2022-10-15 04:01:58 +00:00
absidue 077fde70f1
Fix CTRL+clicking on the channel name on the watch page (#2713) 2022-10-14 06:00:41 +00:00
absidue ad01d2b37d
Make the safe as and open file dialogs blocking (#2712) 2022-10-14 06:00:23 +00:00
absidue 3aa080d707
Make showToast a helper (#2695) 2022-10-14 05:59:49 +00:00
Emma f94d8a9df2
Filtering out invidious instances that don't support the API (#2714)
* Adding two additional checks to the instance filter

- Checking if the instance supports the api at all
- Checking if the instance supports cors in web environments

* Removing instances without API from instances json

* Modifying the hardcoded fallbacks
2022-10-13 22:09:15 +00:00
absidue c0f98eeafe
Use named parameters instead of $ and % in localised strings (#2685)
* Use named parameters instead of $ and % in localised strings

* Fix URL warning again

* Update placeholders in most locales

* Let the translators fix the problematic RTL strings

* Fix the missing quotes in some of the YAML files
2022-10-13 11:51:15 +00:00
Aiz 1695605ab5
Remove deprecated @keypress + some accessability improvements (#2697)
* remove deprecated @keypress from top-nav

* remove deprecated @keypress from side-nav

* add role and tabindex to new window button

it could previously not be selected by tabbing over the buttons
2022-10-12 19:02:39 +02:00
absidue bc8261d970
Move colours from the store to the utils helper (#2710)
* Move colours from the store to the utils helper

* Use a single array for colours
2022-10-12 06:49:12 +00:00
Emma 3c7b143fce
Improving responsiveness in Settings (#2694)
* Removing a `width:auto` which was overriding

the width for a lot of .select-text

* Making the general-settings component not overflow

* Reducing margin in settings when window is narrow

* Moving invidious instance tooltip to reduce overflow

* Reducing the width of sliders to be 100% at maximum

Before this change, the preset width `380px` could easily
be wider than the window.

* Reducing overflow in Theme Settings

- Added breakpoint for theme `select`s
- Added breakpoint for the UI scale slider

* Reducing the remaining overflow in settings

This moves all of the tooltips slightly to the left
when the window is narrow to reduce overflow.

* Expanding the sponsorblock settings to full width

* Moving remaining tooltips into a fixed zone

* Floating the tooltip icon to the right

When the display is narrow, the tooltip
can sometimes overflow, and it is very
difficult to predict how it will overflow
if the tool tip icon comes directly after
a locale string.

This change floats those icons into a
centralized location where the tooltip
can be guaranteed to not overflow.

* Removing some irrelevant changes

* Reducing margin on switches

* Removing bottom margin on the last section

* Making room for overflow ellipsis

* Adding class  `.containsTooltip` to `ft-toggle`

This should make is easier to style the toggles
which contain tooltips specficially.

* Modifying the media query for tooltips

* Adding a media query to reduce data settings margin
2022-10-11 09:38:31 +02:00
efb4f5ff-1298-471a-8973-3d47447115dc 40859b5887
Update index.js (#2706) 2022-10-11 09:26:31 +08:00
absidue 22a5062334
Move calculateColorLuminance, calculatePublishedDate and buildVTTFileLocally out of the store (#2692) 2022-10-10 07:45:18 +00:00
Aiz 7ca6440a88
Add shortcuts for refresh buttons on Subscription, Trending, and Popular views (#2689)
* add shortcut to subscription refresh button

* add shortcut to most popular refresh button

* add shortcut to trending refresh button

* prevent refresh if currently loading
2022-10-09 09:10:57 -04:00
ChunkyProgrammer 41fee01217
Improve Importing Subscriptions (#2604)
* improve import

* fix merge conflicts

* dont add duplicate subscriptions, remove redundant "uniqueId"

* Update src/renderer/components/data-settings/data-settings.js

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* fix unexpected errors

dont show toast when no errors. dont error when already subscribed

* remove check for legacy subscriptions

* rename method

* deduplicate importing code

* remove unused code

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2022-10-09 03:08:34 +02:00
Emma 15d2cbbc8c
Fixing the logic for `isExternalLink` (#2687)
`.href` is computed from the real value of the attribute,
and this was causing an issue where isExternalLink would
classify links that should not be external links as external links.
2022-10-08 22:36:29 +02:00
Emma ec00ee3c04
Hiding two vjs controls when the screen is narrow (#2688)
- If picture and picture is disabled, the control can be hidden
when the available screen real estate is small.
- If the width is under 680, the video is already
almost the width of the entire window, so it makes sense
to hide it.
2022-10-08 22:35:28 +02:00
absidue 0f2fe16583
Move fetching of the sponsorblock segments out of the store (#2684) 2022-10-08 16:23:14 -04:00
absidue 9888005c91
Remove unused property from the invidious store (#2686) 2022-10-08 11:09:08 +08:00
Emma ac5341b309
Replacing `setImmediate` with `setTimeout` (#2683)
* Adding an import for setImmediate

`setImmediate` is a global in node, but
it is technically from the `timers` module,
and it is not global in web.

* Replacing node specific call to `setImmediate`

`setTimeout` is available globally in both node and web
2022-10-07 14:42:13 +00:00
absidue 5677c3182d
Remove jquery from the ft-player component (#2647) 2022-10-05 08:25:50 +00:00
absidue 5cd2e5a7d0
Replace jquery on the trending page (#2663) 2022-10-04 17:56:10 +00:00
absidue 28e07ec0aa
Replace jquery in the profile selector (#2664) 2022-10-04 17:55:55 +00:00
absidue f87014aedc
Replace jquery in live chat and improve the message styling (#2666)
* Replace jquery in live chat and improve the message styling

* Fix the automatic scrolling
2022-10-04 17:55:13 +00:00
Emma 38134bffa0
Centering update prompt card (#2668)
* Making the update prompt card fit inside the window

* Centering the update promptCard using flex
2022-10-04 05:08:26 +00:00
Emma 4a70726216
Adding logic to prevent virtual keyboards (#2667)
from closing the search bar
2022-10-04 10:54:31 +08:00
Emma f722340962
Prevent adding extra `/` when concatenating locale paths (#2665)
* Formatting the locales pathname to be more accurate

Before this change, the URL would refer
`https://localhost//static/locales/${locale}.json`
which technically works in most web browsers,
but it does not work in Cordova at all, so this
changes the links to be more accurately:
`https://localhost/static/locales/${locale}.json`

* Removing usage of `path` because it requires a polyfill/shim

* Linting the code
2022-10-02 23:38:01 +00:00
Aiz 6ddbce2e02
Add setting to disable automatic fetching of subscription feed (#2632)
* Add setting to disable automatic fetching of subscriptions

* rename from load to fetch. fix profile switch auto fetching

* add message for when auto fetch is disabled

* add strings to locale file

* Use a switch column grid for the subscription settings

This matches the layout other settings components

* remove import of now unused ft-flex-box component

* add variable to track if an attempt to fetch has been made.

used so the disable automatic fetch message doesn't block the
empty channels message.

* reduce distance between switches by adding compact=true

* edit tooltip wording
2022-09-29 22:29:47 -04:00
PikachuEXE 21371eec1a
* Update search in new window function to also copy original query text to new window search input (#2637) 2022-09-29 21:22:28 +00:00
absidue bc886af726
Implement chapters (#2224)
* Implement chapters

* Generate chapters locally for the Invidious API backend

* Performance improvements

* More performance improvements

* Improve chapters appearance and add compact mode for Invidious

* Update UI while seeking instead of afterwards

* Invidious extract chapters with range timestamps properly and duplicate chapters

* Minor code improvement

* Add accessibility labels and keyboard navigation

* Add chapter markers

* Fix missing newline at the bottom of ft-video-player.css

* Fix marker placement
2022-09-29 20:01:54 +00:00
absidue 206094aecd
Create video player buttons without jquery (#2636) 2022-09-29 13:15:30 +00:00
Emma f0deb78e6f
Hiding "Disable smooth scroll" option in web (#2638)
* Hiding "smooth-scroll" setting when not electron

- This feature requires the restart of electron and
doesn't work in web builds.

* Removing this comment

- A safeguard was added
- This function won't be called unless IS_ELECTRON is true
2022-09-29 12:24:10 +00:00
absidue 850ed6502c
Fix package.json getting embedded in the release builds (#2635) 2022-09-28 20:55:33 -04:00