Compare commits

..

No commits in common. "ed9a9f6539066159801e7df40a6be2f37a8c5588" and "750235cd8f56aac854d9c61289e4d13f8576b17b" have entirely different histories.

14 changed files with 30 additions and 62 deletions

View File

@ -21,8 +21,15 @@ const JSON_TEMPLATE = {
github: {
silent: true
},
buildCommand: 'yarn build',
outputDirectory: '__sapper__/export',
builds: [
{
src: 'package.json',
use: '@now/static-build',
config: {
distDir: '__sapper__/export'
}
}
],
routes: [
{
src: '^/service-worker\\.js$',

View File

@ -43,8 +43,8 @@ async function setupMastodonDatabase () {
async function installMastodonDependencies () {
const cwd = mastodonDir
const installCommands = [
'gem install bundler -v 2.3.26 --no-document',
'gem install foreman -v 0.87.2 --no-document',
'gem update --system',
'gem install bundler foreman',
'bundle config set --local frozen \'true\'',
'bundle install',
'yarn --pure-lockfile'

View File

@ -16,4 +16,5 @@ or
LOCALE=fr yarn dev
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).
There is also an experimental `LOCALE_DIRECTION` environment variable for the direction (LTR versus RTL) which is
exposed to the source code while building.

View File

@ -1,7 +1,7 @@
{
"name": "pinafore",
"description": "Alternative web client for Mastodon",
"version": "2.6.0",
"version": "2.5.1",
"type": "module",
"engines": {
"node": "^12.20.0 || ^14.13.1 || ^16.0.0 || ^18.0.0"

View File

@ -55,7 +55,7 @@
*/
img, svg, video,
input[type="checkbox"], input[type="radio"],
.inline-emoji, .theme-preview, .account-profile {
.inline-emoji, .theme-preview {
filter: grayscale(100%);
}
</style>

View File

@ -368,7 +368,6 @@ 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',

View File

@ -27,13 +27,11 @@ export function generateAuthLink (instanceName, clientId, redirectUri) {
export function getAccessTokenFromAuthCode (instanceName, clientId, clientSecret, code, redirectUri) {
const url = `${basename(instanceName)}/oauth/token`
// 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({
return post(url, {
client_id: clientId,
client_secret: clientSecret,
redirect_uri: redirectUri,
grant_type: 'authorization_code',
code
}), null, { timeout: WRITE_TIMEOUT })
}, null, { timeout: WRITE_TIMEOUT })
}

View File

@ -260,7 +260,7 @@
notification && notification.status &&
notification.type !== 'mention' && notification.status.id === originalStatusId
),
spoilerShown: ({ $spoilersShown, uuid, $showAllSpoilers }) => (typeof $spoilersShown[uuid] === 'undefined' ? !!$showAllSpoilers : !!$spoilersShown[uuid]),
spoilerShown: ({ $spoilersShown, uuid }) => !!$spoilersShown[uuid],
replyShown: ({ $repliesShown, uuid }) => !!$repliesShown[uuid],
showCard: ({ originalStatus, isStatusInNotification, showMedia, $hideCards }) => (
!$hideCards &&

View File

@ -76,9 +76,8 @@
methods: {
toggleSpoilers (shown) {
const { uuid } = this.get()
const { spoilersShown, showAllSpoilers } = this.store.get()
const currentValue = typeof spoilersShown[uuid] === 'undefined' ? !!showAllSpoilers : spoilersShown[uuid]
spoilersShown[uuid] = typeof shown === 'undefined' ? !currentValue : !!shown
const { spoilersShown } = this.store.get()
spoilersShown[uuid] = typeof shown === 'undefined' ? !spoilersShown[uuid] : !!shown
this.store.set({ spoilersShown })
requestAnimationFrame(() => {
mark('clickSpoilerButton')

View File

@ -8,11 +8,6 @@
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)">

View File

@ -35,7 +35,6 @@ const persistedState = {
loggedInInstances: {},
loggedInInstancesInOrder: [],
markMediaAsSensitive: false,
showAllSpoilers: false,
neverMarkMediaAsSensitive: false,
ignoreBlurhash: false,
omitEmojiInDisplayNames: undefined,

View File

@ -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 || body instanceof URLSearchParams) {
if (body instanceof FormData) {
fetchOptions.body = body
} else {
fetchOptions.body = JSON.stringify(body)

View File

@ -1,37 +0,0 @@
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')
})

View File

@ -6,8 +6,15 @@
"github": {
"silent": true
},
"buildCommand": "yarn build",
"outputDirectory": "__sapper__/export",
"builds": [
{
"src": "package.json",
"use": "@now/static-build",
"config": {
"distDir": "__sapper__/export"
}
}
],
"routes": [
{
"src": "^/service-worker\\.js$",