kopia lustrzana https://github.com/nolanlawson/pinafore
Porównaj commity
7 Commity
750235cd8f
...
ed9a9f6539
Autor | SHA1 | Data |
---|---|---|
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: {
|
github: {
|
||||||
silent: true
|
silent: true
|
||||||
},
|
},
|
||||||
builds: [
|
buildCommand: 'yarn build',
|
||||||
{
|
outputDirectory: '__sapper__/export',
|
||||||
src: 'package.json',
|
|
||||||
use: '@now/static-build',
|
|
||||||
config: {
|
|
||||||
distDir: '__sapper__/export'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
src: '^/service-worker\\.js$',
|
src: '^/service-worker\\.js$',
|
||||||
|
|
|
@ -43,8 +43,8 @@ async function setupMastodonDatabase () {
|
||||||
async function installMastodonDependencies () {
|
async function installMastodonDependencies () {
|
||||||
const cwd = mastodonDir
|
const cwd = mastodonDir
|
||||||
const installCommands = [
|
const installCommands = [
|
||||||
'gem update --system',
|
'gem install bundler -v 2.3.26 --no-document',
|
||||||
'gem install bundler foreman',
|
'gem install foreman -v 0.87.2 --no-document',
|
||||||
'bundle config set --local frozen \'true\'',
|
'bundle config set --local frozen \'true\'',
|
||||||
'bundle install',
|
'bundle install',
|
||||||
'yarn --pure-lockfile'
|
'yarn --pure-lockfile'
|
||||||
|
|
|
@ -16,5 +16,4 @@ or
|
||||||
|
|
||||||
LOCALE=fr yarn dev
|
LOCALE=fr yarn dev
|
||||||
|
|
||||||
There is also an experimental `LOCALE_DIRECTION` environment variable for the direction (LTR versus RTL) which is
|
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).
|
||||||
exposed to the source code while building.
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "pinafore",
|
"name": "pinafore",
|
||||||
"description": "Alternative web client for Mastodon",
|
"description": "Alternative web client for Mastodon",
|
||||||
"version": "2.5.1",
|
"version": "2.6.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.20.0 || ^14.13.1 || ^16.0.0 || ^18.0.0"
|
"node": "^12.20.0 || ^14.13.1 || ^16.0.0 || ^18.0.0"
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
*/
|
*/
|
||||||
img, svg, video,
|
img, svg, video,
|
||||||
input[type="checkbox"], input[type="radio"],
|
input[type="checkbox"], input[type="radio"],
|
||||||
.inline-emoji, .theme-preview {
|
.inline-emoji, .theme-preview, .account-profile {
|
||||||
filter: grayscale(100%);
|
filter: grayscale(100%);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -368,6 +368,7 @@ export default {
|
||||||
general: 'General',
|
general: 'General',
|
||||||
generalSettings: 'General settings',
|
generalSettings: 'General settings',
|
||||||
showSensitive: 'Show sensitive media by default',
|
showSensitive: 'Show sensitive media by default',
|
||||||
|
showAllSpoilers: 'Expand content warnings by default',
|
||||||
showPlain: 'Show a plain gray color for sensitive media',
|
showPlain: 'Show a plain gray color for sensitive media',
|
||||||
allSensitive: 'Treat all media as sensitive',
|
allSensitive: 'Treat all media as sensitive',
|
||||||
largeMedia: 'Show large inline images and videos',
|
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) {
|
export function getAccessTokenFromAuthCode (instanceName, clientId, clientSecret, code, redirectUri) {
|
||||||
const url = `${basename(instanceName)}/oauth/token`
|
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_id: clientId,
|
||||||
client_secret: clientSecret,
|
client_secret: clientSecret,
|
||||||
redirect_uri: redirectUri,
|
redirect_uri: redirectUri,
|
||||||
grant_type: 'authorization_code',
|
grant_type: 'authorization_code',
|
||||||
code
|
code
|
||||||
}, null, { timeout: WRITE_TIMEOUT })
|
}), null, { timeout: WRITE_TIMEOUT })
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,7 @@
|
||||||
notification && notification.status &&
|
notification && notification.status &&
|
||||||
notification.type !== 'mention' && notification.status.id === originalStatusId
|
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],
|
replyShown: ({ $repliesShown, uuid }) => !!$repliesShown[uuid],
|
||||||
showCard: ({ originalStatus, isStatusInNotification, showMedia, $hideCards }) => (
|
showCard: ({ originalStatus, isStatusInNotification, showMedia, $hideCards }) => (
|
||||||
!$hideCards &&
|
!$hideCards &&
|
||||||
|
|
|
@ -76,8 +76,9 @@
|
||||||
methods: {
|
methods: {
|
||||||
toggleSpoilers (shown) {
|
toggleSpoilers (shown) {
|
||||||
const { uuid } = this.get()
|
const { uuid } = this.get()
|
||||||
const { spoilersShown } = this.store.get()
|
const { spoilersShown, showAllSpoilers } = this.store.get()
|
||||||
spoilersShown[uuid] = typeof shown === 'undefined' ? !spoilersShown[uuid] : !!shown
|
const currentValue = typeof spoilersShown[uuid] === 'undefined' ? !!showAllSpoilers : spoilersShown[uuid]
|
||||||
|
spoilersShown[uuid] = typeof shown === 'undefined' ? !currentValue : !!shown
|
||||||
this.store.set({ spoilersShown })
|
this.store.set({ spoilersShown })
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
mark('clickSpoilerButton')
|
mark('clickSpoilerButton')
|
||||||
|
|
|
@ -8,6 +8,11 @@
|
||||||
bind:checked="$neverMarkMediaAsSensitive" on:change="onChange(event)">
|
bind:checked="$neverMarkMediaAsSensitive" on:change="onChange(event)">
|
||||||
{intl.showSensitive}
|
{intl.showSensitive}
|
||||||
</label>
|
</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">
|
<label class="setting-group">
|
||||||
<input type="checkbox" id="choice-use-blurhash"
|
<input type="checkbox" id="choice-use-blurhash"
|
||||||
bind:checked="$ignoreBlurhash" on:change="onChange(event)">
|
bind:checked="$ignoreBlurhash" on:change="onChange(event)">
|
||||||
|
|
|
@ -35,6 +35,7 @@ const persistedState = {
|
||||||
loggedInInstances: {},
|
loggedInInstances: {},
|
||||||
loggedInInstancesInOrder: [],
|
loggedInInstancesInOrder: [],
|
||||||
markMediaAsSensitive: false,
|
markMediaAsSensitive: false,
|
||||||
|
showAllSpoilers: false,
|
||||||
neverMarkMediaAsSensitive: false,
|
neverMarkMediaAsSensitive: false,
|
||||||
ignoreBlurhash: false,
|
ignoreBlurhash: false,
|
||||||
omitEmojiInDisplayNames: undefined,
|
omitEmojiInDisplayNames: undefined,
|
||||||
|
|
|
@ -51,7 +51,7 @@ async function _fetch (url, fetchOptions, options) {
|
||||||
async function _putOrPostOrPatch (method, url, body, headers, options) {
|
async function _putOrPostOrPatch (method, url, body, headers, options) {
|
||||||
const fetchOptions = makeFetchOptions(method, headers, options)
|
const fetchOptions = makeFetchOptions(method, headers, options)
|
||||||
if (body) {
|
if (body) {
|
||||||
if (body instanceof FormData) {
|
if (body instanceof FormData || body instanceof URLSearchParams) {
|
||||||
fetchOptions.body = body
|
fetchOptions.body = body
|
||||||
} else {
|
} else {
|
||||||
fetchOptions.body = JSON.stringify(body)
|
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": {
|
"github": {
|
||||||
"silent": true
|
"silent": true
|
||||||
},
|
},
|
||||||
"builds": [
|
"buildCommand": "yarn build",
|
||||||
{
|
"outputDirectory": "__sapper__/export",
|
||||||
"src": "package.json",
|
|
||||||
"use": "@now/static-build",
|
|
||||||
"config": {
|
|
||||||
"distDir": "__sapper__/export"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"routes": [
|
"routes": [
|
||||||
{
|
{
|
||||||
"src": "^/service-worker\\.js$",
|
"src": "^/service-worker\\.js$",
|
||||||
|
|
Ładowanie…
Reference in New Issue