Skip to content

Commit

Permalink
Merge pull request #5 from venveo/develop-v4
Browse files Browse the repository at this point in the history
Finish 4.0.0-RC1
  • Loading branch information
Mosnar authored Jul 11, 2022
2 parents b7ddb54 + 1b9ee80 commit a86d400
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
1 change: 0 additions & 1 deletion .craftplugin

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Redactor Split Changelog

## 4.0.0 - 2022-07-10

### Changed
- Redactor Split now requires Craft 4

## 1.1.1 - 2021-04-17

### Changed
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "venveo/craft-redactor-split",
"description": "Split a Redactor field within Matrix blocks into additional blocks",
"type": "craft-plugin",
"version": "1.1.1",
"version": "4.0.0",
"keywords": [
"craft",
"cms",
Expand All @@ -22,8 +22,9 @@
}
],
"require": {
"craftcms/cms": "^3.4.0",
"craftcms/redactor": "^2.3"
"craftcms/cms": "^4.0.0-alpha",
"craftcms/redactor": "^3.0.0-beta.1",
"php": "^8.0.2|^9.0"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 4 additions & 8 deletions src/RedactorSplit.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Redactor Split plugin for Craft CMS 3.x
* Redactor Split plugin for Craft CMS 4.x
*
* Split a matrix block
*
Expand All @@ -10,7 +10,6 @@

namespace venveo\redactorsplit;


use Craft;
use craft\base\Plugin;
use craft\redactor\events\RegisterPluginPathsEvent;
Expand All @@ -31,25 +30,22 @@ class RedactorSplit extends Plugin
/**
* @inheritdoc
*/
public function init()
public function init(): void
{
parent::init();

if (Craft::$app->request->isCpRequest && Craft::$app->plugins->isPluginEnabled('redactor')) {
if (Craft::$app->request->isCpRequest) {
Event::on(Plugins::class, Plugins::EVENT_AFTER_LOAD_PLUGINS, function () {
Event::on(
RichText::class,
RichText::EVENT_REGISTER_PLUGIN_PATHS,
function (RegisterPluginPathsEvent $event) {
$src = Craft::getAlias('@venveo/redactorsplit')
. DIRECTORY_SEPARATOR
. 'resources';
$src = Craft::getAlias('@venveo/redactorsplit') . DIRECTORY_SEPARATOR . 'resources';
$event->paths[] = $src;
Craft::$app->getView()->registerAssetBundle(RedactorSplitAsset::class);
}
);
});
}
}

}
8 changes: 3 additions & 5 deletions src/RedactorSplitAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace venveo\redactorsplit;


use craft\redactor\assets\redactor\RedactorAsset;
use craft\web\AssetBundle;
use craft\web\assets\cp\CpAsset;
Expand All @@ -32,15 +31,14 @@ public function init()
$this->depends = [
CpAsset::class,
RedactorAsset::class,
MatrixAsset::class
MatrixAsset::class,
];
$this->js = [
'redactor-split.js'
'redactor-split.js',
];
$this->css = [
'redactor-split.css'
'redactor-split.css',
];
parent::init();
}

}

0 comments on commit a86d400

Please sign in to comment.