diff --git a/.babelrc b/.babelrc index bc2b0e31..3c732dd1 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { - "presets": ["es2015", "stage-2", "env"], - "plugins": ["transform-runtime", "lodash", "transform-vue-jsx"], + "presets": ["@babel/preset-env"], + "plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-transform-vue-jsx"], "comments": false } diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d42288e..7f6d3c92 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ test: - apt install firefox-esr -y --no-install-recommends - firefox --version - yarn - - npm run unit + - yarn unit build: stage: build diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index ca2ebcfa..00000000 --- a/CHANGELOG +++ /dev/null @@ -1,35 +0,0 @@ -## 2017-02-20 - -- Overall CSS styling fixes -- Current theme is displayed in theme selector -- Theme selector is moved to the settings page -- Oembed attachments will now display correctly -- Styling changes to the user info cards -- Notification count in title -- Better Notification handling (persistance, mark as read) -- Post statuses with ctrl+enter -- Links in statuses open in a new tab -- Optimized mobile view -- Fix crash on persistance failure -- Compress persisted state -- Sync mutes with backend (SEE NOTE BELOW) - -Pleroma will now try to get the current mutes from the backend. Sadly, a bug in -Qvitter will not allow getting the mutes from the endpoint, because it will -ignore HTTP Basic authentication. Mutes will still persist in Pleroma through -localstorage, but the mutes from Qvitter won't be picked up if the call fails. - -The patch for Qvitter: - ---- a/actions/apiqvittermutes.php -+++ b/actions/apiqvittermutes.php -@@ -74,7 +74,7 @@ class ApiQvitterMutesAction extends ApiPrivateAuthAction - { - parent::handle(); - -- $this->target = Profile::current(); -+ $this->target = $this->scoped; - - if(!$this->target instanceof Profile) { - $this->clientError(_('You have to be logged in to view your mutes.'), 403); - diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index f8968966..5cc0135e 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -3,6 +3,7 @@ var config = require('../config') var utils = require('./utils') var projectRoot = path.resolve(__dirname, '../') var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin') +var FontelloPlugin = require("fontello-webpack-plugin") var env = process.env.NODE_ENV // check env & config/index.js to decide weither to enable CSS Sourcemaps for the @@ -11,6 +12,8 @@ var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) var useCssSourceMap = cssSourceMapDev || cssSourceMapProd +var now = Date.now() + module.exports = { entry: { app: './src/main.js' @@ -90,6 +93,14 @@ module.exports = { new ServiceWorkerWebpackPlugin({ entry: path.join(__dirname, '..', 'src/sw.js'), filename: 'sw-pleroma.js' + }), + new FontelloPlugin({ + config: require('../static/fontello.json'), + name: 'fontello', + output: { + css: 'static/[name].' + now + '.css', // [hash] is not supported. Use the current timestamp instead for versioning. + font: 'static/font/[name].' + now + '.[ext]' + } }) ] } diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 35363537..0a9bbd7a 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -77,6 +77,9 @@ Use custom image for NSFW'd images ### `showFeaturesPanel` Show panel showcasing instance features/settings to logged-out visitors +### `hideSitename` +Hide instance name in header + ## Indirect configuration Some features are configured depending on how backend is configured. In general the approach is "if backend allows it there's no need to hide it, if backend doesn't allow it there's no need to show it. @@ -96,3 +99,6 @@ Setting this will change the warning text that is displayed for direct messages. ATTENTION: If you actually want the behavior to change. You will need to set the appropriate option at the backend. See the backend documentation for information about that. DO NOT activate this without checking the backend configuration first! + +### Private Mode +If the `private` instance setting is enabled in the backend, features that are not accessible without authentication, such as the timelines and search will be disabled for unauthenticated users. diff --git a/index.html b/index.html index fd4e795e..1ff944d9 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,6 @@ Pleroma - - diff --git a/package.json b/package.json index f039d412..38936b23 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,8 @@ "lint-fix": "eslint --fix --ext .js,.vue src test/unit/specs test/e2e/specs" }, "dependencies": { + "@babel/runtime": "^7.7.6", "@chenfengyuan/vue-qrcode": "^1.0.0", - "babel-plugin-add-module-exports": "^0.2.1", - "babel-plugin-lodash": "^3.2.11", "body-scroll-lock": "^2.6.4", "chromatism": "^3.0.0", "cropperjs": "^1.4.3", @@ -40,20 +39,17 @@ "whatwg-fetch": "^2.0.3" }, "devDependencies": { - "@babel/polyfill": "^7.0.0", + "@babel/core": "^7.7.5", + "@babel/plugin-transform-runtime": "^7.7.6", + "@babel/preset-env": "^7.7.6", + "@babel/register": "^7.7.4", + "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0", + "@vue/babel-plugin-transform-vue-jsx": "^1.1.2", "@vue/test-utils": "^1.0.0-beta.26", "autoprefixer": "^6.4.0", - "babel-core": "^6.0.0", "babel-eslint": "^7.0.0", - "babel-helper-vue-jsx-merge-props": "^2.0.3", - "babel-loader": "^7.0.0", - "babel-plugin-syntax-jsx": "^6.18.0", - "babel-plugin-transform-runtime": "^6.0.0", - "babel-plugin-transform-vue-jsx": "3", - "babel-preset-env": "^1.7.0", - "babel-preset-es2015": "^6.0.0", - "babel-preset-stage-2": "^6.0.0", - "babel-register": "^6.0.0", + "babel-loader": "^8.0.6", + "babel-plugin-lodash": "^3.3.4", "chai": "^3.5.0", "chalk": "^1.1.3", "chromedriver": "^2.21.2", @@ -72,6 +68,7 @@ "eventsource-polyfill": "^0.9.6", "express": "^4.13.3", "file-loader": "^3.0.1", + "fontello-webpack-plugin": "https://github.com/w3geo/fontello-webpack-plugin.git#6149eac8f2672ab6da089e8802fbfcac98487186", "function-bind": "^1.0.2", "html-webpack-plugin": "^3.0.0", "http-proxy-middleware": "^0.17.2", diff --git a/src/App.js b/src/App.js index 04a40e30..61b5eec1 100644 --- a/src/App.js +++ b/src/App.js @@ -90,6 +90,7 @@ export default { }, sitename () { return this.$store.state.instance.name }, chat () { return this.$store.state.chat.channel.state === 'joined' }, + hideSitename () { return this.$store.state.instance.hideSitename }, suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled }, showInstanceSpecificPanel () { return this.$store.state.instance.showInstanceSpecificPanel && @@ -97,7 +98,8 @@ export default { this.$store.state.instance.instanceSpecificPanelContent }, showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }, - isMobileLayout () { return this.$store.state.interface.mobileLayout } + isMobileLayout () { return this.$store.state.interface.mobileLayout }, + privateMode () { return this.$store.state.instance.private } }, methods: { scrollToTop () { diff --git a/src/App.scss b/src/App.scss index 310962b8..754ca62e 100644 --- a/src/App.scss +++ b/src/App.scss @@ -855,3 +855,31 @@ nav { .btn.btn-default { min-height: 28px; } + +.animate-spin { + animation: spin 2s infinite linear; + display: inline-block; +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(359deg); + } +} + +.new-status-notification { + position:relative; + margin-top: -1px; + font-size: 1.1em; + border-width: 1px 0 0 0; + border-style: solid; + border-color: var(--border, $fallback--border); + padding: 10px; + z-index: 1; + background-color: $fallback--fg; + background-color: var(--panel, $fallback--fg); +} diff --git a/src/App.vue b/src/App.vue index dbe842ec..1b1c2648 100644 --- a/src/App.vue +++ b/src/App.vue @@ -31,6 +31,7 @@
{ copyInstanceOption('alwaysShowSubjectInput') copyInstanceOption('noAttachmentLinks') copyInstanceOption('showFeaturesPanel') + copyInstanceOption('hideSitename') return store.dispatch('setTheme', config['theme']) } @@ -218,12 +219,21 @@ const getNodeInfo = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'backendVersion', value: software.version }) store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: software.name === 'pleroma' }) + const priv = metadata.private + store.dispatch('setInstanceOption', { name: 'private', value: priv }) + const frontendVersion = window.___pleromafe_commit_hash store.dispatch('setInstanceOption', { name: 'frontendVersion', value: frontendVersion }) store.dispatch('setInstanceOption', { name: 'tagPolicyAvailable', value: metadata.federation.mrf_policies.includes('TagPolicy') }) const federation = metadata.federation store.dispatch('setInstanceOption', { name: 'federationPolicy', value: federation }) + store.dispatch('setInstanceOption', { + name: 'federating', + value: typeof federation.enabled === 'undefined' + ? true + : federation.enabled + }) const accounts = metadata.staffAccounts await resolveStaffAccounts({ store, accounts }) diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 204d506a..d2153680 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -25,9 +25,6 @@ const AccountActions = { }, reportUser () { this.$store.dispatch('openUserReportingModal', this.user.id) - }, - mentionUser () { - this.$store.dispatch('openPostStatusModal', { replyTo: true, repliedUser: this.user }) } } } diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 046cba93..d3235be1 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -9,17 +9,7 @@ >