Big 'ol set of patches and dep maintenance (#212)

Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: AkkomaGang/pleroma-fe#212
This commit is contained in:
floatingghost 2022-11-15 15:47:32 +00:00
parent 0770981a20
commit db46879a8f
35 changed files with 2034 additions and 3411 deletions

View file

@ -1,17 +1,17 @@
module.exports = { module.exports = {
root: true, root: true,
parserOptions: { parserOptions: {
parser: 'babel-eslint', parser: '@babel/eslint-parser',
sourceType: 'module' sourceType: 'module'
}, },
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: [ extends: [
'standard',
'plugin:vue/recommended' 'plugin:vue/recommended'
], ],
// required to lint *.vue files // required to lint *.vue files
plugins: [ plugins: [
'vue' 'vue',
'import'
], ],
// add your custom rules here // add your custom rules here
rules: { rules: {
@ -23,6 +23,8 @@ module.exports = {
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'vue/require-prop-types': 0, 'vue/require-prop-types': 0,
'vue/no-unused-vars': 0, 'vue/no-unused-vars': 0,
'no-tabs': 0 'no-tabs': 0,
'vue/multi-word-component-names': 0,
'vue/no-reserved-component-names': 0
} }
} }

View file

@ -3,7 +3,7 @@ pipeline:
when: when:
event: event:
- pull_request - pull_request
image: node:16 image: node:18
commands: commands:
- yarn - yarn
- yarn lint - yarn lint
@ -13,7 +13,7 @@ pipeline:
when: when:
event: event:
- pull_request - pull_request
image: node:16 image: node:18
commands: commands:
- apt update - apt update
- apt install firefox-esr -y --no-install-recommends - apt install firefox-esr -y --no-install-recommends
@ -27,7 +27,7 @@ pipeline:
branch: branch:
- develop - develop
- stable - stable
image: node:16 image: node:18
commands: commands:
- yarn - yarn
- yarn build - yarn build
@ -39,7 +39,7 @@ pipeline:
branch: branch:
- develop - develop
- stable - stable
image: node:16 image: node:18
secrets: secrets:
- SCW_ACCESS_KEY - SCW_ACCESS_KEY
- SCW_SECRET_KEY - SCW_SECRET_KEY

24
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,24 @@
# Akkoma Code of Conduct
The Akkoma project aims to be **enjoyable** for anyone to participate in, regardless of their identity or level of expertise. To achieve this, the community must create an environment which is **safe** and **equitable**; the following guidelines have been created with these goals in mind.
1. **Treat individuals with respect.** Differing experiences and viewpoints deserve to be respected, and bigotry and harassment are not tolerated under any circumstances.
- Individuals should at all times be treated as equals, regardless of their age, gender, sexuality, race, ethnicity, _or any other characteristic_, intrinsic or otherwise.
- Behaviour that is harmful in nature should be addressed and corrected *regardless of intent*.
- Respect personal boundaries and ask for clarification whenever they are unclear.
- (Obviously, hate does not count as merely a "differing viewpoint", because it is harmful in nature.)
2. **Be understanding of differences in communication.** Not everyone is aware of unspoken social cues, and speech that is not intended to be offensive should not be treated as such simply due to an atypical manner of communication.
- Somebody who speaks bluntly is not necessarily rude, and somebody who swears a lot is not necessarily volatile.
- Try to confirm your interpretation of their intent rather than assuming bad faith.
- Someone may not communicate as, or come across as a picture of "professionalism", but this should not be seen as a reason to dismiss them. This is a **casual** space, and communication styles can reflect that.
3. **"Uncomfortable" does not mean "unsafe".** In an ideal world, the community would be safe, equitable, enjoyable, *and* comfortable for all members at all times. Unfortunately, this is not always possible in reality.
- Safety and equity will be prioritized over comfort whenever it is necessary to do so.
- Weaponizing one's own discomfort to deflect accountability or censor an individual (e.g. "white fragility") is a form of discriminatory conduct.
4. **Let people grow from their mistakes.** Nobody is perfect; even the most well-meaning individual can do something hurtful. Everyone should be given a fair opportunity to explain themselves and correct their behaviour. Portraying someone as inherently malicious prevents improvement and shifts focus away from the *action* that was problematic.
- Avoid bringing up past events that do not accurately reflect an individual's current actions or beliefs. (This is, of course, different from providing evidence of a recurring pattern of behaviour.)
---
This document was adapted from one created by ~keith as part of punks default repository template, and is licensed under CC-BY-SA 4.0. The original template is here: <https://bytes.keithhacks.cyou/keith/default-template>

View file

@ -1,49 +0,0 @@
```
o$$$$$$oo
o$" "$oo
$ o""""$o "$o
"$ o "o "o $
"$ $o $ $ o$
"$ o$"$ o$
"$ooooo$$ $ o$
o$ """ $ " $$$ " $
o$ $o $$" " "
$$ $ " $ $$$o"$ o o$"
$" o "" $ $" " o" $$
$o " " $ o$" o" o$"
"$o $$ $ o" o$$"
""o$o"$" $oo" o$"
o$$ $ $$$ o$$
o" o oo"" "" "$o
o$o" "" $
$" " o" " " " "o
$$ " " o$ o$o " $
o$ $ $ o$$ " " ""
o $ $" " "o o$
$ o $o$oo$""
$o $ o o o"$$
$o o $ $ "$o
$o $ o $ $ "o
$ $ "o $ "o"$o
$ " o $ o $$
$o$o$o$o$$o$$$o$$o$o$$o$$o$$$o$o$o$o$o$o$o$o$o$ooo
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " $$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$"
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ooooo$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"""""
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
"$o$o$o$o$o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"""
"""""""""""""""""""""""""""""""""""""""""""""""""""""
```

View file

@ -29,18 +29,6 @@ var devMiddleware = require('webpack-dev-middleware')(compiler, {
}) })
var hotMiddleware = require('webpack-hot-middleware')(compiler) var hotMiddleware = require('webpack-hot-middleware')(compiler)
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
// FIXME: This supposed to reload whole page when index.html is changed,
// however now it reloads entire page on every breath, i suppose the order
// of plugins changed or something. It's a minor thing and douesn't hurt
// disabling it, constant reloads hurt much more
// hotMiddleware.publish({ action: 'reload' })
// cb()
})
})
// proxy api requests // proxy api requests
Object.keys(proxyTable).forEach(function (context) { Object.keys(proxyTable).forEach(function (context) {

View file

@ -2,8 +2,7 @@ var path = require('path')
var config = require('../config') var config = require('../config')
var utils = require('./utils') var utils = require('./utils')
var projectRoot = path.resolve(__dirname, '../') var projectRoot = path.resolve(__dirname, '../')
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin') const WorkboxPlugin = require('workbox-webpack-plugin');
var CopyPlugin = require('copy-webpack-plugin');
var { VueLoaderPlugin } = require('vue-loader') var { VueLoaderPlugin } = require('vue-loader')
var env = process.env.NODE_ENV var env = process.env.NODE_ENV
@ -20,6 +19,7 @@ module.exports = {
app: './src/main.js' app: './src/main.js'
}, },
output: { output: {
hashFunction: "sha256", // Workaround for builds with OpenSSL 3.
path: config.build.assetsRoot, 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' filename: '[name].js'
@ -34,6 +34,9 @@ module.exports = {
modules: [ modules: [
path.join(__dirname, '../node_modules') path.join(__dirname, '../node_modules')
], ],
fallback: {
"url": require.resolve("url/"),
},
alias: { alias: {
'static': path.resolve(__dirname, '../static'), 'static': path.resolve(__dirname, '../static'),
'src': path.resolve(__dirname, '../src'), 'src': path.resolve(__dirname, '../src'),
@ -116,23 +119,11 @@ module.exports = {
] ]
}, },
plugins: [ plugins: [
new ServiceWorkerWebpackPlugin({ new WorkboxPlugin.InjectManifest({
entry: path.join(__dirname, '..', 'src/sw.js'), swSrc: path.join(__dirname, '..', 'src/sw.js'),
filename: 'sw-pleroma.js' swDest: 'sw-pleroma.js',
maximumFileSizeToCacheInBytes: 15 * 1024 * 1024,
}), }),
new VueLoaderPlugin(), new VueLoaderPlugin()
// This copies Ruffle's WASM to a directory so that JS side can access it
new CopyPlugin({
patterns: [
{
from: "node_modules/ruffle-mirror/*",
to: "static/ruffle",
flatten: true
},
],
options: {
concurrency: 100,
},
})
] ]
} }

View file

@ -1,6 +1,6 @@
var config = require('../config') var config = require('../config')
var webpack = require('webpack') var webpack = require('webpack')
var merge = require('webpack-merge') var { merge } = require('webpack-merge')
var utils = require('./utils') var utils = require('./utils')
var baseWebpackConfig = require('./webpack.base.conf') var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin') var HtmlWebpackPlugin = require('html-webpack-plugin')
@ -16,7 +16,7 @@ module.exports = merge(baseWebpackConfig, {
}, },
mode: 'development', mode: 'development',
// eval-source-map is faster for development // eval-source-map is faster for development
devtool: '#eval-source-map', devtool: 'eval-source-map',
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': config.dev.env, 'process.env': config.dev.env,

View file

@ -2,7 +2,7 @@ var path = require('path')
var config = require('../config') var config = require('../config')
var utils = require('./utils') var utils = require('./utils')
var webpack = require('webpack') var webpack = require('webpack')
var merge = require('webpack-merge') var { merge } = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf') var baseWebpackConfig = require('./webpack.base.conf')
var MiniCssExtractPlugin = require('mini-css-extract-plugin') var MiniCssExtractPlugin = require('mini-css-extract-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin') var HtmlWebpackPlugin = require('html-webpack-plugin')
@ -19,7 +19,7 @@ var webpackConfig = merge(baseWebpackConfig, {
module: { module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, extract: true }) rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, extract: true })
}, },
devtool: config.build.productionSourceMap ? '#source-map' : false, devtool: 'source-map',
optimization: { optimization: {
minimize: true, minimize: true,
splitChunks: { splitChunks: {
@ -62,7 +62,7 @@ var webpackConfig = merge(baseWebpackConfig, {
// https://github.com/kangax/html-minifier#options-quick-reference // https://github.com/kangax/html-minifier#options-quick-reference
}, },
// necessary to consistently work with multiple chunks via CommonsChunkPlugin // necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency' chunksSortMode: 'auto'
}), }),
// split vendor js into its own file // split vendor js into its own file
// extract webpack runtime and module manifest to its own file in order to // extract webpack runtime and module manifest to its own file in order to

View file

@ -1,4 +1,4 @@
var merge = require('webpack-merge') var { merge } = require('webpack-merge')
var prodEnv = require('./prod.env') var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, { module.exports = merge(prodEnv, {

View file

@ -1,4 +1,4 @@
var merge = require('webpack-merge') var { merge } = require('webpack-merge')
var devEnv = require('./dev.env') var devEnv = require('./dev.env')
module.exports = merge(devEnv, { module.exports = merge(devEnv, {

View file

@ -70,9 +70,6 @@ Default post formatting option (markdown/bbcode/plaintext/etc...)
### `redirectRootNoLogin`, `redirectRootLogin` ### `redirectRootNoLogin`, `redirectRootLogin`
These two settings should point to where FE should redirect visitor when they login/open up website root These two settings should point to where FE should redirect visitor when they login/open up website root
### `scopeCopy`
Copy post scope (visibility) when replying to a post. Instance-default.
### `sidebarRight` ### `sidebarRight`
Change alignment of sidebar and panels to the right. Defaults to `false`. Change alignment of sidebar and panels to the right. Defaults to `false`.

View file

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<title>Pleroma</title> <title>Akkoma</title>
<link rel="stylesheet" href="/static/font/css/fontello.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/css/animation.css">
<link rel="stylesheet" href="/static/font/tiresias.css"> <link rel="stylesheet" href="/static/font/tiresias.css">
@ -13,7 +13,7 @@
<link rel="icon" type="image/png" href="/favicon.png"> <link rel="icon" type="image/png" href="/favicon.png">
</head> </head>
<body class="hidden"> <body class="hidden">
<noscript>To use Pleroma, please enable JavaScript.</noscript> <noscript>To use Akkoma, please enable JavaScript.</noscript>
<div id="app"></div> <div id="app"></div>
<div id="modal"></div> <div id="modal"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->

View file

@ -33,13 +33,13 @@
"escape-html": "1.0.3", "escape-html": "1.0.3",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"localforage": "1.10.0", "localforage": "1.10.0",
"marked": "^4.0.17", "marked": "^4.2.2",
"marked-mfm": "^0.5.0", "marked-mfm": "^0.5.0",
"parse-link-header": "1.0.1", "parse-link-header": "^2.0.0",
"phoenix": "1.6.2", "phoenix": "1.6.2",
"punycode.js": "2.1.0", "punycode.js": "2.1.0",
"qrcode": "1", "qrcode": "1",
"ruffle-mirror": "2021.12.31", "url": "^0.11.0",
"vue": "^3.2.31", "vue": "^3.2.31",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-router": "4.0.14", "vue-router": "4.0.14",
@ -48,6 +48,7 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.17.8", "@babel/core": "7.17.8",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-transform-runtime": "7.17.0", "@babel/plugin-transform-runtime": "7.17.0",
"@babel/preset-env": "7.16.11", "@babel/preset-env": "7.16.11",
"@babel/register": "7.17.7", "@babel/register": "7.17.7",
@ -58,31 +59,29 @@
"@vue/compiler-sfc": "^3.1.0", "@vue/compiler-sfc": "^3.1.0",
"@vue/test-utils": "^2.0.2", "@vue/test-utils": "^2.0.2",
"autoprefixer": "6.7.7", "autoprefixer": "6.7.7",
"babel-eslint": "7.2.3", "babel-loader": "^9.1.0",
"babel-loader": "8.2.4",
"babel-plugin-lodash": "3.3.4", "babel-plugin-lodash": "3.3.4",
"chai": "3.5.0", "chai": "^4.3.7",
"chalk": "1.1.3", "chalk": "1.1.3",
"chromedriver": "87.0.7", "chromedriver": "^107.0.3",
"connect-history-api-fallback": "1.6.0", "connect-history-api-fallback": "^2.0.0",
"copy-webpack-plugin": "6.4.1", "cross-spawn": "^7.0.3",
"cross-spawn": "4.0.2", "css-loader": "^6.7.2",
"css-loader": "0.28.11", "custom-event-polyfill": "^1.0.7",
"custom-event-polyfill": "1.0.7", "eslint": "^7.32.0",
"eslint": "5.16.0", "eslint-config-standard": "^17.0.0",
"eslint-config-standard": "12.0.0", "eslint-friendly-formatter": "^4.0.1",
"eslint-friendly-formatter": "2.0.7", "eslint-loader": "^4.0.2",
"eslint-loader": "2.2.1", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "2.25.4", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-node": "7.0.1", "eslint-plugin-promise": "^6.1.1",
"eslint-plugin-promise": "4.3.1", "eslint-plugin-standard": "^5.0.0",
"eslint-plugin-standard": "4.1.0", "eslint-plugin-vue": "^9.7.0",
"eslint-plugin-vue": "5.2.3",
"eventsource-polyfill": "0.9.6", "eventsource-polyfill": "0.9.6",
"express": "4.17.3", "express": "4.17.3",
"file-loader": "3.0.1", "file-loader": "^6.2.0",
"function-bind": "1.1.1", "function-bind": "1.1.1",
"html-webpack-plugin": "3.2.0", "html-webpack-plugin": "^5.5.0",
"http-proxy-middleware": "0.21.0", "http-proxy-middleware": "0.21.0",
"inject-loader": "2.0.1", "inject-loader": "2.0.1",
"iso-639-1": "2.1.15", "iso-639-1": "2.1.15",
@ -96,7 +95,7 @@
"karma-sinon-chai": "2.0.2", "karma-sinon-chai": "2.0.2",
"karma-sourcemap-loader": "0.3.8", "karma-sourcemap-loader": "0.3.8",
"karma-spec-reporter": "0.0.33", "karma-spec-reporter": "0.0.33",
"karma-webpack": "4.0.2", "karma-webpack": "^5.0.0",
"lodash": "4.17.21", "lodash": "4.17.21",
"lolex": "1.6.0", "lolex": "1.6.0",
"mini-css-extract-plugin": "0.12.0", "mini-css-extract-plugin": "0.12.0",
@ -106,27 +105,27 @@
"ora": "0.4.1", "ora": "0.4.1",
"postcss-loader": "3.0.0", "postcss-loader": "3.0.0",
"raw-loader": "0.5.1", "raw-loader": "0.5.1",
"sass": "1.53.0", "sass": "^1.56.0",
"sass-loader": "7.3.1", "sass-loader": "^13.2.0",
"selenium-server": "2.53.1", "selenium-server": "2.53.1",
"semver": "5.7.1", "semver": "5.7.1",
"serviceworker-webpack-plugin": "1.0.1",
"shelljs": "0.8.5", "shelljs": "0.8.5",
"sinon": "2.4.1", "sinon": "2.4.1",
"sinon-chai": "2.14.0", "sinon-chai": "2.14.0",
"stylelint": "13.6.1", "stylelint": "13.6.1",
"stylelint-config-standard": "20.0.0", "stylelint-config-standard": "20.0.0",
"stylelint-rscss": "0.4.0", "stylelint-rscss": "0.4.0",
"url-loader": "1.1.2", "url-loader": "^4.1.1",
"vue-loader": "^16.0.0", "vue-loader": "^17.0.0",
"vue-style-loader": "4.1.2", "vue-style-loader": "^4.1.2",
"webpack": "4.46.0", "webpack": "^5.75.0",
"webpack-dev-middleware": "3.7.3", "webpack-dev-middleware": "^5.3.3",
"webpack-hot-middleware": "2.25.1", "webpack-hot-middleware": "^2.25.1",
"webpack-merge": "0.20.0" "webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.5.4"
}, },
"engines": { "engines": {
"node": ">= 4.0.0", "node": ">= 16.0.0",
"npm": ">= 3.0.0" "npm": ">= 3.0.0"
} }
} }

View file

@ -170,10 +170,8 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
copyInstanceOption('redirectRootNoLogin') copyInstanceOption('redirectRootNoLogin')
copyInstanceOption('redirectRootLogin') copyInstanceOption('redirectRootLogin')
copyInstanceOption('showInstanceSpecificPanel') copyInstanceOption('showInstanceSpecificPanel')
copyInstanceOption('minimalScopesMode')
copyInstanceOption('hideMutedPosts') copyInstanceOption('hideMutedPosts')
copyInstanceOption('collapseMessageWithSubject') copyInstanceOption('collapseMessageWithSubject')
copyInstanceOption('scopeCopy')
copyInstanceOption('subjectLineBehavior') copyInstanceOption('subjectLineBehavior')
copyInstanceOption('postContentType') copyInstanceOption('postContentType')
copyInstanceOption('alwaysShowSubjectInput') copyInstanceOption('alwaysShowSubjectInput')

View file

@ -227,7 +227,7 @@ const Attachment = {
this.$emit('resize', newHeight) this.$emit('resize', newHeight)
}, },
postStatus (event) { postStatus (event) {
console.log(this.statusForm.postStatus(event, this.statusForm.newStatus)) this.statusForm.postStatus(event, this.statusForm.newStatus)
} }
} }
} }

