Skip to content

Commit

Permalink
fix: work with flarum v1.8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Aug 19, 2023
1 parent b0ab377 commit 50c6392
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 65 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

## Explanation

This Extension is powered by [WiseClock](https://github.com/WiseClock/flarum-ext-reply2see), and updated by [nosun](https://github.com/nosun/flarum-ext-reply2see), but after flarum v1.2, the extension can not be used. so I upgrade it, now it can run under flarum v1.2
This Extension is powered by [WiseClock](https://github.com/WiseClock/flarum-ext-reply2see), and updated by [nosun](https://github.com/nosun/flarum-ext-reply2see). but after flarum v1.2, the extension can not be used. so [littlecxm](https://github.com/littlecxm/flarum-reply-to-see) upgrade it, let it can run under flarum v1.2.

And I upgrade it again, let it can run under flarum v1.8.x.

## About This Extension

Expand Down Expand Up @@ -33,17 +35,17 @@ When creating/editing a post, you can simply use the [reply] BBCode to make it h
install manually with composer:

```bash
composer require littlecxm/flarum-reply-to-see:*
composer require rehiy/flarum-reply-to-see:*
```

Updating

```bash
composer update littlecxm/flarum-reply-to-see
composer update rehiy/flarum-reply-to-see
php flarum cache:clear
```

## Links

- [Packagist](https://packagist.org/packages/littlecxm/flarum-reply-to-see)
- [GitHub](https://github.com/littlecxm/flarum-reply-to-see)
- [Packagist](https://packagist.org/packages/rehiy/flarum-reply-to-see)
- [GitHub](https://github.com/rehiy/flarum-reply-to-see)
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "littlecxm/flarum-reply-to-see",
"name": "rehiy/flarum-reply-to-see",
"description": "Add reply to see to your forum.",
"type": "flarum-extension",
"license": "MIT",
"require": {
"flarum/core": "^1.2.0",
"flarum/core": "^1.8.0",
"flarum/bbcode": "^1.2.0"
},
"autoload": {
"psr-4": {
"Littlecxm\\ReplyToSee\\": "src/"
"Rehiy\\ReplyToSee\\": "src/"
}
},
"extra": {
Expand All @@ -27,4 +27,4 @@
"discuss": ""
}
}
}
}
9 changes: 6 additions & 3 deletions extend.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<?php

use Flarum\Api\Serializer\PostSerializer;
use Flarum\Api\Serializer\BasicPostSerializer;
use Flarum\Extend;
use Littlecxm\ReplyToSee\HideContentInPosts;
use Rehiy\ReplyToSee\HideContentInPosts;
use s9e\TextFormatter\Configurator;

return [
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js')
->css(__DIR__ . '/resources/less/forum.less'),

(new Extend\Formatter)
->configure(function (Configurator $config) {
$config->BBCodes->addCustom(
'[REPLY]{TEXT}[/REPLY]',
'<reply2see>{TEXT}</reply2see>'
);
}),

new Extend\Locales(__DIR__ . '/resources/locale'),
(new Extend\ApiSerializer(PostSerializer::class))

(new Extend\ApiSerializer(BasicPostSerializer::class))
->attributes(HideContentInPosts::class),
];
2 changes: 1 addition & 1 deletion js/dist/forum.js

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

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

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

2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@littlecxm/reply-to-see",
"name": "@rehiy/reply-to-see",
"version": "1.0.0",
"private": true,
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import LogInModal from "flarum/forum/components/LogInModal";
import TextEditor from "flarum/common/components/TextEditor";
import TextEditorButton from "flarum/common/components/TextEditorButton";

app.initializers.add("littlecxm/reply-to-see", () => {
app.initializers.add("rehiy/reply-to-see", () => {
extend(TextEditor.prototype, "toolbarItems", function (items) {
items.add(
"reply-to-see",
Expand All @@ -19,7 +19,7 @@ app.initializers.add("littlecxm/reply-to-see", () => {
}}
icon="fa fa-comment-medical"
>
{app.translator.trans("littlecxm-reply-to-see.forum.button_tooltip")}
{app.translator.trans("rehiy-reply-to-see.forum.button_tooltip")}
</TextEditorButton>
);
});
Expand Down
Loading

0 comments on commit 50c6392

Please sign in to comment.