-
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 #123 from mostafaznv/dev
Dev
- Loading branch information
Showing
30 changed files
with
521 additions
and
139 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
39 changes: 39 additions & 0 deletions
39
docs/advanced-usage/ckeditor-field-options/audio-browser-1.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,39 @@ | ||
--- | ||
description: fileBrowser | ||
--- | ||
|
||
# File 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 file picker functionality within the CKEditor field. | ||
|
||
By utilizing the `fileBrowser` method, you have control over whether the file picker is enabled or disabled for the CKEditor field. The method accepts a boolean value as the `enabled` argument, where `true` enables the file picker, and `false` disables it. | ||
|
||
Enabling the file picker provides a convenient way for users to select and insert file files directly into the CKEditor field. This feature streamlines the file insertion process, enhancing the content creation experience. On the other hand, disabling the file picker removes the option for users to select file files through the CKEditor field, limiting the content to text-only input. | ||
|
||
To utilize the `fileBrowser` method, simply pass `true` or `false` as the `status` argument based on whether you want to enable or disable the file picker, respectively. | ||
|
||
|
||
|
||
```php | ||
use Mostafaznv\NovaCkEditor\CkEditor; | ||
|
||
class Article extends Resource | ||
{ | ||
public function fields(Request $request): array | ||
{ | ||
return [ | ||
CkEditor::make(trans('Content'), 'content') | ||
->fileBrowser() | ||
]; | ||
} | ||
} | ||
``` | ||
|
||
{% hint style="info" %} | ||
This feature was introduced in version <mark style="color:red;">7.3.0</mark> of the NovaCKEditor | ||
{% endhint %} | ||
|
||
|
||
|
28 changes: 28 additions & 0 deletions
28
docs/advanced-usage/configuration/audio-naming-method-1.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,28 @@ | ||
--- | ||
description: file-naming-method | ||
--- | ||
|
||
# File Naming Method | ||
|
||
| Property Name | Type | Default | | ||
| ------------------ | ------ | ------------------------------------------- | | ||
| file-naming-method | string | <mark style="color:red;">`hash-file`</mark> | | ||
|
||
The `file-naming-method` configuration option allows you to specify the naming method for uploaded files within the CKEditor field. This setting determines how the files will be named when they are saved to the storage. | ||
|
||
By default, the `file-naming-method` configuration option is set to `hash-file`, which generates a unique hash-based name for each uploaded file. This helps avoid naming conflicts and ensures uniqueness of the file names. | ||
|
||
|
||
|
||
The available naming methods for the `file-naming-method` configuration option are as follows: | ||
|
||
* `hash-file`: This method generates a unique hash-based name for each uploaded file. | ||
* `real-file-name`: This method retains the original file name of the uploaded file. | ||
* `unique-real-file-name`: This method retains the original file name but adds a unique identifier to prevent naming conflicts. | ||
|
||
To configure the `file-naming-method` option, update the value in the configuration file `config/nova-ckeditor.php` with the desired naming method. | ||
|
||
|
||
|
||
|
||
|
22 changes: 22 additions & 0 deletions
22
docs/advanced-usage/configuration/toolbars/toolbar-1/audio-browser-1.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,22 @@ | ||
--- | ||
description: toolbars.toolbar-1.browser.file | ||
--- | ||
|
||
# File 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.file</td><td>bool</td><td>false</td></tr></tbody></table> | ||
|
||
This option allows you to enable or disable the file picker within the toolbar. By default, this option is set to <mark style="color:red;">`false`</mark>, indicating that the file picker is disabled. | ||
|
||
The file picker provides a convenient way to select and insert files into the CKEditor field. However, in some cases, you may want to enable/disable the file picker functionality. | ||
|
||
To enable the file picker within Toolbar 1, update the value of `toolbars.toolbar-1.browser.file` in the `config/nova-ckeditor.php` file to `true`. | ||
|
||
|
||
|
||
{% hint style="info" %} | ||
This feature was introduced in version <mark style="color:red;">7.3.0</mark> of the NovaCKEditor | ||
{% endhint %} | ||
|
||
|
||
|
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,32 @@ | ||
# Customize FileStorage | ||
|
||
You have the option to override the `FileStorage` service by binding your own extended version using the following code snippet: | ||
|
||
```php | ||
use Illuminate\Http\Request; | ||
use Mostafaznv\NovaCkEditor\FileStorage; | ||
|
||
|
||
class MyFileStorage extends FileStorage | ||
{ | ||
public function __invoke(Request $request) | ||
{ | ||
// TODO: Change the default implementation. | ||
} | ||
} | ||
|
||
$this->app->bind('ckeditor-file-storage', MyFileStorage::class); | ||
``` | ||
|
||
By creating a custom `MyFileStorage` class that extends `FileStorage`, you can define your own logic for handling file storage within the `__invoke()` method. Afterward, binding the custom class to the `'ckeditor-file-storage'` key allows Laravel Nova to use your extended implementation instead of the default one. | ||
|
||
Within the `__invoke()` method of `MyFileStorage`, you can implement your desired functionality to handle file storage according to your specific requirements. | ||
|
||
|
||
|
||
{% hint style="info" %} | ||
This feature was introduced in version <mark style="color:red;">7.3.0</mark> of the NovaCKEditor | ||
{% endhint %} | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<template> | ||
<svg xmlns="http://www.w3.org/2000/svg" :fill="fill" :width="width" :height="height" viewBox="0 0 512 512"> | ||
<path d="M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C231.1 41.5 212.1 32 192 32H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z"/> | ||
</svg> | ||
</template> | ||
|
||
<script lang="js" setup> | ||
const props = defineProps({ | ||
width: { | ||
type: [Number, String], | ||
default: 18 | ||
}, | ||
height: { | ||
type: [Number, String], | ||
default: 18 | ||
}, | ||
fill: { | ||
type: String, | ||
default: '#475569' | ||
} | ||
}) | ||
</script> |
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
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
Oops, something went wrong.