Skip to content

Commit 51152de

Browse files
committed
update integration doc
1 parent 67018c2 commit 51152de

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

docs/integration.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,46 +48,46 @@ Check `vendor/unisharp/laravel-filemanager/src/views/demo.blade.php`, which alre
4848
```
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";
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+
}
76+
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+
});
7585
}
86+
};
7687
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-
};
87-
88-
tinymce.init(editor_config);
89-
</script>
90-
```
88+
tinymce.init(editor_config);
89+
</script>
90+
```
9191

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

0 commit comments

Comments
 (0)