View file

@ -4,7 +4,6 @@ const FeaturesPanel = {
computed: { computed: {
whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled }, whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled },
mediaProxy: function () { return this.$store.state.instance.mediaProxyAvailable }, mediaProxy: function () { return this.$store.state.instance.mediaProxyAvailable },
minimalScopesMode: function () { return this.$store.state.instance.minimalScopesMode },
textlimit: function () { return this.$store.state.instance.textlimit }, textlimit: function () { return this.$store.state.instance.textlimit },
uploadlimit: function () { return fileSizeFormatService.fileSizeFormat(this.$store.state.instance.uploadlimit) } uploadlimit: function () { return fileSizeFormatService.fileSizeFormat(this.$store.state.instance.uploadlimit) }
} }

View file

@ -181,9 +181,6 @@ const PostStatusForm = {
userDefaultScope () { userDefaultScope () {
return this.$store.state.users.currentUser.default_scope return this.$store.state.users.currentUser.default_scope
}, },
showAllScopes () {
return !this.mergedConfig.minimalScopesMode
},
emojiUserSuggestor () { emojiUserSuggestor () {
return suggestor({ return suggestor({
emoji: [ emoji: [
@ -225,9 +222,6 @@ const PostStatusForm = {
isOverLengthLimit () { isOverLengthLimit () {
return this.hasStatusLengthLimit && (this.charactersLeft < 0) return this.hasStatusLengthLimit && (this.charactersLeft < 0)
}, },
minimalScopesMode () {
return this.$store.state.instance.minimalScopesMode
},
alwaysShowSubject () { alwaysShowSubject () {
return this.mergedConfig.alwaysShowSubjectInput return this.mergedConfig.alwaysShowSubjectInput
}, },
@ -647,12 +641,10 @@ const PostStatusForm = {
if (this.copyMessageScope === 'direct') { if (this.copyMessageScope === 'direct') {
return this.copyMessageScope return this.copyMessageScope
} }
if (this.$store.getters.mergedConfig.scopeCopy) {
if (this.copyMessageScope !== 'public' && this.$store.state.users.currentUser.default_scope !== 'private') { if (this.copyMessageScope !== 'public' && this.$store.state.users.currentUser.default_scope !== 'private') {
return this.copyMessageScope return this.copyMessageScope
} }
} }
}
return this.$store.state.users.currentUser.default_scope return this.$store.state.users.currentUser.default_scope
} }
} }

View file

@ -188,7 +188,6 @@
> >
<scope-selector <scope-selector
v-if="!disableVisibilitySelector" v-if="!disableVisibilitySelector"
:show-all="showAllScopes"
:user-default="userDefaultScope" :user-default="userDefaultScope"
:original-scope="copyMessageScope" :original-scope="copyMessageScope"
:initial-scope="newStatus.visibility" :initial-scope="newStatus.visibility"

View file

@ -138,12 +138,6 @@ export default {
) )
}) })
} }
marked.use(markedMfm, {
mangle: false,
gfm: false,
breaks: true
})
const mfmHtml = document.createElement('template') const mfmHtml = document.createElement('template')
mfmHtml.innerHTML = marked.parse(content) mfmHtml.innerHTML = marked.parse(content)

