Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel community page #1568

Merged
merged 104 commits into from
Mar 4, 2023
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
1df9f73
Comunity page strings, Communtiy tab, Community initial API call
GilgusMaximus Apr 13, 2021
034fc4c
Comunity page strings, Communtiy tab, Community initial API call
GilgusMaximus Apr 13, 2021
736fca5
Data returning added
GilgusMaximus Apr 19, 2021
bce1b5b
Merge
GilgusMaximus Apr 19, 2021
d452ceb
Comunity page strings, Communtiy tab, Community initial API call
GilgusMaximus Apr 13, 2021
13ad637
Data returning added
GilgusMaximus Apr 19, 2021
134159b
Merge branch 'communityPage' of github.com:GilgusMaximus/FreeTube int…
GilgusMaximus Apr 19, 2021
ebfe1c8
Images are now displayed in the community tab
GilgusMaximus Apr 19, 2021
fc747c5
Comunity page strings, Communtiy tab, Community initial API call
GilgusMaximus Apr 13, 2021
5ab0a84
Data returning added
GilgusMaximus Apr 19, 2021
9d6ba3b
Images are now displayed in the community tab
GilgusMaximus Apr 19, 2021
59903db
Added primitive video display
GilgusMaximus Apr 21, 2021
089b450
Current changes
GilgusMaximus May 13, 2021
157db72
Current changes Merge
GilgusMaximus May 13, 2021
f7cb1de
Added preston's change with the ftcard and started on some layout basics
GilgusMaximus May 14, 2021
d28af79
Created Community Post Component and added fetch more button + functi…
GilgusMaximus May 14, 2021
1b012b1
Fixed problem with videothumbnails not loading and adjusted their hei…
GilgusMaximus May 16, 2021
5bfec73
Added poll and ft-list-video to the community page
GilgusMaximus May 16, 2021
5d1485d
Added author name placeholder (missing in module), the published date…
GilgusMaximus May 17, 2021
2b65ffa
Added basis for community page playlists
GilgusMaximus May 31, 2021
63af918
Finalized a setup for playlists when wide enough
GilgusMaximus Jun 1, 2021
3b62b75
Merge
GilgusMaximus Aug 6, 2021
e8b2d83
Fix for missing key in custom list
GilgusMaximus Aug 6, 2021
f7b8075
Added publish date translation
GilgusMaximus Aug 6, 2021
f64d225
Merge branch 'development' into communityPage
PrestonN Aug 16, 2021
7275896
Merge branch 'development' into communityPage
PrestonN Aug 16, 2021
fa0430c
Merge branch 'development' into communityPage
PrestonN Aug 16, 2021
be4130b
Merge branch 'development' into communityPage
PrestonN Aug 16, 2021
2cca684
Add empty alt tags
ChunkyProgrammer Oct 2, 2021
6d49c34
Merge branch 'development' into communityPage
ChunkyProgrammer Oct 2, 2021
4bb3d7b
fix accessibility issue
ChunkyProgrammer Oct 2, 2021
b474a9f
change: ununique ids to classes
ChunkyProgrammer Oct 2, 2021
f5d78a8
add missing alt tag
ChunkyProgrammer Oct 13, 2021
9177412
Merge branch 'development' of https://github.com/FreeTubeApp/FreeTube…
ChunkyProgrammer Nov 14, 2021
e722529
Redirect channel/id/community to the channel's community tab
ChunkyProgrammer Nov 14, 2021
1402439
update yt-channel-info
ChunkyProgrammer Mar 14, 2022
878efc1
update to 3.0.1
ChunkyProgrammer Apr 6, 2022
06b79ee
Update yarn.lock
ChunkyProgrammer Apr 6, 2022
9dcf8d1
Merge branch 'update-ytchannelinfp' into pr/1568
ChunkyProgrammer Apr 7, 2022
cdc4512
add basic multiImage support
ChunkyProgrammer Apr 7, 2022
6fa4811
use tiny-slider for multiImage community posts
ChunkyProgrammer Apr 7, 2022
40bdaf1
Merge branch 'development' into pr/1568
ChunkyProgrammer Apr 8, 2022
408bcac
update getChannelCommunityPostsMore
ChunkyProgrammer Apr 8, 2022
491d24d
Merge remote-tracking branch 'upstream/development' into pr/1568
ChunkyProgrammer May 13, 2022
8db0d75
Merge branch 'development' into pr/1568
ChunkyProgrammer May 24, 2022
480e243
Update yarn.lock
ChunkyProgrammer May 24, 2022
2ba1711
Merge branch 'development' into pr/1568
ChunkyProgrammer Jun 1, 2022
1f6a196
fix yarn lock
ChunkyProgrammer Jun 1, 2022
f7120b1
swap community and about tab
ChunkyProgrammer Jun 2, 2022
bce01d4
Merge branch 'development' into pr/1568
ChunkyProgrammer Jun 20, 2022
c840763
Update yarn.lock
ChunkyProgrammer Jun 20, 2022
340b95c
Merge branch 'development' into communityPage
GilgusMaximus Jul 9, 2022
c7824a1
Fix missing comma
GilgusMaximus Jul 10, 2022
404d07e
Removed trailing spaces
GilgusMaximus Jul 10, 2022
a8e3daf
Clearing all community post data when changing to another channel
GilgusMaximus Jul 13, 2022
77c9411
Restructuring of how the post cards are added, Empty page text,
GilgusMaximus Jul 13, 2022
16222b1
Fixed display text path
GilgusMaximus Jul 13, 2022
7a9a1ca
Fix lint"
GilgusMaximus Jul 13, 2022
486ae51
Adjusted css to fit to new layout
GilgusMaximus Jul 14, 2022
e3f2379
Final touches community page to tidy up the console
GilgusMaximus Jul 14, 2022
aef9ef1
Merge branch 'development' into pr/1568
ChunkyProgrammer Oct 11, 2022
ca80c2f
fix icons, fix linter
ChunkyProgrammer Oct 11, 2022
6a53191
Merge branch 'development' into pr/1568
ChunkyProgrammer Oct 18, 2022
fa3a962
fix hiding showmore button for community page
ChunkyProgrammer Oct 18, 2022
942cfeb
fix showToast calls
ChunkyProgrammer Oct 18, 2022
60ebbf0
change all this.showToast to showToaast
ChunkyProgrammer Oct 18, 2022
b1fbc64
Merge branch 'development' into pr/1568
ChunkyProgrammer Nov 1, 2022
067fdef
reinstall tinyslider
ChunkyProgrammer Nov 1, 2022
692bd8f
use helpers
ChunkyProgrammer Nov 1, 2022
1012e6d
Merge branch 'development' into pr/1568
ChunkyProgrammer Nov 14, 2022
b2e82f1
Merge branch 'development' into pr/1568
ChunkyProgrammer Nov 14, 2022
fa55d8e
small fixes
ChunkyProgrammer Nov 14, 2022
e4af04b
Merge branch 'development' into pr/1568
ChunkyProgrammer Dec 20, 2022
cd155a1
Merge branch 'development' into pr/1568
ChunkyProgrammer Jan 4, 2023
20b7efa
Merge branch 'development' into pr/1568
ChunkyProgrammer Jan 24, 2023
7fde6e6
fix: getting continuation of community posts
ChunkyProgrammer Jan 24, 2023
fe90d99
remove unused code
ChunkyProgrammer Jan 24, 2023
2afdcdf
improve slider style import
ChunkyProgrammer Jan 24, 2023
539cebd
fix hiding 'ShowMore' button
ChunkyProgrammer Jan 24, 2023
9b97007
fix weird typo in css
ChunkyProgrammer Jan 24, 2023
d4ac558
add invidous community tab support
ChunkyProgrammer Jan 24, 2023
e55dac1
remove console testing code
ChunkyProgrammer Jan 24, 2023
302031b
Apply suggestions from code review
ChunkyProgrammer Jan 24, 2023
bf207be
implement suggestions, improve thumbnail replacement
ChunkyProgrammer Jan 24, 2023
174d13b
Merge branch 'communityPage' of https://github.com/GilgusMaximus/Free…
ChunkyProgrammer Jan 24, 2023
70e8bb2
use flip horizontal
ChunkyProgrammer Jan 24, 2023
267c1b9
readd invidious fallback code, remove author name workaround
ChunkyProgrammer Jan 26, 2023
484334b
Merge branch 'development' into pr/1568
ChunkyProgrammer Jan 26, 2023
f64678d
replace another google domain when using invidious
ChunkyProgrammer Jan 26, 2023
bb1dbf0
Merge branch 'development' into pr/1568
ChunkyProgrammer Feb 12, 2023
f6f45b4
suppport invidious multiImage posts
ChunkyProgrammer Feb 12, 2023
480613f
Merge branch 'development' into pr/1568
ChunkyProgrammer Mar 1, 2023
b4f3f53
Use youtube.js for community posts
ChunkyProgrammer Mar 1, 2023
f5d5795
add invidious polls, remove support for fetching more
ChunkyProgrammer Mar 1, 2023
8263864
reorder icons alpabetically
ChunkyProgrammer Mar 1, 2023
17603ab
re-allow loading more when using localapi
ChunkyProgrammer Mar 1, 2023
955a336
fix styling of multiImage, hide NA text
ChunkyProgrammer Mar 1, 2023
6126208
fix loading playlist
ChunkyProgrammer Mar 1, 2023
125b233
fix spacing of items
ChunkyProgrammer Mar 1, 2023
3af757f
fix issue with direct url to community tab
ChunkyProgrammer Mar 1, 2023
9ad7d64
make review recommendations
ChunkyProgrammer Mar 2, 2023
279080c
Merge branch 'development' into pr/1568
ChunkyProgrammer Mar 2, 2023
f30a817
Merge branch 'development' into pr/1568
ChunkyProgrammer Mar 3, 2023
baf282a
fix displaying selected tab, get best quality image
ChunkyProgrammer Mar 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"vue-i18n": "^8.28.2",
"vue-observe-visibility": "^1.0.0",
"vue-router": "^3.6.5",
"vue-tiny-slider": "^0.1.39",
"vuex": "^3.6.2",
"youtubei.js": "^3.1.0"
},
Expand Down
119 changes: 119 additions & 0 deletions src/renderer/components/ft-community-post/ft-community-post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import Vue from 'vue'
import FtListVideo from '../ft-list-video/ft-list-video.vue'
import autolinker from 'autolinker'
import VueTinySlider from 'vue-tiny-slider'

