Skip to content

Commit

Permalink
Merge pull request #52 from CakeDC/3.x
Browse files Browse the repository at this point in the history
Updates from 3.x
  • Loading branch information
rochamarcelo committed May 4, 2020
2 parents 8738a6b + b2171c5 commit db03a60
Show file tree
Hide file tree
Showing 1,614 changed files with 449 additions and 46,305 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
.idea
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

Release 1.3.0
-------------

https://github.com/CakeDC/TinyMCE/tree/1.3.0

* [65ea3c5](https://github.com/CakeDC/TinyMCE/pull/40/commits/65ea3c5) Upgrading TinyMCE to 4.3.8

Release 1.2.0
-------------

Expand Down
50 changes: 27 additions & 23 deletions Docs/Documentation/Examples.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
## How to use the helper ##

Wherever you want to use it, load it in the controller
Load it in the controller where you want to use it.

```php
$this->helpers = array('TinyMCE.TinyMCE');
public $helpers = ['TinyMCE.TinyMCE'];
```

In the view simply use the editor() method and pass config key/value pairs in an array.
At the view's top where you want to use it, simply add the editor() method and pass config key/value pairs in an array.

```php
$this->TinyMCE->editor(array('theme' => 'advanced', 'mode' => 'textareas'));
$this->TinyMCE->editor(['theme' => 'modern', 'selector' => 'textarea']);
```

This will instruct TinyMCE to convert all `textarea` elements on the page to TinyMCE editors. If you require some more precise control, or want to change this behavior, checkout the [TinyMCE configuration options](http://www.tinymce.com/wiki.php/Configuration) on the TinyMCE website.

You need to add the jQuery file to make it work the helper.

```php
echo $this->Html->script('jquery-x.x.x.min');
```

Multiple configurations
-----------------------

Expand All @@ -22,36 +28,34 @@ The helper has a configs property which can be filled with data from database or
Here is a basic example of configuration data:

```php
$configs = array(
'simple' => array(
'mode' => 'textareas',
'theme' => 'simple',
'editor_selector' => 'mceSimple'
),
'advanced' => array(
'mode' => 'textareas',
'theme' => 'advanced',
'editor_selector' => 'mceAdvanced'
)
);

$configs = [
'modern' => [
'selector' => 'textarea',
'theme' => 'modern'
],
'withoutPath' => [
'selector' => 'textarea',
'theme' => 'modern',
'elementpath' => false
]
];
$this->TinyMCE->configs = $configs;
```

You can also put the configuration in APP/config/bootstap.php or another config file and load it. Inside the config file you have you can write the config as above to the TinyMce configuration:
You can also put the configuration in APP/config/bootstrap.php or another config file and load it. Inside the config file you have you can write the config as above to the TinyMce configuration:

```php
Configure::write('TinyMCE.configs', array(
'simple' => ...,
'advanced' => ...));
Configure::write('TinyMCE.configs', [
'modern' => ...,
'withoutPath' => ...]);
```

The different sets of configuration data will be auto loaded by the helper inside its constructor. It is suggested that you use this way of passing different configs to the helper because by this you'll be able to store all of them in one place.

When you passed the configuration to the helper you can simply use it by calling the editor() method of the helper with a string that is equal to the key of the configuration in the array:

```php
$this->TinyMCE->editor('simple'); // This matches the 'simple' config name we passed in earlier.
$this->TinyMCE->editor('modern'); // This matches the 'modern' config name we passed in earlier.
```

Application wide default options
Expand All @@ -62,7 +66,7 @@ If you want a quick way to configure default values for all the TinyMCE Editors
Here is an example of a line you could have in `bootstrap.php`:

```php
Configure::write('TinyMCE.editorOptions', array('height' => '300px'))
Configure::write('TinyMCE.editorOptions', ['height' => '300px'])
```

It will make all editors to have a 300px height. You may want to override this value for a single editor. To do so, just pass the option to the editor() method and it will override the default value.
Expand Down
6 changes: 3 additions & 3 deletions Docs/Documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ To install the plugin, place the files in a directory labelled "TinyMCE/" in you
Git Submodule
-------------

If you're using git for version control, you may want to add the **Migrations** plugin as a submodule on your repository. To do so, run the following command from the base of your repository:
If you're using git for version control, you may want to add the **TinyMCE** plugin as a submodule on your repository. To do so, run the following command from the base of your repository:

```
git submodule add [email protected]:CakeDC/TinyMCE.git app/Plugin/Migrations
git submodule add [email protected]:CakeDC/TinyMCE.git app/Plugin/TinyMCE
```

After doing so, you will see the submodule in your changes pending, plus the file ".gitmodules". Simply commit and push to your repository.
Expand All @@ -20,7 +20,7 @@ To initialize the submodule(s) run the following command:
git submodule update --init --recursive
```

To retreive the latest updates to the plugin, assuming you're using the "master" branch, go to "app/Plugin/Migrations" and run the following command:
To retreive the latest updates to the plugin, assuming you're using the "master" branch, go to "app/Plugin/TinyMCE" and run the following command:

```
git pull origin master
Expand Down
12 changes: 6 additions & 6 deletions Docs/Documentation/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ The TinyMCE helper is basically just a convenience helper that allows you to use
There two ways you can use this plugin, simply use the helper or load the editor "by hand" using

```php
$this->Html->script('/TinyMCE/js/tiny_mce/tiny_mce.js', array(
'inline' => false
));
$this->Html->script('/TinyMCE/js/tiny_mce4/tinymce.min.js', [
'block' => true
]);
```

and placing your own script in the head of the page. Please note that the helper will auto add the TinyMCE editor script to the header of the page. No need to do that by hand if you use the helper.

If your app is not set up to work in the top level of your host / but instead in /yourapp/ the automatic inclusion of the script wont work. You'll manually have to add the js file to your app:

```php
$this->Html->script('/yourapp/TinyMCE/js/tiny_mce/tiny_mce.js', array(
'inline' => false
));
$this->Html->script('/yourapp/TinyMCE/js/tiny_mce4/tinymce.min.js', [
'block' => true
]);
```
2 changes: 1 addition & 1 deletion Docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This **TinyMCE** allows developers to quickly add the TinyMCE editor to their ap
Requirements
------------

* CakePHP 2.5+
* CakePHP 3.0+
* PHP 5.2.8+

Documentation
Expand Down
26 changes: 0 additions & 26 deletions Test/Case/AllTinyMCETest.php

This file was deleted.

196 changes: 0 additions & 196 deletions Test/Case/View/Helper/TinyMceHelperTest.php

This file was deleted.

Loading

0 comments on commit db03a60

Please sign in to comment.