Laravel version update
Laravel version update
This commit is contained in:
@@ -1,33 +1,24 @@
|
||||
(function( $ ){
|
||||
|
||||
$.fn.filemanager = function(type = 'image') {
|
||||
$.fn.filemanager = function(type, options) {
|
||||
type = type || 'file';
|
||||
|
||||
if (type === 'image' || type === 'images') {
|
||||
type = 'Images';
|
||||
} else {
|
||||
type = 'Files';
|
||||
}
|
||||
this.on('click', function(e) {
|
||||
var route_prefix = (options && options.prefix) ? options.prefix : '/laravel-filemanager';
|
||||
localStorage.setItem('target_input', $(this).data('input'));
|
||||
localStorage.setItem('target_preview', $(this).data('preview'));
|
||||
window.open(route_prefix + '?type=' + type, 'FileManager', 'width=900,height=600');
|
||||
window.SetUrl = function (url, file_path) {
|
||||
//set the value of the desired input to image url
|
||||
var target_input = $('#' + localStorage.getItem('target_input'));
|
||||
target_input.val(file_path).trigger('change');
|
||||
|
||||
let input_id = this.data('input');
|
||||
let preview_id = this.data('preview');
|
||||
|
||||
this.on('click', function(e) {
|
||||
localStorage.setItem('target_input', input_id);
|
||||
localStorage.setItem('target_preview', preview_id);
|
||||
window.open('/laravel-filemanager?type=' + type, 'FileManager', 'width=900,height=600');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
//set or change the preview image src
|
||||
var target_preview = $('#' + localStorage.getItem('target_preview'));
|
||||
target_preview.attr('src', url).trigger('change');
|
||||
};
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
function SetUrl(url){
|
||||
//set the value of the desired input to image url
|
||||
let target_input = $('#' + localStorage.getItem('target_input'));
|
||||
target_input.val(url);
|
||||
|
||||
//set or change the preview image src
|
||||
let target_preview = $('#' + localStorage.getItem('target_preview'));
|
||||
target_preview.attr('src',url);
|
||||
}
|
||||
|
Reference in New Issue
Block a user