Skip to content

Commit 7d79035

Browse files
committed
Update default and dark theme
1 parent 7f61a49 commit 7d79035

14 files changed

+389
-14
lines changed

resources/views/ckeditor4.blade.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function getUrlParam(paramName) {
1717
1818
$().ready(function() {
1919
var funcNum = getUrlParam('CKEditorFuncNum');
20+
var theme = 'default';
2021
2122
var elf = $('#elfinder').elfinder({
2223
// set your elFinder options here
@@ -31,8 +32,35 @@ function getUrlParam(paramName) {
3132
getFileCallback : function(file) {
3233
window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
3334
window.close();
34-
}
35+
},
36+
themes: {
37+
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
38+
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
39+
},
40+
theme: theme
41+
},
42+
function(fm, extraObj) {
43+
fm.bind('open', function() {
44+
setElFinderColorMode();
45+
});
3546
}).elfinder('instance');
47+
48+
function isElfinderInDarkMode() {
49+
return typeof window.parent.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
50+
}
51+
52+
function setElFinderColorMode() {
53+
theme = isElfinderInDarkMode() ? 'dark' : 'default';
54+
55+
let instance = $('#elfinder').elfinder('instance');
56+
instance.changeTheme(theme).storage('theme', theme);
57+
}
58+
59+
if(typeof window.parent.colorMode !== 'undefined') {
60+
window.parent.colorMode.onChange(function() {
61+
setElFinderColorMode();
62+
});
63+
}
3664
});
3765
</script>
3866
</head>

resources/views/ckeditor4.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function getUrlParam(paramName) {
3333

3434
$().ready(function() {
3535
var funcNum = getUrlParam('CKEditorFuncNum');
36+
var theme = 'default';
3637

3738
var elf = $('#elfinder').elfinder({
3839
// set your elFinder options here
@@ -47,8 +48,35 @@ function getUrlParam(paramName) {
4748
getFileCallback : function(file) {
4849
window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
4950
window.close();
50-
}
51+
},
52+
themes: {
53+
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
54+
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
55+
},
56+
theme: theme
57+
},
58+
function(fm, extraObj) {
59+
fm.bind('open', function() {
60+
setElFinderColorMode();
61+
});
5162
}).elfinder('instance');
63+
64+
function isElfinderInDarkMode() {
65+
return typeof window.parent.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
66+
}
67+
68+
function setElFinderColorMode() {
69+
theme = isElfinderInDarkMode() ? 'dark' : 'default';
70+
71+
let instance = $('#elfinder').elfinder('instance');
72+
instance.changeTheme(theme).storage('theme', theme);
73+
}
74+
75+
if(typeof window.parent.colorMode !== 'undefined') {
76+
window.parent.colorMode.onChange(function() {
77+
setElFinderColorMode();
78+
});
79+
}
5280
});
5381
</script>
5482
</head>

resources/views/elfinder.blade.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// Documentation for client options:
1010
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
1111
$().ready(function() {
12+
var theme = 'default';
13+
1214
$('#elfinder').elfinder({
1315
// set your elFinder options here
1416
@if($locale)
@@ -18,8 +20,35 @@
1820
_token: '{{ csrf_token() }}'
1921
},
2022
url : '{{ route("elfinder.connector") }}', // connector URL
21-
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}'
23+
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
24+
themes: {
25+
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
26+
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
27+
},
28+
theme: theme
29+
},
30+
function(fm, extraObj) {
31+
fm.bind('open', function() {
32+
setElFinderColorMode();
33+
});
2234
});
35+
36+
function isElfinderInDarkMode() {
37+
return typeof window.parent.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
38+
}
39+
40+
function setElFinderColorMode() {
41+
theme = isElfinderInDarkMode() ? 'dark' : 'default';
42+
43+
let instance = $('#elfinder').elfinder('instance');
44+
instance.changeTheme(theme).storage('theme', theme);
45+
}
46+
47+
if(typeof window.parent.colorMode !== 'undefined') {
48+
window.parent.colorMode.onChange(function() {
49+
setElFinderColorMode();
50+
});
51+
}
2352
});
2453
</script>
2554
@endsection

resources/views/elfinder.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
// Documentation for client options:
2727
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
2828
$().ready(function() {
29+
var theme = 'default';
30+
2931
$('#elfinder').elfinder({
3032
// set your elFinder options here
3133
<?php if ($locale) { ?>
@@ -35,8 +37,35 @@
3537
_token: '<?= csrf_token() ?>'
3638
},
3739
url : '<?= route('elfinder.connector') ?>', // connector URL
38-
soundPath: '<?= asset($dir.'/sounds') ?>'
40+
soundPath: '<?= asset($dir.'/sounds') ?>',
41+
themes: {
42+
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
43+
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
44+
},
45+
theme: theme
46+
},
47+
function(fm, extraObj) {
48+
fm.bind('open', function() {
49+
setElFinderColorMode();
50+
});
3951
});
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';
59+
60+
let instance = $('#elfinder').elfinder('instance');
61+
instance.changeTheme(theme).storage('theme', theme);
62+
}
63+
64+
if(typeof window.parent.colorMode !== 'undefined') {
65+
window.parent.colorMode.onChange(function() {
66+
setElFinderColorMode();
67+
});
68+
}
4069
});
4170
</script>
4271
</head>

