diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js
index ea46ce6f..e07bb7a2 100644
--- a/build/webpack.base.conf.js
+++ b/build/webpack.base.conf.js
@@ -95,7 +95,8 @@ module.exports = {
},
plugins: [
new ServiceWorkerWebpackPlugin({
- entry: path.join(__dirname, '..', 'src/sw.js')
+ entry: path.join(__dirname, '..', 'src/sw.js'),
+ filename: 'sw-pleroma.js'
})
]
}
diff --git a/src/App.js b/src/App.js
index 85df9416..18bff2dd 100644
--- a/src/App.js
+++ b/src/App.js
@@ -6,6 +6,7 @@ import InstanceSpecificPanel from './components/instance_specific_panel/instance
import FeaturesPanel from './components/features_panel/features_panel.vue'
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
import ChatPanel from './components/chat_panel/chat_panel.vue'
+import MediaModal from './components/media_modal/media_modal.vue'
import SideDrawer from './components/side_drawer/side_drawer.vue'
import { unseenNotificationsFromStore } from './services/notification_utils/notification_utils'
@@ -20,6 +21,7 @@ export default {
FeaturesPanel,
WhoToFollowPanel,
ChatPanel,
+ MediaModal,
SideDrawer
},
data: () => ({
@@ -79,7 +81,8 @@ export default {
},
unseenNotificationsCount () {
return this.unseenNotifications.length
- }
+ },
+ showFeaturesPanel () { return this.$store.state.config.showFeaturesPanel }
},
methods: {
scrollToTop () {
diff --git a/src/App.scss b/src/App.scss
index ed06bbbc..d3721b32 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -425,6 +425,12 @@ main-router {
border-radius: 0 0 $fallback--panelRadius $fallback--panelRadius;
border-radius: 0 0 var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius);
+
+ .faint {
+ color: $fallback--faint;
+ color: var(--panelFaint, $fallback--faint);
+ }
+
a {
color: $fallback--link;
color: var(--panelLink, $fallback--link)
@@ -499,7 +505,7 @@ nav {
}
.main {
- flex-basis: 60%;
+ flex-basis: 50%;
flex-grow: 1;
flex-shrink: 1;
}
@@ -533,7 +539,7 @@ nav {
}
}
-@media all and (min-width: 960px) {
+@media all and (min-width: 800px) {
body {
overflow-y: scroll;
}
@@ -617,7 +623,7 @@ nav {
color: $fallback--faint;
color: var(--faint, $fallback--faint);
}
-@media all and (min-width: 959px) {
+@media all and (min-width: 800px) {
.logo {
opacity: 1 !important;
}
@@ -654,7 +660,34 @@ nav {
border-radius: var(--inputRadius, $fallback--inputRadius);
}
-@media all and (max-width: 959px) {
+@keyframes shakeError {
+ 0% {
+ transform: translateX(0);
+ }
+ 15% {
+ transform: translateX(0.375rem);
+ }
+ 30% {
+ transform: translateX(-0.375rem);
+ }
+ 45% {
+ transform: translateX(0.375rem);
+ }
+ 60% {
+ transform: translateX(-0.375rem);
+ }
+ 75% {
+ transform: translateX(0.375rem);
+ }
+ 90% {
+ transform: translateX(-0.375rem);
+ }
+ 100% {
+ transform: translateX(0);
+ }
+}
+
+@media all and (max-width: 800px) {
.mobile-hidden {
display: none;
}
diff --git a/src/App.vue b/src/App.vue
index feadb009..082c6cb6 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -29,7 +29,7 @@
-
+
@@ -41,6 +41,7 @@
+
diff --git a/src/assets/nsfw.png b/src/assets/nsfw.png
index 42749033..d2513776 100644
Binary files a/src/assets/nsfw.png and b/src/assets/nsfw.png differ
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 50500582..5693dcc6 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -89,6 +89,8 @@ const afterStoreSetup = ({ store, i18n }) => {
if ((config.chatDisabled)) {
store.dispatch('disableChat')
+ } else {
+ store.dispatch('initializeSocket')
}
const router = new VueRouter({
diff --git a/src/boot/routes.js b/src/boot/routes.js
index 9dba532a..cfbcb1fe 100644
--- a/src/boot/routes.js
+++ b/src/boot/routes.js
@@ -39,7 +39,7 @@ export default (store) => {
{ name: 'dms', path: '/users/:username/dms', component: DMs },
{ name: 'settings', path: '/settings', component: Settings },
{ name: 'registration', path: '/registration', component: Registration },
- { name: 'registration', path: '/registration/:token', component: Registration },
+ { name: 'registration-token', path: '/registration/:token', component: Registration },
{ name: 'friend-requests', path: '/friend-requests', component: FollowRequests },
{ name: 'user-settings', path: '/user-settings', component: UserSettings },
{ name: 'notifications', path: '/:username/notifications', component: Notifications },
diff --git a/src/components/about/about.js b/src/components/about/about.js
index b4433b4e..b1ce3c7d 100644
--- a/src/components/about/about.js
+++ b/src/components/about/about.js
@@ -7,6 +7,9 @@ const About = {
InstanceSpecificPanel,
FeaturesPanel,
TermsOfServicePanel
+ },
+ computed: {
+ showFeaturesPanel () { return this.$store.state.config.showFeaturesPanel }
}
}
diff --git a/src/components/about/about.vue b/src/components/about/about.vue
index bf87e0b8..13dec87c 100644
--- a/src/components/about/about.vue
+++ b/src/components/about/about.vue
@@ -1,7 +1,7 @@
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index 9212b74b..3b7f08dc 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -1,4 +1,5 @@
import StillImage from '../still-image/still-image.vue'
+import VideoAttachment from '../video_attachment/video_attachment.vue'
import nsfwImage from '../../assets/nsfw.png'
import fileTypeService from '../../services/file_type/file_type.service.js'
@@ -7,23 +8,29 @@ const Attachment = {
'attachment',
'nsfw',
'statusId',
- 'size'
+ 'size',
+ 'allowPlay',
+ 'setMedia'
],
data () {
return {
nsfwImage: this.$store.state.instance.nsfwCensorImage || nsfwImage,
hideNsfwLocal: this.$store.state.config.hideNsfw,
preloadImage: this.$store.state.config.preloadImage,
- loopVideo: this.$store.state.config.loopVideo,
- showHidden: false,
loading: false,
- img: fileTypeService.fileType(this.attachment.mimetype) === 'image' && document.createElement('img')
+ img: fileTypeService.fileType(this.attachment.mimetype) === 'image' && document.createElement('img'),
+ modalOpen: false,
+ showHidden: false
}
},
components: {
- StillImage
+ StillImage,
+ VideoAttachment
},
computed: {
+ usePlaceHolder () {
+ return this.size === 'hide' || this.type === 'unknown'
+ },
referrerpolicy () {
return this.$store.state.instance.mediaProxyAvailable ? '' : 'no-referrer'
},
@@ -40,7 +47,7 @@ const Attachment = {
return this.size === 'small'
},
fullwidth () {
- return fileTypeService.fileType(this.attachment.mimetype) === 'html'
+ return this.type === 'html' || this.type === 'audio'
}
},
methods: {
@@ -49,7 +56,24 @@ const Attachment = {
window.open(target.href, '_blank')
}
},
- toggleHidden () {
+ openModal (event) {
+ const modalTypes = this.$store.state.config.playVideosInModal
+ ? ['image', 'video']
+ : ['image']
+ if (fileTypeService.fileMatchesSomeType(modalTypes, this.attachment) ||
+ this.usePlaceHolder
+ ) {
+ event.stopPropagation()
+ event.preventDefault()
+ this.setMedia()
+ this.$store.dispatch('setCurrent', this.attachment)
+ }
+ },
+ toggleHidden (event) {
+ if (this.$store.state.config.useOneClickNsfw && !this.showHidden) {
+ this.openModal(event)
+ return
+ }
if (this.img && !this.preloadImage) {
if (this.img.onload) {
this.img.onload()
@@ -64,23 +88,6 @@ const Attachment = {
} else {
this.showHidden = !this.showHidden
}
- },
- onVideoDataLoad (e) {
- if (typeof e.srcElement.webkitAudioDecodedByteCount !== 'undefined') {
- // non-zero if video has audio track
- if (e.srcElement.webkitAudioDecodedByteCount > 0) {
- this.loopVideo = this.loopVideo && !this.$store.state.config.loopVideoSilentOnly
- }
- } else if (typeof e.srcElement.mozHasAudio !== 'undefined') {
- // true if video has audio track
- if (e.srcElement.mozHasAudio) {
- this.loopVideo = this.loopVideo && !this.$store.state.config.loopVideoSilentOnly
- }
- } else if (typeof e.srcElement.audioTracks !== 'undefined') {
- if (e.srcElement.audioTracks.length > 0) {
- this.loopVideo = this.loopVideo && !this.$store.state.config.loopVideoSilentOnly
- }
- }
}
}
}
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue
index d7f25953..7e972026 100644
--- a/src/components/attachment/attachment.vue
+++ b/src/components/attachment/attachment.vue
@@ -1,19 +1,44 @@
-
-
[{{nsfw ? "NSFW/" : ""}}{{type.toUpperCase()}}]
+
-
-
-
+
+
+
+
-
-
+
+
+
-
+
+
+
+
@@ -40,12 +65,17 @@
.attachment.media-upload-container {
flex: 0 0 auto;
- max-height: 300px;
+ max-height: 200px;
max-width: 100%;
+ display: flex;
+ video {
+ max-width: 100%;
+ }
}
.placeholder {
- margin-right: 0.5em;
+ margin-right: 8px;
+ margin-bottom: 4px;
}
.nsfw-placeholder {
@@ -56,17 +86,9 @@
}
}
- .small-attachment {
- &.image, &.video {
- max-width: 35%;
- }
- max-height: 100px;
- }
-
.attachment {
position: relative;
- flex: 1 0 30%;
- margin: 0.5em 0.7em 0.6em 0.0em;
+ margin: 0.5em 0.5em 0em 0em;
align-self: flex-start;
line-height: 0;
@@ -78,6 +100,28 @@
border-color: var(--border, $fallback--border);
overflow: hidden;
}
+
+ .non-gallery.attachment {
+ &.video {
+ flex: 1 0 40%;
+ }
+ .nsfw {
+ height: 260px;
+ }
+ .small {
+ height: 120px;
+ flex-grow: 0;
+ }
+ .video {
+ height: 260px;
+ display: flex;
+ }
+ video {
+ max-height: 100%;
+ object-fit: contain;
+ }
+ }
+
.fullwidth {
flex-basis: 100%;
}
@@ -86,6 +130,28 @@
line-height: 0;
}
+ .video-container {
+ display: flex;
+ max-height: 100%;
+ }
+
+ .video {
+ width: 100%;
+ }
+
+ .play-icon {
+ position: absolute;
+ font-size: 64px;
+ top: calc(50% - 32px);
+ left: calc(50% - 32px);
+ color: rgba(255, 255, 255, 0.75);
+ text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
+ }
+
+ .play-icon::before {
+ margin: 0;
+ }
+
&.html {
flex-basis: 90%;
width: 100%;
@@ -94,6 +160,7 @@
.hider {
position: absolute;
+ white-space: nowrap;
margin: 10px;
padding: 5px;
background: rgba(230,230,230,0.6);
@@ -104,13 +171,7 @@
border-radius: var(--tooltipRadius, $fallback--tooltipRadius);
}
- .small {
- max-height: 100px;
- }
video {
- max-height: 500px;
- height: 100%;
- width: 100%;
z-index: 0;
}
@@ -120,7 +181,7 @@
img.media-upload {
line-height: 0;
- max-height: 300px;
+ max-height: 200px;
max-width: 100%;
}
@@ -157,29 +218,20 @@
}
.image-attachment {
- display: flex;
- flex: 1;
+ width: 100%;
+ height: 100%;
&.hidden {
display: none;
}
- .still-image {
+ .nsfw {
+ object-fit: cover;
width: 100%;
height: 100%;
}
- .small {
- img {
- max-height: 100px;
- }
- }
-
img {
- object-fit: contain;
- width: 100%;
- height: 100%; /* If this isn't here, chrome will stretch the images */
- max-height: 500px;
image-orientation: from-image;
}
}
diff --git a/src/components/follow_list/follow_list.js b/src/components/follow_list/follow_list.js
new file mode 100644
index 00000000..6d00eb94
--- /dev/null
+++ b/src/components/follow_list/follow_list.js
@@ -0,0 +1,62 @@
+import UserCard from '../user_card/user_card.vue'
+
+const FollowList = {
+ data () {
+ return {
+ loading: false,
+ bottomedOut: false,
+ error: false
+ }
+ },
+ props: ['userId', 'showFollowers'],
+ created () {
+ window.addEventListener('scroll', this.scrollLoad)
+ if (this.entries.length === 0) {
+ this.fetchEntries()
+ }
+ },
+ destroyed () {
+ window.removeEventListener('scroll', this.scrollLoad)
+ this.$store.dispatch('clearFriendsAndFollowers', this.userId)
+ },
+ computed: {
+ user () {
+ return this.$store.getters.userById(this.userId)
+ },
+ entries () {
+ return this.showFollowers ? this.user.followers : this.user.friends
+ }
+ },
+ methods: {
+ fetchEntries () {
+ if (!this.loading) {
+ const command = this.showFollowers ? 'addFollowers' : 'addFriends'
+ this.loading = true
+ this.$store.dispatch(command, this.userId).then(entries => {
+ this.error = false
+ this.loading = false
+ this.bottomedOut = entries.length === 0
+ }).catch(() => {
+ this.error = true
+ this.loading = false
+ })
+ }
+ },
+ scrollLoad (e) {
+ const bodyBRect = document.body.getBoundingClientRect()
+ const height = Math.max(bodyBRect.height, -(bodyBRect.y))
+ if (this.loading === false &&
+ this.bottomedOut === false &&
+ this.$el.offsetHeight > 0 &&
+ (window.innerHeight + window.pageYOffset) >= (height - 750)
+ ) {
+ this.fetchEntries()
+ }
+ }
+ },
+ components: {
+ UserCard
+ }
+}
+
+export default FollowList
diff --git a/src/components/follow_list/follow_list.vue b/src/components/follow_list/follow_list.vue
new file mode 100644
index 00000000..24ab97d8
--- /dev/null
+++ b/src/components/follow_list/follow_list.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js
new file mode 100644
index 00000000..7f33a81b
--- /dev/null
+++ b/src/components/gallery/gallery.js
@@ -0,0 +1,55 @@
+import Attachment from '../attachment/attachment.vue'
+import { chunk, last, dropRight } from 'lodash'
+
+const Gallery = {
+ data: () => ({
+ width: 500
+ }),
+ props: [
+ 'attachments',
+ 'nsfw',
+ 'setMedia'
+ ],
+ components: { Attachment },
+ mounted () {
+ this.resize()
+ window.addEventListener('resize', this.resize)
+ },
+ destroyed () {
+ window.removeEventListener('resize', this.resize)
+ },
+ computed: {
+ rows () {
+ if (!this.attachments) {
+ return []
+ }
+ const rows = chunk(this.attachments, 3)
+ if (last(rows).length === 1 && rows.length > 1) {
+ // if 1 attachment on last row -> add it to the previous row instead
+ const lastAttachment = last(rows)[0]
+ const allButLastRow = dropRight(rows)
+ last(allButLastRow).push(lastAttachment)
+ return allButLastRow
+ }
+ return rows
+ },
+ rowHeight () {
+ return itemsPerRow => ({ 'height': `${(this.width / (itemsPerRow + 0.6))}px` })
+ },
+ useContainFit () {
+ return this.$store.state.config.useContainFit
+ }
+ },
+ methods: {
+ resize () {
+ // Quick optimization to make resizing not always trigger state change,
+ // only update attachment size in 10px steps
+ const width = Math.floor(this.$el.getBoundingClientRect().width / 10) * 10
+ if (this.width !== width) {
+ this.width = width
+ }
+ }
+ }
+}
+
+export default Gallery
diff --git a/src/components/gallery/gallery.vue b/src/components/gallery/gallery.vue
new file mode 100644
index 00000000..3f90caa9
--- /dev/null
+++ b/src/components/gallery/gallery.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
diff --git a/src/components/link-preview/link-preview.js b/src/components/link-preview/link-preview.js
new file mode 100644
index 00000000..2f6da55e
--- /dev/null
+++ b/src/components/link-preview/link-preview.js
@@ -0,0 +1,21 @@
+const LinkPreview = {
+ name: 'LinkPreview',
+ props: [
+ 'card',
+ 'size',
+ 'nsfw'
+ ],
+ computed: {
+ useImage () {
+ // Currently BE shoudn't give cards if tagged NSFW, this is a bit paranoid
+ // as it makes sure to hide the image if somehow NSFW tagged preview can
+ // exist.
+ return this.card.image && !this.nsfw && this.size !== 'hide'
+ },
+ useDescription () {
+ return this.card.description && /\S/.test(this.card.description)
+ }
+ }
+}
+
+export default LinkPreview
diff --git a/src/components/link-preview/link-preview.vue b/src/components/link-preview/link-preview.vue
new file mode 100644
index 00000000..e4a247c5
--- /dev/null
+++ b/src/components/link-preview/link-preview.vue
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js
index 013222a8..fb6dc651 100644
--- a/src/components/login_form/login_form.js
+++ b/src/components/login_form/login_form.js
@@ -22,19 +22,29 @@ const LoginForm = {
oauth: this.$store.state.oauth,
instance: this.$store.state.instance.server
}
+ this.clearError()
oauthApi.getOrCreateApp(data).then((app) => {
oauthApi.getTokenWithCredentials(
{
app,
instance: data.instance,
username: this.user.username,
- password: this.user.password})
- .then((result) => {
- this.$store.commit('setToken', result.access_token)
- this.$store.dispatch('loginUser', result.access_token)
- this.$router.push({name: 'friends'})
- })
+ password: this.user.password
+ }
+ ).then((result) => {
+ if (result.error) {
+ this.authError = result.error
+ this.user.password = ''
+ return
+ }
+ this.$store.commit('setToken', result.access_token)
+ this.$store.dispatch('loginUser', result.access_token)
+ this.$router.push({name: 'friends'})
+ })
})
+ },
+ clearError () {
+ this.authError = false
}
}
}
diff --git a/src/components/login_form/login_form.vue b/src/components/login_form/login_form.vue
index 12971882..27a8e48a 100644
--- a/src/components/login_form/login_form.vue
+++ b/src/components/login_form/login_form.vue
@@ -33,6 +33,13 @@
+
+
@@ -48,10 +55,6 @@
width: 10em;
}
- .error {
- text-align: center;
- }
-
.register {
flex: 1 1;
}
@@ -64,4 +67,14 @@
justify-content: space-between;
}
}
+
+.login {
+ .error {
+ text-align: center;
+
+ animation-name: shakeError;
+ animation-duration: 0.4s;
+ animation-timing-function: ease-in-out;
+ }
+}
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js
new file mode 100644
index 00000000..14ae19d4
--- /dev/null
+++ b/src/components/media_modal/media_modal.js
@@ -0,0 +1,38 @@
+import StillImage from '../still-image/still-image.vue'
+import VideoAttachment from '../video_attachment/video_attachment.vue'
+import fileTypeService from '../../services/file_type/file_type.service.js'
+
+const MediaModal = {
+ components: {
+ StillImage,
+ VideoAttachment
+ },
+ computed: {
+ showing () {
+ return this.$store.state.mediaViewer.activated
+ },
+ currentIndex () {
+ return this.$store.state.mediaViewer.currentIndex
+ },
+ currentMedia () {
+ return this.$store.state.mediaViewer.media[this.currentIndex]
+ },
+ type () {
+ return this.currentMedia ? fileTypeService.fileType(this.currentMedia.mimetype) : null
+ }
+ },
+ created () {
+ document.addEventListener('keyup', e => {
+ if (e.keyCode === 27 && this.showing) { // escape
+ this.hide()
+ }
+ })
+ },
+ methods: {
+ hide () {
+ this.$store.dispatch('closeMediaViewer')
+ }
+ }
+}
+
+export default MediaModal
diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
new file mode 100644
index 00000000..796d4e40
--- /dev/null
+++ b/src/components/media_modal/media_modal.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js
index 42d900d3..1c874faa 100644
--- a/src/components/media_upload/media_upload.js
+++ b/src/components/media_upload/media_upload.js
@@ -3,19 +3,10 @@ import statusPosterService from '../../services/status_poster/status_poster.serv
import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
const mediaUpload = {
- mounted () {
- const input = this.$el.querySelector('input')
-
- input.addEventListener('change', ({target}) => {
- for (var i = 0; i < target.files.length; i++) {
- let file = target.files[i]
- this.uploadFile(file)
- }
- })
- },
data () {
return {
- uploading: false
+ uploading: false,
+ uploadReady: true
}
},
methods: {
@@ -56,6 +47,18 @@ const mediaUpload = {
} else {
e.dataTransfer.dropEffect = 'none'
}
+ },
+ clearFile () {
+ this.uploadReady = false
+ this.$nextTick(() => {
+ this.uploadReady = true
+ })
+ },
+ change ({target}) {
+ for (var i = 0; i < target.files.length; i++) {
+ let file = target.files[i]
+ this.uploadFile(file)
+ }
}
},
props: [
diff --git a/src/components/media_upload/media_upload.vue b/src/components/media_upload/media_upload.vue
index 768d3565..fcdc3471 100644
--- a/src/components/media_upload/media_upload.vue
+++ b/src/components/media_upload/media_upload.vue
@@ -3,7 +3,7 @@
diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue
index ad7c53f9..3aa0a793 100644
--- a/src/components/nav_panel/nav_panel.vue
+++ b/src/components/nav_panel/nav_panel.vue
@@ -44,6 +44,7 @@
.nav-panel .panel {
overflow: hidden;
+ box-shadow: var(--panelShadow);
}
.nav-panel ul {
list-style: none;
diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js
index f95a329f..7d9807de 100644
--- a/src/components/notification/notification.js
+++ b/src/components/notification/notification.js
@@ -1,5 +1,5 @@
import Status from '../status/status.vue'
-import StillImage from '../still-image/still-image.vue'
+import UserAvatar from '../user_avatar/user_avatar.vue'
import UserCardContent from '../user_card_content/user_card_content.vue'
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
@@ -13,7 +13,7 @@ const Notification = {
},
props: [ 'notification' ],
components: {
- Status, StillImage, UserCardContent
+ Status, UserAvatar, UserCardContent
},
methods: {
toggleUserExpanded () {
diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue
index f91c90cc..a0a55cba 100644
--- a/src/components/notification/notification.vue
+++ b/src/components/notification/notification.vue
@@ -2,7 +2,7 @@
-
+
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index ea32bbd0..5e95631a 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -13,6 +13,11 @@ const Notifications = {
notificationsFetcher.startFetching({ store, credentials })
},
+ data () {
+ return {
+ bottomedOut: false
+ }
+ },
computed: {
notifications () {
return notificationsFromStore(this.$store)
@@ -28,6 +33,9 @@ const Notifications = {
},
unseenCount () {
return this.unseenNotifications.length
+ },
+ loading () {
+ return this.$store.state.statuses.notifications.loading
}
},
components: {
@@ -49,10 +57,16 @@ const Notifications = {
fetchOlderNotifications () {
const store = this.$store
const credentials = store.state.users.currentUser.credentials
+ store.commit('setNotificationsLoading', { value: true })
notificationsFetcher.fetchAndUpdate({
store,
credentials,
older: true
+ }).then(notifs => {
+ store.commit('setNotificationsLoading', { value: false })
+ if (notifs.length === 0) {
+ this.bottomedOut = true
+ }
})
}
}
diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss
index 5c4ca1b9..bc81d45c 100644
--- a/src/components/notifications/notifications.scss
+++ b/src/components/notifications/notifications.scss
@@ -36,26 +36,7 @@
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
- .avatar-compact {
- width: 32px;
- height: 32px;
- box-shadow: var(--avatarStatusShadow);
- border-radius: $fallback--avatarAltRadius;
- border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
- overflow: hidden;
- line-height: 0;
-
- &.better-shadow {
- box-shadow: var(--avatarStatusShadowInset);
- filter: var(--avatarStatusShadowFilter)
- }
-
- &.animated::before {
- display: none;
- }
- }
-
- &:hover .animated.avatar-compact {
+ &:hover .animated.avatar {
canvas {
display: none;
}
diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue
index 64f18720..6f162b62 100644
--- a/src/components/notifications/notifications.vue
+++ b/src/components/notifications/notifications.vue
@@ -18,10 +18,15 @@
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 8a4e2489..5e8c2252 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -16,7 +16,7 @@ const buildMentionsString = ({user, attentions}, currentUser) => {
return `@${attention.screen_name}`
})
- return mentions.join(' ') + ' '
+ return mentions.length > 0 ? mentions.join(' ') + ' ' : ''
}
const PostStatusForm = {
@@ -250,6 +250,7 @@ const PostStatusForm = {
visibility: newStatus.visibility,
contentType: newStatus.contentType
}
+ this.$refs.mediaUpload.clearFile()
this.$emit('posted')
let el = this.$el.querySelector('textarea')
el.style.height = 'auto'
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 398f1871..e09ad37f 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -64,7 +64,7 @@
-
+
{{ charactersLeft }}
{{ charactersLeft }}
diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue
index 25c1a9d0..f428ead3 100644
--- a/src/components/registration/registration.vue
+++ b/src/components/registration/registration.vue
@@ -147,24 +147,6 @@ $validations-cRed: #f04124;
margin-bottom: 1em;
}
- @keyframes shakeError {
- 0% {
- transform: translateX(0); }
- 15% {
- transform: translateX(0.375rem); }
- 30% {
- transform: translateX(-0.375rem); }
- 45% {
- transform: translateX(0.375rem); }
- 60% {
- transform: translateX(-0.375rem); }
- 75% {
- transform: translateX(0.375rem); }
- 90% {
- transform: translateX(-0.375rem); }
- 100% {
- transform: translateX(0); } }
-
.form-group--error {
animation-name: shakeError;
animation-duration: .6s;
@@ -215,7 +197,7 @@ $validations-cRed: #f04124;
}
}
-@media all and (max-width: 959px) {
+@media all and (max-width: 800px) {
.registration-form .container {
flex-direction: column-reverse;
}
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
index d45ec72d..8d138485 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -1,5 +1,5 @@
/* eslint-env browser */
-import TabSwitcher from '../tab_switcher/tab_switcher.jsx'
+import TabSwitcher from '../tab_switcher/tab_switcher.js'
import StyleSwitcher from '../style_switcher/style_switcher.vue'
import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue'
import { filter, trim } from 'lodash'
@@ -13,6 +13,7 @@ const settings = {
hideAttachmentsLocal: user.hideAttachments,
hideAttachmentsInConvLocal: user.hideAttachmentsInConv,
hideNsfwLocal: user.hideNsfw,
+ useOneClickNsfw: user.useOneClickNsfw,
hideISPLocal: user.hideISP,
preloadImage: user.preloadImage,
@@ -29,7 +30,6 @@ const settings = {
notificationVisibilityLocal: user.notificationVisibility,
replyVisibilityLocal: user.replyVisibility,
loopVideoLocal: user.loopVideo,
- loopVideoSilentOnlyLocal: user.loopVideoSilentOnly,
muteWordsString: user.muteWords.join('\n'),
autoLoadLocal: user.autoLoad,
streamingLocal: user.streaming,
@@ -58,13 +58,16 @@ const settings = {
stopGifs: user.stopGifs,
webPushNotificationsLocal: user.webPushNotifications,
+ loopVideoSilentOnlyLocal: user.loopVideosSilentOnly,
loopSilentAvailable:
// Firefox
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
// Chrome-likes
Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
// Future spec, still not supported in Nightly 63 as of 08/2018
- Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks')
+ Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks'),
+ playVideosInModal: user.playVideosInModal,
+ useContainFit: user.useContainFit
}
},
components: {
@@ -96,6 +99,9 @@ const settings = {
hideNsfwLocal (value) {
this.$store.dispatch('setOption', { name: 'hideNsfw', value })
},
+ useOneClickNsfw (value) {
+ this.$store.dispatch('setOption', { name: 'useOneClickNsfw', value })
+ },
preloadImage (value) {
this.$store.dispatch('setOption', { name: 'preloadImage', value })
},
@@ -157,6 +163,12 @@ const settings = {
webPushNotificationsLocal (value) {
this.$store.dispatch('setOption', { name: 'webPushNotifications', value })
if (value) this.$store.dispatch('registerPushNotifications')
+ },
+ playVideosInModal (value) {
+ this.$store.dispatch('setOption', { name: 'playVideosInModal', value })
+ },
+ useContainFit (value) {
+ this.$store.dispatch('setOption', { name: 'useContainFit', value })
}
}
}
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index 39125009..9953780f 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -123,6 +123,10 @@
+
+
+
+
@@ -141,6 +145,14 @@
+
+
+
+
+
+
+
+
diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js
index 754a57e0..40ffa1dd 100644
--- a/src/components/side_drawer/side_drawer.js
+++ b/src/components/side_drawer/side_drawer.js
@@ -26,6 +26,12 @@ const SideDrawer = {
},
suggestionsEnabled () {
return this.$store.state.instance.suggestionsEnabled
+ },
+ logo () {
+ return this.$store.state.instance.logo
+ },
+ sitename () {
+ return this.$store.state.instance.name
}
},
methods: {
diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue
index fc90977b..a6c6f237 100644
--- a/src/components/side_drawer/side_drawer.vue
+++ b/src/components/side_drawer/side_drawer.vue
@@ -8,8 +8,11 @@
@touchmove="touchMove"
>
-
-
+
+
+
+
{{sitename}}
+
-
@@ -141,6 +144,24 @@
background-color: var(--bg, $fallback--bg);
}
+.side-drawer-logo-wrapper {
+ display: flex;
+ align-items: center;
+ padding: 0.85em;
+
+ img {
+ flex: none;
+ height: 50px;
+ margin-right: 0.85em;
+ }
+
+ span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+}
+
.side-drawer-click-outside-closed {
flex: 0 0 0;
}
@@ -154,7 +175,6 @@
flex-direction: column;
align-items: stretch;
display: flex;
- min-height: 7em;
padding: 0;
margin: 0;
diff --git a/src/components/status/status.js b/src/components/status/status.js
index b14a74ec..65ddcb9f 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -4,10 +4,14 @@ import RetweetButton from '../retweet_button/retweet_button.vue'
import DeleteButton from '../delete_button/delete_button.vue'
import PostStatusForm from '../post_status_form/post_status_form.vue'
import UserCardContent from '../user_card_content/user_card_content.vue'
-import StillImage from '../still-image/still-image.vue'
-import { filter, find } from 'lodash'
-import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
+import UserAvatar from '../user_avatar/user_avatar.vue'
+import Gallery from '../gallery/gallery.vue'
+import LinkPreview from '../link-preview/link-preview.vue'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
+import fileType from 'src/services/file_type/file_type.service'
+import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
+import { mentionMatchesUrl } from 'src/services/mention_matcher/mention_matcher.js'
+import { filter, find } from 'lodash'
const Status = {
name: 'Status',
@@ -31,11 +35,13 @@ const Status = {
userExpanded: false,
preview: null,
showPreview: false,
- showingTall: false,
+ showingTall: this.inConversation && this.focused,
+ showingLongSubject: false,
expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined'
? !this.$store.state.instance.collapseMessageWithSubject
: !this.$store.state.config.collapseMessageWithSubject,
- betterShadow: this.$store.state.interface.browserSupport.cssFilter
+ betterShadow: this.$store.state.interface.browserSupport.cssFilter,
+ maxAttachments: 9
}
},
computed: {
@@ -78,12 +84,13 @@ const Status = {
},
replyProfileLink () {
if (this.isReply) {
- return this.generateUserProfileLink(this.status.in_reply_to_status_id, this.replyToName)
+ return this.generateUserProfileLink(this.status.in_reply_to_user_id, this.replyToName)
}
},
retweet () { return !!this.statusoid.retweeted_status },
- retweeter () { return this.statusoid.user.name },
+ retweeter () { return this.statusoid.user.name || this.statusoid.user.screen_name },
retweeterHtml () { return this.statusoid.user.name_html },
+ retweeterProfileLink () { return this.generateUserProfileLink(this.statusoid.user.id, this.statusoid.user.screen_name) },
status () {
if (this.retweet) {
return this.statusoid.retweeted_status
@@ -124,8 +131,11 @@ const Status = {
const lengthScore = this.status.statusnet_html.split(/
20
},
+ longSubject () {
+ return this.status.summary.length > 900
+ },
isReply () {
- return !!this.status.in_reply_to_status_id
+ return !!(this.status.in_reply_to_status_id && this.status.in_reply_to_user_id)
},
replyToName () {
const user = this.$store.state.users.usersObject[this.status.in_reply_to_user_id]
@@ -178,7 +188,7 @@ const Status = {
return this.tallStatus
},
showingMore () {
- return this.showingTall || (this.status.summary && this.expandingSubject)
+ return (this.tallStatus && this.showingTall) || (this.status.summary && this.expandingSubject)
},
nsfwClickthrough () {
if (!this.status.nsfw) {
@@ -205,12 +215,31 @@ const Status = {
},
attachmentSize () {
if ((this.$store.state.config.hideAttachments && !this.inConversation) ||
- (this.$store.state.config.hideAttachmentsInConv && this.inConversation)) {
+ (this.$store.state.config.hideAttachmentsInConv && this.inConversation) ||
+ (this.status.attachments.length > this.maxAttachments)) {
return 'hide'
} else if (this.compact) {
return 'small'
}
return 'normal'
+ },
+ galleryTypes () {
+ if (this.attachmentSize === 'hide') {
+ return []
+ }
+ return this.$store.state.config.playVideosInModal
+ ? ['image', 'video']
+ : ['image']
+ },
+ galleryAttachments () {
+ return this.status.attachments.filter(
+ file => fileType.fileMatchesSomeType(this.galleryTypes, file)
+ )
+ },
+ nonGalleryAttachments () {
+ return this.status.attachments.filter(
+ file => !fileType.fileMatchesSomeType(this.galleryTypes, file)
+ )
}
},
components: {
@@ -220,7 +249,9 @@ const Status = {
DeleteButton,
PostStatusForm,
UserCardContent,
- StillImage
+ UserAvatar,
+ Gallery,
+ LinkPreview
},
methods: {
visibilityIcon (visibility) {
@@ -235,11 +266,23 @@ const Status = {
return 'icon-globe'
}
},
- linkClicked ({target}) {
+ linkClicked (event) {
+ let { target } = event
if (target.tagName === 'SPAN') {
target = target.parentNode
}
if (target.tagName === 'A') {
+ if (target.className.match(/mention/)) {
+ const href = target.getAttribute('href')
+ const attn = this.status.attentions.find(attn => mentionMatchesUrl(attn, href))
+ if (attn) {
+ event.stopPropagation()
+ event.preventDefault()
+ const link = this.generateUserProfileLink(attn.id, attn.screen_name)
+ this.$router.push(link)
+ return
+ }
+ }
window.open(target.href, '_blank')
}
},
@@ -264,11 +307,11 @@ const Status = {
toggleShowMore () {
if (this.showingTall) {
this.showingTall = false
- } else if (this.expandingSubject) {
+ } else if (this.expandingSubject && this.status.summary) {
this.expandingSubject = false
} else if (this.hideTallStatus) {
this.showingTall = true
- } else if (this.hideSubjectStatus) {
+ } else if (this.hideSubjectStatus && this.status.summary) {
this.expandingSubject = true
}
},
@@ -295,6 +338,10 @@ const Status = {
},
generateUserProfileLink (id, name) {
return generateProfileLink(id, name, this.$store.state.instance.restrictedNicknames)
+ },
+ setMedia () {
+ const attachments = this.attachmentSize === 'hide' ? this.status.attachments : this.galleryAttachments
+ return () => this.$store.dispatch('setMedia', attachments)
}
},
watch: {
@@ -302,8 +349,13 @@ const Status = {
if (this.status.id === id) {
let rect = this.$el.getBoundingClientRect()
if (rect.top < 100) {
- window.scrollBy(0, rect.top - 200)
+ // Post is above screen, match its top to screen top
+ window.scrollBy(0, rect.top - 100)
+ } else if (rect.height >= (window.innerHeight - 50)) {
+ // Post we want to see is taller than screen so match its top to screen top
+ window.scrollBy(0, rect.top - 100)
} else if (rect.bottom > window.innerHeight - 50) {
+ // Post is below screen, match its bottom to screen bottom
window.scrollBy(0, rect.bottom - window.innerHeight + 50)
}
}
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 9ba8912d..f14115fc 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -13,10 +13,13 @@