first commit

This commit is contained in:
Eric Li
2025-06-13 12:09:50 +08:00
commit b12cd07419
545 changed files with 39389 additions and 0 deletions

View File

@ -0,0 +1,38 @@
<!-- iframe field -->
@include('crud::fields.inc.wrapper_start')
<label>{!! $field['label'] !!}</label>
<br>
<a href="{{ $field['url'] }}" target="_blank" class="btn btn-success">檔案另開新視窗</a>
<br>
@include('crud::fields.inc.translatable_icon')
@if(isset($field['url']) && !empty($field['url']))
@if (strpos($field['url'], ".pdf") !== false)
<embed style="border: solid gray 1px"
src="{{ $field['url'] }}"
width="{{ $field['width'] ?? '' }}"
height="{{ $field['height'] ?? '' }}"
frameborder="0"
allowfullscreen
@if(isset($field['extra_attributes']))
@foreach($field['extra_attributes'] as $key => $value)
{{ $key }}="{{ $value }}"
@endforeach
@endif
></embed>
@else
<img style="border: solid gray 1px"
src="{{ $field['url'] }}"
height="{{ $field['height'] ?? '' }}"
></embed>
@endif
@if(isset($field['hint']))
<p class="help-block">{!! $field['hint'] !!}</p>
@endif
@else
<p class="text-muted">沒有可以顯示內容。</p>
@endif
</div>
@include('crud::fields.inc.wrapper_start')

View File

@ -0,0 +1,20 @@
{{-- This file is used for menu items by any Backpack v6 theme --}}
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('dashboard') }}"><i class="la la-home nav-icon"></i> {{ trans('backpack::base.dashboard') }}</a></li>
<x-backpack::menu-item title="使用者" icon="la la-question" :link="backpack_url('user')" />
<hr>
<x-backpack::menu-item :title="trans('backpack::crud.file_manager')" icon="la la-files-o" :link="backpack_url('elfinder')" />
<hr>
<!--<x-backpack::menu-item title="News catalogs" icon="la la-question" :link="backpack_url('news-catalog')" />-->
<x-backpack::menu-item title="最新消息" icon="la la-question" :link="backpack_url('news')" />
<!--<x-backpack::menu-item title="Health info catalogs" icon="la la-question" :link="backpack_url('health-info-catalog')" />-->
<x-backpack::menu-item title="健康資訊" icon="la la-question" :link="backpack_url('health-info')" />
<!--<x-backpack::menu-item title="Notice catalogs" icon="la la-question" :link="backpack_url('notice-catalog')" />-->
<x-backpack::menu-item title="注意事項" icon="la la-question" :link="backpack_url('notice')" />
<!--<x-backpack::menu-item title="Faq catalogs" icon="la la-question" :link="backpack_url('faq-catalog')" />-->
<x-backpack::menu-item title="常見問題" icon="la la-question" :link="backpack_url('faq')" />
<hr>
<x-backpack::menu-item title="活動設定" icon="la la-question" :link="backpack_url('event-registration-info')" />
<x-backpack::menu-item title="活動:符合代謝新收案" icon="la la-question" :link="backpack_url('event-metabolism')" />
<x-backpack::menu-item title="活動健康達標GO" icon="la la-question" :link="backpack_url('event-improved-health')" />
<x-backpack::menu-item title="活動:反轉代謝新人生" icon="la la-question" :link="backpack_url('event-health-allowance')" />

View 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('(?:[\?&]|&amp;)' + 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>

View 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('(?:[\?&]|&amp;)' + 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>

View 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'))

View 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

View 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

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>