resources/views/filepicker.blade.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
<script type="text/javascript">
99
$().ready(function () {
10+
var theme = 'default';
11+
1012
var elf = $('#elfinder').elfinder({
1113
// set your elFinder options here
1214
@if($locale)
@@ -51,8 +53,35 @@
5153
// display parent directory in listing as ".."
5254
oldSchool : false
5355
}
54-
}
56+
},
57+
themes: {
58+
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
59+
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
60+
},
61+
theme: theme
62+
},
63+
function(fm, extraObj) {
64+
fm.bind('open', function() {
65+
setElFinderColorMode();
66+
});
5567
}).elfinder('instance');
68+
69+
function isElfinderInDarkMode() {
70+
return typeof window.parent.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
71+
}
72+
73+
function setElFinderColorMode() {
74+
theme = isElfinderInDarkMode() ? 'dark' : 'default';
75+
76+
let instance = $('#elfinder').elfinder('instance');
77+
instance.changeTheme(theme).storage('theme', theme);
78+
}
79+
80+
if(typeof window.parent.colorMode !== 'undefined') {
81+
window.parent.colorMode.onChange(function() {
82+
setElFinderColorMode();
83+
});
84+
}
5685
});
5786
</script>
5887
</head>

resources/views/filepicker.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
<script type="text/javascript">
2626
$().ready(function () {
27+
var theme = 'default';
28+
2729
var elf = $('#elfinder').elfinder({
2830
// set your elFinder options here
2931
<?php if ($locale) { ?>
@@ -68,8 +70,35 @@
6870
// display parent directory in listing as ".."
6971
oldSchool : false
7072
}
71-
}
73+
},
74+
themes: {
75+
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
76+
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
77+
},
78+
theme: theme
79+
},
80+
function(fm, extraObj) {
81+
fm.bind('open', function() {
82+
setElFinderColorMode();
83+
});
7284
}).elfinder('instance');
85+
86+
function isElfinderInDarkMode() {
87+
return typeof window.parent.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
88+
}
89+
90+
function setElFinderColorMode() {
91+
theme = isElfinderInDarkMode() ? 'dark' : 'default';
92+
93+
let instance = $('#elfinder').elfinder('instance');
94+
instance.changeTheme(theme).storage('theme', theme);
95+
}
96+
97+
if(typeof window.parent.colorMode !== 'undefined') {
98+
window.parent.colorMode.onChange(function() {
99+
setElFinderColorMode();
100+
});
101+
}
73102
});
74103
</script>
75104

resources/views/standalonepopup.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
4242
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
4343
},
44-
theme: theme,
44+
theme: theme
4545
},
4646
function(fm, extraObj) {
4747
fm.bind('open', function() {

resources/views/standalonepopup.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
<script type="text/javascript">
2626
$().ready(function () {
27+
var theme = 'default';
28+
2729
var elf = $('#elfinder').elfinder({
2830
// set your elFinder options here
2931
<?php if ($locale) { ?>
@@ -44,8 +46,35 @@
4446
getFileCallback: function (file) {
4547
window.parent.processSelectedFile(file.path, '<?= $input_id?>');
4648
parent.jQuery.colorbox.close();
47-
}
49+
},
50+
themes: {
51+
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
52+
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
53+
},
54+
theme: theme
55+
},
56+
function(fm, extraObj) {
57+
fm.bind('open', function() {
58+
setElFinderColorMode();
59+
});
4860
}).elfinder('instance');
61+
62+
function isElfinderInDarkMode() {
63+
return typeof window.parent.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
64+
}
65+
66+
function setElFinderColorMode() {
67+
theme = isElfinderInDarkMode() ? 'dark' : 'default';
68+
69+
let instance = $('#elfinder').elfinder('instance');
70+
instance.changeTheme(theme).storage('theme', theme);
71+
}
72+
73+
if(typeof window.parent.colorMode !== 'undefined') {
74+
window.parent.colorMode.onChange(function() {
75+
setElFinderColorMode();
76+
});
77+
}
4978
});
5079
</script>
5180

resources/views/tinymce.blade.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
tinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);
4040
4141
$().ready(function() {
42+
var theme = 'default';
43+
4244
var elf = $('#elfinder').elfinder({
4345
// set your elFinder options here
4446
@if($locale)
@@ -51,8 +53,35 @@
5153
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
5254
getFileCallback: function(file) { // editor callback
5355
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
54-
}
56+
},
57+
themes: {
58+
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
59+
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
60+
},
61+
theme: theme
62+
},
63+
function(fm, extraObj) {
64+
fm.bind('open', function() {
65+
setElFinderColorMode();
66+
});
5567
}).elfinder('instance');
68+
69+
function isElfinderInDarkMode() {
70+
return typeof window.parent.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
71+
}
72+
73+
function setElFinderColorMode() {
74+
theme = isElfinderInDarkMode() ? 'dark' : 'default';
75+
76+
let instance = $('#elfinder').elfinder('instance');
77+
instance.changeTheme(theme).storage('theme', theme);
78+
}
79+
80+
if(typeof window.parent.colorMode !== 'undefined') {
81+
window.parent.colorMode.onChange(function() {
82+
setElFinderColorMode();
83+
});
84+
}
5685
});
5786
</script>
5887

0 commit comments

Comments
 (0)