Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mosnar committed Mar 12, 2019
0 parents commit f33ce03
Show file tree
Hide file tree
Showing 12 changed files with 486 additions and 0 deletions.
1 change: 1 addition & 0 deletions .craftplugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"pluginName":"Redactor Split","pluginDescription":"Split a matrix block","pluginVersion":"1.0.0","pluginAuthorName":"Venveo","pluginVendorName":"venveo","pluginAuthorUrl":"https://www.venveo.com","pluginAuthorGithub":"venveo","codeComments":"","pluginComponents":"","consolecommandName":"","controllerName":"","cpsectionName":"","elementName":"","fieldName":"","modelName":"","purchasableName":"","recordName":"","serviceName":"","taskName":"","utilityName":"","widgetName":"","apiVersion":"api_version_3_0"}
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# CRAFT ENVIRONMENT
.env.php
.env.sh
.env

# COMPOSER
/vendor

# BUILD FILES
/bower_components/*
/node_modules/*
/build/*
/yarn-error.log

# MISC FILES
.cache
.DS_Store
.idea
.project
.settings
*.esproj
*.sublime-workspace
*.sublime-project
*.tmproj
*.tmproject
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
config.codekit3
prepros-6.config
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Redactor Split Changelog

## 1.0.0 - 2019-03-11
### Added
- Initial release
40 changes: 40 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Copyright © Venveo

Permission is hereby granted to any person obtaining a copy of this software
(the “Software”) to use, copy, modify, merge, publish and/or distribute copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

1. **Don’t plagiarize.** The above copyright notice and this license shall be
included in all copies or substantial portions of the Software.

2. **Don’t use the same license on more than one project.** Each licensed copy
of the Software shall be actively installed in no more than one production
environment at a time.

3. **Don’t mess with the licensing features.** Software features related to
licensing shall not be altered or circumvented in any way, including (but
not limited to) license validation, payment prompts, feature restrictions,
and update eligibility.

4. **Pay up.** Payment shall be made immediately upon receipt of any notice,
prompt, reminder, or other message indicating that a payment is owed.

5. **Follow the law.** All use of the Software shall not violate any applicable
law or regulation, nor infringe the rights of any other person or entity.

Failure to comply with the foregoing conditions will automatically and
immediately result in termination of the permission granted hereby. This
license does not include any right to receive updates to the Software or
technical support. Licensees bear all risk related to the quality and
performance of the Software and any modifications made or obtained to it,
including liability for actual and consequential harm, such as loss or
corruption of data, and any necessary service, repair, or correction.

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, INCLUDING SPECIAL, INCIDENTAL AND CONSEQUENTIAL DAMAGES, 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.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Redactor Split plugin for Craft CMS 3.x

Split a matrix block

![Screenshot](resources/img/plugin-logo.png)

## Requirements

- Craft CMS 3.1.x
- Redactor Craft CMS plugin 2.3.x

## Installation

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

cd /path/to/project

2. Then tell Composer to load the plugin:

composer require venveo/craft-redactor-split

3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Redactor Split.

4. Add the plugin to your Redactor configurations:
```json
{
"buttons": [
"bold",
"italic",
"unorderedlist",
"orderedlist",
"link",
"etc"
],
"plugins": ["redactor-split"],
"toolbarFixed": false
}
```
Brought to you by [Venveo](https://www.venveo.com)
41 changes: 41 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "venveo/craft-redactor-split",
"description": "Split a matrix block",
"type": "craft-plugin",
"version": "1.0.0",
"keywords": [
"craft",
"cms",
"craftcms",
"craft-plugin",
"redactor split"
],
"support": {
"docs": "https://github.com/venveo/craft-redactor-split/blob/master/README.md",
"issues": "https://github.com/venveo/craft-redactor-split/issues"
},
"license": "MIT",
"authors": [
{
"name": "Venveo",
"homepage": "https://www.venveo.com"
}
],
"require": {
"craftcms/cms": "^3.1.0",
"craftcms/redactor": "^2.3"
},
"autoload": {
"psr-4": {
"venveo\\redactorsplit\\": "src/"
}
},
"extra": {
"name": "Redactor Split",
"handle": "redactor-split",
"hasCpSettings": false,
"hasCpSection": false,
"changelogUrl": "https://raw.githubusercontent.com/venveo/craft-redactor-split/master/CHANGELOG.md",
"class": "venveo\\redactorsplit\\RedactorSplit"
}
}
64 changes: 64 additions & 0 deletions src/RedactorSplit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/**
* Redactor Split plugin for Craft CMS 3.x
*
* Split a matrix block
*
* @link https://www.venveo.com
* @copyright Copyright (c) 2019 Venveo
*/

namespace venveo\redactorsplit;


use Craft;
use craft\base\Plugin;
use craft\redactor\events\RegisterPluginPathsEvent;
use craft\redactor\Field as RichText;
use yii\base\Event;

/**
* Class RedactorSplit
*
* @author Venveo
* @package RedactorSplit
* @since 1.0.0
*
*/
class RedactorSplit extends Plugin
{
// Static Properties
// =========================================================================

/**
* @var RedactorSplit
*/
public static $plugin;

/**
* @inheritdoc
*/
public function init()
{
parent::init();
self::$plugin = $this;

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

// Protected Methods
// =========================================================================

}
43 changes: 43 additions & 0 deletions src/RedactorSplitAsset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Redactor Split plugin for Craft CMS 3.x
*
* Split a matrix block
*
* @link https://www.venveo.com
* @copyright Copyright (c) 2019 Venveo
*/

namespace venveo\redactorsplit;


use craft\redactor\assets\redactor\RedactorAsset;
use craft\web\AssetBundle;
use craft\web\assets\cp\CpAsset;
use craft\web\assets\matrix\MatrixAsset;

/**
* Class RedactorSplit
*
* @author Venveo
* @package RedactorSplit
* @since 1.0.0
*
*/
class RedactorSplitAsset extends AssetBundle
{
public function init()
{
$this->sourcePath = '@venveo/redactorsplit/resources';
$this->depends = [
CpAsset::class,
RedactorAsset::class,
MatrixAsset::class
];
$this->js = [
'redactor-split.js'
];
parent::init();
}

}
52 changes: 52 additions & 0 deletions src/icon-mask.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions src/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/resources/redactor-split.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.venveo.icon.redactor-split {

}
Loading

0 comments on commit f33ce03

Please sign in to comment.