import {
toLocalePublicationString
} from '../../helpers/utils'
import { youtubeImageUrlToInvidious } from '../../helpers/api/invidious'

import 'tiny-slider/dist/tiny-slider.css'

export default Vue.extend({
name: 'FtCommunityPost',
components: {
'ft-list-video': FtListVideo,
'tiny-slider': VueTinySlider
},
props: {
data: {
type: Object,
required: true
},
playlistId: {
type: String,
default: null
},
forceListType: {
type: String,
default: null
},
appearance: {
type: String,
required: true
}
},
data: function () {
return {
postText: '',
postId: '',
authorThumbnails: null,
publishedText: '',
voteCount: '',
postContent: '',
commentCount: '',
isLoading: true,
author: ''
}
},
computed: {
tinySliderOptions: function() {
return {
items: 1,
arrowKeys: true,
controls: false,
autoplay: false,
slideBy: 'page',
navPosition: 'bottom'
}
},

listType: function () {
return this.$store.getters.getListType
}
},
mounted: function () {
this.parseVideoData()
},
methods: {
parseVideoData: function () {
if ('backstagePostThreadRenderer' in this.data) {
this.postText = 'Shared post'
this.type = 'text'
let authorThumbnails = ['', 'https://yt3.ggpht.com/ytc/AAUvwnjm-0qglHJkAHqLFsCQQO97G7cCNDuDLldsrn25Lg=s88-c-k-c0x00ffffff-no-rj']
if (!process.env.IS_ELECTRON || this.backendPreference === 'invidious') {
authorThumbnails = authorThumbnails.map(thumbnail => {
thumbnail.url = youtubeImageUrlToInvidious(thumbnail.url)
return thumbnail
})
}
this.authorThumbnails = authorThumbnails
return
}
this.postText = autolinker.link(this.data.postText)
let authorThumbnails = this.data.authorThumbnails
if (!process.env.IS_ELECTRON || this.backendPreference === 'invidious') {
authorThumbnails = authorThumbnails.map(thumbnail => {
thumbnail.url = youtubeImageUrlToInvidious(thumbnail.url)
return thumbnail
})
} else {
authorThumbnails = authorThumbnails.map(thumbnail => {
if (thumbnail.url.startsWith('//')) {
thumbnail.url = 'https:' + thumbnail.url
}
return thumbnail
})
}
this.authorThumbnails = authorThumbnails
this.postContent = this.data.postContent
this.postId = this.data.postId
this.publishedText = toLocalePublicationString({
publishText: this.data.publishedText,
isLive: this.isLive,
isUpcoming: this.isUpcoming,
isRSS: this.data.isRSS
})
this.voteCount = this.data.voteCount
this.commentCount = this.data.commentCount
this.type = (this.data.postContent !== null && this.data.postContent !== undefined) ? this.data.postContent.type : 'text'
this.author = this.data.author
this.isLoading = false
},

getBestQualityImage(imageArray) {
return imageArray[Math.max(0, imageArray.length - 1)].url
}
}
})
156 changes: 156 additions & 0 deletions src/renderer/components/ft-community-post/ft-community-post.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/* stylelint-disable property-no-vendor-prefix */
@use '../../scss-partials/_ft-list-item';

