Skip to content

Commit 061a744

Browse files
committed
Merge pull request #9 from tsawler/Development
Development
2 parents 2398169 + 388be6b commit 061a744

File tree

3 files changed

+81
-79
lines changed

3 files changed

+81
-79
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,25 @@ since they do not enforce any kind of security), change this entry in config/lfm
5353
'use_package_routes' => true,
5454
```
5555

56-
1. If you don't want to use the default image directory or url, update the appropriate lines in config/lfm.php:
56+
1. If you don't want to use the default image/file directory or url, update the appropriate lines in config/lfm.php:
5757

5858
```php
59-
'images_dir' => 'public/vendor/laravel-filemanager/files/',
60-
'images_url' => '/vendor/laravel-filemanager/files/',
59+
'images_dir' => 'public/vendor/laravel-filemanager/images/',
60+
'images_url' => '/vendor/laravel-filemanager/images/',
61+
'files_dir' => 'public/vendor/laravel-filemanager/files/',
62+
'files_url' => '/vendor/laravel-filemanager/files/',
6163
```
6264

65+
1. Ensure that the files & images directories are writable by your web serber
66+
6367
1. In the view where you are using a CKEditor instance, use the file uploader by initializing the
6468
CKEditor instance as follows:
6569

6670
```javascript
6771
<script>
6872
CKEDITOR.replace( 'editor', {
69-
filebrowserBrowseUrl: '/laravel-filemanager?type=Images'
73+
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
74+
filebrowserBrowseUrl: '/laravel-filemanager?type=Files'
7075
});
7176
</script>
7277
```

public/css/lfm.css

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
html, body {
2+
height: 100%;
3+
}
4+
5+
.img-row {
6+
overflow: visible;
7+
}
8+
9+
.container {
10+
height: 100%;
11+
margin-left: 5px;
12+
margin-right: 5px;
13+
width: 99%;
14+
}
15+
16+
.fill {
17+
height: 100%;
18+
min-height: 100%;
19+
}
20+
21+
.wrapper {
22+
height: 100%;
23+
}
24+
25+
#lfm-leftcol {
26+
min-height: 80%;
27+
}
28+
29+
#right-nav {
30+
border-left: 1px solid silver;
31+
height: 90%;
32+
min-height: 90%;
33+
}
34+
35+
#content {
36+
overflow: auto;
37+
}
38+
39+
#tree1 {
40+
margin-left: 5px;
41+
}
42+
43+
.pointer {
44+
cursor: pointer;
45+
}
46+
47+
.img-preview {
48+
background-color: #f7f7f7;
49+
overflow: hidden;
50+
width: 100%;
51+
text-align: center;
52+
height: 200px;
53+
}
54+
55+
.hidden {
56+
display: none;
57+
}

src/views/index.blade.php

Lines changed: 15 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,8 @@
66
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
77
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
88
<link rel="stylesheet" href="/vendor/laravel-filemanager/css/cropper.min.css">
9+
<link rel="stylesheet" href="/vendor/laravel-filemanager/css/lfm.css">
910
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.css">
10-
<style>
11-
html, body {
12-
height: 100%;
13-
}
14-
15-
.img-row {
16-
overflow: visible;
17-
}
18-
19-
.container {
20-
height: 100%;
21-
margin-left: 5px;
22-
margin-right: 5px;
23-
width: 99%;
24-
}
25-
26-
.fill {
27-
height: 100%;
28-
min-height: 100%;
29-
}
30-
31-
.wrapper {
32-
height: 100%;
33-
}
34-
35-
#lfm-leftcol {
36-
min-height: 80%;
37-
}
38-
39-
#right-nav {
40-
border-left: 1px solid silver;
41-
height: 90%;
42-
min-height: 90%;
43-
}
44-
45-
#content {
46-
overflow: auto;
47-
}
48-
49-
#tree1 {
50-
margin-left: 5px;
51-
}
52-
53-
.pointer {
54-
cursor: pointer;
55-
}
56-
57-
.img-preview {
58-
background-color: #f7f7f7;
59-
overflow: hidden;
60-
width: 100%;
61-
text-align: center;
62-
height: 200px;
63-
}
64-
65-
.hidden {
66-
display: none;
67-
}
68-
</style>
6911
</head>
7012
<body>
7113
<div class="container">
@@ -193,12 +135,6 @@ class="fa fa-list"></i> List</a>
193135
$("#tree1").html(data);
194136
});
195137
loadImages();
196-
197-
@if (Input::has('base'))
198-
199-
@endif
200-
201-
202138
});
203139
204140
function highlight(x) {
@@ -211,19 +147,16 @@ function highlight(x) {
211147
}
212148
213149
$("#upload-btn").click(function () {
214-
$("#upload-btn").html('<i class="fa fa-refresh fa-spin"></i> Uploading...');
215-
//$("#uploadForm").submit();
216-
217150
var options = {
218-
beforeSubmit: showRequest, // pre-submit callback
219-
success: showResponse // post-submit callback
151+
beforeSubmit: showRequest,
152+
success: showResponse
220153
};
221154
222155
function showRequest(formData, jqForm, options) {
156+
$("#upload-btn").html('<i class="fa fa-refresh fa-spin"></i> Uploading...');
223157
return true;
224158
}
225159
226-
// post-submit callback
227160
function showResponse(responseText, statusText, xhr, $form) {
228161
$("#uploadModal").modal('hide');
229162
loadImages();
@@ -356,7 +289,6 @@ function notImp() {
356289
});
357290
});
358291
359-
360292
function useFile(file) {
361293
var path = $('#working_dir').val();
362294
@@ -369,11 +301,19 @@ function getUrlParam(paramName) {
369301
var funcNum = getUrlParam('CKEditorFuncNum');
370302
window.opener.CKEDITOR.tools.callFunction(funcNum, path + "/" + file);
371303
372-
if (path != '/') {
373-
window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ \Config::get('lfm.images_url') }}' + path + "/" + file);
304+
@if ((Session::has('lfm_type')) && (Session::get('lfm_type') == "Images"))
305+
if (path != '/') {
306+
window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ \Config::get('lfm.images_url') }}' + path + "/" + file);
307+
} else {
308+
window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ \Config::get('lfm.images_url') }}' + file);
309+
}
310+
@else
311+
if (path != '/') {
312+
window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ \Config::get('lfm.files_url') }}' + path + "/" + file);
374313
} else {
375-
window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ \Config::get('lfm.images_url') }}' + file);
314+
window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ \Config::get('lfm.files_url') }}' + file);
376315
}
316+
@endif
377317
window.close();
378318
}
379319

0 commit comments

Comments
 (0)