Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Commit

Permalink
3rd version upgrade:
Browse files Browse the repository at this point in the history
- Readme updated
- Changelog updated
- Upgrading created
  • Loading branch information
Vyacheslav Basenko committed Jul 3, 2019
1 parent 2db5f70 commit a728104
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 27 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All Notable changes to `froala/nova-froala-field` will be documented in this fil

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## 3.0.0 -2019-07-03

- Upgraded Froala to **3.0.1** version!
- Fixed an error when no toolbarButtons provided
- Font Awesome 5 support
- TUI Advanced Image Editor support

## 2.2.1 - 2019-06-10

- Fixed dynamic import of 3rd party plugins
Expand Down Expand Up @@ -49,4 +56,4 @@ according to _Trix_ fix in **Nova v1.1.5**. Now you can use the `trix` driver wi

## 1.0.1 - 2018-10-19

- Added minimum required dependencies versions
- Added minimum required dependencies versions
88 changes: 62 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Full support of attaching Images, Files and Videos

Notifications for _Froala_ events are handled by [Toasted](https://nova.laravel.com/docs/1.0/customization/frontend.html#notifications) which is provided in _Nova_ by default.

## Upgrading

For upgrading to **Froala 3**, check out – [Upgrading Instructions](UPGRADING.md).

## Installation

You can install the package into a Laravel application that uses [Nova](https://nova.laravel.com) via composer:
Expand All @@ -27,14 +31,6 @@ You can install the package into a Laravel application that uses [Nova](https://
composer require froala/nova-froala-field
```

Then, you must publish _Font Awesome_ fonts for displaying editor buttons:

```bash
php artisan vendor:publish --tag=nova-froala-field-fonts --provider=Froala\\NovaFroalaField\\FroalaFieldServiceProvider
```

**\*** To use _Nova Froala Field_ with local **Nova@^2.0** installation and **Laravel@^5.8**, use **Nova Froala Field@^2.1**

## Usage

Just use the `Froala\NovaFroalaField\Froala` field in your Nova resource:
Expand Down Expand Up @@ -89,19 +85,25 @@ edit `nova.froala-field.options` value:

'options' => [
'toolbarButtons' => [
'bold',
'italic',
'underline',
'|',
'formatOL',
'formatUL',
'|',
'insertImage',
'insertFile',
'insertLink',
'insertVideo',
'|',
'html',
[
'bold',
'italic',
'underline',
],
[
'formatOL',
'formatUL',
],
[
'insertImage',
'insertFile',
'insertLink',
'insertVideo',
],
[
'embedly',
'html',
],
],
],

Expand Down Expand Up @@ -360,13 +362,47 @@ To setup your license key, uncomment `key` option in the config file and set `FR

## 3rd Party Integrations

To enable a button that uses some a 3rd party service and needs additional script inluding, like: *Embed.ly*, *Aviary* or *SCAYT Web SpellChecker*, you should publish 3rd party scripts:
To enable a button that uses some a 3rd party service and needs additional script inluding, like: *Embed.ly*, *TUI Advanced Image Editor* or *SCAYT Web SpellChecker*, you should publish 3rd party scripts:

```bash
php artisan vendor:publish --tag=nova-froala-field-plugins --provider=Froala\\NovaFroalaField\\FroalaFieldServiceProvider
```

Script will be dynamically imported when you enable `embedly` or `spellChecker` buttons or set `aviaryKey` api key.
Script will be dynamically imported when you enable `embedly` or `spellChecker` buttons.

### TUI Advanced Image Editor

If you want to use _TUI Image Editor_ to add advanced image editing options, switch `tuiEnable` option to `true`:

```php
'options' => [
// 'key' => env('FROALA_KEY'),

// 'tuiEnable' => true,

//...
],
```

### Font Awesome 5

If you have a [Font Awesome Pro license](https://fontawesome.com), you can enable using the regular icons instead of
the solid ones by using the iconsTemplate option.

Add `iconsTemplate` config value into `froala-field.php` config:

```php
'options' => [
// 'key' => env('FROALA_KEY'),

'iconsTemplate' => 'font_awesome_5',
// If you want to use the regular/light icons, change the template to the following.
// iconsTemplate: 'font_awesome_5r'
// iconsTemplate: 'font_awesome_5l'

//...
],
```

**Note**:

Expand All @@ -385,9 +421,9 @@ If you want to setup custom event handlers for froala editor instance, create js
```javascript
window.froala = {
events: {
'froalaEditor.image.error': (e, editor, error, response) => {},
'froalaEditor.imageManager.error': (e, editor, error, response) => {},
'froalaEditor.file.error': (e, editor, error, response) => {},
'image.error': (error, response) => {},
'imageManager.error': (error, response) => {},
'file.error': (error, response) => {},
}
};
```
Expand Down
36 changes: 36 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Upgrading

Upgrade guide for major versions which have breaking changes.

## 3.0

### Required

Only one step required for upgrading to _Froala 3_:

```bash
composer require froala/nova-froala-field
```

Done!

Font Awesome has been removed in 3.0 as required dependency.
So, you can delete your `public/vendor/nova/fonts/font-awesome` directory.
If you want to use _Font Awesome 5_, please read the [instruction](README.md#font-awesome-5).

### Additional

1. Toolbar Buttons configuration format has been changed in 3.0 version.
You can check new format in the lateset config file version: [config file](https://github.com/froala/nova-froala-field/blob/master/config/froala-field.php)
2. If you use any 3rd party plugins such as: Embed.ly, SCAYT Web SpellChecker... make force republish:
```bash
php artisan vendor:publish --tag=nova-froala-field-plugins --force
```
3. If you use _Aviary_ plugin, it's currently not supported in 3.0 version, instead of _Aviary_,
you can use _TUI Advanced Image Editor_, check out the [instruction](README.md#tui-advanced-image-editor)
4. If you previously setup _Custom Event Handlers_, in 3.0 version api has been changed,
check out the new version [here](README.md#custom-event-handlers)
**Note**:
If you have made any advanced customizations, please check official upgrade guide - [https://www.froala.com/wysiwyg-editor/docs/migrate-from-v2](https://www.froala.com/wysiwyg-editor/docs/migrate-from-v2).

0 comments on commit a728104

Please sign in to comment.