|
| 1 | +## Documents |
| 2 | + |
| 3 | + 1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md) |
| 4 | + 1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md) |
| 5 | + 1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md) |
| 6 | + 1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md) |
| 7 | + |
1 | 8 | ## WYSIWYG Editor Integration:
|
2 | 9 | ### Option 1: CKEditor
|
3 | 10 |
|
|
80 | 87 |
|
81 | 88 | ##Independent use
|
82 | 89 |
|
83 |
| -If you are going to use filemanager independently,meaning set the value of an input to selected photo/file url,follow this structure: |
84 |
| - |
85 |
| -1. create a popup window or modal(whatever you like): |
86 |
| - |
87 |
| -```html |
88 |
| - <a href="/laravel-filemanager" id="feature-img-container"><img src="no_photo.jpg"></a> |
89 |
| - <input name="thumbnail" type="hidden" id="thumbnail"> |
90 |
| -``` |
91 |
| - |
92 |
| -```javascript |
93 |
| - $('#feature-img-container').on('click', function(e) |
94 |
| - { |
95 |
| - |
96 |
| - window.open(this.href, 'Filemanager', 'width=900,height=600'); |
| 90 | +If you are going to use filemanager independently, meaning set the value of an input to selected photo/file url, follow this structure: |
97 | 91 |
|
98 |
| - return false; |
99 |
| - }); |
100 |
| -``` |
| 92 | +1. Create a button, input, and image preview holder if you are going to choose images. |
101 | 93 |
|
102 |
| -2. define a function named `SetUrl`: |
| 94 | + Specify the id to the input and image preview by `data-input` and `data-preview`. |
103 | 95 |
|
104 |
| -```javascript |
105 |
| - function SetUrl(url){ |
| 96 | + ```html |
| 97 | + <div class="input-group"> |
| 98 | + <span class="input-group-btn"> |
| 99 | + <a id="lfm" data-input="thumbnail" data-preview="holder" class="btn btn-primary"> |
| 100 | + <i class="fa fa-picture-o"> Choose |
| 101 | + </a> |
| 102 | + </span> |
| 103 | + <input id="thumbnail" class="form-control" type="text" name="filepath"> |
| 104 | + </div> |
| 105 | + <img id="holder" style="margin-top:15px;max-height:100px;"> |
| 106 | + ``` |
| 107 | + |
| 108 | +1. Init filemanager with type. (required jQuery) |
| 109 | + |
| 110 | + ```javascript |
| 111 | + $('#lfm').filemanager('image'); |
| 112 | + ``` |
| 113 | + or |
106 | 114 |
|
107 |
| - //set the value of the desired input to image url,often this is a hidden input |
108 |
| - $('#thumbnail').val(url); |
109 |
| - |
110 |
| - //set or change the feature image src,recall wordpress feature image |
111 |
| - $('#feature-img-container').find('img').attr('src',url); |
112 |
| - } |
113 |
| -``` |
| 115 | + ```javascript |
| 116 | + $('#lfm').filemanager('file'); |
| 117 | + ``` |
0 commit comments