Skip to content

Commit 2fe75ca

Browse files
authored
Merge branch 'master' into s3_support
2 parents 06efd05 + 93c9970 commit 2fe75ca

31 files changed

+378
-133
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
Please check the following instructions before submitting a bug :
2-
* Make sure you are using the latest version.
3-
* Make sure you read [installation](http://unisharp.github.io/laravel-filemanager/installation), [integration](http://unisharp.github.io/laravel-filemanager/integration), and [upgrade](http://unisharp.github.io/laravel-filemanager/upgrade) document.
4-
5-
And provide the followings :
6-
* Operating system :
7-
* Laravel version :
8-
* Package version :
9-
* Steps to reproduce your issue :
10-
* Screenshots of browser console :
1+
## Delete this section after you read them:
2+
* Make sure you are using the latest version.
3+
* Make sure you read [installation](http://unisharp.github.io/laravel-filemanager/installation), [integration](http://unisharp.github.io/laravel-filemanager/integration), and [upgrade](http://unisharp.github.io/laravel-filemanager/upgrade) document.
4+
5+
## Expected Behavior
6+
7+
8+
## Actual Behavior
9+
10+
11+
## Steps to Reproduce the Problem
12+
13+
1.
14+
1.
15+
1.
16+
17+
## Specifications
18+
19+
* Operating system :
20+
* Laravel version :
21+
* Package version :
22+
* Screenshots of browser console :

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@ about: Create a report to help us improve
44

55
---
66

7-
Please check the following instructions before submitting a bug :
8-
* Make sure you are using the latest version.
9-
* Make sure you read [installation](http://unisharp.github.io/laravel-filemanager/installation), [integration](http://unisharp.github.io/laravel-filemanager/integration), and [upgrade](http://unisharp.github.io/laravel-filemanager/upgrade) document.
10-
11-
And provide the followings :
12-
* Operating system :
13-
* Laravel version :
14-
* Package version :
15-
* Steps to reproduce your issue :
16-
* Screenshots of browser console :
7+
## Delete this section after you read them:
8+
* Make sure you are using the latest version.
9+
* Make sure you read [installation](http://unisharp.github.io/laravel-filemanager/installation), [integration](http://unisharp.github.io/laravel-filemanager/integration), and [upgrade](http://unisharp.github.io/laravel-filemanager/upgrade) document.
10+
11+
## Expected Behavior
12+
13+
14+
## Actual Behavior
15+
16+
17+
## Steps to Reproduce the Problem
18+
19+
1.
20+
1.
21+
1.
22+
23+
## Specifications
24+
25+
* Operating system :
26+
* Laravel version :
27+
* Package version :
28+
* Screenshots of browser console :

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ about: Suggest an idea for this project
44

55
---
66

7-
**Is your feature request related to a problem? Please describe.**
7+
## Is your feature request related to a problem? Please describe.
88
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
99

10-
**Describe the solution you'd like**
10+
## Describe the solution you'd like
1111
A clear and concise description of what you want to happen.
1212

13-
**Describe alternatives you've considered**
13+
## Describe alternatives you've considered
1414
A clear and concise description of any alternative solutions or features you've considered.
1515

16-
**Additional context**
16+
## Additional context
1717
Add any other context or screenshots about the feature request here.

README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<p align="center"><img src="https://unisharp.github.io/laravel-filemanager/images/logo_vertical_colored.png"></p>
22

33
<p align="center">
4+
<a href="https://packagist.org/packages/unisharp/laravel-filemanager"><img src="https://img.shields.io/packagist/v/unisharp/laravel-filemanager" alt="Latest Stable Version"></a>
45
<a target="_blank" href="https://packagist.org/packages/unisharp/laravel-filemanager"><img src="https://poser.pugx.org/unisharp/laravel-filemanager/downloads"></a>
56
<a target="_blank" href="https://packagist.org/packages/unisharp/laravel-filemanager"><img src="https://img.shields.io/packagist/dm/unisharp/laravel-filemanager.svg"></a>
6-
<a target="_blank" href="https://packagist.org/packages/unisharp/laravel-filemanager"><img src="https://img.shields.io/badge/stable-2.4.1-blue.svg"></a>
7+
<!-- <a target="_blank" href="https://packagist.org/packages/unisharp/laravel-filemanager"><img src="https://img.shields.io/badge/stable-2.6.4-blue.svg"></a> -->
78
<a target="_blank" href="https://packagist.org/packages/unisharp/laravel-filemanager"><img src="https://poser.pugx.org/unisharp/laravel-filemanager/license"></a>
89
<br>
910
<a href="https://github.styleci.io/repos/39873788?branch=master"><img src="https://github.styleci.io/repos/39873788/shield?branch=master" alt="StyleCI"></a>
@@ -12,6 +13,8 @@
1213
<a target="_blank" href="https://codeclimate.com/github/UniSharp/laravel-filemanager/maintainability"><img src="https://api.codeclimate.com/v1/badges/e51f2ef8f4d9f97268db/maintainability" /></a>
1314
</p>
1415

16+
![RWD demo](https://unisharp.github.io/laravel-filemanager/images/screenshots-v2.png)
17+
1518
<p align="center">
1619
<a href="http://unisharp.github.io/laravel-filemanager/">Documents</a>
1720
@@ -50,17 +53,6 @@
5053
* Supports two categories: files and images. Each type works in different directory.
5154
* Supported locales : ar, az, bg, cs, de, el, en, es, eu, fa, fr, he, hu, id, it, ka, nl, pl, pt, pt-BR, ro, rs, ru, sk, sv, tr, uk, vi, zh-CN, zh-TW
5255

53-
## v2.0 backlogs
54-
55-
There are still some thing we need to do make this package better:
56-
* [x] Documents for v2.0.0
57-
* [x] Add more events for files and folders manipulation
58-
* [ ] Events should pass object instead of only file path
59-
60-
We are also going to gain more integration like vue.js and Laravel Nova. Any PR is welcome!
61-
62-
![RWD demo](https://unisharp.github.io/laravel-filemanager/images/screenshots-v2.png)
63-
6456
## Maintainers
6557

6658
* [Stream](https://github.com/streamtw)

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@
2626
"php": ">=7.2.0",
2727
"ext-exif": "*",
2828
"ext-fileinfo": "*",
29-
"intervention/image": "2.*",
30-
"illuminate/config": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0",
31-
"illuminate/filesystem": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0",
32-
"illuminate/support": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0",
33-
"illuminate/http": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0",
34-
"illuminate/container": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0"
29+
"intervention/image": ">=2.0.0",
30+
"illuminate/config": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
31+
"illuminate/filesystem": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
32+
"illuminate/support": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
33+
"illuminate/http": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
34+
"illuminate/container": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
35+
"league/flysystem": ">=2.0.0"
3536
},
3637
"require-dev": {
37-
"phpunit/phpunit": "^6.2",
38-
"mockery/mockery": "^0.9.9",
38+
"phpunit/phpunit": "~8.0",
39+
"mockery/mockery": "~1.3.0",
3940
"squizlabs/php_codesniffer": "^3.1"
4041
},
4142
"suggest": {

docs/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ theme: jekyll-theme-cayman
33
# Setup
44
title: Laravel File Manager
55
description: It's like Dropbox for your Laravel app.
6-
google_analytics: UA-92410814-4
6+
google_analytics: G-X9XY279785
77

88
# About/contact
99
author:

docs/_layouts/default.html

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
<!DOCTYPE html>
22
<html lang="en-us">
33
<head>
4+
{% if site.google_analytics %}
5+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
6+
<script>
7+
window.dataLayer = window.dataLayer || [];
8+
function gtag(){dataLayer.push(arguments);}
9+
gtag('js', new Date());
10+
11+
gtag('config', '{{ site.google_analytics }}');
12+
</script>
13+
{% endif %}
414
<meta charset="UTF-8">
515
<title>{{ page.title | default: site.title }}</title>
616
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -125,17 +135,5 @@ <h2 class="project-tagline">{{ site.description | default: site.github.project_t
125135
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
126136
</footer>
127137
</section>
128-
129-
{% if site.google_analytics %}
130-
<script type="text/javascript">
131-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
132-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
133-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
134-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
135-
136-
ga('create', '{{ site.google_analytics }}', 'auto');
137-
ga('send', 'pageview');
138-
</script>
139-
{% endif %}
140138
</body>
141139
</html>

docs/installation.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,16 @@
2525
composer require unisharp/laravel-filemanager
2626
```
2727

28-
1. (optional) Edit `config/app.php` :
28+
1. (optional) Install required dependency with `v3.*` of `intervention/image`:
2929

30-
\* *For Laravel 5.5 and up, skip to step 3. All service providers and facades are automatically discovered.*
30+
This package use `intervention/image` to perform image cropping/resizing and generating thumbnails. Since `v3.*` of `intervention/image` does not support Laravel by default, the service provider need to be installed with the following scripts. Details can be found here: https://github.com/Intervention/image-laravel
3131

32-
Add service providers
33-
34-
```php
35-
UniSharp\LaravelFilemanager\LaravelFilemanagerServiceProvider::class,
36-
Intervention\Image\ImageServiceProvider::class,
37-
```
38-
39-
And add class aliases
40-
41-
```php
42-
'Image' => Intervention\Image\Facades\Image::class,
32+
```bash
33+
composer require intervention/image-laravel
34+
php artisan vendor:publish --provider="Intervention\Image\Laravel\ServiceProvider"
4335
```
4436

45-
Code above is for Laravel 5.1.
46-
In Laravel 5.0 should leave only quoted class names.
37+
\* *Do not run these scripts if you use `v2.*` of `intervention/image`.*
4738

4839
1. Publish the package's config and assets :
4940

docs/integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ If you are going to use filemanager independently, meaning set the value of an i
197197
</span>
198198
<input id="thumbnail" class="form-control" type="text" name="filepath">
199199
</div>
200-
<img id="holder" style="margin-top:15px;max-height:100px;">
200+
<div id="holder" style="margin-top:15px;max-height:100px;"></div>
201201
```
202202
1. Import lfm.js(run `php artisan vendor:publish` if you need).
203203

public/js/script.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,11 @@ function performLfmRequest(url, parameter, type) {
284284
}
285285

286286
function displayErrorResponse(jqXHR) {
287-
notify('<div style="max-height:50vh;overflow: scroll;">' + jqXHR.responseText + '</div>');
287+
var message = JSON.parse(jqXHR.responseText)
288+
if (Array.isArray(message)) {
289+
message = message.join('<br>')
290+
}
291+
notify('<div style="max-height:50vh;overflow: auto;">' + message + '</div>');
288292
}
289293

290294
var refreshFoldersAndItems = function (data) {
@@ -540,7 +544,7 @@ function rename(item) {
540544
}
541545

542546
function trash(items) {
543-
notify(lang['message-delete'], function () {
547+
confirm(lang['message-delete'], function () {
544548
performLfmRequest('delete', {
545549
items: items.map(function (item) { return item.name; })
546550
}).done(refreshFoldersAndItems)
@@ -597,7 +601,7 @@ function preview(items) {
597601
}
598602

599603
carouselItem.find('.carousel-label').attr('target', '_blank').attr('href', item.url)
600-
.append(item.name)
604+
.text(item.name)
601605
.append($('<i class="fas fa-external-link-alt ml-2"></i>'));
602606

603607
carousel.children('.carousel-inner').append(carouselItem);
@@ -794,12 +798,16 @@ function notImp() {
794798
notify('Not yet implemented!');
795799
}
796800

797-
function notify(body, callback) {
798-
$('#notify').find('.btn-primary').toggle(callback !== undefined);
799-
$('#notify').find('.btn-primary').unbind().click(callback);
801+
function notify(body) {
800802
$('#notify').modal('show').find('.modal-body').html(body);
801803
}
802804

805+
function confirm(body, callback) {
806+
$('#confirm').find('.btn-primary').toggle(callback !== undefined);
807+
$('#confirm').find('.btn-primary').click(callback);
808+
$('#confirm').modal('show').find('.modal-body').html(body);
809+
}
810+
803811
function dialog(title, value, callback) {
804812
$('#dialog').find('input').val(value);
805813
$('#dialog').on('shown.bs.modal', function () {

0 commit comments

Comments
 (0)