View file

@ -13,6 +13,14 @@ library.add(
faLockOpen faLockOpen
) )
const SCOPE_LEVELS = {
'direct': 0,
'private': 1,
'local': 2,
'unlisted': 2,
'public': 3
}
const ScopeSelector = { const ScopeSelector = {
props: [ props: [
'showAll', 'showAll',
@ -57,11 +65,15 @@ const ScopeSelector = {
}, },
methods: { methods: {
shouldShow (scope) { shouldShow (scope) {
return this.showAll || if (!this.originalScope) {
this.currentScope === scope || return true
this.originalScope === scope || }
this.userDefault === scope ||
scope === 'direct' if (this.originalScope === 'local') {
return scope === 'direct' || scope === 'local'
}
return SCOPE_LEVELS[scope] <= SCOPE_LEVELS[this.originalScope]
}, },
changeVis (scope) { changeVis (scope) {
this.currentScope = scope this.currentScope = scope

View file

@ -175,7 +175,6 @@ const SettingsModal = {
return this.$store.state.config.expertLevel > 0 return this.$store.state.config.expertLevel > 0
}, },
set (value) { set (value) {
console.log(value)
this.$store.dispatch('setOption', { name: 'expertLevel', value: value ? 1 : 0 }) this.$store.dispatch('setOption', { name: 'expertLevel', value: value ? 1 : 0 })
} }
} }

View file

@ -537,18 +537,12 @@
{{ $t('settings.default_vis') }} <ServerSideIndicator :server-side="true" /> {{ $t('settings.default_vis') }} <ServerSideIndicator :server-side="true" />
<ScopeSelector <ScopeSelector
class="scope-selector" class="scope-selector"
:show-all="true"
:user-default="serverSide_defaultScope" :user-default="serverSide_defaultScope"
:initial-scope="serverSide_defaultScope" :initial-scope="serverSide_defaultScope"
:on-scope-change="changeDefaultScope" :on-scope-change="changeDefaultScope"
/> />
</label> </label>
</li> </li>
<li>
<BooleanSetting path="minimalScopesMode">
{{ $t('settings.minimal_scopes_mode') }}
</BooleanSetting>
</li>
<li> <li>
<BooleanSetting path="sensitiveByDefault"> <BooleanSetting path="sensitiveByDefault">
{{ $t('settings.sensitive_by_default') }} {{ $t('settings.sensitive_by_default') }}
@ -559,14 +553,6 @@
{{ $t('settings.sensitive_if_subject') }} {{ $t('settings.sensitive_if_subject') }}
</BooleanSetting> </BooleanSetting>
</li> </li>
<li>
<BooleanSetting
path="scopeCopy"
expert="1"
>
{{ $t('settings.scope_copy') }}
</BooleanSetting>
</li>
<li> <li>
<BooleanSetting <BooleanSetting
path="alwaysShowSubjectInput" path="alwaysShowSubjectInput"
@ -594,14 +580,6 @@
{{ $t('settings.post_status_content_type') }} {{ $t('settings.post_status_content_type') }}
</ChoiceSetting> </ChoiceSetting>
</li> </li>
<li>
<BooleanSetting
path="minimalScopesMode"
expert="1"
>
{{ $t('settings.minimal_scopes_mode') }}
</BooleanSetting>
</li>
<li> <li>
<BooleanSetting <BooleanSetting
path="alwaysShowNewPostButton" path="alwaysShowNewPostButton"

View file

@ -753,7 +753,6 @@ export default {
selected () { selected () {
this.selectedTheme = Object.entries(this.availableStyles).find(([k, s]) => { this.selectedTheme = Object.entries(this.availableStyles).find(([k, s]) => {
if (Array.isArray(s)) { if (Array.isArray(s)) {
console.log(s[0] === this.selected, this.selected)
return s[0] === this.selected return s[0] === this.selected
} else { } else {
return s.name === this.selected return s.name === this.selected

View file

@ -126,7 +126,7 @@ const Timeline = {
this.$store.commit('setLoading', { timeline: this.timelineName, value: false }) this.$store.commit('setLoading', { timeline: this.timelineName, value: false })
}, },
methods: { methods: {
stopBlockingClicks: debounce(function () { stopBlockingClicks: debounce( function() {
this.blockingClicks = false this.blockingClicks = false
}, 1000), }, 1000),
blockClicksTemporarily () { blockClicksTemporarily () {
@ -154,7 +154,7 @@ const Timeline = {
window.scrollTo({ top: 0 }) window.scrollTo({ top: 0 })
} }
}, },
fetchOlderStatuses: throttle(function () { fetchOlderStatuses: throttle( function () {
const store = this.$store const store = this.$store
const credentials = store.state.users.currentUser.credentials const credentials = store.state.users.currentUser.credentials
store.commit('setLoading', { timeline: this.timelineName, value: true }) store.commit('setLoading', { timeline: this.timelineName, value: true })
@ -188,7 +188,7 @@ const Timeline = {
const centerOfScreen = window.pageYOffset + (window.innerHeight * 0.5) const centerOfScreen = window.pageYOffset + (window.innerHeight * 0.5)
// Start from approximating the index of some visible status by using the // Start from approximating the index of some visible status by using
// the center of the screen on the timeline. // the center of the screen on the timeline.
let approxIndex = Math.floor(statuses.length * (centerOfScreen / height)) let approxIndex = Math.floor(statuses.length * (centerOfScreen / height))
let err = statuses[approxIndex].getBoundingClientRect().y let err = statuses[approxIndex].getBoundingClientRect().y
@ -226,7 +226,7 @@ const Timeline = {
this.fetchOlderStatuses() this.fetchOlderStatuses()
} }
}, },
handleScroll: throttle(function (e) { handleScroll: throttle( function (e) {
this.determineVisibleStatuses() this.determineVisibleStatuses()
this.scrollLoad(e) this.scrollLoad(e)
}, 200), }, 200),

View file

@ -71,7 +71,6 @@ export default {
return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus` return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`
}, },
loggedIn () { loggedIn () {
console.log({ ...this.$store.state.users.currentUser })
return this.$store.state.users.currentUser return this.$store.state.users.currentUser
}, },
dailyAvg () { dailyAvg () {

View file

@ -62,7 +62,7 @@ export default function createPersistedState ({
} }
loaded = true loaded = true
} catch (e) { } catch (e) {
console.log("Couldn't load state") console.error("Couldn't load state")
console.error(e) console.error(e)
loaded = true loaded = true
} }
@ -83,8 +83,8 @@ export default function createPersistedState ({
}) })
} }
} catch (e) { } catch (e) {
console.log("Couldn't persist state:") console.error("Couldn't persist state:")
console.log(e) console.error(e)
} }
}) })
} }

View file

@ -76,11 +76,9 @@ export const defaultState = {
hideScopeNotice: false, hideScopeNotice: false,
useStreamingApi: false, useStreamingApi: false,
sidebarRight: undefined, // instance default sidebarRight: undefined, // instance default
scopeCopy: undefined, // instance default
subjectLineBehavior: undefined, // instance default subjectLineBehavior: undefined, // instance default
alwaysShowSubjectInput: undefined, // instance default alwaysShowSubjectInput: undefined, // instance default
postContentType: undefined, // instance default postContentType: undefined, // instance default
minimalScopesMode: undefined, // instance default
// This hides statuses filtered via a word filter // This hides statuses filtered via a word filter
hideFilteredStatuses: undefined, // instance default hideFilteredStatuses: undefined, // instance default
modalOnRepeat: undefined, // instance default modalOnRepeat: undefined, // instance default

View file

@ -53,12 +53,10 @@ const defaultState = {
logoMargin: '.2em', logoMargin: '.2em',
logoMask: true, logoMask: true,
logoLeft: false, logoLeft: false,
minimalScopesMode: false,
nsfwCensorImage: undefined, nsfwCensorImage: undefined,
postContentType: 'text/plain', postContentType: 'text/plain',
redirectRootLogin: '/main/friends', redirectRootLogin: '/main/friends',
redirectRootNoLogin: '/main/all', redirectRootNoLogin: '/main/all',
scopeCopy: true,
showFeaturesPanel: true, showFeaturesPanel: true,
showInstanceSpecificPanel: false, showInstanceSpecificPanel: false,
showNavShortcuts: true, showNavShortcuts: true,

View file

@ -1,7 +1,6 @@
import { promiseInterval } from '../promise_interval/promise_interval.js' import { promiseInterval } from '../promise_interval/promise_interval.js'
const startFetching = ({ credentials, store }) => { const startFetching = ({ credentials, store }) => {
console.log('startFetching: Config')
const boundFetchAndUpdate = () => store.dispatch('getSettingsProfile') const boundFetchAndUpdate = () => store.dispatch('getSettingsProfile')
boundFetchAndUpdate() boundFetchAndUpdate()
return promiseInterval(boundFetchAndUpdate, 10 * 60000) return promiseInterval(boundFetchAndUpdate, 10 * 60000)

View file

@ -1,5 +1,3 @@
import runtime from 'serviceworker-webpack-plugin/lib/runtime'
function urlBase64ToUint8Array (base64String) { function urlBase64ToUint8Array (base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4) const padding = '='.repeat((4 - base64String.length % 4) % 4)
const base64 = (base64String + padding) const base64 = (base64String + padding)
@ -15,7 +13,7 @@ function isPushSupported () {
} }
function getOrCreateServiceWorker () { function getOrCreateServiceWorker () {
return runtime.register() return navigator.serviceWorker.register('/sw-pleroma.js')
.catch((err) => console.error('Unable to get or create a service worker.', err)) .catch((err) => console.error('Unable to get or create a service worker.', err))
} }

View file

@ -5,7 +5,9 @@ import { parseNotification } from './services/entity_normalizer/entity_normalize
import { prepareNotificationObject } from './services/notification_utils/notification_utils.js' import { prepareNotificationObject } from './services/notification_utils/notification_utils.js'
import { createI18n } from 'vue-i18n' import { createI18n } from 'vue-i18n'
import messages from './i18n/service_worker_messages.js' import messages from './i18n/service_worker_messages.js'
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
precacheAndRoute(self.__WB_MANIFEST);
const i18n = createI18n({ const i18n = createI18n({
// By default, use the browser locale, we will update it if neccessary // By default, use the browser locale, we will update it if neccessary
locale: 'en', locale: 'en',

View file

@ -13,12 +13,10 @@
"logoMargin": ".1em", "logoMargin": ".1em",
"logoMask": true, "logoMask": true,
"logoLeft": false, "logoLeft": false,
"minimalScopesMode": false,
"nsfwCensorImage": "", "nsfwCensorImage": "",
"postContentType": "text/plain", "postContentType": "text/plain",
"redirectRootLogin": "/main/friends", "redirectRootLogin": "/main/friends",
"redirectRootNoLogin": "/main/all", "redirectRootNoLogin": "/main/all",
"scopeCopy": true,
"showFeaturesPanel": true, "showFeaturesPanel": true,
"showInstanceSpecificPanel": false, "showInstanceSpecificPanel": false,
"sidebarRight": false, "sidebarRight": false,

View file

@ -4,7 +4,7 @@
// https://github.com/webpack/karma-webpack // https://github.com/webpack/karma-webpack
// var path = require('path') // var path = require('path')
var merge = require('webpack-merge') var { merge } = require('webpack-merge')
var HtmlWebpackPlugin = require('html-webpack-plugin') var HtmlWebpackPlugin = require('html-webpack-plugin')
var baseConfig = require('../../build/webpack.base.conf') var baseConfig = require('../../build/webpack.base.conf')
var utils = require('../../build/utils') var utils = require('../../build/utils')
@ -16,7 +16,7 @@ var webpackConfig = merge(baseConfig, {
module: { module: {
rules: utils.styleLoaders() rules: utils.styleLoaders()
}, },
devtool: '#inline-source-map', devtool: 'inline-source-map',
// vue: { // vue: {
// loaders: { // loaders: {
// js: 'isparta' // js: 'isparta'

View file

@ -194,8 +194,9 @@ describe('API Entities normalizer', () => {
expect(parsedPost).to.have.property('type', 'status') expect(parsedPost).to.have.property('type', 'status')
expect(parsedRepeat).to.have.property('type', 'retweet') expect(parsedRepeat).to.have.property('type', 'retweet')
console.log(parsedRepeat)
expect(parsedRepeat).to.have.property('retweeted_status') expect(parsedRepeat).to.have.property('retweeted_status')
expect(parsedRepeat).to.have.deep.property('retweeted_status.id', 'deadbeef') expect(parsedRepeat).to.have.nested.property('retweeted_status.id', 'deadbeef')
}) })
it('sets nsfw for statuses with the #nsfw tag', () => { it('sets nsfw for statuses with the #nsfw tag', () => {
@ -229,7 +230,7 @@ describe('API Entities normalizer', () => {
expect(parsedPost).to.have.property('type', 'status') expect(parsedPost).to.have.property('type', 'status')
expect(parsedRepeat).to.have.property('type', 'retweet') expect(parsedRepeat).to.have.property('type', 'retweet')
expect(parsedRepeat).to.have.property('retweeted_status') expect(parsedRepeat).to.have.property('retweeted_status')
expect(parsedRepeat).to.have.deep.property('retweeted_status.id', 'deadbeef') expect(parsedRepeat).to.have.nested.property('retweeted_status.id', 'deadbeef')
}) })
}) })
}) })
@ -284,9 +285,9 @@ describe('API Entities normalizer', () => {
}) })
expect(parseNotification(notif)).to.have.property('id', 123) expect(parseNotification(notif)).to.have.property('id', 123)
expect(parseNotification(notif)).to.have.property('seen', false) expect(parseNotification(notif)).to.have.property('seen', false)
expect(parseNotification(notif)).to.have.deep.property('status.id', '444') expect(parseNotification(notif)).to.have.nested.property('status.id', '444')
expect(parseNotification(notif)).to.have.deep.property('action.id', '444') expect(parseNotification(notif)).to.have.nested.property('action.id', '444')
expect(parseNotification(notif)).to.have.deep.property('from_profile.id', 'spurdo') expect(parseNotification(notif)).to.have.nested.property('from_profile.id', 'spurdo')
}) })
it('correctly normalizes favorite notifications', () => { it('correctly normalizes favorite notifications', () => {
@ -303,9 +304,9 @@ describe('API Entities normalizer', () => {
expect(parseNotification(notif)).to.have.property('id', 123) expect(parseNotification(notif)).to.have.property('id', 123)
expect(parseNotification(notif)).to.have.property('type', 'like') expect(parseNotification(notif)).to.have.property('type', 'like')
expect(parseNotification(notif)).to.have.property('seen', true) expect(parseNotification(notif)).to.have.property('seen', true)
expect(parseNotification(notif)).to.have.deep.property('status.id', '4412') expect(parseNotification(notif)).to.have.nested.property('status.id', '4412')
expect(parseNotification(notif)).to.have.deep.property('action.id', '444') expect(parseNotification(notif)).to.have.nested.property('action.id', '444')
expect(parseNotification(notif)).to.have.deep.property('from_profile.id', 'spurdo') expect(parseNotification(notif)).to.have.nested.property('from_profile.id', 'spurdo')
}) })
}) })

5104
yarn.lock

File diff suppressed because it is too large Load diff