Skip to content

Commit 944f283

Browse files
committed
cleanup javascript
1 parent be6d90e commit 944f283

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/views/index.blade.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,6 @@ class="fa fa-list"></i> List</a>
135135
$("#tree1").html(data);
136136
});
137137
loadImages();
138-
139-
@if (Input::has('base'))
140-
141-
@endif
142-
143-
144138
});
145139
146140
function highlight(x) {
@@ -153,19 +147,16 @@ function highlight(x) {
153147
}
154148
155149
$("#upload-btn").click(function () {
156-
$("#upload-btn").html('<i class="fa fa-refresh fa-spin"></i> Uploading...');
157-
//$("#uploadForm").submit();
158-
159150
var options = {
160-
beforeSubmit: showRequest, // pre-submit callback
161-
success: showResponse // post-submit callback
151+
beforeSubmit: showRequest,
152+
success: showResponse
162153
};
163154
164155
function showRequest(formData, jqForm, options) {
156+
$("#upload-btn").html('<i class="fa fa-refresh fa-spin"></i> Uploading...');
165157
return true;
166158
}
167159
168-
// post-submit callback
169160
function showResponse(responseText, statusText, xhr, $form) {
170161
$("#uploadModal").modal('hide');
171162
loadImages();
@@ -298,7 +289,6 @@ function notImp() {
298289
});
299290
});
300291
301-
302292
function useFile(file) {
303293
var path = $('#working_dir').val();
304294
@@ -311,11 +301,19 @@ function getUrlParam(paramName) {
311301
var funcNum = getUrlParam('CKEditorFuncNum');
312302
window.opener.CKEDITOR.tools.callFunction(funcNum, path + "/" + file);
313303
314-
if (path != '/') {
315-
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);
316313
} else {
317-
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);
318315
}
316+
@endif
319317
window.close();
320318
}
321319

0 commit comments

Comments
 (0)