Commit graph

17 commits

Author SHA1 Message Date
Aayush Gupta
4280434aed
Make podcast-playback to be controllable via keyboard (#14139)
* Make podcast-playback to be controllable via keyboard

* Add improved state handling for the play/pause controller

* Fix business logic + Improve HTML semantics

* Remove manual tabIndex addition (not required now)

* Refactor redudant event-listener

* Keep aria-pressed label in sync in all cases

* Code refactor

* Add seed data to create a test podcast

* Add a static file and use that as example podcast episode (#1)

Rather than relying at test time on external media, and requiring the
podcast episode import flow to run during e2e testing, just insert a
canned episode that shows.

Confirmed in cypress this does show after visit('/pod') in the
togglePodcastPlayback.spec.js

* Add cypress test

* Move cypress tests

* Update cypress/integration/seededFlows/podcastFlows/togglePodcastPlayback.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* fix button name in test

Co-authored-by: Daniel Uber <djuber@gmail.com>
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-08-20 12:45:53 +02:00
rhymes
f9506affb5
Use faster JS selection methods (#11409)
* Add JS tips section to frontend documentation

* Replace document.getElementsByTagName('body') with document.body

* Replace querySelectorAll with faster selecting methods where appropriate

* Replace querySelector with faster selecting methods where appropriate

* Fix typo

* Fix forEach and getElementsByClassName

* Change querySelector* to faster methods in erb files

* Change querySelector* to faster methods in ruby files

* Fix runkit tag

* Various fixes

* Update app/assets/javascripts/initializers/initializeEllipsisMenu.js

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update app/assets/javascripts/utilities/slideSidebar.js

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Commenting out flaky spec

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-11-16 17:35:50 +01:00
Fernando Valverde
756acebaed
Podcast + Video player native bridge small refactor (#11345) 2020-11-10 07:36:05 -06:00
Fernando Valverde
9da71a47c7
[deploy] Introduces Runtime class for standardized & other native cleanup + replace podcast GA with ahoy (#10026) 2020-08-28 05:52:04 -06:00
Fernando Valverde
bf740ac5d8
[deploy] Podcast Player native bridge calls refactor to use message based communication (#8054)
* Podcast native bridge calls now message based

* Resets current time to 0 when initializing
2020-05-27 11:14:31 -04:00
Josh Puetz
2abe830377
[deploy] Home Page Feed redesign + top comments (#7579)
* feed cards

* frontend

* preactify

* preactify

* .

* fix

* fixing things and adding dropdown

* whoops.

* whoops 2.

* revert body bg color change

* search snippet

* search snippet

* get rid of featured article

* get rid of featured article...

* cover to its own component

* videos

* videos

* reading time

* small-save-filled asset

* author adjustments

* adjustments

* Author --> Meta

* whoops.

* loader

* logged out state

* .

* dropping what's not needed for now

* better name for cover

* get rid of nav overflow

* bringin comments placeholder back

* bringing comments placeholder back

* publish date

* fix

* date

* .

* save button icon

* ghost button

* lets skip the icon for saving for now

* more buttons

* counting logic

* Display top comments on homepage feed

* Comment list and item components

* Remove 'Top Comments' title

* Remove subscribe button, add reading time

* Update snapshots and tests

* Fix article and follower scrolling

* Added reading time

* (Try) to do flare tags

* Button component from Pawel

* More button styles from Pawel

* Comment count style from Pawel

* Handle empty parens for age on older articles

* Dont show 'more comment' button for more than 2 comments

* cover ratio

* flare tag

* cover fix

* fix buttons

* more button fixes

* tags fix

* responsiveness fix

* reading time  + a bit of responsiveness

* Reading time in more places

* snapshots

* default color for flare tag

* Update CommentsList test snapshot with new styles

* fixing search results

* fixing buttons

* Fix podcast card tests by updating snapshots

* Line clamping for top comments

* Reflect save button state after click before mouseout

* Now the entire feed card is clickable. (#7638)

* Now pointer cursor is only on feed posts. (#7727)

* Revert podcast card styling

* Update test snapshot

* merge

* Fix rspec on feed page

* Reduce complexity of class check for feed card clicking

* PR feedback/fixes

* Fix featured article test and snapshot

* Last minute test tweaks

* clean up crayons

* padding issue + empty div

* Correct merge error

* Fix search results tests

* Test fixes and snapshot updates

* themes

* podcasts colors

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-12 07:57:57 -05:00
Fernando Valverde
8f567524f7
Adds an extra check for Android Native app for playing podcasts (#7651) 2020-05-01 15:04:26 -04:00
Fernando Valverde
96c27ecdc6
[deploy] Android native audio feature support (#7554)
* First commit Android Bridge for Podcasts

* Working Android Bridge controls

* Adds Android metadata message & cleans up a couple longs functions

* Brings back use strict

* Cleans up a bit the conditional for either ios/android native players
2020-05-01 13:09:05 -04:00
Fernando Valverde
f2ee0378f9
[deploy] Decorator podcast episode metadata (#7303)
* Moves podcast episode metadata to decorator

* Updates the podcast episode metadata to use image_url

* Syntax tweaks, initializeMedia() fix for initialized audio & brought back use strict
2020-04-17 12:52:11 -06:00
Fernando Valverde
14c13cb33b
Adds Podcast Episode metadata as JSON to avoid scraping the HTML (#6727) [deploy]
* Adds Podcast Episode metadata as JSON to avoid scraping the HTML

* Uses app_url helper instead of app_protocol_and_domain string interpolation for podcastImageUrl

* Adds podcast_episode#mobile_player_metadata, cleans eslint/codeclimate mess I made & adds tests

* Removes an extra line to fix codeclimate

* Removes unnecessary return
2020-03-20 10:28:24 -04:00
Fernando Valverde
0bc7b0ea21
Podcast playback update for iOS app native implementation (#6035) [deploy]
* First experiment with supressing audio playback on native iOS

* Adds load audio message posting

* First version of refactor working on web

* handlePodcastMessages now receives messages sent into JS from native iOS app

* bump back to "v2" local storage key or playback state

* terminatePodcastBar now clears the currentAudioState

* function getMediaState now initializeMedia, fixes audioExistAndIsPlaying for web, better playAudio error management & others

* Fixes bug in playAudio() & clears audioInitialized when no Podcast was initialized

* Codeclimate tweaks

* Reorders functions to comply with codeclimate

* More codeclimate reordering & fixes

* Upgrades the audio bridge messages to JSON instead of strings

* codeclimate doh
2020-03-09 12:09:42 -04:00
Ben Halpern
e9252bcd10
Fix podcast NaN time issue (#5513) [deploy] 2020-01-14 15:30:11 -05:00
Ben Halpern
c0a7c17054
Modify podcast design details and functionality (#5472) [deploy]
* Modify podcast design details and functionality

* Adjust play button size

* Add heroku slug commit to some cache keys
2020-01-14 13:56:47 -05:00
Gabe Dunn
1c1a2e44fb update muteUnmute to use ternaries instead of if/else to avoid duplicated code (#4442) 2019-10-15 17:12:27 -04:00
Anna Buianova
445bb0952c Open a page in a new tab w/o warning when playing a podcast #2958 (#3499) 2019-07-18 09:51:08 -04:00
Ben Halpern
c76abbbdb3
Allow users to follow podcasts (#2690)
* Allow users to follow podcasts

* Only display podcasts user follows

* Add main_color_hex to factory

* Fix podcast test and modify styles

* Fix tests

* Remove weird test
2019-05-04 15:30:40 -04:00
Mac Siri
c35544a154 Replace sprocket-es6 with new uglifier feature (#928) 2018-10-19 13:12:07 -04:00
Renamed from app/assets/javascripts/initializers/initializePodcastPlayback.es6 (Browse further)