-
+
diff --git a/src/components/poll/poll_vote/poll_vote.vue b/src/components/poll/poll_vote/poll_vote.vue
deleted file mode 100644
index 3950312a..00000000
--- a/src/components/poll/poll_vote/poll_vote.vue
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
-
-
- {{percentageForOption(option.votes_count)}}%
- {{option.title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index e335054c..031a1518 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -2,7 +2,7 @@ import statusPoster from '../../services/status_poster/status_poster.service.js'
import MediaUpload from '../media_upload/media_upload.vue'
import ScopeSelector from '../scope_selector/scope_selector.vue'
import EmojiInput from '../emoji-input/emoji-input.vue'
-import PollForm from '../poll/poll_form/poll_form.vue'
+import PollForm from '../poll/poll_form.vue'
import fileTypeService from '../../services/file_type/file_type.service.js'
import Completion from '../../services/completion/completion.js'
import { take, filter, reject, map, uniqBy } from 'lodash'
@@ -82,7 +82,7 @@ const PostStatusForm = {
contentType
},
caret: 0,
- pollFormVisible: true
+ pollFormVisible: false
}
},
computed: {
@@ -188,7 +188,7 @@ const PostStatusForm = {
return this.$store.state.instance.safeDM
},
pollsAvailable () {
- return true // this.$store.state.instance.pollsAvailable
+ return this.$store.state.instance.pollsAvailable
},
hideScopeNotice () {
return this.$store.state.config.hideScopeNotice
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 8b26b9d6..a41df321 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -103,7 +103,7 @@
diff --git a/src/components/timeago/timeago.vue b/src/components/timeago/timeago.vue
index 6a885191..3f185a2d 100644
--- a/src/components/timeago/timeago.vue
+++ b/src/components/timeago/timeago.vue
@@ -9,7 +9,7 @@ import * as DateUtils from 'src/services/date_utils/date_utils.js'
export default {
name: 'Timeago',
- props: ['time', 'autoUpdate', 'longFormat'],
+ props: ['time', 'autoUpdate', 'longFormat', 'nowThreshold'],
data () {
return {
relativeTime: { key: 'time.now', num: 0 },
@@ -27,18 +27,14 @@ export default {
return typeof this.time === 'string'
? new Date(Date.parse(this.time)).toLocaleString()
: this.time.toLocaleString()
- },
- relativeTimeObject () {
- return this.longFormat
- ? DateUtils.relativeTime(this.time)
- : DateUtils.relativeTimeShort(this.time)
}
},
methods: {
refreshRelativeTimeObject () {
+ const nowThreshold = typeof this.nowThreshold === 'number' ? this.nowThreshold : 1
this.relativeTime = this.longFormat
- ? DateUtils.relativeTime(this.time)
- : DateUtils.relativeTimeShort(this.time)
+ ? DateUtils.relativeTime(this.time, nowThreshold)
+ : DateUtils.relativeTimeShort(this.time, nowThreshold)
if (this.autoUpdate) {
this.interval = setTimeout(
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 88123cc7..e303c93c 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -80,10 +80,12 @@
"no_more_notifications": "No more notifications"
},
"polls": {
+ "add_poll": "Add Poll",
"add_option": "Add Option",
"option": "Option",
"votes": "votes",
"vote": "Vote",
+ "type": "Poll type",
"single_choice": "Single choice",
"multiple_choices": "Multiple choices",
"expiry": "Poll age",
@@ -540,8 +542,7 @@
"repeat": "Repeat",
"reply": "Reply",
"favorite": "Favorite",
- "user_settings": "User Settings",
- "poll": "Add Poll"
+ "user_settings": "User Settings"
},
"upload":{
"error": {
diff --git a/src/i18n/fi.json b/src/i18n/fi.json
index 184d7a2f..9c8cd863 100644
--- a/src/i18n/fi.json
+++ b/src/i18n/fi.json
@@ -36,6 +36,7 @@
"chat": "Paikallinen Chat",
"friend_requests": "Seurauspyynnöt",
"mentions": "Maininnat",
+ "interactions": "Interaktiot",
"dms": "Yksityisviestit",
"public_tl": "Julkinen Aikajana",
"timeline": "Aikajana",
@@ -54,6 +55,24 @@
"repeated_you": "toisti viestisi",
"no_more_notifications": "Ei enempää ilmoituksia"
},
+ "polls": {
+ "add_poll": "Lisää äänestys",
+ "add_option": "Lisää vaihtoehto",
+ "option": "Vaihtoehto",
+ "votes": "ääntä",
+ "vote": "Äänestä",
+ "type": "Äänestyksen tyyppi",
+ "single_choice": "Yksi valinta",
+ "multiple_choices": "Monivalinta",
+ "expiry": "Äänestyksen kesto",
+ "expires_in": "Päättyy {0} päästä",
+ "expired": "Päättyi {0} sitten"
+ },
+ "interactions": {
+ "favs_repeats": "Toistot ja tykkäykset",
+ "follows": "Uudet seuraukset",
+ "load_older": "Lataa vanhempia interaktioita"
+ },
"post_status": {
"new_status": "Uusi viesti",
"account_not_locked_warning": "Tilisi ei ole {0}. Kuka vain voi seurata sinua nähdäksesi 'vain-seuraajille' -viestisi",
@@ -298,9 +317,9 @@
},
"upload":{
"error": {
- "base": "Lataus epäonnistui.",
- "file_too_big": "Tiedosto liian suuri [{filesize}{filesizeunit} / {allowedsize}{allowedsizeunit}]",
- "default": "Yritä uudestaan myöhemmin"
+ "base": "Lataus epäonnistui.",
+ "file_too_big": "Tiedosto liian suuri [{filesize}{filesizeunit} / {allowedsize}{allowedsizeunit}]",
+ "default": "Yritä uudestaan myöhemmin"
},
"file_size_units": {
"B": "tavua",
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 5a91fce6..e10c664c 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -56,11 +56,10 @@ const defaultState = {
backendVersion: '',
frontendVersion: '',
+ pollsAvailable: true,
pollLimits: {
max_options: 4,
- max_option_chars: 255,
- min_expiration: 60,
- max_expiration: 600
+ max_option_chars: 255
}
}
diff --git a/src/services/date_utils/date_utils.js b/src/services/date_utils/date_utils.js
index 6dff3ee3..32e13bca 100644
--- a/src/services/date_utils/date_utils.js
+++ b/src/services/date_utils/date_utils.js
@@ -6,12 +6,12 @@ export const WEEK = 7 * DAY
export const MONTH = 30 * DAY
export const YEAR = 365.25 * DAY
-export const relativeTime = date => {
+export const relativeTime = (date, nowThreshold = 1) => {
if (typeof date === 'string') date = Date.parse(date)
const round = Date.now() > date ? Math.floor : Math.ceil
const d = Math.abs(Date.now() - date)
let r = { num: round(d / YEAR), key: 'time.years' }
- if (d < 30 * SECOND) {
+ if (d < nowThreshold * SECOND) {
r.num = 0
r.key = 'time.now'
} else if (d < MINUTE) {
@@ -38,8 +38,8 @@ export const relativeTime = date => {
return r
}
-export const relativeTimeShort = date => {
- const r = relativeTime(date)
+export const relativeTimeShort = (date, nowThreshold = 1) => {
+ const r = relativeTime(date, nowThreshold)
r.key += '_short'
return r
}
diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js
index d0b6ccbf..d73106b8 100644
--- a/src/services/style_setter/style_setter.js
+++ b/src/services/style_setter/style_setter.js
@@ -202,6 +202,7 @@ const generateColors = (input) => {
colors.topBarLink = col.topBarLink || getTextColor(colors.topBar, colors.fgLink)
colors.faintLink = col.faintLink || Object.assign({}, col.link)
+ colors.linkBg = alphaBlend(colors.link, 0.4, colors.bg)
colors.icon = mixrgb(colors.bg, colors.text)