Skip to content

Use local vendor directory as consistent source for elFinder assets #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions resources/views/ckeditor4.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>


@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@include('vendor.elfinder.common_scripts')
@include('vendor.elfinder.common_styles')

Expand All @@ -23,11 +24,11 @@ function getUrlParam(paramName) {
@if($locale)
lang: '{{ $locale }}', // locale
@endif
customData: {
customData: {
_token: '{{ csrf_token() }}'
},
url: '{{ route("elfinder.connector") }}', // connector URL
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
soundPath: '{{ Basset::getUrl("elfinder-vendor/sounds") }}',
getFileCallback : function(file) {
window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
window.close();
Expand Down
34 changes: 17 additions & 17 deletions resources/views/common_scripts.blade.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{{-- jQuery (REQUIRED) --}}
@if (!isset ($jquery) || (isset($jquery) && $jquery == true))
@basset('https://unpkg.com/[email protected]/dist/jquery.min.js')
@endif
{{-- jQuery (REQUIRED) --}}
@if (!isset ($jquery) || (isset($jquery) && $jquery == true))
@basset('https://unpkg.com/[email protected]/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')
{{-- 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.61.tar.gz', 'elfinder-2.1.61')
@basset('elfinder-2.1.61/elFinder-2.1.61/js/elfinder.min.js')
{{-- elFinder JS (REQUIRED) --}}
@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@basset('elfinder-vendor/js/elfinder.min.js')

{{-- elFinder translation (OPTIONAL) --}}
@if($locale)
@basset('https://cdnjs.cloudflare.com/ajax/libs/elfinder/2.1.61/js/i18n/elfinder.'.$locale.'.min.js')
@endif
{{-- elFinder translation (OPTIONAL) --}}
@if($locale)
@basset('elfinder-vendor/js/i18n/elfinder.'.$locale.'.js')
@endif

{{-- elFinder sounds --}}
@basset(base_path('vendor/studio-42/elfinder/sounds/rm.wav'))
{{-- elFinder sounds --}}
@basset('elfinder-vendor/sounds/rm.wav')
14 changes: 7 additions & 7 deletions resources/views/common_styles.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<meta charset="utf-8">
<title>File Manager</title>
<meta charset="utf-8">
<title>File Manager</title>

{{-- elFinder CSS (REQUIRED) --}}
@bassetArchive('https://github.com/Studio-42/elFinder/archive/refs/tags/2.1.61.tar.gz', 'elfinder-2.1.61')
@basset('elfinder-2.1.61/elFinder-2.1.61/css/elfinder.min.css')
{{-- elFinder CSS (REQUIRED) --}}
@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@basset('elfinder-vendor/css/elfinder.min.css')

{{-- elFinder Backpack Theme --}}
@basset(base_path('vendor/backpack/filemanager/resources/assets/css/elfinder.backpack.theme.css'))
{{-- elFinder Backpack Theme --}}
@basset(base_path('vendor/backpack/filemanager/resources/assets/css/elfinder.backpack.theme.css'))
5 changes: 3 additions & 2 deletions resources/views/elfinder.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@extends(backpack_view('blank'))

@section('after_scripts')
@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@include('vendor.elfinder.common_scripts')
@include('vendor.elfinder.common_styles')

Expand All @@ -14,11 +15,11 @@
@if($locale)
lang: '{{ $locale }}', // locale
@endif
customData: {
customData: {
_token: '{{ csrf_token() }}'
},
url : '{{ route("elfinder.connector") }}', // connector URL
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}'
soundPath: '{{ Basset::getUrl("elfinder-vendor/sounds") }}'
});
});
</script>
Expand Down
7 changes: 4 additions & 3 deletions resources/views/filepicker.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>


@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@include('vendor.elfinder.common_scripts')
@include('vendor.elfinder.common_styles')

<script type="text/javascript">
$().ready(function () {
var elf = $('#elfinder').elfinder({
Expand All @@ -16,7 +17,7 @@
_token: '{{ csrf_token() }}'
},
url: '{{ route("elfinder.connector") }}', // connector URL
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
soundPath: '{{ Basset::getUrl("elfinder-vendor/sounds") }}',
resizable: false,
ui: ['toolbar', 'path','stat'],
onlyMimes: [{{ $mimeTypes }}],
Expand Down
7 changes: 4 additions & 3 deletions resources/views/standalonepopup.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>


@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@include('vendor.elfinder.common_scripts')
@include('vendor.elfinder.common_styles')

Expand All @@ -12,11 +13,11 @@
@if($locale)
lang: '{{ $locale }}', // locale
@endif
customData: {
customData: {
_token: '{{ csrf_token() }}'
},
url: '{{ route("elfinder.connector") }}', // connector URL
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
soundPath: '{{ Basset::getUrl("elfinder-vendor/sounds") }}',
dialog: {width: 900, modal: true, title: 'Select a file'},
resizable: false,
onlyMimes: @json(unserialize(urldecode(request('mimes'))), JSON_UNESCAPED_SLASHES),
Expand Down
7 changes: 4 additions & 3 deletions resources/views/tinymce.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>


@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@include('vendor.elfinder.common_scripts')
@include('vendor.elfinder.common_styles')

Expand Down Expand Up @@ -44,11 +45,11 @@
@if($locale)
lang: '{{ $locale }}', // locale
@endif
customData: {
customData: {
_token: '{{ csrf_token() }}'
},
url : '{{ route("elfinder.connector") }}', // connector URL
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
soundPath: '{{ Basset::getUrl("elfinder-vendor/sounds") }}',
getFileCallback: function(file) { // editor callback
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
}
Expand Down
9 changes: 5 additions & 4 deletions resources/views/tinymce4.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!DOCTYPE html>
<html>
<head>


@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@include('vendor.elfinder.common_scripts')
@include('vendor.elfinder.common_styles')

<!-- elFinder initialization (REQUIRED) -->
<script type="text/javascript">
var FileBrowserDialogue = {
Expand All @@ -26,11 +27,11 @@
@if($locale)
lang: '{{ $locale }}', // locale
@endif
customData: {
customData: {
_token: '{{ csrf_token() }}'
},
url: '{{ route("elfinder.connector") }}', // connector URL
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
soundPath: '{{ Basset::getUrl("elfinder-vendor/sounds") }}',
getFileCallback: function(file) { // editor callback
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
}
Expand Down
5 changes: 3 additions & 2 deletions resources/views/tinymce5.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html>
<head>


@bassetDirectory(base_path('vendor/studio-42/elfinder/'), 'elfinder-vendor')
@include('vendor.elfinder.common_scripts')
@include('vendor.elfinder.common_styles')

Expand Down Expand Up @@ -31,7 +32,7 @@
_token: '{{ csrf_token() }}'
},
url: '{{ route("elfinder.connector") }}', // connector URL
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
soundPath: '{{ Basset::getUrl("elfinder-vendor/sounds") }}',
getFileCallback: function(file) { // editor callback
FileBrowserDialogue.mySubmit(file); // pass selected file path to TinyMCE
}
Expand Down