|
3 | 3 | <head> |
4 | 4 |
|
5 | 5 | @include('vendor.elfinder.common_scripts') |
6 | | - @include('vendor.elfinder.common_styles') |
| 6 | + @include('vendor.elfinder.common_styles', ['styleBodyElement' => true]) |
7 | 7 |
|
8 | 8 | <!-- elFinder initialization (REQUIRED) --> |
9 | 9 | <script type="text/javascript"> |
10 | | - var FileBrowserDialogue = { |
11 | | - init: function() { |
12 | | - // Here goes your code for setting your custom things onLoad. |
13 | | - }, |
14 | | - mySubmit: function (file) { |
15 | | - window.parent.postMessage({ |
16 | | - mceAction: 'fileSelected', |
17 | | - data: { |
18 | | - file: file |
19 | | - } |
20 | | - }, '*'); |
21 | | - } |
22 | | - }; |
| 10 | + $(document).ready(function () { |
23 | 11 |
|
24 | | - $().ready(function() { |
25 | | - var theme = 'default'; |
26 | | -
|
27 | | - var elf = $('#elfinder').elfinder({ |
| 12 | + var FileBrowserDialogue = { |
| 13 | + init: function() { |
| 14 | + // Here goes your code for setting your custom things onLoad. |
| 15 | + }, |
| 16 | + mySubmit: function (file) { |
| 17 | + window.parent.postMessage({ |
| 18 | + mceAction: 'fileSelected', |
| 19 | + data: { |
| 20 | + file: file |
| 21 | + } |
| 22 | + }, '*'); |
| 23 | + } |
| 24 | + }; |
| 25 | +
|
| 26 | + let elfinderConfig = { |
| 27 | + cssAutoLoad : false, |
| 28 | + speed: 100, |
28 | 29 | // set your elFinder options here |
29 | 30 | @if($locale) |
30 | 31 | lang: '{{ $locale }}', // locale |
|
37 | 38 | getFileCallback: function(file) { // editor callback |
38 | 39 | FileBrowserDialogue.mySubmit(file); // pass selected file path to TinyMCE |
39 | 40 | }, |
40 | | - themes: { |
41 | | - default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json', |
42 | | - dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json', |
43 | | - }, |
44 | | - theme: theme, |
45 | 41 | height: $(window).height() |
46 | | - }, |
47 | | - function(fm, extraObj) { |
48 | | - fm.bind('open', function() { |
49 | | - setElFinderColorMode(); |
50 | | - }); |
51 | | - }).elfinder('instance'); |
52 | | -
|
53 | | - function isElfinderInDarkMode() { |
54 | | - return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark'; |
55 | | - } |
56 | | -
|
57 | | - function setElFinderColorMode() { |
58 | | - theme = isElfinderInDarkMode() ? 'dark' : 'default'; |
| 42 | + }; |
59 | 43 |
|
60 | | - let instance = $('#elfinder').elfinder('instance'); |
61 | | - instance.changeTheme(theme).storage('theme', theme); |
62 | | - } |
| 44 | + var elf = $('#elfinder').elfinder(elfinderConfig); |
| 45 | + document.getElementById('elfinder').style.opacity = 1; |
63 | 46 | }); |
64 | 47 | </script> |
65 | 48 | </head> |
|
0 commit comments