-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from mostafaznv/dev
GITBOOK-3: change request with no subject merged in GitBook
- Loading branch information
Showing
9 changed files
with
144 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
docs/advanced-usage/ckeditor-field-options/audio-browser.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
description: audioBrowser | ||
--- | ||
|
||
# Audio Browser | ||
|
||
<table><thead><tr><th>Argument</th><th width="140">Type</th><th width="155" data-type="checkbox">Required</th><th>Default</th></tr></thead><tbody><tr><td>enabled</td><td>bool</td><td>false</td><td>true</td></tr></tbody></table> | ||
|
||
This method allows you to enable or disable the audio picker functionality within the CKEditor field. | ||
|
||
By utilizing the `audioBrowser` method, you have control over whether the audio picker is enabled or disabled for the CKEditor field. The method accepts a boolean value as the `enabled` argument, where `true` enables the audio picker, and `false` disables it. | ||
|
||
Enabling the audio picker provides a convenient way for users to select and insert audio files directly into the CKEditor field. This feature streamlines the audio insertion process, enhancing the content creation experience. On the other hand, disabling the audio picker removes the option for users to select audio files through the CKEditor field, limiting the content to text-only input. | ||
|
||
To utilize the `audioBrowser` method, simply pass `true` or `false` as the `status` argument based on whether you want to enable or disable the audio picker, respectively. | ||
|
||
|
||
|
||
```php | ||
use Mostafaznv\NovaCkEditor\CkEditor; | ||
|
||
class Article extends Resource | ||
{ | ||
public function fields(Request $request): array | ||
{ | ||
return [ | ||
CkEditor::make(trans('Content'), 'content') | ||
->audioBrowser() | ||
]; | ||
} | ||
} | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
description: audio-naming-method | ||
--- | ||
|
||
# Audio Naming Method | ||
|
||
| Property Name | Type | Default | | ||
| ------------------- | ------ | ------------------------------------------- | | ||
| audio-naming-method | string | <mark style="color:red;">`hash-file`</mark> | | ||
|
||
The `audio-naming-method` configuration option allows you to specify the naming method for uploaded audio files within the CKEditor field. This setting determines how the audio files will be named when they are saved to the storage. | ||
|
||
By default, the `audio-naming-method` configuration option is set to `hash-file`, which generates a unique hash-based name for each uploaded audio file. This helps avoid naming conflicts and ensures uniqueness of the file names. | ||
|
||
|
||
|
||
The available naming methods for the `audio-naming-method` configuration option are as follows: | ||
|
||
* `hash-file`: This method generates a unique hash-based name for each uploaded audio file. | ||
* `real-file-name`: This method retains the original file name of the uploaded audio. | ||
* `unique-real-file-name`: This method retains the original file name but adds a unique identifier to prevent naming conflicts. | ||
|
||
To configure the `audio-naming-method` option, update the value in the configuration file `config/nova-ckeditor.php` with the desired naming method. | ||
|
||
|
||
|
||
|
||
|
16 changes: 16 additions & 0 deletions
16
docs/advanced-usage/configuration/toolbars/toolbar-1/audio-browser.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
description: toolbars.toolbar-1.browser.audio | ||
--- | ||
|
||
# Audio Browser | ||
|
||
<table><thead><tr><th width="340">Property Name</th><th width="158.33333333333331">Type</th><th>Default</th></tr></thead><tbody><tr><td>toolbars.toolbar-1.browser.audio</td><td>bool</td><td>true</td></tr></tbody></table> | ||
|
||
This option allows you to enable or disable the audio picker within the toolbar. By default, this option is set to `true`, indicating that the audio picker is enabled. | ||
|
||
The audio picker provides a convenient way to select and insert audio files into the CKEditor field. However, in some cases, you may want to disable the audio picker functionality. | ||
|
||
To disable the audio picker within Toolbar 1, update the value of `toolbars.toolbar-1.browser.audio` in the `config/nova-ckeditor.php` file to `false`. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Customize AudioStorage | ||
|
||
You have the option to override the `AudioStorage` service by binding your own extended version using the following code snippet: | ||
|
||
```php | ||
use Illuminate\Http\Request; | ||
use Mostafaznv\NovaCkEditor\AudioStorage; | ||
|
||
class MyAudioStorage extends AudioStorage | ||
{ | ||
public function __invoke(Request $request) | ||
{ | ||
// TODO: Change the default implementation. | ||
} | ||
} | ||
|
||
$this->app->bind('ckeditor-audio-storage', MyAudioStorage::class); | ||
``` | ||
|
||
By creating a custom `MyAudioStorage` class that extends `AudioStorage`, you can define your own logic for handling audio storage within the `__invoke()` method. Afterward, binding the custom class to the `'ckeditor-audio-storage'` key allows Laravel Nova to use your extended implementation instead of the default one. | ||
|
||
Within the `__invoke()` method of `MyAudioStorage`, you can implement your desired functionality to handle audio storage according to your specific requirements. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters