first commit
This commit is contained in:
67
resources/views/vendor/elfinder/ckeditor4.blade.php
vendored
Normal file
67
resources/views/vendor/elfinder/ckeditor4.blade.php
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
|
||||
@include('vendor.elfinder.common_scripts')
|
||||
@include('vendor.elfinder.common_styles')
|
||||
|
||||
<!-- elFinder initialization (REQUIRED) -->
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// Helper function to get parameters from the query string.
|
||||
function getUrlParam(paramName) {
|
||||
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i') ;
|
||||
var match = window.location.search.match(reParam) ;
|
||||
|
||||
return (match && match.length > 1) ? match[1] : '' ;
|
||||
}
|
||||
|
||||
$().ready(function() {
|
||||
var funcNum = getUrlParam('CKEditorFuncNum');
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
@if($locale)
|
||||
lang: '{{ $locale }}', // locale
|
||||
@endif
|
||||
customData: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
url: '{{ route("elfinder.connector") }}', // connector URL
|
||||
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
|
||||
getFileCallback : function(file) {
|
||||
window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
|
||||
window.close();
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
83
resources/views/vendor/elfinder/ckeditor4.php
vendored
Normal file
83
resources/views/vendor/elfinder/ckeditor4.php
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= app()->getLocale() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>elFinder 2.0</title>
|
||||
|
||||
<!-- jQuery and jQuery UI (REQUIRED) -->
|
||||
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- elFinder CSS (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/elfinder.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/theme.css') ?>">
|
||||
|
||||
<!-- elFinder JS (REQUIRED) -->
|
||||
<script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script>
|
||||
|
||||
<?php if ($locale) { ?>
|
||||
<!-- elFinder translation (OPTIONAL) -->
|
||||
<script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script>
|
||||
<?php } ?>
|
||||
|
||||
<!-- elFinder initialization (REQUIRED) -->
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// Helper function to get parameters from the query string.
|
||||
function getUrlParam(paramName) {
|
||||
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i') ;
|
||||
var match = window.location.search.match(reParam) ;
|
||||
|
||||
return (match && match.length > 1) ? match[1] : '' ;
|
||||
}
|
||||
|
||||
$().ready(function() {
|
||||
var funcNum = getUrlParam('CKEditorFuncNum');
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
<?php if ($locale) { ?>
|
||||
lang: '<?= $locale ?>', // locale
|
||||
<?php } ?>
|
||||
customData: {
|
||||
_token: '<?= csrf_token() ?>'
|
||||
},
|
||||
url: '<?= route('elfinder.connector') ?>', // connector URL
|
||||
soundPath: '<?= asset($dir.'/sounds') ?>',
|
||||
getFileCallback : function(file) {
|
||||
window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
|
||||
window.close();
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
21
resources/views/vendor/elfinder/common_scripts.blade.php
vendored
Normal file
21
resources/views/vendor/elfinder/common_scripts.blade.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{{-- jQuery (REQUIRED) --}}
|
||||
@if (!isset ($jquery) || (isset($jquery) && $jquery == true))
|
||||
@basset('https://unpkg.com/jquery@3.6.1/dist/jquery.min.js')
|
||||
@endif
|
||||
|
||||
{{-- jQuery UI and Smoothness theme --}}
|
||||
@bassetArchive('https://github.com/jquery/jquery-ui/archive/refs/tags/1.13.2.tar.gz', 'jquery-ui-1.13.2')
|
||||
@basset('jquery-ui-1.13.2/jquery-ui-1.13.2/dist/themes/smoothness/jquery-ui.min.css')
|
||||
@basset('jquery-ui-1.13.2/jquery-ui-1.13.2/dist/jquery-ui.min.js')
|
||||
|
||||
{{-- elFinder JS (REQUIRED) --}}
|
||||
@bassetArchive('https://github.com/Studio-42/elFinder/archive/refs/tags/2.1.64.tar.gz', 'elfinder-2.1.64')
|
||||
@basset('elfinder-2.1.64/elFinder-2.1.64/js/elfinder.min.js')
|
||||
|
||||
{{-- elFinder translation (OPTIONAL) --}}
|
||||
@if($locale)
|
||||
@basset('https://cdnjs.cloudflare.com/ajax/libs/elfinder/2.1.64/js/i18n/elfinder.'.$locale.'.min.js')
|
||||
@endif
|
||||
|
||||
{{-- elFinder sounds --}}
|
||||
@basset(base_path('vendor/studio-42/elfinder/sounds/rm.wav'))
|
89
resources/views/vendor/elfinder/common_styles.blade.php
vendored
Normal file
89
resources/views/vendor/elfinder/common_styles.blade.php
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
<meta charset="utf-8">
|
||||
<title>File Manager</title>
|
||||
{{-- elFinder CSS (REQUIRED) --}}
|
||||
@php
|
||||
$themeStylesheetVersion = '3.0.0';
|
||||
@endphp
|
||||
@bassetArchive('https://github.com/Studio-42/elFinder/archive/refs/tags/2.1.64.tar.gz', 'elfinder-2.1.64')
|
||||
@basset('elfinder-2.1.64/elFinder-2.1.64/css/elfinder.min.css')
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/css/theme.min.css')
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/images/loading.svg', false)
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/font/material.eot', false)
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/font/material.svg', false)
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/images/icons-big.svg', false)
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/images/icons-small.svg', false)
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/font/material.woff', false)
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/font/material.ttf', false)
|
||||
@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/font/material.woff2', false)
|
||||
|
||||
@bassetBlock('elfinderThemeSwitcherScript.js')
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
function getElfinderStyleSheet(main = true) {
|
||||
let themeStylesheetVersion = '{{$themeStylesheetVersion}}';
|
||||
const regex = new RegExp(main ? `RobiNN1\/elFinder-Material-Theme@${themeStylesheetVersion}\/Material\/css\/theme\.min\.css` : `RobiNN1\/elFinder-Material-Theme@${themeStylesheetVersion}\/Material\/css\/theme-gray\.min\.css`);
|
||||
const linkElements = document.querySelectorAll('link[rel="stylesheet"]');
|
||||
// Find the main elfinder stylesheet
|
||||
let selectedLinkElement;
|
||||
for (const linkElement of linkElements) {
|
||||
if (regex.test(linkElement.href)) {
|
||||
selectedLinkElement = linkElement;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return selectedLinkElement;
|
||||
}
|
||||
|
||||
function addElfinderLightStylesheet() {
|
||||
let themeLightAsset = `{{ Basset::basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@'.$themeStylesheetVersion.'/Material/css/theme-gray.min.css') }}`;
|
||||
const match = themeLightAsset.match(/<link\s+href="([^"]+)"/i);
|
||||
if (match && match.length > 1) {
|
||||
let mainStyleSheet = getElfinderStyleSheet();
|
||||
let lightStyleSheet = getElfinderStyleSheet(false);
|
||||
// if found append the light mode css to the main theme stylesheet
|
||||
if (mainStyleSheet && ! lightStyleSheet) {
|
||||
let themeLight = document.createElement('link');
|
||||
themeLight.href = match[1];
|
||||
themeLight.rel = 'stylesheet';
|
||||
themeLight.type = 'text/css';
|
||||
mainStyleSheet.insertAdjacentElement('afterend', themeLight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let colorMode = window.parent.colorMode?.result ?? window.colorMode?.result ?? false;
|
||||
|
||||
if(colorMode !== 'dark') {
|
||||
addElfinderLightStylesheet();
|
||||
}
|
||||
|
||||
// register a color mode change event so that we remove
|
||||
// the light stylesheet when the color mode change
|
||||
if(colorMode) {
|
||||
let colorModeClass = window.parent.colorMode ?? window.colorMode;
|
||||
colorModeClass.onChange(function(scheme) {
|
||||
let getMainStylesheet = scheme === 'dark' ? false : true;
|
||||
let selectedLinkElement = getElfinderStyleSheet(getMainStylesheet);
|
||||
|
||||
if (! selectedLinkElement) {
|
||||
return true;
|
||||
}
|
||||
// in case we switched to dark mode, remove the ligth theme css
|
||||
if(scheme === 'dark') {
|
||||
selectedLinkElement.parentNode.removeChild(selectedLinkElement);
|
||||
return true;
|
||||
}
|
||||
addElfinderLightStylesheet()
|
||||
});
|
||||
}
|
||||
|
||||
// we dont want to style the body when elfinder is loaded as a component in a backpack view
|
||||
// we pass true when loading elfinder inside an iframe to style the iframe body.
|
||||
@if($styleBodyElement ?? false)
|
||||
// use the topbar and footbar darker color as the background to ease transitions
|
||||
document.getElementsByTagName('body')[0].style.background = '#061325';
|
||||
document.getElementsByTagName('body')[0].style.opacity = 1;
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endBassetBlock
|
47
resources/views/vendor/elfinder/elfinder.blade.php
vendored
Normal file
47
resources/views/vendor/elfinder/elfinder.blade.php
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
@extends(backpack_view('blank'))
|
||||
|
||||
@section('after_scripts')
|
||||
|
||||
@include('vendor.elfinder.common_scripts')
|
||||
@include('vendor.elfinder.common_styles')
|
||||
|
||||
<!-- elFinder initialization (REQUIRED) -->
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// Documentation for client options:
|
||||
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
|
||||
$(document).ready(function() {
|
||||
$('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
@if($locale)
|
||||
lang: '{{ $locale }}', // locale
|
||||
@endif
|
||||
customData: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
url : '{{ route("elfinder.connector") }}', // connector URL
|
||||
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
|
||||
cssAutoLoad : false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@php
|
||||
$breadcrumbs = [
|
||||
trans('backpack::crud.admin') => url(config('backpack.base.route_prefix'), 'dashboard'),
|
||||
trans('backpack::crud.file_manager') => false,
|
||||
];
|
||||
@endphp
|
||||
|
||||
@section('header')
|
||||
<section class="container-fluid" bp-section="page-header">
|
||||
<h1 bp-section="page-heading">{{ trans('backpack::crud.file_manager') }}</h1>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
@endsection
|
72
resources/views/vendor/elfinder/elfinder.php
vendored
Normal file
72
resources/views/vendor/elfinder/elfinder.php
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= app()->getLocale() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>elFinder 2.0</title>
|
||||
|
||||
<!-- jQuery and jQuery UI (REQUIRED) -->
|
||||
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- elFinder CSS (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/elfinder.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/theme.css') ?>">
|
||||
|
||||
<!-- elFinder JS (REQUIRED) -->
|
||||
<script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script>
|
||||
|
||||
<?php if ($locale) { ?>
|
||||
<!-- elFinder translation (OPTIONAL) -->
|
||||
<script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script>
|
||||
<?php } ?>
|
||||
|
||||
<!-- elFinder initialization (REQUIRED) -->
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// Documentation for client options:
|
||||
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
|
||||
$().ready(function() {
|
||||
var theme = 'default';
|
||||
|
||||
$('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
<?php if ($locale) { ?>
|
||||
lang: '<?= $locale ?>', // locale
|
||||
<?php } ?>
|
||||
customData: {
|
||||
_token: '<?= csrf_token() ?>'
|
||||
},
|
||||
url : '<?= route('elfinder.connector') ?>', // connector URL
|
||||
soundPath: '<?= asset($dir.'/sounds') ?>',
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
});
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
88
resources/views/vendor/elfinder/filepicker.blade.php
vendored
Normal file
88
resources/views/vendor/elfinder/filepicker.blade.php
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
|
||||
@include('vendor.elfinder.common_scripts')
|
||||
@include('vendor.elfinder.common_styles')
|
||||
|
||||
<script type="text/javascript">
|
||||
$().ready(function () {
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
@if($locale)
|
||||
lang: '{{ $locale }}', // locale
|
||||
@endif
|
||||
customData: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
url: '{{ route("elfinder.connector") }}', // connector URL
|
||||
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
|
||||
resizable: false,
|
||||
ui: ['toolbar', 'path','stat'],
|
||||
onlyMimes: [{{ $mimeTypes }}],
|
||||
rememberLastDir : false,
|
||||
height: 300,
|
||||
defaultView: 'list',
|
||||
getFileCallback: function (file) {
|
||||
window.parent.processSelectedFile(file, '{{ $input_id }}');
|
||||
console.log(file);
|
||||
},
|
||||
uiOptions : {
|
||||
// toolbar configuration
|
||||
toolbar : [
|
||||
['home', 'up'],
|
||||
['upload'],
|
||||
['quicklook'],
|
||||
],
|
||||
// directories tree options
|
||||
tree : {
|
||||
// expand current root on init
|
||||
openRootOnLoad : true,
|
||||
// auto load current dir parents
|
||||
syncTree : true
|
||||
},
|
||||
// navbar options
|
||||
navbar : {
|
||||
minWidth : 150,
|
||||
maxWidth : 500
|
||||
},
|
||||
// current working directory options
|
||||
cwd : {
|
||||
// display parent directory in listing as ".."
|
||||
oldSchool : false
|
||||
}
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin: 0;">
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
106
resources/views/vendor/elfinder/filepicker.php
vendored
Normal file
106
resources/views/vendor/elfinder/filepicker.php
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= app()->getLocale() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>elFinder 2.0</title>
|
||||
|
||||
<!-- jQuery and jQuery UI (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/smoothness/jquery-ui.css">
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- elFinder CSS (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/elfinder.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/theme.css') ?>">
|
||||
|
||||
<!-- elFinder JS (REQUIRED) -->
|
||||
<script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script>
|
||||
|
||||
<?php if ($locale) { ?>
|
||||
<!-- elFinder translation (OPTIONAL) -->
|
||||
<script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script>
|
||||
<?php } ?>
|
||||
<!-- Include jQuery, jQuery UI, elFinder (REQUIRED) -->
|
||||
|
||||
<script type="text/javascript">
|
||||
$().ready(function () {
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
<?php if ($locale) { ?>
|
||||
lang: '<?= $locale ?>', // locale
|
||||
<?php } ?>
|
||||
customData: {
|
||||
_token: '<?= csrf_token() ?>'
|
||||
},
|
||||
url: '<?= route('elfinder.connector') ?>', // connector URL
|
||||
soundPath: '<?= asset($dir.'/sounds') ?>',
|
||||
resizable: false,
|
||||
ui: ['toolbar', 'path','stat'],
|
||||
onlyMimes: [<?= $mimeTypes ?>],
|
||||
rememberLastDir : false,
|
||||
height: 300,
|
||||
defaultView: 'list',
|
||||
getFileCallback: function (file) {
|
||||
window.parent.processSelectedFile(file, '<?= $input_id?>');
|
||||
console.log(file);
|
||||
},
|
||||
uiOptions : {
|
||||
// toolbar configuration
|
||||
toolbar : [
|
||||
['home', 'up'],
|
||||
['upload'],
|
||||
['quicklook'],
|
||||
],
|
||||
// directories tree options
|
||||
tree : {
|
||||
// expand current root on init
|
||||
openRootOnLoad : true,
|
||||
// auto load current dir parents
|
||||
syncTree : true
|
||||
},
|
||||
// navbar options
|
||||
navbar : {
|
||||
minWidth : 150,
|
||||
maxWidth : 500
|
||||
},
|
||||
// current working directory options
|
||||
cwd : {
|
||||
// display parent directory in listing as ".."
|
||||
oldSchool : false
|
||||
}
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body style="margin: 0;">
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
63
resources/views/vendor/elfinder/standalonepopup.blade.php
vendored
Normal file
63
resources/views/vendor/elfinder/standalonepopup.blade.php
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
|
||||
@include('vendor.elfinder.common_scripts')
|
||||
@include('vendor.elfinder.common_styles', ['styleBodyElement' => true])
|
||||
<style type="text/css">
|
||||
.elfinder-workzone {
|
||||
min-height: max-content !important;
|
||||
}
|
||||
|
||||
#elfinder {
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
top:0;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
let elfinderConfig = {
|
||||
cssAutoLoad : false,
|
||||
speed: 100,
|
||||
// set your elFinder options here
|
||||
@if($locale)
|
||||
lang: '{{ $locale }}', // locale
|
||||
@endif
|
||||
customData: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
url: '{{ route("elfinder.connector") }}', // connector URL
|
||||
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
|
||||
resizable: false,
|
||||
onlyMimes: @json(unserialize(urldecode(request('mimes'))), JSON_UNESCAPED_SLASHES),
|
||||
commandsOptions: {
|
||||
getfile: {
|
||||
multiple: {{ request('multiple') ? 'true' : 'false' }},
|
||||
oncomplete: 'destroy'
|
||||
}
|
||||
},
|
||||
getFileCallback: (file) => {
|
||||
@if (request()->has('multiple') && request()->input('multiple') == 1)
|
||||
window.parent.processSelectedMultipleFiles(file, '{{ $input_id }}');
|
||||
@else
|
||||
window.parent.processSelectedFile(file.path, '{{ $input_id }}');
|
||||
@endif
|
||||
window.parent.jQuery.colorbox.close();
|
||||
},
|
||||
};
|
||||
let elfinderOptions = window.parent.elfinderOptions ?? {};
|
||||
var elf = $('#elfinder').elfinder({...elfinderConfig, ...elfinderOptions}).elfinder('instance');
|
||||
|
||||
document.getElementById('elfinder').style.opacity = 1;
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0;position:absolute;top:0;left:0;width:100%;height:100%;">
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder" style="position:absolute;top:0;left:0;width:100%;height:100%;"></div>
|
||||
</body>
|
||||
</html>
|
82
resources/views/vendor/elfinder/standalonepopup.php
vendored
Normal file
82
resources/views/vendor/elfinder/standalonepopup.php
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= app()->getLocale() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>elFinder 2.0</title>
|
||||
|
||||
<!-- jQuery and jQuery UI (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/smoothness/jquery-ui.css">
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- elFinder CSS (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/elfinder.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/theme.css') ?>">
|
||||
|
||||
<!-- elFinder JS (REQUIRED) -->
|
||||
<script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script>
|
||||
|
||||
<?php if ($locale) { ?>
|
||||
<!-- elFinder translation (OPTIONAL) -->
|
||||
<script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script>
|
||||
<?php } ?>
|
||||
<!-- Include jQuery, jQuery UI, elFinder (REQUIRED) -->
|
||||
|
||||
<script type="text/javascript">
|
||||
$().ready(function () {
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
<?php if ($locale) { ?>
|
||||
lang: '<?= $locale ?>', // locale
|
||||
<?php } ?>
|
||||
customData: {
|
||||
_token: '<?= csrf_token() ?>'
|
||||
},
|
||||
url: '<?= route('elfinder.connector') ?>', // connector URL
|
||||
soundPath: '<?= asset($dir.'/sounds') ?>',
|
||||
dialog: {width: 900, modal: true, title: 'Select a file'},
|
||||
resizable: false,
|
||||
commandsOptions: {
|
||||
getfile: {
|
||||
oncomplete: 'destroy'
|
||||
}
|
||||
},
|
||||
getFileCallback: function (file) {
|
||||
window.parent.processSelectedFile(file.path, '<?= $input_id?>');
|
||||
parent.jQuery.colorbox.close();
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
89
resources/views/vendor/elfinder/tinymce.blade.php
vendored
Normal file
89
resources/views/vendor/elfinder/tinymce.blade.php
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
|
||||
@include('vendor.elfinder.common_scripts')
|
||||
@include('vendor.elfinder.common_styles')
|
||||
|
||||
<!-- TinyMCE Popup class (REQUIRED) -->
|
||||
<script type="text/javascript" src="{{ asset($dir.'/js/tiny_mce_popup.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var FileBrowserDialogue = {
|
||||
init: function() {
|
||||
// Here goes your code for setting your custom things onLoad.
|
||||
},
|
||||
mySubmit: function (URL) {
|
||||
var win = tinyMCEPopup.getWindowArg('window');
|
||||
|
||||
// pass selected file path to TinyMCE
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = URL;
|
||||
|
||||
// are we an image browser?
|
||||
if (typeof(win.ImageDialog) != 'undefined') {
|
||||
// update image dimensions
|
||||
if (win.ImageDialog.getImageData) {
|
||||
win.ImageDialog.getImageData();
|
||||
}
|
||||
// update preview if necessary
|
||||
if (win.ImageDialog.showPreviewImage) {
|
||||
win.ImageDialog.showPreviewImage(URL);
|
||||
}
|
||||
}
|
||||
|
||||
// close popup window
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);
|
||||
|
||||
$().ready(function() {
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
@if($locale)
|
||||
lang: '{{ $locale }}', // locale
|
||||
@endif
|
||||
customData: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
url : '{{ route("elfinder.connector") }}', // connector URL
|
||||
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
|
||||
getFileCallback: function(file) { // editor callback
|
||||
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
105
resources/views/vendor/elfinder/tinymce.php
vendored
Normal file
105
resources/views/vendor/elfinder/tinymce.php
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= app()->getLocale() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>elFinder 2.0</title>
|
||||
|
||||
<!-- jQuery and jQuery UI (REQUIRED) -->
|
||||
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- elFinder CSS (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/elfinder.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/theme.css') ?>">
|
||||
|
||||
<!-- elFinder JS (REQUIRED) -->
|
||||
<script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script>
|
||||
|
||||
<!-- TinyMCE Popup class (REQUIRED) -->
|
||||
<script type="text/javascript" src="<?= asset($dir.'/js/tiny_mce_popup.js') ?>"></script>
|
||||
|
||||
<?php if ($locale) { ?>
|
||||
<!-- elFinder translation (OPTIONAL) -->
|
||||
<script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script>
|
||||
<?php } ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var FileBrowserDialogue = {
|
||||
init: function() {
|
||||
// Here goes your code for setting your custom things onLoad.
|
||||
},
|
||||
mySubmit: function (URL) {
|
||||
var win = tinyMCEPopup.getWindowArg('window');
|
||||
|
||||
// pass selected file path to TinyMCE
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = URL;
|
||||
|
||||
// are we an image browser?
|
||||
if (typeof(win.ImageDialog) != 'undefined') {
|
||||
// update image dimensions
|
||||
if (win.ImageDialog.getImageData) {
|
||||
win.ImageDialog.getImageData();
|
||||
}
|
||||
// update preview if necessary
|
||||
if (win.ImageDialog.showPreviewImage) {
|
||||
win.ImageDialog.showPreviewImage(URL);
|
||||
}
|
||||
}
|
||||
|
||||
// close popup window
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);
|
||||
|
||||
$().ready(function() {
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
<?php if ($locale) { ?>
|
||||
lang: '<?= $locale ?>', // locale
|
||||
<?php } ?>
|
||||
customData: {
|
||||
_token: '<?= csrf_token() ?>'
|
||||
},
|
||||
url : '<?= route('elfinder.connector') ?>', // connector URL
|
||||
soundPath: '<?= asset($dir.'/sounds') ?>',
|
||||
getFileCallback: function(file) { // editor callback
|
||||
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
71
resources/views/vendor/elfinder/tinymce4.blade.php
vendored
Normal file
71
resources/views/vendor/elfinder/tinymce4.blade.php
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
@include('vendor.elfinder.common_scripts')
|
||||
@include('vendor.elfinder.common_styles')
|
||||
|
||||
<!-- elFinder initialization (REQUIRED) -->
|
||||
<script type="text/javascript">
|
||||
var FileBrowserDialogue = {
|
||||
init: function() {
|
||||
// Here goes your code for setting your custom things onLoad.
|
||||
},
|
||||
mySubmit: function (URL) {
|
||||
// pass selected file path to TinyMCE
|
||||
parent.tinymce.activeEditor.windowManager.getParams().setUrl(URL);
|
||||
|
||||
// close popup window
|
||||
parent.tinymce.activeEditor.windowManager.close();
|
||||
}
|
||||
}
|
||||
|
||||
$().ready(function() {
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
@if($locale)
|
||||
lang: '{{ $locale }}', // locale
|
||||
@endif
|
||||
customData: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
url: '{{ route("elfinder.connector") }}', // connector URL
|
||||
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
|
||||
getFileCallback: function(file) { // editor callback
|
||||
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
86
resources/views/vendor/elfinder/tinymce4.php
vendored
Normal file
86
resources/views/vendor/elfinder/tinymce4.php
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= app()->getLocale() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>elFinder 2.0</title>
|
||||
|
||||
<!-- jQuery and jQuery UI (REQUIRED) -->
|
||||
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- elFinder CSS (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/elfinder.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/theme.css') ?>">
|
||||
|
||||
<!-- elFinder JS (REQUIRED) -->
|
||||
<script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script>
|
||||
|
||||
<?php if ($locale) { ?>
|
||||
<!-- elFinder translation (OPTIONAL) -->
|
||||
<script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script>
|
||||
<?php } ?>
|
||||
|
||||
<!-- elFinder initialization (REQUIRED) -->
|
||||
<script type="text/javascript">
|
||||
var FileBrowserDialogue = {
|
||||
init: function() {
|
||||
// Here goes your code for setting your custom things onLoad.
|
||||
},
|
||||
mySubmit: function (URL) {
|
||||
// pass selected file path to TinyMCE
|
||||
parent.tinymce.activeEditor.windowManager.getParams().setUrl(URL);
|
||||
|
||||
// close popup window
|
||||
parent.tinymce.activeEditor.windowManager.close();
|
||||
}
|
||||
}
|
||||
|
||||
$().ready(function() {
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
<?php if ($locale) { ?>
|
||||
lang: '<?= $locale ?>', // locale
|
||||
<?php } ?>
|
||||
customData: {
|
||||
_token: '<?= csrf_token() ?>'
|
||||
},
|
||||
url: '<?= route('elfinder.connector') ?>', // connector URL
|
||||
soundPath: '<?= asset($dir.'/sounds') ?>',
|
||||
getFileCallback: function(file) { // editor callback
|
||||
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
55
resources/views/vendor/elfinder/tinymce5.blade.php
vendored
Normal file
55
resources/views/vendor/elfinder/tinymce5.blade.php
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
@include('vendor.elfinder.common_scripts')
|
||||
@include('vendor.elfinder.common_styles', ['styleBodyElement' => true])
|
||||
|
||||
<!-- elFinder initialization (REQUIRED) -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
var FileBrowserDialogue = {
|
||||
init: function() {
|
||||
// Here goes your code for setting your custom things onLoad.
|
||||
},
|
||||
mySubmit: function (file) {
|
||||
window.parent.postMessage({
|
||||
mceAction: 'fileSelected',
|
||||
data: {
|
||||
file: file
|
||||
}
|
||||
}, '*');
|
||||
}
|
||||
};
|
||||
|
||||
let elfinderConfig = {
|
||||
cssAutoLoad : false,
|
||||
speed: 100,
|
||||
// set your elFinder options here
|
||||
@if($locale)
|
||||
lang: '{{ $locale }}', // locale
|
||||
@endif
|
||||
customData: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
url: '{{ route("elfinder.connector") }}', // connector URL
|
||||
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
|
||||
getFileCallback: function(file) { // editor callback
|
||||
FileBrowserDialogue.mySubmit(file); // pass selected file path to TinyMCE
|
||||
},
|
||||
height: $(window).height()
|
||||
};
|
||||
|
||||
var elf = $('#elfinder').elfinder(elfinderConfig);
|
||||
document.getElementById('elfinder').style.opacity = 1;
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0;top:0;left:0;bottom:0;width:100%;height:100%;">
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
87
resources/views/vendor/elfinder/tinymce5.php
vendored
Normal file
87
resources/views/vendor/elfinder/tinymce5.php
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= app()->getLocale() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>elFinder 2.0</title>
|
||||
|
||||
<!-- jQuery and jQuery UI (REQUIRED) -->
|
||||
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- elFinder CSS (REQUIRED) -->
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/elfinder.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?= asset($dir.'/css/theme.css') ?>">
|
||||
|
||||
<!-- elFinder JS (REQUIRED) -->
|
||||
<script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script>
|
||||
|
||||
<?php if ($locale) { ?>
|
||||
<!-- elFinder translation (OPTIONAL) -->
|
||||
<script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script>
|
||||
<?php } ?>
|
||||
|
||||
<!-- elFinder initialization (REQUIRED) -->
|
||||
<script type="text/javascript">
|
||||
var FileBrowserDialogue = {
|
||||
init: function() {
|
||||
// Here goes your code for setting your custom things onLoad.
|
||||
},
|
||||
mySubmit: function (file) {
|
||||
window.parent.postMessage({
|
||||
mceAction: 'fileSelected',
|
||||
data: {
|
||||
file: file
|
||||
}
|
||||
}, '*');
|
||||
}
|
||||
};
|
||||
|
||||
$().ready(function() {
|
||||
var theme = 'default';
|
||||
|
||||
var elf = $('#elfinder').elfinder({
|
||||
// set your elFinder options here
|
||||
<?php if ($locale) { ?>
|
||||
lang: '<?= $locale ?>', // locale
|
||||
<?php } ?>
|
||||
customData: {
|
||||
_token: '<?= csrf_token() ?>'
|
||||
},
|
||||
url: '<?= route('elfinder.connector') ?>', // connector URL
|
||||
soundPath: '<?= asset($dir.'/sounds') ?>',
|
||||
getFileCallback: function(file) { // editor callback
|
||||
FileBrowserDialogue.mySubmit(file); // pass selected file path to TinyMCE
|
||||
},
|
||||
themes: {
|
||||
default : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-gray.json',
|
||||
dark : 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme/manifests/material-default.json',
|
||||
},
|
||||
theme: theme
|
||||
},
|
||||
function(fm, extraObj) {
|
||||
fm.bind('open', function() {
|
||||
setElFinderColorMode();
|
||||
});
|
||||
}).elfinder('instance');
|
||||
|
||||
function isElfinderInDarkMode() {
|
||||
return typeof window.parent?.colorMode !== 'undefined' && window.parent.colorMode.result === 'dark';
|
||||
}
|
||||
|
||||
function setElFinderColorMode() {
|
||||
theme = isElfinderInDarkMode() ? 'dark' : 'default';
|
||||
|
||||
let instance = $('#elfinder').elfinder('instance');
|
||||
instance.changeTheme(theme).storage('theme', theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Element where elFinder will be created (REQUIRED) -->
|
||||
<div id="elfinder"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user