mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 07:42:48 +08:00
Merge remote-tracking branch 'extensions_bbcode/REWRITE'
This commit is contained in:
commit
95c53806aa
19
extensions/bbcode/.editorconfig
Normal file
19
extensions/bbcode/.editorconfig
Normal file
|
@ -0,0 +1,19 @@
|
|||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
18
extensions/bbcode/.gitattributes
vendored
Normal file
18
extensions/bbcode/.gitattributes
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
|
||||
* text=auto eol=lf
|
12
extensions/bbcode/.gitignore
vendored
Normal file
12
extensions/bbcode/.gitignore
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
/vendor
|
||||
composer.lock
|
||||
composer.phar
|
||||
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
tests/.phpunit.result.cache
|
||||
/tests/integration/tmp
|
||||
.vagrant
|
||||
.idea/*
|
||||
.vscode
|
||||
js/coverage-ts
|
14
extensions/bbcode/.styleci.yml
Normal file
14
extensions/bbcode/.styleci.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
preset: recommended
|
||||
|
||||
enabled:
|
||||
- logical_not_operators_with_successor_space
|
||||
|
||||
disabled:
|
||||
- align_double_arrow
|
||||
- blank_line_after_opening_tag
|
||||
- multiline_array_trailing_comma
|
||||
- new_with_braces
|
||||
- phpdoc_align
|
||||
- phpdoc_order
|
||||
- phpdoc_separation
|
||||
- phpdoc_types
|
35
extensions/bbcode/CHANGELOG.md
Normal file
35
extensions/bbcode/CHANGELOG.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Changelog
|
||||
|
||||
## [1.2.0](https://github.com/flarum/akismet/compare/v1.1.0...v1.2.0)
|
||||
|
||||
No changes.
|
||||
|
||||
## [1.1.0](https://github.com/flarum/akismet/compare/v1.0.0...v1.1.0)
|
||||
|
||||
No changes.
|
||||
|
||||
## [1.0.0](https://github.com/flarum/bbcode/compare/v0.1.0-beta.16...v1.0.0)
|
||||
|
||||
### Changed
|
||||
- Compatibility with Flarum v1.0.0.
|
||||
|
||||
## [0.1.0-beta.16](https://github.com/flarum/bbcode/compare/v0.1.0-beta.15...v0.1.0-beta.16)
|
||||
|
||||
### Changed
|
||||
- Updated admin category from formatting to feature (https://github.com/flarum/bbcode/pull/11)
|
||||
|
||||
## [0.1.0-beta.15](https://github.com/flarum/bbcode/compare/v0.1.0-beta.12...v0.1.0-beta.15)
|
||||
|
||||
### Changed
|
||||
- Updated composer.json for new admin area.
|
||||
|
||||
## [0.1.0-beta.8](https://github.com/flarum/bbcode/compare/v0.1.0-beta.5...v0.1.0-beta.8)
|
||||
|
||||
### Changed
|
||||
- Update for beta 8
|
||||
- Drop `flarum-ext-` prefix from package name ([5d47da1](https://github.com/flarum/bbcode/commit/5d47da142a3e340190dc37e461090226dddcf0cd))
|
||||
|
||||
## [0.1.0-beta.5](https://github.com/flarum/bbcode/compare/v0.1.0-beta.3...v0.1.0-beta.5)
|
||||
|
||||
### Added
|
||||
- New BBCode tags: DEL, COLOR, CENTER, SIZE (@wackymole)
|
22
extensions/bbcode/LICENSE
Normal file
22
extensions/bbcode/LICENSE
Normal file
|
@ -0,0 +1,22 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019-2021 Stichting Flarum (Flarum Foundation)
|
||||
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
|
||||
|
||||
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.
|
55
extensions/bbcode/composer.json
Normal file
55
extensions/bbcode/composer.json
Normal file
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"name": "flarum/bbcode",
|
||||
"description": "Allow posts to be formatted with BBCode.",
|
||||
"type": "flarum-extension",
|
||||
"keywords": [
|
||||
"formatting"
|
||||
],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"source": "https://github.com/flarum/bbcode",
|
||||
"forum": "https://discuss.flarum.org"
|
||||
},
|
||||
"homepage": "https://flarum.org",
|
||||
"funding": [
|
||||
{
|
||||
"type": "website",
|
||||
"url": "https://flarum.org/donate/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"flarum/core": "^1.2"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.x-dev"
|
||||
},
|
||||
"flarum-extension": {
|
||||
"title": "BBCode",
|
||||
"category": "feature",
|
||||
"icon": {
|
||||
"name": "fas fa-bold",
|
||||
"backgroundColor": "#238C59",
|
||||
"color": "#fff"
|
||||
}
|
||||
},
|
||||
"flarum-cli": {
|
||||
"modules": {
|
||||
"admin": false,
|
||||
"forum": false,
|
||||
"js": false,
|
||||
"jsCommon": false,
|
||||
"css": false,
|
||||
"gitConf": true,
|
||||
"githubActions": false,
|
||||
"prettier": false,
|
||||
"typescript": false,
|
||||
"bundlewatch": false,
|
||||
"backendTesting": false,
|
||||
"editorConfig": true,
|
||||
"styleci": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
30
extensions/bbcode/extend.php
Normal file
30
extensions/bbcode/extend.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Flarum\Extend;
|
||||
use s9e\TextFormatter\Configurator;
|
||||
|
||||
return (new Extend\Formatter)
|
||||
->configure(function (Configurator $config) {
|
||||
$config->BBCodes->addFromRepository('B');
|
||||
$config->BBCodes->addFromRepository('I');
|
||||
$config->BBCodes->addFromRepository('U');
|
||||
$config->BBCodes->addFromRepository('S');
|
||||
$config->BBCodes->addFromRepository('URL');
|
||||
$config->BBCodes->addFromRepository('IMG');
|
||||
$config->BBCodes->addFromRepository('EMAIL');
|
||||
$config->BBCodes->addFromRepository('CODE');
|
||||
$config->BBCodes->addFromRepository('QUOTE');
|
||||
$config->BBCodes->addFromRepository('LIST');
|
||||
$config->BBCodes->addFromRepository('DEL');
|
||||
$config->BBCodes->addFromRepository('COLOR');
|
||||
$config->BBCodes->addFromRepository('CENTER');
|
||||
$config->BBCodes->addFromRepository('SIZE');
|
||||
$config->BBCodes->addFromRepository('*');
|
||||
});
|
Loading…
Reference in New Issue
Block a user