Skip to content

Commit

Permalink
Update for beta 15 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland authored Dec 16, 2020
1 parent 06360e3 commit e8c0e99
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 74 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
MIT License

Copyright (c) 2018 FriendsOfFlarum
Copyright (c) 2016 Connor Davis
Copyright (c) 2016 Connor Davis (davis@produes.co)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
82 changes: 45 additions & 37 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,50 @@
{
"name": "fof/secure-https",
"description": "Changes all images using http to https",
"keywords": [
"flarum"
],
"type": "flarum-extension",
"license": "MIT",
"require": {
"flarum/core": "^0.1.0-beta-14",
"fof/components": "^0.2.0"
},
"authors": [
{
"name": "Connor Davis",
"email": "davis@produes.co"
"name": "fof/secure-https",
"description": "Changes all images using http to https",
"keywords": [
"flarum"
],
"type": "flarum-extension",
"license": "MIT",
"support": {
"issues": "https://github.com/FriendsOfFlarum/secure-https/issues",
"source": "https://github.com/FriendsOfFlarum/secure-https",
"forum": "https://discuss.flarum.org/d/17771"
},
{
"name": "David Sevilla Martín",
"email": "david.s@redevs.org",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"FoF\\SecureHttps\\": "src/"
}
},
"extra": {
"flarum-extension": {
"title": "FoF Secure HTTPS",
"icon": {
"name": "fas fa-lock",
"backgroundColor": "#e74c3c",
"color": "#fff"
}
"homepage": "https://friendsofflarum.org",
"funding": [
{
"type": "website",
"url": "https://opencollective.com/fof/donate"
}
],
"require": {
"flarum/core": ">=0.1.0-beta-15 <0.1.0-beta-16"
},
"authors": [
{
"name": "David Sevilla Martín",
"email": "david.s@redevs.org",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"FoF\\SecureHttps\\": "src/"
}
},
"flagrow": {
"discuss": "https://discuss.flarum.org/d/17771-friendsofflarum-secure-https"
"extra": {
"flarum-extension": {
"title": "FoF Secure HTTPS",
"category": "feature",
"icon": {
"name": "fas fa-lock",
"backgroundColor": "#e74c3c",
"color": "#fff"
}
},
"flagrow": {
"discuss": "https://discuss.flarum.org/d/17771"
}
}
}
}
3 changes: 0 additions & 3 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
namespace FoF\SecureHttps;

use Flarum\Extend;
use FoF\Components\Extend\AddFofComponents;
use Illuminate\Events\Dispatcher;
use s9e\TextFormatter\Configurator;

return [
new AddFofComponents(),

(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),

Expand Down
12 changes: 6 additions & 6 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
},
"scripts": {
"build": "webpack --mode production",
"watch": "webpack --mode development --watch",
"lint": "prettier --single-quote --trailing-comma es5 --print-width 150 --tab-width 4 --write 'src/**/*'"
"dev": "webpack --mode development --watch",
"lint": "prettier --single-quote --trailing-comma es5 --print-width 150 --tab-width 4 --write src"
},
"devDependencies": {
"prettier": "^1.19.1"
"prettier": "^2.1.2"
}
}
25 changes: 7 additions & 18 deletions js/src/admin/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import { settings } from '@fof-components';

const {
SettingsModal,
items: { BooleanItem },
} = settings;
import app from 'flarum/app';

app.initializers.add('fof/secure-https', () => {
app.extensionSettings['fof-secure-https'] = () =>
app.modal.show(
SettingsModal, {
title: app.translator.trans('fof-secure-https.admin.settings.title'),
type: 'small',
items: e => [
<BooleanItem setting={e} name="fof-secure-https.proxy" cast={Number}>
{app.translator.trans('fof-secure-https.admin.settings.replace')}
</BooleanItem>,
],
}
);
app.extensionData.for('fof-secure-https')
.registerSetting({
label: app.translator.trans('fof-secure-https.admin.settings.replace'),
setting: 'fof-secure-https.proxy',
type: 'boolean'
});
});
4 changes: 1 addition & 3 deletions js/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
module.exports = require('flarum-webpack-config')({
useExtensions: ['fof-components']
});
module.exports = require('flarum-webpack-config')();
3 changes: 1 addition & 2 deletions resources/locale/en.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
fof-secure-https:
admin:
settings:
title: Configuration
replace: Proxy images through HTTPS
forum:
removed: Image removed due to the lack of support for HTTPS.
show: Show Anyway
show: Show Anyway

0 comments on commit e8c0e99

Please sign in to comment.