diff --git a/CHANGELOG.md b/CHANGELOG.md index 870d1a1..b1fb3a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,23 @@ # Redactor nofollow link plugin Changelog -## Unreleased +## 2.0.0 - 2022-05-02 + +### Added + +- Craft CMS 4 compatibility + ### Changed -- Fixed background color of icon + +- Requires Craft CMS >= 4.0 and Redactor >= 3.0 ## 1.0.1 - 2020-04-08 + ### Fixed +- - Fixed a bug when editing an existing link with the target="_blank" attribute causing the checkbox "nofollow" to always be selected. ## 1.0.0 - 2019-05-16 + ### Added +- - Initial release diff --git a/README.md b/README.md index 1a97820..b617f3d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Redactor nofollow link plugin for Craft CMS 3.x +# Redactor nofollow link plugin for Craft CMS ![Icon](resources/nofollow.png) @@ -10,8 +10,8 @@ For a lot of sites it is important to set links to ```rel="nofollow"```. Redacto ## Requirements - * Craft CMS >= 3.0.0 - * Craft Redactor Plugin >= 2.1.0 + * Craft CMS >= 4.0.0 + * Craft Redactor Plugin >= 3.0.0 ## Installation @@ -33,7 +33,7 @@ Add the new plugin to your Redactor config file: } ``` -The ```nofollow``` will be stripped in all Redactor fields by the HTMLPurifier, which is enabled by default. Instead of disabling the hole HTMLPurifier for a field, you should create your own JSON config file in the directory ```config/htmlpurifier``` and add the following content: +The ```nofollow``` will be stripped in all Redactor fields by the HTMLPurifier, which is enabled by default. Instead of disabling the hole HTMLPurifier for a field, you should add the following line to the ```config/htmlpurifier/Default.json```: ```json { @@ -44,6 +44,4 @@ The ```nofollow``` will be stripped in all Redactor fields by the HTMLPurifier, } ``` -The ```"Attr.AllowedRel": ["nofollow"]``` is for this plugin, the first three lines are Craft's default configuration, because your config file overrides Craft's defaults. After creating your config file, you have to activate this in every Redactor field in the advanced section. - With ❤ by [codemonauts](https://codemonauts.com) diff --git a/composer.json b/composer.json index 2ede2df..d064fac 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "codemonauts/craft-redactor-nofollow", "description": "Craft CMS plugin to extends the Redactor's link module with the nofollow relationship attribute.", - "version": "1.0.1", + "version": "2.0.0", "type": "craft-plugin", "keywords": [ "craft", @@ -24,8 +24,8 @@ "issues": "https://github.com/codemonauts/craft-redactor-nofollow/issues" }, "require": { - "craftcms/cms": "^3.0.0", - "craftcms/redactor": "^2.1.7" + "craftcms/cms": "^4.0.0-alpha.1", + "craftcms/redactor": "^3.0.0-beta.1" }, "autoload": { "psr-4": { @@ -35,9 +35,6 @@ "extra": { "handle": "nofollow", "class": "codemonauts\\nofollow\\Nofollow", - "name": "Redactor nofollow link plugin", - "description": "Extends the Redactor's link module with the nofollow relationship attribute.", - "hasCpSection": false, - "hasSettings": false + "name": "Redactor nofollow link plugin" } } diff --git a/resources/nofollow.png b/resources/nofollow.png index 4fb4da0..0515ff2 100644 Binary files a/resources/nofollow.png and b/resources/nofollow.png differ diff --git a/src/Nofollow.php b/src/Nofollow.php index a230990..7651acc 100644 --- a/src/Nofollow.php +++ b/src/Nofollow.php @@ -19,8 +19,8 @@ public function init() if (Craft::$app->request->isCpRequest) { // Register Plugin Path - Event::on(Field::class, Field::EVENT_REGISTER_PLUGIN_PATHS, function(RegisterPluginPathsEvent $event) { - $event->paths[] = __DIR__.'/resources/'; + Event::on(Field::class, Field::EVENT_REGISTER_PLUGIN_PATHS, function (RegisterPluginPathsEvent $event) { + $event->paths[] = __DIR__ . '/resources/'; }); Field::registerRedactorPlugin('nofollow'); diff --git a/src/icon-mask.svg b/src/icon-mask.svg new file mode 100644 index 0000000..b0aa132 --- /dev/null +++ b/src/icon-mask.svg @@ -0,0 +1,10 @@ + + + + + + + + + +