Compare commits
7 Commits
750235cd8f
...
ed9a9f6539
Author | SHA1 | Date |
---|---|---|
Nolan Lawson | ed9a9f6539 | |
Arnaldo Gabriel | 452b34b3b4 | |
Thomas Preece | fd4bb4d864 | |
vitalyster | c426b7fe31 | |
Noelia Ruiz Martínez | c2851ce104 | |
Nolan Lawson | 2578d0964d | |
Noelia Ruiz Martínez | ff53fcab10 |
|
@ -21,15 +21,8 @@ const JSON_TEMPLATE = {
|
|||
github: {
|
||||
silent: true
|
||||
},
|
||||
builds: [
|
||||
{
|
||||
src: 'package.json',
|
||||
use: '@now/static-build',
|
||||
config: {
|
||||
distDir: '__sapper__/export'
|
||||
}
|
||||
}
|
||||
],
|
||||
buildCommand: 'yarn build',
|
||||
outputDirectory: '__sapper__/export',
|
||||
routes: [
|
||||
{
|
||||
src: '^/service-worker\\.js$',
|
||||
|
|
|
@ -43,8 +43,8 @@ async function setupMastodonDatabase () {
|
|||
async function installMastodonDependencies () {
|
||||
const cwd = mastodonDir
|
||||
const installCommands = [
|
||||
'gem update --system',
|
||||
'gem install bundler foreman',
|
||||
'gem install bundler -v 2.3.26 --no-document',
|
||||
'gem install foreman -v 0.87.2 --no-document',
|
||||
'bundle config set --local frozen \'true\'',
|
||||
'bundle install',
|
||||
'yarn --pure-lockfile'
|
||||
|
|
|
@ -16,5 +16,4 @@ or
|
|||
|
||||
LOCALE=fr yarn dev
|
||||
|
||||
There is also an experimental `LOCALE_DIRECTION` environment variable for the direction (LTR versus RTL) which is
|
||||
exposed to the source code while building.
|
||||
To host a localized version of Pinafore using Vercel, you can see this example: [buildCommand in vercel.json for Spanish](https://github.com/nvdaes/vercelPinafore/blob/45c70fb2088fe5f2380a729dab83e6f3ab4e6291/vercel.json#L9).
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "pinafore",
|
||||
"description": "Alternative web client for Mastodon",
|
||||
"version": "2.5.1",
|
||||
"version": "2.6.0",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || ^16.0.0 || ^18.0.0"
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
*/
|
||||
img, svg, video,
|
||||
input[type="checkbox"], input[type="radio"],
|
||||
.inline-emoji, .theme-preview {
|
||||
.inline-emoji, .theme-preview, .account-profile {
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -368,6 +368,7 @@ export default {
|
|||
general: 'General',
|
||||
generalSettings: 'General settings',
|
||||
showSensitive: 'Show sensitive media by default',
|
||||
showAllSpoilers: 'Expand content warnings by default',
|
||||
showPlain: 'Show a plain gray color for sensitive media',
|
||||
allSensitive: 'Treat all media as sensitive',
|
||||
largeMedia: 'Show large inline images and videos',
|
||||
|
|
|
@ -27,11 +27,13 @@ export function generateAuthLink (instanceName, clientId, redirectUri) {
|
|||
|
||||
export function getAccessTokenFromAuthCode (instanceName, clientId, clientSecret, code, redirectUri) {
|
||||
const url = `${basename(instanceName)}/oauth/token`
|
||||
return post(url, {
|
||||
// Using URLSearchParams here guarantees a content type of application/x-www-form-urlencoded
|
||||
// See https://fetch.spec.whatwg.org/#bodyinit-unions
|
||||
return post(url, new URLSearchParams({
|
||||
client_id: clientId,
|
||||
client_secret: clientSecret,
|
||||
redirect_uri: redirectUri,
|
||||
grant_type: 'authorization_code',
|
||||
code
|
||||
}, null, { timeout: WRITE_TIMEOUT })
|
||||
}), null, { timeout: WRITE_TIMEOUT })
|
||||
}
|
||||
|
|
|
@ -260,7 +260,7 @@
|
|||
notification && notification.status &&
|
||||
notification.type !== 'mention' && notification.status.id === originalStatusId
|
||||
),
|
||||
spoilerShown: ({ $spoilersShown, uuid }) => !!$spoilersShown[uuid],
|
||||
spoilerShown: ({ $spoilersShown, uuid, $showAllSpoilers }) => (typeof $spoilersShown[uuid] === 'undefined' ? !!$showAllSpoilers : !!$spoilersShown[uuid]),
|
||||
replyShown: ({ $repliesShown, uuid }) => !!$repliesShown[uuid],
|
||||
showCard: ({ originalStatus, isStatusInNotification, showMedia, $hideCards }) => (
|
||||
!$hideCards &&
|
||||
|
|
|
@ -76,8 +76,9 @@
|
|||
methods: {
|
||||
toggleSpoilers (shown) {
|
||||
const { uuid } = this.get()
|
||||
const { spoilersShown } = this.store.get()
|
||||
spoilersShown[uuid] = typeof shown === 'undefined' ? !spoilersShown[uuid] : !!shown
|
||||
const { spoilersShown, showAllSpoilers } = this.store.get()
|
||||
const currentValue = typeof spoilersShown[uuid] === 'undefined' ? !!showAllSpoilers : spoilersShown[uuid]
|
||||
spoilersShown[uuid] = typeof shown === 'undefined' ? !currentValue : !!shown
|
||||
this.store.set({ spoilersShown })
|
||||
requestAnimationFrame(() => {
|
||||
mark('clickSpoilerButton')
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
bind:checked="$neverMarkMediaAsSensitive" on:change="onChange(event)">
|
||||
{intl.showSensitive}
|
||||
</label>
|
||||
<label class="setting-group">
|
||||
<input type="checkbox" id="choice-show-all-spoilers"
|
||||
bind:checked="$showAllSpoilers" on:change="onChange(event)">
|
||||
{intl.showAllSpoilers}
|
||||
</label>
|
||||
<label class="setting-group">
|
||||
<input type="checkbox" id="choice-use-blurhash"
|
||||
bind:checked="$ignoreBlurhash" on:change="onChange(event)">
|
||||
|
|
|
@ -35,6 +35,7 @@ const persistedState = {
|
|||
loggedInInstances: {},
|
||||
loggedInInstancesInOrder: [],
|
||||
markMediaAsSensitive: false,
|
||||
showAllSpoilers: false,
|
||||
neverMarkMediaAsSensitive: false,
|
||||
ignoreBlurhash: false,
|
||||
omitEmojiInDisplayNames: undefined,
|
||||
|
|
|
@ -51,7 +51,7 @@ async function _fetch (url, fetchOptions, options) {
|
|||
async function _putOrPostOrPatch (method, url, body, headers, options) {
|
||||
const fetchOptions = makeFetchOptions(method, headers, options)
|
||||
if (body) {
|
||||
if (body instanceof FormData) {
|
||||
if (body instanceof FormData || body instanceof URLSearchParams) {
|
||||
fetchOptions.body = body
|
||||
} else {
|
||||
fetchOptions.body = JSON.stringify(body)
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
import {
|
||||
getUrl,
|
||||
scrollToStatus,
|
||||
getNthStatusSpoiler,
|
||||
settingsNavButton,
|
||||
generalSettingsButton,
|
||||
homeNavButton,
|
||||
getNthStatus,
|
||||
getNthShowOrHideButton
|
||||
} from '../utils'
|
||||
import { loginAsFoobar } from '../roles'
|
||||
import { homeTimeline } from '../fixtures.js'
|
||||
import { Selector as $ } from 'testcafe'
|
||||
|
||||
fixture`043-content-warnings.js`
|
||||
.page`http://localhost:4002`
|
||||
|
||||
test('Can set content warnings to auto-expand', async t => {
|
||||
await loginAsFoobar(t)
|
||||
await t
|
||||
.expect(getUrl()).eql('http://localhost:4002/')
|
||||
.click(settingsNavButton)
|
||||
.click(generalSettingsButton)
|
||||
.click($('#choice-show-all-spoilers'))
|
||||
.click(homeNavButton)
|
||||
.expect(getUrl()).eql('http://localhost:4002/')
|
||||
.expect(getNthStatus(1).exists).ok()
|
||||
const idx = homeTimeline.findIndex(_ => _.spoiler === 'kitten CW')
|
||||
await scrollToStatus(t, idx + 1)
|
||||
await t
|
||||
.expect(getNthStatusSpoiler(1 + idx).innerText).contains('kitten CW')
|
||||
.expect(getNthStatus(1 + idx).innerText).contains('here\'s a kitten with a CW')
|
||||
.click(getNthShowOrHideButton(1 + idx))
|
||||
.expect(getNthStatus(1 + idx).innerText).notContains('here\'s a kitten with a CW')
|
||||
.click(getNthShowOrHideButton(1 + idx))
|
||||
.expect(getNthStatus(1 + idx).innerText).contains('here\'s a kitten with a CW')
|
||||
})
|
11
vercel.json
11
vercel.json
|
@ -6,15 +6,8 @@
|
|||
"github": {
|
||||
"silent": true
|
||||
},
|
||||
"builds": [
|
||||
{
|
||||
"src": "package.json",
|
||||
"use": "@now/static-build",
|
||||
"config": {
|
||||
"distDir": "__sapper__/export"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildCommand": "yarn build",
|
||||
"outputDirectory": "__sapper__/export",
|
||||
"routes": [
|
||||
{
|
||||
"src": "^/service-worker\\.js$",
|
||||
|
|
Loading…
Reference in New Issue