first commit
This commit is contained in:
104
resources/views/vendor/laravel-filemanager/crop.blade.php
vendored
Normal file
104
resources/views/vendor/laravel-filemanager/crop.blade.php
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
<div class="row no-gutters">
|
||||
<div class="col-xl-8">
|
||||
<div class="crop-container">
|
||||
<img src="{{ $img->url . '?timestamp=' . $img->time }}" class="img img-responsive">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<div class="text-center">
|
||||
<div class="img-preview center-block"></div>
|
||||
<br>
|
||||
<div class="btn-group clearfix">
|
||||
<label class="btn btn-info btn-aspectRatio active" onclick="changeAspectRatio(this, 16 / 9)">
|
||||
16:9
|
||||
</label>
|
||||
<label class="btn btn-info btn-aspectRatio" onclick="changeAspectRatio(this, 4 / 3)">
|
||||
4:3
|
||||
</label>
|
||||
<label class="btn btn-info btn-aspectRatio" onclick="changeAspectRatio(this, 1)">
|
||||
1:1
|
||||
</label>
|
||||
<label class="btn btn-info btn-aspectRatio" onclick="changeAspectRatio(this, 2 / 3)">
|
||||
2:3
|
||||
</label>
|
||||
<label class="btn btn-info btn-aspectRatio" onclick="changeAspectRatio(this, null)">
|
||||
{{ trans('laravel-filemanager::lfm.btn-crop-free') }}
|
||||
</label>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="btn-group clearfix">
|
||||
<button class="btn btn-secondary" onclick="loadItems()">{{ trans('laravel-filemanager::lfm.btn-cancel') }}</button>
|
||||
<button class="btn btn-warning" onclick="performCropNew()">{{ trans('laravel-filemanager::lfm.btn-copy-crop') }}</button>
|
||||
<button class="btn btn-primary" onclick="performCrop()">{{ trans('laravel-filemanager::lfm.btn-crop') }}</button>
|
||||
</div>
|
||||
<form id='cropForm'>
|
||||
<input type="hidden" id="img" name="img" value="{{ $img->name }}">
|
||||
<input type="hidden" id="working_dir" name="working_dir" value="{{ $working_dir }}">
|
||||
<input type="hidden" id="dataX" name="dataX">
|
||||
<input type="hidden" id="dataY" name="dataY">
|
||||
<input type="hidden" id="dataWidth" name="dataWidth">
|
||||
<input type="hidden" id="dataHeight" name="dataHeight">
|
||||
<input type='hidden' name='_token' value='{{csrf_token()}}'>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var $image = null,
|
||||
options = {};
|
||||
|
||||
$(document).ready(function () {
|
||||
var $dataX = $('#dataX'),
|
||||
$dataY = $('#dataY'),
|
||||
$dataHeight = $('#dataHeight'),
|
||||
$dataWidth = $('#dataWidth');
|
||||
|
||||
$image = $('.crop-container > img');
|
||||
options = {
|
||||
aspectRatio: 16 / 9,
|
||||
preview: ".img-preview",
|
||||
strict: false,
|
||||
crop: function (data) {
|
||||
// Output the result data for cropping image.
|
||||
$dataX.val(Math.round(data.x));
|
||||
$dataY.val(Math.round(data.y));
|
||||
$dataHeight.val(Math.round(data.height));
|
||||
$dataWidth.val(Math.round(data.width));
|
||||
}
|
||||
};
|
||||
$image.cropper(options);
|
||||
});
|
||||
function changeAspectRatio(_this, aspectRatio) {
|
||||
options.aspectRatio = aspectRatio;
|
||||
$('.btn-aspectRatio.active').removeClass('active');
|
||||
$(_this).addClass('active');
|
||||
$('.img-preview').removeAttr('style');
|
||||
$image.cropper('destroy').cropper(options);
|
||||
return false;
|
||||
}
|
||||
function performCrop() {
|
||||
performLfmRequest('cropimage', {
|
||||
img: $("#img").val(),
|
||||
working_dir: $("#working_dir").val(),
|
||||
dataX: $("#dataX").val(),
|
||||
dataY: $("#dataY").val(),
|
||||
dataHeight: $("#dataHeight").val(),
|
||||
dataWidth: $("#dataWidth").val(),
|
||||
type: $('#type').val()
|
||||
}).done(loadItems);
|
||||
}
|
||||
|
||||
function performCropNew() {
|
||||
performLfmRequest('cropnewimage', {
|
||||
img: $("#img").val(),
|
||||
working_dir: $("#working_dir").val(),
|
||||
dataX: $("#dataX").val(),
|
||||
dataY: $("#dataY").val(),
|
||||
dataHeight: $("#dataHeight").val(),
|
||||
dataWidth: $("#dataWidth").val(),
|
||||
type: $('#type').val()
|
||||
}).done(loadItems);
|
||||
}
|
||||
</script>
|
213
resources/views/vendor/laravel-filemanager/demo.blade.php
vendored
Normal file
213
resources/views/vendor/laravel-filemanager/demo.blade.php
vendored
Normal file
@ -0,0 +1,213 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Laravel Filemanager</title>
|
||||
<link rel="shortcut icon" type="image/png" href="{{ asset('vendor/laravel-filemanager/img/72px color.png') }}">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="page-header">Integration Demo Page</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2 class="mt-4">CKEditor</h2>
|
||||
<textarea name="ce" class="form-control"></textarea>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h2 class="mt-4">TinyMCE</h2>
|
||||
<textarea name="tm" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2 class="mt-4">Summernote</h2>
|
||||
<textarea id="summernote-editor" name="content"></textarea>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h2 class="mt-4">Standalone Image Button</h2>
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<a id="lfm" data-input="thumbnail" data-preview="holder" class="btn btn-primary text-white">
|
||||
<i class="fa fa-picture-o"></i> Choose
|
||||
</a>
|
||||
</span>
|
||||
<input id="thumbnail" class="form-control" type="text" name="filepath">
|
||||
</div>
|
||||
<div id="holder" style="margin-top:15px;max-height:100px;"></div>
|
||||
<h2 class="mt-4">Standalone File Button</h2>
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<a id="lfm2" data-input="thumbnail2" data-preview="holder2" class="btn btn-primary text-white">
|
||||
<i class="fa fa-picture-o"></i> Choose
|
||||
</a>
|
||||
</span>
|
||||
<input id="thumbnail2" class="form-control" type="text" name="filepath">
|
||||
</div>
|
||||
<div id="holder2" style="margin-top:15px;max-height:100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2 class="mt-4">Embed file manager</h2>
|
||||
<iframe src="/filemanager" style="width: 100%; height: 500px; overflow: hidden; border: none;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
var route_prefix = "{{env('APP_URL')}}/files";
|
||||
</script>
|
||||
|
||||
<!-- CKEditor init -->
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.11/ckeditor.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.11/adapters/jquery.js"></script>
|
||||
<script>
|
||||
$('textarea[name=ce]').ckeditor({
|
||||
height: 100,
|
||||
filebrowserImageBrowseUrl: route_prefix + '?type=Images',
|
||||
filebrowserImageUploadUrl: route_prefix + '/upload?type=Images&_token={{csrf_token()}}',
|
||||
filebrowserBrowseUrl: route_prefix + '?type=Files',
|
||||
filebrowserUploadUrl: route_prefix + '/upload?type=Files&_token={{csrf_token()}}'
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- TinyMCE init -->
|
||||
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
|
||||
<script>
|
||||
var editor_config = {
|
||||
path_absolute : "",
|
||||
selector: "textarea[name=tm]",
|
||||
plugins: [
|
||||
"link image"
|
||||
],
|
||||
relative_urls: false,
|
||||
height: 129,
|
||||
file_browser_callback : function(field_name, url, type, win) {
|
||||
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
|
||||
var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;
|
||||
|
||||
var cmsURL = editor_config.path_absolute + route_prefix + '?field_name=' + field_name;
|
||||
if (type == 'image') {
|
||||
cmsURL = cmsURL + "&type=Images";
|
||||
} else {
|
||||
cmsURL = cmsURL + "&type=Files";
|
||||
}
|
||||
|
||||
tinyMCE.activeEditor.windowManager.open({
|
||||
file : cmsURL,
|
||||
title : 'Filemanager',
|
||||
width : x * 0.8,
|
||||
height : y * 0.8,
|
||||
resizable : "yes",
|
||||
close_previous : "no"
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
tinymce.init(editor_config);
|
||||
</script>
|
||||
|
||||
<script>
|
||||
{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/js/stand-alone-button.js')) !!}
|
||||
</script>
|
||||
<script>
|
||||
$('#lfm').filemanager('image', {prefix: route_prefix});
|
||||
// $('#lfm').filemanager('file', {prefix: route_prefix});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var lfm = function(id, type, options) {
|
||||
let button = document.getElementById(id);
|
||||
|
||||
button.addEventListener('click', function () {
|
||||
var route_prefix = (options && options.prefix) ? options.prefix : '/filemanager';
|
||||
var target_input = document.getElementById(button.getAttribute('data-input'));
|
||||
var target_preview = document.getElementById(button.getAttribute('data-preview'));
|
||||
|
||||
window.open(route_prefix + '?type=' + options.type || 'file', 'FileManager', 'width=900,height=600');
|
||||
window.SetUrl = function (items) {
|
||||
var file_path = items.map(function (item) {
|
||||
return item.url;
|
||||
}).join(',');
|
||||
|
||||
// set the value of the desired input to image url
|
||||
target_input.value = file_path;
|
||||
target_input.dispatchEvent(new Event('change'));
|
||||
|
||||
// clear previous preview
|
||||
target_preview.innerHtml = '';
|
||||
|
||||
// set or change the preview image src
|
||||
items.forEach(function (item) {
|
||||
let img = document.createElement('img')
|
||||
img.setAttribute('style', 'height: 5rem')
|
||||
img.setAttribute('src', item.thumb_url)
|
||||
target_preview.appendChild(img);
|
||||
});
|
||||
|
||||
// trigger change event
|
||||
target_preview.dispatchEvent(new Event('change'));
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
lfm('lfm2', 'file', {prefix: route_prefix});
|
||||
</script>
|
||||
|
||||
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.8/summernote.css" rel="stylesheet">
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.8/summernote.js"></script>
|
||||
<style>
|
||||
.popover {
|
||||
top: auto;
|
||||
left: auto;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
// Define function to open filemanager window
|
||||
var lfm = function(options, cb) {
|
||||
var route_prefix = (options && options.prefix) ? options.prefix : '/filemanager';
|
||||
window.open(route_prefix + '?type=' + options.type || 'file', 'FileManager', 'width=900,height=600');
|
||||
window.SetUrl = cb;
|
||||
};
|
||||
|
||||
// Define LFM summernote button
|
||||
var LFMButton = function(context) {
|
||||
var ui = $.summernote.ui;
|
||||
var button = ui.button({
|
||||
contents: '<i class="note-icon-picture"></i> ',
|
||||
tooltip: 'Insert image with filemanager',
|
||||
click: function() {
|
||||
|
||||
lfm({type: 'image', prefix: '/filemanager'}, function(lfmItems, path) {
|
||||
lfmItems.forEach(function (lfmItem) {
|
||||
context.invoke('insertImage', lfmItem.url);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
return button.render();
|
||||
};
|
||||
|
||||
// Initialize summernote with LFM button in the popover button group
|
||||
// Please note that you can add this button to any other button group you'd like
|
||||
$('#summernote-editor').summernote({
|
||||
toolbar: [
|
||||
['popovers', ['lfm']],
|
||||
],
|
||||
buttons: {
|
||||
lfm: LFMButton
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
292
resources/views/vendor/laravel-filemanager/index.blade.php
vendored
Normal file
292
resources/views/vendor/laravel-filemanager/index.blade.php
vendored
Normal file
@ -0,0 +1,292 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
<!-- Chrome, Firefox OS and Opera -->
|
||||
<meta name="theme-color" content="#333844">
|
||||
<!-- Windows Phone -->
|
||||
<meta name="msapplication-navbutton-color" content="#333844">
|
||||
<!-- iOS Safari -->
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="#333844">
|
||||
|
||||
<title>{{ trans('laravel-filemanager::lfm.title-page') }}</title>
|
||||
<link rel="shortcut icon" type="image/png" href="{{ asset('vendor/laravel-filemanager/img/72px color.png') }}">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.0/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.5.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-ui-dist@1.12.1/jquery-ui.min.css">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/laravel-filemanager/css/cropper.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/laravel-filemanager/css/dropzone.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/laravel-filemanager/css/mime-icons.min.css') }}">
|
||||
<style>{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/css/lfm.css')) !!}</style>
|
||||
{{-- Use the line below instead of the above if you need to cache the css. --}}
|
||||
{{-- <link rel="stylesheet" href="{{ asset('/vendor/laravel-filemanager/css/lfm.css') }}"> --}}
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar sticky-top navbar-expand-lg navbar-dark" id="nav">
|
||||
<a class="navbar-brand invisible-lg d-none d-lg-inline" id="to-previous">
|
||||
<i class="fas fa-arrow-left fa-fw"></i>
|
||||
<span class="d-none d-lg-inline">{{ trans('laravel-filemanager::lfm.nav-back') }}</span>
|
||||
</a>
|
||||
<a class="navbar-brand d-block d-lg-none" id="show_tree">
|
||||
<i class="fas fa-bars fa-fw"></i>
|
||||
</a>
|
||||
<a class="navbar-brand d-block d-lg-none" id="current_folder"></a>
|
||||
<a id="loading" class="navbar-brand"><i class="fas fa-spinner fa-spin"></i></a>
|
||||
<div class="ml-auto px-2">
|
||||
<a class="navbar-link d-none" id="multi_selection_toggle">
|
||||
<i class="fa fa-check-double fa-fw"></i>
|
||||
<span class="d-none d-lg-inline">{{ trans('laravel-filemanager::lfm.menu-multiple') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
<a class="navbar-toggler collapsed border-0 px-1 py-2 m-0" data-toggle="collapse" data-target="#nav-buttons">
|
||||
<i class="fas fa-cog fa-fw"></i>
|
||||
</a>
|
||||
<div class="collapse navbar-collapse flex-grow-0" id="nav-buttons">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-display="grid">
|
||||
<i class="fas fa-th-large fa-fw"></i>
|
||||
<span>{{ trans('laravel-filemanager::lfm.nav-thumbnails') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-display="list">
|
||||
<i class="fas fa-list-ul fa-fw"></i>
|
||||
<span>{{ trans('laravel-filemanager::lfm.nav-list') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-sort fa-fw"></i>{{ trans('laravel-filemanager::lfm.nav-sort') }}
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right border-0"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<nav class="bg-light fixed-bottom border-top d-none" id="actions">
|
||||
<a data-action="open" data-multiple="false"><i class="fas fa-folder-open"></i>{{ trans('laravel-filemanager::lfm.btn-open') }}</a>
|
||||
<a data-action="preview" data-multiple="true"><i class="fas fa-images"></i>{{ trans('laravel-filemanager::lfm.menu-view') }}</a>
|
||||
<a data-action="use" data-multiple="true"><i class="fas fa-check"></i>{{ trans('laravel-filemanager::lfm.btn-confirm') }}</a>
|
||||
</nav>
|
||||
|
||||
<div class="d-flex flex-row">
|
||||
<div id="tree"></div>
|
||||
|
||||
<div id="main">
|
||||
<div id="alerts"></div>
|
||||
|
||||
<nav aria-label="breadcrumb" class="d-none d-lg-block" id="breadcrumbs">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item invisible">Home</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div id="empty" class="d-none">
|
||||
<i class="far fa-folder-open"></i>
|
||||
{{ trans('laravel-filemanager::lfm.message-empty') }}
|
||||
</div>
|
||||
|
||||
<div id="content"></div>
|
||||
<div id="pagination"></div>
|
||||
|
||||
<a id="item-template" class="d-none">
|
||||
<div class="square"></div>
|
||||
|
||||
<div class="info">
|
||||
<div class="item_name text-truncate"></div>
|
||||
<time class="text-muted font-weight-light text-truncate"></time>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="fab"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">{{ trans('laravel-filemanager::lfm.title-upload') }}</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aia-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('unisharp.lfm.upload') }}" role='form' id='uploadForm' name='uploadForm' method='post' enctype='multipart/form-data' class="dropzone">
|
||||
<div class="form-group" id="attachment">
|
||||
<div class="controls text-center">
|
||||
<div class="input-group w-100">
|
||||
<a class="btn btn-primary w-100 text-white" id="upload-button">{{ trans('laravel-filemanager::lfm.message-choose') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type='hidden' name='working_dir' id='working_dir'>
|
||||
<input type='hidden' name='type' id='type' value='{{ request("type") }}'>
|
||||
<input type='hidden' name='_token' value='{{csrf_token()}}'>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="notify" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body"></div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-close') }}</button>
|
||||
<button type="button" class="btn btn-primary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-confirm') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-close') }}</button>
|
||||
<button type="button" class="btn btn-primary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-confirm') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="carouselTemplate" class="d-none carousel slide bg-light" data-ride="carousel">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#previewCarousel" data-slide-to="0" class="active"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item active">
|
||||
<a class="carousel-label"></a>
|
||||
<div class="carousel-image"></div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="carousel-control-prev" href="#previewCarousel" role="button" data-slide="prev">
|
||||
<div class="carousel-control-background" aria-hidden="true">
|
||||
<i class="fas fa-chevron-left"></i>
|
||||
</div>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#previewCarousel" role="button" data-slide="next">
|
||||
<div class="carousel-control-background" aria-hidden="true">
|
||||
<i class="fas fa-chevron-right"></i>
|
||||
</div>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.3/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.0/dist/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery-ui-dist@1.12.1/jquery-ui.min.js"></script>
|
||||
<script src="{{ asset('vendor/laravel-filemanager/js/cropper.min.js') }}"></script>
|
||||
<script src="{{ asset('vendor/laravel-filemanager/js/dropzone.min.js') }}"></script>
|
||||
<script>
|
||||
var lang = {!! json_encode(trans('laravel-filemanager::lfm')) !!};
|
||||
var actions = [
|
||||
// {
|
||||
// name: 'use',
|
||||
// icon: 'check',
|
||||
// label: 'Confirm',
|
||||
// multiple: true
|
||||
// },
|
||||
{
|
||||
name: 'rename',
|
||||
icon: 'edit',
|
||||
label: lang['menu-rename'],
|
||||
multiple: false
|
||||
},
|
||||
{
|
||||
name: 'download',
|
||||
icon: 'download',
|
||||
label: lang['menu-download'],
|
||||
multiple: true
|
||||
},
|
||||
// {
|
||||
// name: 'preview',
|
||||
// icon: 'image',
|
||||
// label: lang['menu-view'],
|
||||
// multiple: true
|
||||
// },
|
||||
{
|
||||
name: 'move',
|
||||
icon: 'paste',
|
||||
label: lang['menu-move'],
|
||||
multiple: true
|
||||
},
|
||||
{
|
||||
name: 'resize',
|
||||
icon: 'arrows-alt',
|
||||
label: lang['menu-resize'],
|
||||
multiple: false
|
||||
},
|
||||
{
|
||||
name: 'crop',
|
||||
icon: 'crop',
|
||||
label: lang['menu-crop'],
|
||||
multiple: false
|
||||
},
|
||||
{
|
||||
name: 'trash',
|
||||
icon: 'trash',
|
||||
label: lang['menu-delete'],
|
||||
multiple: true
|
||||
},
|
||||
];
|
||||
|
||||
var sortings = [
|
||||
{
|
||||
by: 'alphabetic',
|
||||
icon: 'sort-alpha-down',
|
||||
label: lang['nav-sort-alphabetic']
|
||||
},
|
||||
{
|
||||
by: 'time',
|
||||
icon: 'sort-numeric-down',
|
||||
label: lang['nav-sort-time']
|
||||
}
|
||||
];
|
||||
</script>
|
||||
<script>{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/js/script.js')) !!}</script>
|
||||
{{-- Use the line below instead of the above if you need to cache the script. --}}
|
||||
{{-- <script src="{{ asset('vendor/laravel-filemanager/js/script.js') }}"></script> --}}
|
||||
<script>
|
||||
Dropzone.options.uploadForm = {
|
||||
paramName: "upload[]", // The name that will be used to transfer the file
|
||||
uploadMultiple: false,
|
||||
parallelUploads: 5,
|
||||
timeout:0,
|
||||
clickable: '#upload-button',
|
||||
dictDefaultMessage: lang['message-drop'],
|
||||
init: function() {
|
||||
var _this = this; // For the closure
|
||||
this.on('success', function(file, response) {
|
||||
if (response == 'OK') {
|
||||
loadFolders();
|
||||
} else {
|
||||
this.defaultOptions.error(file, response.join('\n'));
|
||||
}
|
||||
});
|
||||
},
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + getUrlParam('token')
|
||||
},
|
||||
acceptedFiles: "{{ implode(',', $helper->availableMimeTypes()) }}",
|
||||
maxFilesize: ({{ $helper->maxUploadSize() }} / 1000)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
40
resources/views/vendor/laravel-filemanager/move.blade.php
vendored
Normal file
40
resources/views/vendor/laravel-filemanager/move.blade.php
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
<ul class="nav nav-pills flex-column">
|
||||
@foreach($root_folders as $root_folder)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" data-type="0" onclick="moveToNewFolder(`{{$root_folder->url}}`)">
|
||||
<i class="fa fa-folder fa-fw"></i> {{ $root_folder->name }}
|
||||
<input type="hidden" id="goToFolder" name="goToFolder" value="{{ $root_folder->url }}">
|
||||
<div id="items">
|
||||
@foreach($items as $i)
|
||||
<input type="hidden" id="{{ $i }}" name="items[]" value="{{ $i }}">
|
||||
@endforeach
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@foreach($root_folder->children as $directory)
|
||||
<li class="nav-item sub-item">
|
||||
<a class="nav-link" href="#" data-type="0" onclick="moveToNewFolder(`{{$directory->url}}`)">
|
||||
<i class="fa fa-folder fa-fw"></i> {{ $directory->name }}
|
||||
<input type="hidden" id="goToFolder" name="goToFolder" value="{{ $directory->url }}">
|
||||
<div id="items">
|
||||
@foreach($items as $i)
|
||||
<input type="hidden" id="{{ $i }}" name="items[]" value="{{ $i }}">
|
||||
@endforeach
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
function moveToNewFolder($folder) {
|
||||
$("#notify").modal('hide');
|
||||
var items =[];
|
||||
$("#items").find("input").each(function() {items.push(this.id)});
|
||||
performLfmRequest('domove', {
|
||||
items: items,
|
||||
goToFolder: $folder
|
||||
}).done(refreshFoldersAndItems);
|
||||
}
|
||||
</script>
|
123
resources/views/vendor/laravel-filemanager/resize.blade.php
vendored
Normal file
123
resources/views/vendor/laravel-filemanager/resize.blade.php
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
<style>
|
||||
#work_space {
|
||||
padding: 30px;
|
||||
height: 100vw;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
#work_space {
|
||||
width: unset;
|
||||
height: unset;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 bg-light" id="work_space">
|
||||
<div id="containment" class="d-none d-md-inline">
|
||||
<img id="resize" src="{{ $img->url . '?timestamp=' . $img->time }}" height="{{ $height }}" width="{{ $width }}">
|
||||
</div>
|
||||
<div id="resize_mobile" style="background-image: url({{ $img->url . '?timestamp=' . $img->time }})" class="d-block d-md-none"></div>
|
||||
</div>
|
||||
<div class="col-md-4 pt-3">
|
||||
<table class="table table-compact table-striped">
|
||||
<thead></thead>
|
||||
<tbody>
|
||||
@if ($scaled)
|
||||
<tr>
|
||||
<td class="text-nowrap">{{ trans('laravel-filemanager::lfm.resize-ratio') }}</td>
|
||||
<td class="text-right">{{ number_format($ratio, 2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-nowrap">{{ trans('laravel-filemanager::lfm.resize-scaled') }}</td>
|
||||
<td class="text-right">
|
||||
{{ trans('laravel-filemanager::lfm.resize-true') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td class="text-nowrap">{{ trans('laravel-filemanager::lfm.resize-old-height') }}</td>
|
||||
<td class="text-right">{{ $original_height }}px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-nowrap">{{ trans('laravel-filemanager::lfm.resize-old-width') }}</td>
|
||||
<td class="text-right">{{ $original_width }}px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-nowrap" style="vertical-align: middle">{{ trans('laravel-filemanager::lfm.resize-new-height') }}</td>
|
||||
<td class="text-right"><input type="text" id="height_display" class="form-control w-50 d-inline mr-2" value="{{ $height }}">px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-nowrap" style="vertical-align: middle">{{ trans('laravel-filemanager::lfm.resize-new-width') }}</td>
|
||||
<td class="text-right"><input type="text" id="width_display" class="form-control w-50 d-inline mr-2" value="{{ $width }}">px</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="d-flex mb-3">
|
||||
<button class="btn btn-secondary w-50 mr-1" onclick="loadItems()">{{ trans('laravel-filemanager::lfm.btn-cancel') }}</button>
|
||||
<button class="btn btn-primary w-50" onclick="doResize()">{{ trans('laravel-filemanager::lfm.btn-resize') }}</button>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="img" name="img" value="{{ $img->name }}">
|
||||
<input type="hidden" name="ratio" value="{{ $ratio }}">
|
||||
<input type="hidden" name="scaled" value="{{ $scaled }}">
|
||||
<input type="hidden" id="original_height" name="original_height" value="{{ $original_height }}">
|
||||
<input type="hidden" id="original_width" name="original_width" value="{{ $original_width }}">
|
||||
<input type="hidden" id="height" name="height" value="{{ $height }}">
|
||||
<input type="hidden" id="width" name="width" value="{{ $width }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
renderResizedValues($("#width_display").val(), $("#height_display").val());
|
||||
|
||||
$("#resize").resizable({
|
||||
aspectRatio: true,
|
||||
containment: "#containment",
|
||||
handles: "n, e, s, w, se, sw, ne, nw",
|
||||
resize: function (event, ui) {
|
||||
renderResizedValues(ui.size.width, ui.size.height);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#width_display, #height_display').change(function () {
|
||||
var newWidth = $("#width_display").val();
|
||||
var newHeight = $("#height_display").val();
|
||||
|
||||
renderResizedValues(newWidth, newHeight);
|
||||
$("#containment > .ui-wrapper").width(newWidth).height(newHeight);
|
||||
$("#resize").width(newWidth).height(newHeight);
|
||||
});
|
||||
|
||||
function renderResizedValues(newWidth, newHeight) {
|
||||
$("#width").val(newWidth);
|
||||
$("#height").val(newHeight);
|
||||
$("#width_display").val(newWidth);
|
||||
$("#height_display").val(newHeight);
|
||||
|
||||
$('#resize_mobile').css('background-size', '100% 100%');
|
||||
|
||||
if (newWidth < newHeight) {
|
||||
$('#resize_mobile').css('width', (newWidth / newHeight * 100) + '%').css('padding-bottom', '100%');
|
||||
} else if (newWidth > newHeight) {
|
||||
$('#resize_mobile').css('width', '100%').css('padding-bottom', (newHeight / newWidth * 100) + '%');
|
||||
} else { // newWidth === newHeight
|
||||
$('#resize_mobile').css('width', '100%').css('padding-bottom', '100%');
|
||||
}
|
||||
}
|
||||
|
||||
function doResize() {
|
||||
performLfmRequest('doresize', {
|
||||
img: $("#img").val(),
|
||||
dataHeight: $("#height").val(),
|
||||
dataWidth: $("#width").val()
|
||||
}).done(loadItems);
|
||||
}
|
||||
</script>
|
34
resources/views/vendor/laravel-filemanager/tree.blade.php
vendored
Normal file
34
resources/views/vendor/laravel-filemanager/tree.blade.php
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
<div class="m-3 d-block d-lg-none">
|
||||
<h1 style="font-size: 1.5rem;">Laravel File Manager</h1>
|
||||
<small class="d-block">Ver 2.0</small>
|
||||
<div class="row mt-3">
|
||||
<div class="col-4">
|
||||
<img src="{{ asset('vendor/laravel-filemanager/img/152px color.png') }}" class="w-100">
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<p>Current usage :</p>
|
||||
<p>20 GB (Max : 1 TB)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="progress mt-3" style="height: .5rem;">
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated w-75 bg-main" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="nav nav-pills flex-column">
|
||||
@foreach($root_folders as $root_folder)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" data-type="0" data-path="{{ $root_folder->url }}">
|
||||
<i class="fa fa-folder fa-fw"></i> {{ $root_folder->name }}
|
||||
</a>
|
||||
</li>
|
||||
@foreach($root_folder->children as $directory)
|
||||
<li class="nav-item sub-item">
|
||||
<a class="nav-link" href="#" data-type="0" data-path="{{ $directory->url }}">
|
||||
<i class="fa fa-folder fa-fw"></i> {{ $directory->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</ul>
|
16
resources/views/vendor/laravel-filemanager/use.blade.php
vendored
Normal file
16
resources/views/vendor/laravel-filemanager/use.blade.php
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<script type='text/javascript'>
|
||||
function getUrlParam(paramName) {
|
||||
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i');
|
||||
var match = window.location.search.match(reParam);
|
||||
return ( match && match.length > 1 ) ? match[1] : null;
|
||||
}
|
||||
|
||||
var funcNum = getUrlParam('CKEditorFuncNum');
|
||||
|
||||
var par = window.parent;
|
||||
var op = window.opener;
|
||||
var o = (par && par.CKEDITOR) ? par : ((op && op.CKEDITOR) ? op : false);
|
||||
|
||||
if (op) window.close();
|
||||
if (o !== false) o.CKEDITOR.tools.callFunction(funcNum, "{{ $file }}");
|
||||
</script>
|
Reference in New Issue
Block a user