Skip to content

Commit 2f6f2fd

Browse files
committed
fix indent spaces in documents
1 parent 9d34ed8 commit 2f6f2fd

File tree

2 files changed

+101
-99
lines changed

2 files changed

+101
-99
lines changed

docs/integration/index.md

Lines changed: 100 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -11,123 +11,125 @@ Check `vendor/unisharp/laravel-filemanager/src/views/demo.blade.php`, which alre
1111

1212
## WYSIWYG Editor Integration:
1313
### Option 1: CKEditor
14-
1. Install [laravel-ckeditor](https://github.com/UniSharp/laravel-ckeditor) package
14+
1. Install [laravel-ckeditor](https://github.com/UniSharp/laravel-ckeditor) package
1515

16-
1. Modify the views
16+
1. Modify the views
1717

18-
* Sample 1 - Replace by ID:
18+
* Sample 1 - Replace by ID:
1919

20-
```html
21-
<script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
22-
<textarea id="my-editor" name="content" class="form-control">{!! old('content', 'test editor content') !!}</textarea>
23-
<script>
24-
CKEDITOR.replace( 'my-editor', {
25-
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
26-
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
27-
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
28-
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
29-
});
30-
</script>
31-
```
32-
33-
* Sample 2 - With JQuery Selector:
34-
35-
```html
36-
<script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
37-
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
38-
<script src="/vendor/unisharp/laravel-ckeditor/adapters/jquery.js"></script>
39-
<textarea name="content" class="form-control my-editor">{!! old('content', 'test editor content') !!}</textarea>
40-
<script>
41-
$('textarea.my-editor').ckeditor({
42-
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
43-
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
44-
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
45-
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
46-
});
47-
</script>
48-
```
20+
```html
21+
<script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
22+
<textarea id="my-editor" name="content" class="form-control">{!! old('content', 'test editor content') !!}</textarea>
23+
<script>
24+
CKEDITOR.replace( 'my-editor', {
25+
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
26+
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
27+
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
28+
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
29+
});
30+
</script>
31+
```
32+
33+
* Sample 2 - With JQuery Selector:
34+
35+
```html
36+
<script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
37+
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
38+
<script src="/vendor/unisharp/laravel-ckeditor/adapters/jquery.js"></script>
39+
<textarea name="content" class="form-control my-editor">{!! old('content', 'test editor content') !!}</textarea>
40+
<script>
41+
$('textarea.my-editor').ckeditor({
42+
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
43+
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
44+
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
45+
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
46+
});
47+
</script>
48+
```
4949

5050
### Option 2: TinyMCE4
51-
```html
52-
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
53-
<textarea name="content" class="form-control my-editor">{!! old('content', $content) !!}</textarea>
54-
<script>
55-
var editor_config = {
56-
path_absolute : "/",
57-
selector: "textarea.my-editor",
58-
plugins: [
59-
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
60-
"searchreplace wordcount visualblocks visualchars code fullscreen",
61-
"insertdatetime media nonbreaking save table contextmenu directionality",
62-
"emoticons template paste textcolor colorpicker textpattern"
63-
],
64-
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
65-
relative_urls: false,
66-
file_browser_callback : function(field_name, url, type, win) {
67-
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
68-
var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;
69-
70-
var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
71-
if (type == 'image') {
72-
cmsURL = cmsURL + "&type=Images";
73-
} else {
74-
cmsURL = cmsURL + "&type=Files";
75-
}
7651

77-
tinyMCE.activeEditor.windowManager.open({
78-
file : cmsURL,
79-
title : 'Filemanager',
80-
width : x * 0.8,
81-
height : y * 0.8,
82-
resizable : "yes",
83-
close_previous : "no"
84-
});
85-
}
86-
};
52+
```html
53+
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
54+
<textarea name="content" class="form-control my-editor">{!! old('content', $content) !!}</textarea>
55+
<script>
56+
var editor_config = {
57+
path_absolute : "/",
58+
selector: "textarea.my-editor",
59+
plugins: [
60+
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
61+
"searchreplace wordcount visualblocks visualchars code fullscreen",
62+
"insertdatetime media nonbreaking save table contextmenu directionality",
63+
"emoticons template paste textcolor colorpicker textpattern"
64+
],
65+
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
66+
relative_urls: false,
67+
file_browser_callback : function(field_name, url, type, win) {
68+
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
69+
var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;
70+
71+
var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
72+
if (type == 'image') {
73+
cmsURL = cmsURL + "&type=Images";
74+
} else {
75+
cmsURL = cmsURL + "&type=Files";
76+
}
77+
78+
tinyMCE.activeEditor.windowManager.open({
79+
file : cmsURL,
80+
title : 'Filemanager',
81+
width : x * 0.8,
82+
height : y * 0.8,
83+
resizable : "yes",
84+
close_previous : "no"
85+
});
86+
}
87+
};
8788
88-
tinymce.init(editor_config);
89-
</script>
90-
```
89+
tinymce.init(editor_config);
90+
</script>
91+
```
9192

9293
##Standalone button
9394
If you are going to use filemanager independently, meaning set the value of an input to selected photo/file url, follow this structure:
9495

95-
1. Create a button, input, and image preview holder if you are going to choose images.
96+
1. Create a button, input, and image preview holder if you are going to choose images.
9697

9798
Specify the id to the input and image preview by `data-input` and `data-preview`.
9899

99-
```html
100-
<div class="input-group">
101-
<span class="input-group-btn">
102-
<a id="lfm" data-input="thumbnail" data-preview="holder" class="btn btn-primary">
103-
<i class="fa fa-picture-o"></i> Choose
104-
</a>
105-
</span>
106-
<input id="thumbnail" class="form-control" type="text" name="filepath">
107-
</div>
108-
<img id="holder" style="margin-top:15px;max-height:100px;">
109-
```
110-
111-
1. Import lfm.js(run `php artisan vendor:publish` if you need).
100+
```html
101+
<div class="input-group">
102+
<span class="input-group-btn">
103+
<a id="lfm" data-input="thumbnail" data-preview="holder" class="btn btn-primary">
104+
<i class="fa fa-picture-o"></i> Choose
105+
</a>
106+
</span>
107+
<input id="thumbnail" class="form-control" type="text" name="filepath">
108+
</div>
109+
<img id="holder" style="margin-top:15px;max-height:100px;">
110+
```
111+
112+
1. Import lfm.js(run `php artisan vendor:publish` if you need).
112113

113-
```html
114-
<script src="/vendor/laravel-filemanager/js/lfm.js"></script>
115-
```
114+
```html
115+
<script src="/vendor/laravel-filemanager/js/lfm.js"></script>
116+
```
116117

117-
1. Init filemanager with type. (requires jQuery)
118+
1. Init filemanager with type. (requires jQuery)
118119

119-
```javascript
120-
$('#lfm').filemanager('image');
121-
```
120+
```javascript
121+
$('#lfm').filemanager('image');
122+
```
123+
122124
or
123125

124-
```javascript
125-
$('#lfm').filemanager('file');
126-
```
126+
```javascript
127+
$('#lfm').filemanager('file');
128+
```
127129

128130
Domain can be specified in the second parameter(optional, but will be required when developing on Windows mechines) :
129131

130-
```javascript
131-
var domain = "{{ url() }}";
132-
$('#lfm').filemanager('image', {prefix: domain});
133-
```
132+
```javascript
133+
var domain = "{{ url() }}";
134+
$('#lfm').filemanager('image', {prefix: domain});
135+
```

docs/upgrade/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
php artisan vendor:publish --tag=lfm_public --force
1818
php artisan vendor:publish --tag=lfm_config --force
1919
```
20+
2021
1. Clear browser cache if page is broken after upgrading.
21-

0 commit comments

Comments
 (0)