diff --git a/extensions/bbcode/.editorconfig b/extensions/bbcode/.editorconfig new file mode 100644 index 000000000..a61a3ab36 --- /dev/null +++ b/extensions/bbcode/.editorconfig @@ -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 diff --git a/extensions/bbcode/.gitattributes b/extensions/bbcode/.gitattributes new file mode 100644 index 000000000..ca0f40972 --- /dev/null +++ b/extensions/bbcode/.gitattributes @@ -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 diff --git a/extensions/bbcode/.gitignore b/extensions/bbcode/.gitignore new file mode 100644 index 000000000..4ebb168a0 --- /dev/null +++ b/extensions/bbcode/.gitignore @@ -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 diff --git a/extensions/bbcode/.styleci.yml b/extensions/bbcode/.styleci.yml new file mode 100644 index 000000000..8806a5402 --- /dev/null +++ b/extensions/bbcode/.styleci.yml @@ -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 diff --git a/extensions/bbcode/CHANGELOG.md b/extensions/bbcode/CHANGELOG.md new file mode 100644 index 000000000..f4618053f --- /dev/null +++ b/extensions/bbcode/CHANGELOG.md @@ -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) diff --git a/extensions/bbcode/LICENSE b/extensions/bbcode/LICENSE new file mode 100644 index 000000000..54ac29ab2 --- /dev/null +++ b/extensions/bbcode/LICENSE @@ -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. diff --git a/extensions/bbcode/composer.json b/extensions/bbcode/composer.json new file mode 100644 index 000000000..564ffcd23 --- /dev/null +++ b/extensions/bbcode/composer.json @@ -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 + } + } + } +} diff --git a/extensions/bbcode/extend.php b/extensions/bbcode/extend.php new file mode 100644 index 000000000..7783be0cf --- /dev/null +++ b/extensions/bbcode/extend.php @@ -0,0 +1,30 @@ +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('*'); + });