.outside {
margin: auto;
width: 40%;
}

.circle {
background-color: transparent;
border-radius: 50%;
border-style: solid;
border-width: 2px;
display: block;
float: left;
height: 10px;
left: 5px;
position: relative;
top: 8px;
width: 10px;
}

.poll-text {
border-radius: 5px;
border-style: solid;
border-width: 2px;
padding: 5px 25px;
}

.poll-option {
padding-bottom: 10px;
}

.communityImage {
height: 100%;
width: 100%;
}

.communityThumbnail {
-webkit-border-radius: 50%;
border-radius: 50%;
height: 55px;
margin-right: 5px;
width: 55px;
}

.author-div {
display: flex;

.authorName {
font-size: 15px;
font-weight: bold;
margin: 5px 6px 0 5px;
}

.publishedText {
font-size: 15px;
margin: 5px 6px 0 5px;
}
}

.bottomSection {
color: var(--tertiary-text-color);
display: block;
flex-direction: column;
font-size: 15px;
margin-top: 4px;
max-width: 210px;
text-align: left;

@media screen and (max-width: 680px) {
margin-left: 0;
text-align: left;
}

.likeBar {
border-radius: 4px;
height: 8px;
margin-bottom: 4px;
}

.likeCount {
margin-left: 5px;
margin-right: 6px;
}

.dislikeCount {
margin-right: 10px;
}
}

.playlistWrapper {
display: flex;

.videoThumbnail {
display: flex;
margin-bottom: auto;
margin-top: auto;
position: relative;
width: 50%;

.thumbnailImage {
display: block;
height: auto;
max-width: 100%;
width: auto;
}
}

.playlistText {
margin-left: 10px;
width: 50%;
word-wrap: break-word;

.playlistAuthor {
font-size: small;

.playlistVideoCount {
font-size: smaller;
}
}

.playlistTitle {
color: var(--primary-text-color);
}

.playlistPreviewVideos {
color: var(--primary-text-color);
display: flex;
font-size: small;
padding-top: 10px;
text-decoration-line: none;
width: 100%;
}

.playlistPreviewVideoTitle {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
}
}

.tns-nav .tns-nav-active {
background-color: #999;
}

.tns-nav button {
background-color: #ddd;
border-radius: 50%;
height: 1em;
padding: 0;
width: 1em;
}
Loading