format (almost) everything remaining with prettier

This commit is contained in:
emma 2022-12-08 19:48:04 +00:00
parent 142f90c4cf
commit b07cf33a04
39 changed files with 1995 additions and 1812 deletions

View file

@ -1,5 +1,9 @@
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-jsx"],
"plugins": [
"@babel/plugin-transform-runtime",
"lodash",
"@vue/babel-plugin-jsx"
],
"comments": false
}

View file

@ -12,13 +12,16 @@ var webpackConfig = require('./webpack.prod.conf')
console.log(
' Tip:\n' +
' Built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
" Opening index.html over file:// won't work.\n"
)
var spinner = ora('building for production...')
spinner.start()
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
var assetsPath = path.join(
config.build.assetsRoot,
config.build.assetsSubDirectory
)
rm('-rf', assetsPath)
mkdir('-p', assetsPath)
cp('-R', 'static/*', assetsPath)
@ -26,11 +29,13 @@ cp('-R', 'static/*', assetsPath)
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
process.stdout.write(
stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n')
}) + '\n'
)
})

View file

@ -2,8 +2,7 @@ var semver = require('semver')
var chalk = require('chalk')
var packageConfig = require('../package.json')
var exec = function (cmd) {
return require('child_process')
.execSync(cmd).toString().trim()
return require('child_process').execSync(cmd).toString().trim()
}
var versionRequirements = [
@ -24,8 +23,11 @@ module.exports = function () {
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
warnings.push(
mod.name +
': ' +
chalk.red(mod.currentVersion) +
' should be ' +
chalk.green(mod.versionRequirement)
)
}
@ -33,7 +35,11 @@ module.exports = function () {
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log(
chalk.yellow(
'To use this template, you must update following to modules:'
)
)
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]

View file

@ -6,7 +6,8 @@ var express = require('express')
var webpack = require('webpack')
var opn = require('opn')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = process.env.NODE_ENV === 'testing'
var webpackConfig =
process.env.NODE_ENV === 'testing'
? require('./webpack.prod.conf')
: require('./webpack.dev.conf')
@ -50,7 +51,10 @@ app.use(devMiddleware)
app.use(hotMiddleware)
// serve pure static assets
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
var staticPath = path.posix.join(
config.dev.assetsPublicPath,
config.dev.assetsSubDirectory
)
app.use(staticPath, express.static('./static'))
module.exports = app.listen(port, function (err) {

View file

@ -4,7 +4,8 @@ var sass = require('sass')
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
var assetsSubDirectory =
process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
@ -13,7 +14,7 @@ exports.assetsPath = function (_path) {
exports.cssLoaders = function (options) {
options = options || {}
function generateLoaders (loaders) {
function generateLoaders(loaders) {
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
@ -27,11 +28,11 @@ exports.cssLoaders = function (options) {
return [
{
test: /\.(post)?css$/,
use: generateLoaders(['css-loader', 'postcss-loader']),
use: generateLoaders(['css-loader', 'postcss-loader'])
},
{
test: /\.less$/,
use: generateLoaders(['css-loader', 'postcss-loader', 'less-loader']),
use: generateLoaders(['css-loader', 'postcss-loader', 'less-loader'])
},
{
test: /\.sass$/,
@ -52,8 +53,8 @@ exports.cssLoaders = function (options) {
},
{
test: /\.styl(us)?$/,
use: generateLoaders(['css-loader', 'postcss-loader', 'stylus-loader']),
},
use: generateLoaders(['css-loader', 'postcss-loader', 'stylus-loader'])
}
]
}

View file

@ -7,8 +7,8 @@ var { VueLoaderPlugin } = require('vue-loader')
var env = process.env.NODE_ENV
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
// various preprocessor loaders added to vue-loader at the end of this file
var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap)
var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap)
var cssSourceMapDev = env === 'development' && config.dev.cssSourceMap
var cssSourceMapProd = env === 'production' && config.build.productionSourceMap
var useCssSourceMap = cssSourceMapDev || cssSourceMapProd
var now = Date.now()
@ -18,9 +18,12 @@ module.exports = {
app: './src/main.js'
},
output: {
hashFunction: "sha256", // Workaround for builds with OpenSSL 3.
hashFunction: 'sha256', // Workaround for builds with OpenSSL 3.
path: config.build.assetsRoot,
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
publicPath:
process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath,
filename: '[name].js'
},
optimization: {
@ -30,17 +33,15 @@ module.exports = {
},
resolve: {
extensions: ['.js', '.jsx', '.vue', '.mjs'],
modules: [
path.join(__dirname, '../node_modules')
],
modules: [path.join(__dirname, '../node_modules')],
fallback: {
"url": require.resolve("url/"),
url: require.resolve('url/')
},
alias: {
'static': path.resolve(__dirname, '../static'),
'src': path.resolve(__dirname, '../src'),
'assets': path.resolve(__dirname, '../src/assets'),
'components': path.resolve(__dirname, '../src/components'),
static: path.resolve(__dirname, '../static'),
src: path.resolve(__dirname, '../src'),
assets: path.resolve(__dirname, '../src/assets'),
components: path.resolve(__dirname, '../src/components'),
'vue-i18n': 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js'
}
},
@ -66,14 +67,15 @@ module.exports = {
test: /\.(json5?|ya?ml)$/, // target json, json5, yaml and yml files
type: 'javascript/auto',
loader: '@intlify/vue-i18n-loader',
include: [ // Use `Rule.include` to specify the files of locale messages to be pre-compiled
include: [
// Use `Rule.include` to specify the files of locale messages to be pre-compiled
path.resolve(__dirname, '../src/i18n')
]
},
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
type: 'javascript/auto'
},
{
test: /\.vue$/,
@ -114,10 +116,8 @@ module.exports = {
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
},
}
]
},
plugins: [
new VueLoaderPlugin()
]
plugins: [new VueLoaderPlugin()]
}

View file

@ -7,7 +7,9 @@ var HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(
baseWebpackConfig.entry[name]
)
})
module.exports = merge(baseWebpackConfig, {
@ -20,10 +22,10 @@ module.exports = merge(baseWebpackConfig, {
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env,
'COMMIT_HASH': JSON.stringify('DEV'),
'DEV_OVERRIDES': JSON.stringify(config.dev.settings),
'__VUE_OPTIONS_API__': true,
'__VUE_PROD_DEVTOOLS__': false
COMMIT_HASH: JSON.stringify('DEV'),
DEV_OVERRIDES: JSON.stringify(config.dev.settings),
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),

View file

@ -2,23 +2,27 @@ var path = require('path')
var config = require('../config')
var utils = require('./utils')
var webpack = require('webpack')
const WorkboxPlugin = require('workbox-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin')
var { merge } = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var env = process.env.NODE_ENV === 'testing'
var env =
process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: config.build.env
let commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString();
.toString()
var webpackConfig = merge(baseWebpackConfig, {
mode: 'production',
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, extract: true })
rules: utils.styleLoaders({
sourceMap: config.dev.cssSourceMap,
extract: true
})
},
devtool: 'source-map',
optimization: {
@ -36,15 +40,15 @@ var webpackConfig = merge(baseWebpackConfig, {
new WorkboxPlugin.InjectManifest({
swSrc: path.join(__dirname, '..', 'src/sw.js'),
swDest: 'sw-pleroma.js',
maximumFileSizeToCacheInBytes: 15 * 1024 * 1024,
maximumFileSizeToCacheInBytes: 15 * 1024 * 1024
}),
// http://vuejs.github.io/vue-loader/workflow/production.html
new webpack.DefinePlugin({
'process.env': env,
'COMMIT_HASH': JSON.stringify(commitHash),
'DEV_OVERRIDES': JSON.stringify(undefined),
'__VUE_OPTIONS_API__': true,
'__VUE_PROD_DEVTOOLS__': false
COMMIT_HASH: JSON.stringify(commitHash),
DEV_OVERRIDES: JSON.stringify(undefined),
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false
}),
// extract css into its own file
new MiniCssExtractPlugin({
@ -54,9 +58,8 @@ var webpackConfig = merge(baseWebpackConfig, {
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
filename:
process.env.NODE_ENV === 'testing' ? 'index.html' : config.build.index,
template: 'index.html',
inject: true,
minify: {
@ -69,7 +72,7 @@ var webpackConfig = merge(baseWebpackConfig, {
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'auto'
}),
})
// split vendor js into its own file
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
@ -87,9 +90,7 @@ if (config.build.productionGzip) {
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
'\\.(' + config.build.productionGzipExtensions.join('|') + ')$'
),
threshold: 10240,
minRatio: 0.8

View file

@ -59,7 +59,7 @@ module.exports = {
cookieDomainRewrite: 'localhost',
ws: true,
headers: {
'Origin': target
Origin: target
}
},
'/oauth/revoke': {
@ -76,7 +76,7 @@ module.exports = {
target,
changeOrigin: true,
cookieDomainRewrite: 'localhost'
},
}
},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README

View file

@ -1,18 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1,user-scalable=no"
/>
<title>Akkoma</title>
<link rel="stylesheet" href="/static/font/css/fontello.css">
<link rel="stylesheet" href="/static/font/css/animation.css">
<link rel="stylesheet" href="/static/font/tiresias.css">
<link rel="stylesheet" href="/static/font/css/lato.css">
<link rel="stylesheet" href="/static/mfm.css">
<link rel="stylesheet" href="/static/custom.css">
<link
rel="stylesheet"
href="/static/font/css/fontello.css"
/>
<link
rel="stylesheet"
href="/static/font/css/animation.css"
/>
<link
rel="stylesheet"
href="/static/font/tiresias.css"
/>
<link
rel="stylesheet"
href="/static/font/css/lato.css"
/>
<link
rel="stylesheet"
href="/static/mfm.css"
/>
<link
rel="stylesheet"
href="/static/custom.css"
/>
<!--server-generated-meta-->
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="manifest" href="/manifest.json">
<link
rel="icon"
type="image/png"
href="/favicon.png"
/>
<link
rel="manifest"
href="/manifest.json"
/>
</head>
<body class="hidden">
<noscript>To use Akkoma, please enable JavaScript.</noscript>

View file

@ -1,6 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
"extends": ["config:base"]
}

View file

@ -117,7 +117,6 @@
padding-top: 0.5em;
}
.play-icon {
position: absolute;
font-size: 64px;

View file

@ -8,7 +8,7 @@
flex: 0 0 0;
max-width: 9em;
align-items: stretch;
padding: .2em 8px;
padding: 0.2em 8px;
input {
background: none;
@ -40,9 +40,10 @@
}
.transparentIndicator {
// forgot to install counter-strike source, ooops
background-color: #FF00FF;
background-color: #ff00ff;
position: relative;
&::before, &::after {
&::before,
&::after {
display: block;
content: '';
background-color: #000000;
@ -64,5 +65,4 @@
.label {
flex: 1 1 auto;
}
}

View file

@ -15,7 +15,7 @@
display: grid;
grid-template-rows: var(--navbar-height);
grid-template-columns: 2fr auto 2fr;
grid-template-areas: "nav-left logo actions";
grid-template-areas: 'nav-left logo actions';
box-sizing: border-box;
padding: 0 1.2em;
margin: auto;
@ -24,11 +24,12 @@
&.-logoLeft .inner-nav {
grid-template-columns: auto 2fr 2fr;
grid-template-areas: "logo nav-left actions";
grid-template-areas: 'logo nav-left actions';
}
.button-default {
&, svg {
&,
svg {
color: $fallback--text;
color: var(--btnTopBarText, $fallback--text);
}
@ -49,7 +50,7 @@
color: $fallback--text;
color: var(--btnToggledTopBarText, $fallback--text);
background-color: $fallback--fg;
background-color: var(--btnToggledTopBar, $fallback--fg)
background-color: var(--btnToggledTopBar, $fallback--fg);
}
}

View file

@ -100,7 +100,7 @@
justify-content: center;
width: 32px;
height: 32px;
padding: .4em;
padding: 0.4em;
cursor: pointer;
img {
@ -133,7 +133,7 @@
}
.sticker-picker {
flex: 1 1 auto
flex: 1 1 auto;
}
.stickers,
@ -221,7 +221,5 @@
max-height: 100%;
}
}
}
}

View file

@ -2,19 +2,21 @@
margin: 1em;
table {
width:100%;
width: 100%;
text-align: left;
padding-left:10px;
padding-bottom:20px;
padding-left: 10px;
padding-bottom: 20px;
th, td {
th,
td {
width: 180px;
max-width: 360px;
overflow: hidden;
vertical-align: text-top;
}
th+th, td+td {
th + th,
td + td {
width: auto;
}
}

View file

@ -74,8 +74,7 @@
&.-striped {
& .shortName,
& .full {
background-image:
repeating-linear-gradient(
background-image: repeating-linear-gradient(
135deg,
var(--____highlight-tintColor),
var(--____highlight-tintColor) 5px,
@ -88,7 +87,10 @@
&.-solid {
& .shortName,
& .full {
background-image: linear-gradient(var(--____highlight-tintColor2), var(--____highlight-tintColor2));
background-image: linear-gradient(
var(--____highlight-tintColor2),
var(--____highlight-tintColor2)
);
}
}

View file

@ -6,7 +6,7 @@
margin: 1em 1em 1.4em;
> div {
margin-bottom: .5em;
margin-bottom: 0.5em;
&:last-child {
margin-bottom: 0;
}

View file

@ -2,19 +2,21 @@
margin: 1em;
table {
width:100%;
width: 100%;
text-align: left;
padding-left:10px;
padding-bottom:20px;
padding-left: 10px;
padding-bottom: 20px;
th, td {
th,
td {
width: 180px;
max-width: 360px;
overflow: hidden;
vertical-align: text-top;
}
th+th, td+td {
th + th,
td + td {
width: auto;
}
}

View file

@ -1,9 +1,15 @@
import { unescape, flattenDeep } from 'lodash'
import { getTagName, processTextForEmoji, getAttrs } from 'src/services/html_converter/utility.service.js'
import {
getTagName,
processTextForEmoji,
getAttrs
} from 'src/services/html_converter/utility.service.js'
import { convertHtmlToTree } from 'src/services/html_converter/html_tree_converter.service.js'
import { convertHtmlToLines } from 'src/services/html_converter/html_line_converter.service.js'
import StillImage from 'src/components/still-image/still-image.vue'
import MentionsLine, { MENTIONS_LIMIT } from 'src/components/mentions_line/mentions_line.vue'
import MentionsLine, {
MENTIONS_LIMIT
} from 'src/components/mentions_line/mentions_line.vue'
import HashtagLink from 'src/components/hashtag_link/hashtag_link.vue'
import './rich_content.scss'
@ -67,7 +73,7 @@ export default {
}
},
// NEVER EVER TOUCH DATA INSIDE RENDER
render () {
render() {
// Don't greentext MFM
const greentext = this.mfm ? false : this.greentext
@ -87,10 +93,12 @@ export default {
let tagsIndex = 0
const renderImage = (tag) => {
return <StillImage
return (
<StillImage
{...getAttrs(tag)}
class="img"
/>
)
}
const renderHashtag = (attrs, children, encounteredTextReverse) => {
@ -100,12 +108,20 @@ export default {
lastTags.push(linkData)
}
const { url, tag, content } = linkData
return <HashtagLink url={url} tag={tag} content={content}/>
return (
<HashtagLink
url={url}
tag={tag}
content={content}
/>
)
}
const renderMention = (attrs, children) => {
const linkData = getLinkData(attrs, children, mentionIndex++)
linkData.notifying = this.attentions.some(a => a.statusnet_profile_url === linkData.url)
linkData.notifying = this.attentions.some(
(a) => a.statusnet_profile_url === linkData.url
)
writtenMentions.push(linkData)
if (currentMentions === null) {
currentMentions = []
@ -115,7 +131,7 @@ export default {
invisibleMentions.push(linkData)
}
if (currentMentions.length === 1) {
return <MentionsLine mentions={ currentMentions } />
return <MentionsLine mentions={currentMentions} />
} else {
return ''
}
@ -134,23 +150,26 @@ export default {
// in MentionsLine
lastSpacing = item
// Don't remove last space in a container (fixes poast mentions)
return (index !== array.length - 1) && (currentMentions !== null) ? item.trim() : item
return index !== array.length - 1 && currentMentions !== null
? item.trim()
: item
}
currentMentions = null
if (item.includes(':')) {
item = ['', processTextForEmoji(
item,
this.emoji,
({ shortcode, url }) => {
return <StillImage
item = [
'',
processTextForEmoji(item, this.emoji, ({ shortcode, url }) => {
return (
<StillImage
class="emoji img"
src={url}
title={`:${shortcode}:`}
alt={`:${shortcode}:`}
/>
}
)]
)
})
]
}
return item
}
@ -169,7 +188,11 @@ export default {
// Padding is only needed if we just finished parsing mentions
previouslyMentions &&
// Don't add padding if content is string and has padding already
!(children && typeof children[0] === 'string' && children[0].match(/^\s/))
!(
children &&
typeof children[0] === 'string' &&
children[0].match(/^\s/)
)
? lastSpacing
: ''
switch (Tag) {
@ -188,7 +211,11 @@ export default {
break
}
case 'span':
if (this.handleLinks && attrs['class'] && attrs['class'].includes('h-card')) {
if (
this.handleLinks &&
attrs['class'] &&
attrs['class'].includes('h-card')
) {
return ['', children.map(processItem), '']
}
}
@ -196,10 +223,7 @@ export default {
if (children !== undefined) {
return [
'',
[
mentionsLinePadding,
[opener, children.map(processItem), closer]
],
[mentionsLinePadding, [opener, children.map(processItem), closer]],
''
]
} else {
@ -228,16 +252,17 @@ export default {
// should only be this
if (
(attrs['class'] && attrs['class'].includes('hashtag')) || // Pleroma style
(attrs['rel'] === 'tag') // Mastodon style
attrs['rel'] === 'tag' // Mastodon style
) {
return renderHashtag(attrs, children, encounteredTextReverse)
} else {
attrs.target = '_blank'
const newChildren = [...children].reverse().map(processItemReverse).reverse()
const newChildren = [...children]
.reverse()
.map(processItemReverse)
.reverse()
return <a {...attrs}>
{ newChildren }
</a>
return <a {...attrs}>{newChildren}</a>
}
case '':
return [...children].reverse().map(processItemReverse).reverse()
@ -248,11 +273,9 @@ export default {
const newChildren = Array.isArray(children)
? [...children].reverse().map(processItemReverse).reverse()
: children
return <Tag {...getAttrs(opener)}>
{ newChildren }
</Tag>
return <Tag {...getAttrs(opener)}>{newChildren}</Tag>
} else {
return <Tag/>
return <Tag />
}
}
return item
@ -263,9 +286,7 @@ export default {
// DO NOT USE SLOTS they cause a re-render feedback loop here.
// slots updated -> rerender -> emit -> update up the tree -> rerender -> ...
// at least until vue3?
const result = <span class="RichContent">
{ pass2 }
</span>
const result = <span class="RichContent">{pass2}</span>
const event = {
lastTags,
@ -311,7 +332,9 @@ export const preProcessPerLine = (html, greentext) => {
const greentextHandle = new Set(['p', 'div'])
const lines = convertHtmlToLines(html)
const newHtml = lines.reverse().map((item, index, array) => {
const newHtml = lines
.reverse()
.map((item, index, array) => {
if (!item.text) return item
const string = item.text
@ -320,11 +343,12 @@ export const preProcessPerLine = (html, greentext) => {
// Only if greentext is engaged
greentext &&
// Only handle p's and divs. Don't want to affect blockquotes, code etc
item.level.every(l => greentextHandle.has(l)) &&
item.level.every((l) => greentextHandle.has(l)) &&
// Only if line begins with '>' or '<'
(string.includes('&gt;') || string.includes('&lt;'))
) {
const cleanedString = string.replace(/<[^>]+?>/gi, '') // remove all tags
const cleanedString = string
.replace(/<[^>]+?>/gi, '') // remove all tags
.replace(/@\w+/gi, '') // remove mentions (even failed ones)
.trim()
if (cleanedString.startsWith('&gt;')) {
@ -335,7 +359,9 @@ export const preProcessPerLine = (html, greentext) => {
}
return string
}).reverse().join('')
})
.reverse()
.join('')
return { newHtml }
}

View file

@ -10,7 +10,7 @@
margin-bottom: 0.5em;
}
.suboptions {
margin-top: 0.3em
margin-top: 0.3em;
}
}
@ -49,7 +49,7 @@
height: 100%;
}
>.panel-body {
> .panel-body {
height: 100%;
overflow-y: hidden;
@ -63,7 +63,7 @@
.settings-footer {
display: flex;
>* {
> * {
margin-right: 0.5em;
}

View file

@ -10,7 +10,7 @@
> div,
> label {
display: block;
margin-bottom: .5em;
margin-bottom: 0.5em;
&:last-child {
margin-bottom: 0;
}
@ -21,7 +21,7 @@
.option-list {
margin: 0;
padding-left: .5em;
padding-left: 0.5em;
}
}

View file

@ -12,18 +12,18 @@
}
.bulk-action-button {
width: 10em
width: 10em;
}
.domain-mute-form {
padding: 1em;
display: flex;
flex-direction: column
flex-direction: column;
}
.domain-mute-button {
align-self: flex-end;
margin-top: 1em;
width: 10em
width: 10em;
}
}

View file

@ -12,7 +12,7 @@
padding-top: 5px;
}
input[type=file] {
input[type='file'] {
padding: 5px;
height: auto;
}

View file

@ -4,10 +4,10 @@
.theme-warning {
display: flex;
align-items: baseline;
margin-bottom: .5em;
margin-bottom: 0.5em;
.buttons {
.btn {
margin-bottom: .5em;
margin-bottom: 0.5em;
}
}
}
@ -25,29 +25,31 @@
}
&.disabled {
input, select {
opacity: .5
input,
select {
opacity: 0.5;
}
}
.opt {
margin: .5em;
margin: 0.5em;
}
.color-input {
flex: 0 0 0;
}
input, select {
input,
select {
min-width: 3em;
margin: 0;
flex: 0;
&[type=number] {
&[type='number'] {
min-width: 5em;
}
&[type=range] {
&[type='range'] {
flex: 1;
min-width: 3em;
align-self: flex-start;
@ -63,8 +65,7 @@
.reset-container,
.apply-container,
.radius-container,
.color-container,
{
.color-container {
display: flex;
}
@ -73,7 +74,7 @@
flex-direction: column;
}
.color-container{
.color-container {
> h4 {
width: 99%;
}
@ -100,7 +101,7 @@
p {
flex: 1;
margin: 0;
margin-right: .5em;
margin-right: 0.5em;
}
}
@ -112,14 +113,14 @@
min-width: 1px;
flex: 0 auto;
padding: 0 1em;
margin-bottom: .5em;
margin-bottom: 0.5em;
}
}
.shadow-selector {
.override {
flex: 1;
margin-left: .5em;
margin-left: 0.5em;
}
.select-container {
margin-top: -4px;
@ -136,7 +137,7 @@
.presets,
.import-export {
margin-bottom: .5em;
margin-bottom: 0.5em;
}
.import-export {
@ -144,16 +145,16 @@
}
.override {
margin-left: .5em;
margin-left: 0.5em;
}
}
.save-load-options {
flex-wrap: wrap;
margin-top: .5em;
margin-top: 0.5em;
justify-content: center;
.keep-option {
margin: 0 .5em .5em;
margin: 0 0.5em 0.5em;
min-width: 25%;
}
}
@ -179,11 +180,11 @@
flex: 1;
h4 {
margin-bottom: .25em;
margin-bottom: 0.25em;
}
.icons {
margin-top: .5em;
margin-top: 0.5em;
display: flex;
i {
@ -199,8 +200,19 @@
align-items: center;
}
.avatar, .avatar-alt{
background: linear-gradient(135deg, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%);
.avatar,
.avatar-alt {
background: linear-gradient(
135deg,
#b8e1fc 0%,
#a9d2f3 10%,
#90bae4 25%,
#90bcea 37%,
#90bff0 50%,
#6ba8e5 51%,
#a2daf5 83%,
#bdf3fd 100%
);
color: black;
font-family: sans-serif;
text-align: center;
@ -255,21 +267,21 @@
.color-item {
min-width: 20em;
margin: 5px 6px 0 0;
display:flex;
display: flex;
flex-direction: column;
flex: 1 1 0;
&.wide {
min-width: 60%
min-width: 60%;
}
&:not(.wide):nth-child(2n+1) {
&:not(.wide):nth-child(2n + 1) {
margin-right: 7px;
}
.color, .opacity {
display:flex;
.color,
.opacity {
display: flex;
align-items: baseline;
}
}
@ -301,7 +313,7 @@
flex: 1;
}
.theme-radius-lb{
.theme-radius-lb {
max-width: 50em;
}
@ -310,8 +322,8 @@
}
.btn {
margin-left: .25em;
margin-right: .25em;
margin-left: 0.25em;
margin-right: 0.25em;
}
}

View file

@ -105,8 +105,8 @@
.media-body-wrapper {
min-height: 0;
mask:
linear-gradient(to top, white, transparent) bottom/100% 70px no-repeat,
mask: linear-gradient(to top, white, transparent) bottom/100% 70px
no-repeat,
linear-gradient(to top, white, white);
/* Autoprefixed seem to ignore this one, and also syntax is different */
@ -210,4 +210,3 @@
}
}
}

View file

@ -5,7 +5,7 @@ import { FontAwesomeIcon as FAIcon } from '@fortawesome/vue-fontawesome'
import './tab_switcher.scss'
const findFirstUsable = (slots) => slots.findIndex(_ => _.props)
const findFirstUsable = (slots) => slots.findIndex((_) => _.props)
export default {
name: 'TabSwitcher',
@ -41,58 +41,61 @@ export default {
default: false
}
},
data () {
data() {
return {
active: findFirstUsable(this.slots())
}
},
computed: {
activeIndex () {
activeIndex() {
// In case of controlled component
if (this.activeTab) {
return this.slots().findIndex(slot => slot && slot.props && this.activeTab === slot.props.key)
return this.slots().findIndex(
(slot) => slot && slot.props && this.activeTab === slot.props.key
)
} else {
return this.active
}
},
isActive () {
return tabName => {
const isWanted = slot => slot.props && slot.props['data-tab-name'] === tabName
isActive() {
return (tabName) => {
const isWanted = (slot) =>
slot.props && slot.props['data-tab-name'] === tabName
return this.$slots.default().findIndex(isWanted) === this.activeIndex
}
},
settingsModalVisible () {
settingsModalVisible() {
return this.settingsModalState === 'visible'
},
modModalVisible () {
modModalVisible() {
return this.modModalState === 'visible'
},
...mapState({
settingsModalState: state => state.interface.settingsModalState,
modModalState: state => state.interface.modModalState
settingsModalState: (state) => state.interface.settingsModalState,
modModalState: (state) => state.interface.modModalState
})
},
beforeUpdate () {
beforeUpdate() {
const currentSlot = this.slots()[this.active]
if (!currentSlot.props) {
this.active = findFirstUsable(this.slots())
}
},
methods: {
clickTab (index) {
clickTab(index) {
return (e) => {
e.preventDefault()
this.setTab(index)
}
},
// DO NOT put it to computed, it doesn't work (caching?)
slots () {
slots() {
if (this.$slots.default()[0].type === Fragment) {
return this.$slots.default()[0].children
}
return this.$slots.default()
},
setTab (index) {
setTab(index) {
if (typeof this.onSwitch === 'function') {
this.onSwitch.call(null, this.slots()[index].key)
}
@ -102,9 +105,8 @@ export default {
}
}
},
render () {
const tabs = this.slots()
.map((slot, index) => {
render() {
const tabs = this.slots().map((slot, index) => {
const props = slot.props
if (!props) return
const classesTab = ['tab', 'button-default']
@ -122,7 +124,10 @@ export default {
class={classesTab.join(' ')}
type="button"
>
<img src={props.image} title={props['image-tooltip']}/>
<img
src={props.image}
title={props['image-tooltip']}
/>
{props.label ? '' : props.label}
</button>
</div>
@ -136,10 +141,17 @@ export default {
class={classesTab.join(' ')}
type="button"
>
{!props.icon ? '' : (<FAIcon class="tab-icon" size="2x" fixed-width icon={props.icon}/>)}
<span class="text">
{props.label}
</span>
{!props.icon ? (
''
) : (
<FAIcon
class="tab-icon"
size="2x"
fixed-width
icon={props.icon}
/>
)}
<span class="text">{props.label}</span>
</button>
</div>
)
@ -149,31 +161,25 @@ export default {
const props = slot.props
if (!props) return
const active = this.activeIndex === index
const classes = [ active ? 'active' : 'hidden' ]
const classes = [active ? 'active' : 'hidden']
if (props.fullHeight) {
classes.push('full-height')
}
const renderSlot = (!this.renderOnlyFocused || active)
? slot
: ''
const renderSlot = !this.renderOnlyFocused || active ? slot : ''
return (
<div class={classes}>
{
this.sideTabBar
? <h1 class="mobile-label">{props.label}</h1>
: ''
}
{this.sideTabBar ? <h1 class="mobile-label">{props.label}</h1> : ''}
{renderSlot}
</div>
)
})
return (
<div class={'tab-switcher ' + (this.sideTabBar ? 'side-tabs' : 'top-tabs')}>
<div class="tabs">
{tabs}
</div>
<div
class={'tab-switcher ' + (this.sideTabBar ? 'side-tabs' : 'top-tabs')}
>
<div class="tabs">{tabs}</div>
<div
ref="contents"
class={'contents' + (this.scrollableTabs ? ' scrollable-tabs' : '')}

View file

@ -22,7 +22,8 @@
}
.timeline-heading {
.button-default, .alert {
.button-default,
.alert {
line-height: 2em;
width: 100%;
}

View file

@ -6,27 +6,27 @@ import './with_load_more.scss'
import { FontAwesomeIcon as FAIcon } from '@fortawesome/vue-fontawesome'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faCircleNotch
} from '@fortawesome/free-solid-svg-icons'
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
library.add(
faCircleNotch
)
library.add(faCircleNotch)
const withLoadMore = ({
const withLoadMore =
({
fetch, // function to fetch entries and return a promise
select, // function to select data from store
unmounted, // function called at "destroyed" lifecycle
childPropName = 'entries', // name of the prop to be passed into the wrapped component
additionalPropNames = [] // additional prop name list of the wrapper component
}) => (WrappedComponent) => {
}) =>
(WrappedComponent) => {
const originalProps = Object.keys(getComponentProps(WrappedComponent))
const props = originalProps.filter(v => v !== childPropName).concat(additionalPropNames)
const props = originalProps
.filter((v) => v !== childPropName)
.concat(additionalPropNames)
return {
props,
data () {
data() {
return {
loading: false,
bottomedOut: false,
@ -34,23 +34,23 @@ const withLoadMore = ({
entries: []
}
},
created () {
created() {
window.addEventListener('scroll', this.scrollLoad)
if (this.entries.length === 0) {
this.fetchEntries()
}
},
unmounted () {
unmounted() {
window.removeEventListener('scroll', this.scrollLoad)
unmounted && unmounted(this.$props, this.$store)
},
methods: {
// Entries is not a computed because computed can't track the dynamic
// selector for changes and won't trigger after fetch.
updateEntries () {
updateEntries() {
this.entries = select(this.$props, this.$store) || []
},
fetchEntries () {
fetchEntries() {
if (!this.loading) {
this.loading = true
this.error = false
@ -68,19 +68,20 @@ const withLoadMore = ({
})
}
},
scrollLoad (e) {
scrollLoad(e) {
const bodyBRect = document.body.getBoundingClientRect()
const height = Math.max(bodyBRect.height, -(bodyBRect.y))
if (this.loading === false &&
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)
window.innerHeight + window.pageYOffset >= height - 750
) {
this.fetchEntries()
}
}
},
render () {
render() {
const props = {
...this.$props,
[childPropName]: this.entries
@ -88,22 +89,30 @@ const withLoadMore = ({
const children = this.$slots
return (
<div class="with-load-more">
<WrappedComponent {...props}>
{children}
</WrappedComponent>
<WrappedComponent {...props}>{children}</WrappedComponent>
<div class="with-load-more-footer">
{this.error &&
<button onClick={this.fetchEntries} class="button-unstyled -link -fullwidth alert error">
{this.error && (
<button
onClick={this.fetchEntries}
class="button-unstyled -link -fullwidth alert error"
>
{this.$t('general.generic_error')}
</button>
}
{!this.error && this.loading && <FAIcon spin icon="circle-notch"/>}
{!this.error && !this.loading && !this.bottomedOut && <a onClick={this.fetchEntries}>{this.$t('general.more')}</a>}
)}
{!this.error && this.loading && (
<FAIcon
spin
icon="circle-notch"
/>
)}
{!this.error && !this.loading && !this.bottomedOut && (
<a onClick={this.fetchEntries}>{this.$t('general.more')}</a>
)}
</div>
</div>
)
}
}
}
}
export default withLoadMore

View file

@ -1,4 +1,3 @@
@import '../../_variables.scss';
.with-load-more {

View file

@ -6,46 +6,46 @@ import './with_subscription.scss'
import { FontAwesomeIcon as FAIcon } from '@fortawesome/vue-fontawesome'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faCircleNotch
} from '@fortawesome/free-solid-svg-icons'
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
library.add(
faCircleNotch
)
library.add(faCircleNotch)
const withSubscription = ({
const withSubscription =
({
fetch, // function to fetch entries and return a promise
select, // function to select data from store
childPropName = 'content', // name of the prop to be passed into the wrapped component
additionalPropNames = [] // additional prop name list of the wrapper component
}) => (WrappedComponent) => {
}) =>
(WrappedComponent) => {
const originalProps = Object.keys(getComponentProps(WrappedComponent))
const props = originalProps.filter(v => v !== childPropName).concat(additionalPropNames)
const props = originalProps
.filter((v) => v !== childPropName)
.concat(additionalPropNames)
return {
props: [
...props,
'refresh' // boolean saying to force-fetch data whenever created
],
data () {
data() {
return {
loading: false,
error: false
}
},
computed: {
fetchedData () {
fetchedData() {
return select(this.$props, this.$store)
}
},
created () {
created() {
if (this.refresh || isEmpty(this.fetchedData)) {
this.fetchData()
}
},
methods: {
fetchData () {
fetchData() {
if (!this.loading) {
this.loading = true
this.error = false
@ -60,7 +60,7 @@ const withSubscription = ({
}
}
},
render () {
render() {
if (!this.error && !this.loading) {
const props = {
...this.$props,
@ -69,23 +69,30 @@ const withSubscription = ({
const children = this.$slots
return (
<div class="with-subscription">
<WrappedComponent {...props}>
{children}
</WrappedComponent>
<WrappedComponent {...props}>{children}</WrappedComponent>
</div>
)
} else {
return (
<div class="with-subscription-loading">
{this.error
? <a onClick={this.fetchData} class="alert error">{this.$t('general.generic_error')}</a>
: <FAIcon spin icon="circle-notch"/>
}
{this.error ? (
<a
onClick={this.fetchData}
class="alert error"
>
{this.$t('general.generic_error')}
</a>
) : (
<FAIcon
spin
icon="circle-notch"
/>
)}
</div>
)
}
}
}
}
}
export default withSubscription

View file

@ -17,10 +17,14 @@ exports.assertion = function (selector, count) {
}
this.command = function (cb) {
var self = this
return this.api.execute(function (selector) {
return this.api.execute(
function (selector) {
return document.querySelectorAll(selector).length
}, [selector], function (res) {
},
[selector],
function (res) {
cb.call(self, res)
})
}
)
}
}

View file

@ -3,43 +3,45 @@ var config = require('../../config')
// http://nightwatchjs.org/guide#settings-file
module.exports = {
'src_folders': ['test/e2e/specs'],
'output_folder': 'test/e2e/reports',
'custom_assertions_path': ['test/e2e/custom-assertions'],
src_folders: ['test/e2e/specs'],
output_folder: 'test/e2e/reports',
custom_assertions_path: ['test/e2e/custom-assertions'],
'selenium': {
'start_process': true,
'server_path': 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar',
'host': '127.0.0.1',
'port': 4444,
'cli_args': {
selenium: {
start_process: true,
server_path:
'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar',
host: '127.0.0.1',
port: 4444,
cli_args: {
'webdriver.chrome.driver': require('chromedriver').path
}
},
'test_settings': {
'default': {
'selenium_port': 4444,
'selenium_host': 'localhost',
'silent': true,
'globals': {
'devServerURL': 'http://localhost:' + (process.env.PORT || config.dev.port)
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL:
'http://localhost:' + (process.env.PORT || config.dev.port)
}
},
'chrome': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true
}
},
'firefox': {
'desiredCapabilities': {
'browserName': 'firefox',
'javascriptEnabled': true,
'acceptSslCerts': true
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
}
}
}

View file

@ -1,4 +1,5 @@
[{
[
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -42,12 +43,14 @@
"in_reply_to_id": "10423197",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "sampo@pleroma.soykaf.com",
"id": "14660",
"url": "https://pleroma.soykaf.com/users/sampo",
"username": "sampo"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -62,7 +65,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -105,7 +109,8 @@
"in_reply_to_account_id": "982",
"in_reply_to_id": "10423446",
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": "Jotaro - YES YES YES YES YES-sq_Fm7qfRQk.webm",
"id": "1104859167",
"preview_url": "https://shigusegubu.club/media/4596ab2f-28e6-4f26-83db-0f26f29848cd/Jotaro - YES YES YES YES YES-sq_Fm7qfRQk.webm",
@ -113,13 +118,16 @@
"text_url": "https://shigusegubu.club/media/4596ab2f-28e6-4f26-83db-0f26f29848cd/Jotaro - YES YES YES YES YES-sq_Fm7qfRQk.webm",
"type": "video",
"url": "https://shigusegubu.club/media/4596ab2f-28e6-4f26-83db-0f26f29848cd/Jotaro - YES YES YES YES YES-sq_Fm7qfRQk.webm"
}],
"mentions": [{
}
],
"mentions": [
{
"acct": "feld@bikeshed.party",
"id": "982",
"url": "https://bikeshed.party/users/feld",
"username": "feld"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -134,7 +142,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -177,7 +186,8 @@
"in_reply_to_account_id": null,
"in_reply_to_id": null,
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": "scrot_17-01-19_18-16-40.png",
"id": "-804793492",
"preview_url": "https://pleroma.soykaf.com/media/fd13d009-2c1f-4a53-9762-257e592a7ff6/scrot_17-01-19_18-16-40.png",
@ -185,13 +195,16 @@
"text_url": "https://pleroma.soykaf.com/media/fd13d009-2c1f-4a53-9762-257e592a7ff6/scrot_17-01-19_18-16-40.png",
"type": "image",
"url": "https://pleroma.soykaf.com/media/fd13d009-2c1f-4a53-9762-257e592a7ff6/scrot_17-01-19_18-16-40.png"
}],
"mentions": [{
}
],
"mentions": [
{
"acct": "sampo@pleroma.soykaf.com",
"id": "14660",
"url": "https://pleroma.soykaf.com/users/sampo",
"username": "sampo"
}],
}
],
"muted": false,
"reblog": {
"account": {
@ -236,7 +249,8 @@
"in_reply_to_account_id": null,
"in_reply_to_id": null,
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": "scrot_17-01-19_18-16-40.png",
"id": "-804793492",
"preview_url": "https://pleroma.soykaf.com/media/fd13d009-2c1f-4a53-9762-257e592a7ff6/scrot_17-01-19_18-16-40.png",
@ -244,7 +258,8 @@
"text_url": "https://pleroma.soykaf.com/media/fd13d009-2c1f-4a53-9762-257e592a7ff6/scrot_17-01-19_18-16-40.png",
"type": "image",
"url": "https://pleroma.soykaf.com/media/fd13d009-2c1f-4a53-9762-257e592a7ff6/scrot_17-01-19_18-16-40.png"
}],
}
],
"mentions": [],
"muted": false,
"reblog": null,
@ -273,7 +288,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -316,7 +332,8 @@
"in_reply_to_account_id": "982",
"in_reply_to_id": "10423380",
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": "Uhh No.avi-Xrne2-gOoqU.webm",
"id": "483179103",
"preview_url": "https://shigusegubu.club/media/65de40a9-a99b-4207-97d0-40dd836532db/Uhh No.avi-Xrne2-gOoqU.webm",
@ -324,13 +341,16 @@
"text_url": "https://shigusegubu.club/media/65de40a9-a99b-4207-97d0-40dd836532db/Uhh No.avi-Xrne2-gOoqU.webm",
"type": "video",
"url": "https://shigusegubu.club/media/65de40a9-a99b-4207-97d0-40dd836532db/Uhh No.avi-Xrne2-gOoqU.webm"
}],
"mentions": [{
}
],
"mentions": [
{
"acct": "feld@bikeshed.party",
"id": "982",
"url": "https://bikeshed.party/users/feld",
"username": "feld"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -345,7 +365,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -389,12 +410,14 @@
"in_reply_to_id": "10423114",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "fedebot@social.super-niche.club",
"id": "16633",
"url": "https://social.super-niche.club/user/31",
"username": "fedebot"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -409,7 +432,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -452,7 +476,8 @@
"in_reply_to_account_id": null,
"in_reply_to_id": null,
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": null,
"id": "1373175917",
"preview_url": "https://social.super-niche.club/file/c366cae1e5820d68dc1e6bc7a06a2f2bc15166de1faabea4f060490d45fdf527.jpg",
@ -460,13 +485,16 @@
"text_url": "https://social.super-niche.club/file/c366cae1e5820d68dc1e6bc7a06a2f2bc15166de1faabea4f060490d45fdf527.jpg",
"type": "image",
"url": "https://social.super-niche.club/file/c366cae1e5820d68dc1e6bc7a06a2f2bc15166de1faabea4f060490d45fdf527.jpg"
}],
"mentions": [{
}
],
"mentions": [
{
"acct": "fedebot@social.super-niche.club",
"id": "16633",
"url": "https://social.super-niche.club/user/31",
"username": "fedebot"
}],
}
],
"muted": false,
"reblog": {
"account": {
@ -511,7 +539,8 @@
"in_reply_to_account_id": null,
"in_reply_to_id": null,
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": null,
"id": "1373175917",
"preview_url": "https://social.super-niche.club/file/c366cae1e5820d68dc1e6bc7a06a2f2bc15166de1faabea4f060490d45fdf527.jpg",
@ -519,7 +548,8 @@
"text_url": "https://social.super-niche.club/file/c366cae1e5820d68dc1e6bc7a06a2f2bc15166de1faabea4f060490d45fdf527.jpg",
"type": "image",
"url": "https://social.super-niche.club/file/c366cae1e5820d68dc1e6bc7a06a2f2bc15166de1faabea4f060490d45fdf527.jpg"
}],
}
],
"mentions": [],
"muted": false,
"reblog": null,
@ -528,10 +558,12 @@
"replies_count": 0,
"sensitive": false,
"spoiler_text": "",
"tags": [{
"tags": [
{
"name": "animeirl",
"url": "/tag/animeirl"
}],
}
],
"uri": "tag:social.super-niche.club,2019-01-17:noticeId=2353002:objectType=note",
"url": "https://social.super-niche.club/notice/2353002",
"visibility": "public",
@ -544,17 +576,20 @@
"replies_count": 0,
"sensitive": false,
"spoiler_text": "",
"tags": [{
"tags": [
{
"name": "animeirl",
"url": "/tag/animeirl"
}],
}
],
"uri": "tag:social.super-niche.club,2019-01-17:noticeId=2353002:objectType=note",
"url": "tag:social.super-niche.club,2019-01-17:noticeId=2353002:objectType=note",
"visibility": "public",
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -597,7 +632,8 @@
"in_reply_to_account_id": null,
"in_reply_to_id": null,
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": "image.png",
"id": "-948580066",
"preview_url": "https://miniwa.moe/media/4076945a-4a3b-4fb3-8b62-04eb401697ff/image.png",
@ -605,13 +641,16 @@
"text_url": "https://miniwa.moe/media/4076945a-4a3b-4fb3-8b62-04eb401697ff/image.png",
"type": "image",
"url": "https://miniwa.moe/media/4076945a-4a3b-4fb3-8b62-04eb401697ff/image.png"
}],
"mentions": [{
}
],
"mentions": [
{
"acct": "ivesen@miniwa.moe",
"id": "39686",
"url": "https://miniwa.moe/users/ivesen",
"username": "ivesen"
}],
}
],
"muted": false,
"reblog": {
"account": {
@ -621,12 +660,14 @@
"bot": false,
"created_at": "2018-09-08T17:55:27.000Z",
"display_name": "tsumiki :bun:",
"emojis": [{
"emojis": [
{
"shortcode": "bun",
"static_url": "https://miniwa.moe/emoji/custom/bun.png",
"url": "https://miniwa.moe/emoji/custom/bun.png",
"visible_in_picker": false
}],
}
],
"fields": [],
"followers_count": 8,
"following_count": 3,
@ -661,7 +702,8 @@
"in_reply_to_account_id": null,
"in_reply_to_id": null,
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": "image.png",
"id": "-948580066",
"preview_url": "https://miniwa.moe/media/4076945a-4a3b-4fb3-8b62-04eb401697ff/image.png",
@ -669,7 +711,8 @@
"text_url": "https://miniwa.moe/media/4076945a-4a3b-4fb3-8b62-04eb401697ff/image.png",
"type": "image",
"url": "https://miniwa.moe/media/4076945a-4a3b-4fb3-8b62-04eb401697ff/image.png"
}],
}
],
"mentions": [],
"muted": false,
"reblog": null,
@ -698,7 +741,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -734,12 +778,14 @@
},
"content": "<span><a data-user=\"570\" href=\"https://social.sakamoto.gq/users/eal\">@<span>eal</span></a></span> thanks, alex jacobson :denton:",
"created_at": "2019-01-17T14:12:42.000Z",
"emojis": [{
"emojis": [
{
"shortcode": "denton",
"static_url": "https://shigusegubu.club/emoji/sgsgb/denton.png",
"url": "https://shigusegubu.club/emoji/sgsgb/denton.png",
"visible_in_picker": false
}],
}
],
"favourited": false,
"favourites_count": 0,
"id": "10419752",
@ -747,12 +793,14 @@
"in_reply_to_id": "10419729",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "eal@social.sakamoto.gq",
"id": "570",
"url": "https://social.sakamoto.gq/users/eal",
"username": "eal"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -767,7 +815,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -811,12 +860,14 @@
"in_reply_to_id": "10419694",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "pony@blovice.bahnhof.cz",
"id": "4395",
"url": "https://blovice.bahnhof.cz/users/pony",
"username": "pony"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -831,7 +882,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -890,7 +942,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -949,7 +1002,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1008,7 +1062,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1052,12 +1107,14 @@
"in_reply_to_id": "10394997",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "lanodan@queer.hacktivis.me",
"id": "27194",
"url": "https://queer.hacktivis.me/users/lanodan",
"username": "lanodan"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -1072,7 +1129,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1116,12 +1174,14 @@
"in_reply_to_id": "10394990",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "lain@pleroma.soykaf.com",
"id": "58",
"url": "https://pleroma.soykaf.com/users/lain",
"username": "lain"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -1136,7 +1196,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1180,12 +1241,14 @@
"in_reply_to_id": "10394677",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "cathode@pleroma.site",
"id": "55339",
"url": "https://pleroma.site/users/cathode",
"username": "cathode"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -1200,7 +1263,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1244,12 +1308,14 @@
"in_reply_to_id": null,
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "cathode@pleroma.site",
"id": "55339",
"url": "https://pleroma.site/users/cathode",
"username": "cathode"
}],
}
],
"muted": false,
"reblog": {
"account": {
@ -1323,7 +1389,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1367,12 +1434,14 @@
"in_reply_to_id": "10394582",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "lain@pleroma.soykaf.com",
"id": "58",
"url": "https://pleroma.soykaf.com/users/lain",
"username": "lain"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -1387,7 +1456,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1430,7 +1500,8 @@
"in_reply_to_account_id": null,
"in_reply_to_id": null,
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": null,
"id": "-1089888084",
"preview_url": "https://pleroma.soykaf.com/media/d985e90d-b079-4f6a-a5bc-9b5e26b1fa5a/Tusky_1547676391813_2VJ7ITWJ3T.webm",
@ -1438,13 +1509,16 @@
"text_url": "https://pleroma.soykaf.com/media/d985e90d-b079-4f6a-a5bc-9b5e26b1fa5a/Tusky_1547676391813_2VJ7ITWJ3T.webm",
"type": "video",
"url": "https://pleroma.soykaf.com/media/d985e90d-b079-4f6a-a5bc-9b5e26b1fa5a/Tusky_1547676391813_2VJ7ITWJ3T.webm"
}],
"mentions": [{
}
],
"mentions": [
{
"acct": "lain@pleroma.soykaf.com",
"id": "58",
"url": "https://pleroma.soykaf.com/users/lain",
"username": "lain"
}],
}
],
"muted": false,
"reblog": {
"account": {
@ -1489,7 +1563,8 @@
"in_reply_to_account_id": null,
"in_reply_to_id": null,
"language": null,
"media_attachments": [{
"media_attachments": [
{
"description": null,
"id": "-1089888084",
"preview_url": "https://pleroma.soykaf.com/media/d985e90d-b079-4f6a-a5bc-9b5e26b1fa5a/Tusky_1547676391813_2VJ7ITWJ3T.webm",
@ -1497,7 +1572,8 @@
"text_url": "https://pleroma.soykaf.com/media/d985e90d-b079-4f6a-a5bc-9b5e26b1fa5a/Tusky_1547676391813_2VJ7ITWJ3T.webm",
"type": "video",
"url": "https://pleroma.soykaf.com/media/d985e90d-b079-4f6a-a5bc-9b5e26b1fa5a/Tusky_1547676391813_2VJ7ITWJ3T.webm"
}],
}
],
"mentions": [],
"muted": false,
"reblog": null,
@ -1526,7 +1602,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1570,12 +1647,14 @@
"in_reply_to_id": "10393849",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "proxeus@iscute.moe",
"id": "17544",
"url": "https://iscute.moe/users/proxeus",
"username": "proxeus"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -1590,7 +1669,8 @@
"pleroma": {
"local": true
}
}, {
},
{
"account": {
"acct": "hj",
"avatar": "https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png",
@ -1634,12 +1714,14 @@
"in_reply_to_id": "10393808",
"language": null,
"media_attachments": [],
"mentions": [{
"mentions": [
{
"acct": "cdmnky",
"id": "60913",
"url": "https://shigusegubu.club/users/cdmnky",
"username": "cdmnky"
}],
}
],
"muted": false,
"reblog": null,
"reblogged": false,
@ -1654,4 +1736,5 @@
"pleroma": {
"local": true
}
}]
}
]

File diff suppressed because it is too large Load diff

View file

@ -63,16 +63,12 @@ module.exports = function (config) {
frameworks: ['mocha', 'sinon-chai'],
reporters: ['mocha'],
customLaunchers: {
'FirefoxHeadless': {
FirefoxHeadless: {
base: 'Firefox',
flags: [
'-headless'
]
flags: ['-headless']
}
},
files: [
'./index.js'
],
files: ['./index.js'],
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
},
@ -85,10 +81,7 @@ module.exports = function (config) {
},
coverageReporter: {
dir: './coverage',
reporters: [
{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' }
]
reporters: [{ type: 'lcov', subdir: '.' }, { type: 'text-summary' }]
}
})
}

View file

@ -26,10 +26,10 @@ const run = () => {
let data = fs.readFileSync(newEmojiFilename, 'utf8')
// First filter out anything that's more than one codepoint
const newEmojis = JSON.parse(data).emojis.filter(e => e.emoji.length <= 2)
const newEmojis = JSON.parse(data).emojis.filter((e) => e.emoji.length <= 2)
// Create a table with format { shortname: emoji }, remove the :
newEmojis.forEach(e => {
newEmojis.forEach((e) => {
const name = e.shortname.slice(1, e.shortname.length - 1).toLowerCase()
if (name.length > 0) {
newEmojisObject[name] = e.emoji
@ -41,27 +41,34 @@ const run = () => {
emojisObject = JSON.parse(data)
// Get rid of longer emojis that don't play nice with reactions
Object.keys(emojisObject).forEach(e => {
Object.keys(emojisObject).forEach((e) => {
if (emojisObject[e].length > 2) emojisObject[e] = undefined
})
// Add new emojis from the new tables to the old table
Object.keys(newEmojisObject).forEach(e => {
Object.keys(newEmojisObject).forEach((e) => {
if (!emojisObject[e] && newEmojisObject[e].length <= 2) {
emojisObject[e] = newEmojisObject[e]
}
})
// Sort by key
const sorted = Object.keys(emojisObject).sort().reduce((acc, key) => {
const sorted = Object.keys(emojisObject)
.sort()
.reduce((acc, key) => {
if (key.length === 0) return acc
acc[key] = emojisObject[key]
return acc
}, {})
fs.writeFile(outputFilename, JSON.stringify(sorted, null, 2), 'utf8', (err) => {
fs.writeFile(
outputFilename,
JSON.stringify(sorted, null, 2),
'utf8',
(err) => {
if (err) console.log('Error writing file', err)
})
}
)
}
run()