/**
* Theme: Ubold Admin Template
* Author: Coderthemes
* Email: coderthemes@gmail.com
* File Uploads
*/
$(document).ready(function(){
'use-strict';
//Example 2
$('#filer_input2').filer({
limit: 3,
maxSize: 3,
extensions: ['jpg', 'jpeg', 'png', 'gif', 'psd'],
changeInput: true,
showThumbs: true,
addMore: true
});
//Example 1
$("#filer_input1").filer({
limit: null,
maxSize: null,
extensions: null,
changeInput: '
',
showThumbs: true,
theme: "dragdropbox",
templates: {
box: '',
item: '\
\
\
\
\
\
{{fi-name | limitTo: 25}}\
{{fi-size2}}\
\
{{fi-image}}\
\
\
\
\
',
itemAppend: '\
\
\
\
\
\
{{fi-name | limitTo: 25}}\
{{fi-size2}}\
\
{{fi-image}}\
\
\
\
\
',
progressBar: '',
itemAppendToEnd: false,
removeConfirmation: true,
_selectors: {
list: '.jFiler-items-list',
item: '.jFiler-item',
progressBar: '.bar',
remove: '.jFiler-item-trash-action'
}
},
dragDrop: {
dragEnter: null,
dragLeave: null,
drop: null,
},
uploadFile: {
url: "../plugins/jquery.filer/php/upload.php",
data: null,
type: 'POST',
enctype: 'multipart/form-data',
beforeSend: function(){},
success: function(data, el){
var parent = el.find(".jFiler-jProgressBar").parent();
el.find(".jFiler-jProgressBar").fadeOut("slow", function(){
$(" Success
").hide().appendTo(parent).fadeIn("slow");
});
},
error: function(el){
var parent = el.find(".jFiler-jProgressBar").parent();
el.find(".jFiler-jProgressBar").fadeOut("slow", function(){
$(" Error
").hide().appendTo(parent).fadeIn("slow");
});
},
statusCode: null,
onProgress: null,
onComplete: null
},
files: [
{
name: "1.jpg",
size: 145,
type: "image/jpg",
file: "assets/images/small/img1.jpg"
},
{
name: "2.jpg",
size: 145,
type: "image/jpg",
file: "assets/images/small/img2.jpg"
}
],
addMore: false,
clipBoardPaste: true,
excludeName: null,
beforeRender: null,
afterRender: null,
beforeShow: null,
beforeSelect: null,
onSelect: null,
afterShow: null,
onRemove: function(itemEl, file, id, listEl, boxEl, newInputEl, inputEl){
var file = file.name;
$.post('../plugins/jquery.filer/php/remove_file.php', {file: file});
},
onEmpty: null,
options: null,
captions: {
button: "Choose Files",
feedback: "Choose files To Upload",
feedback2: "files were chosen",
drop: "Drop file here to Upload",
removeConfirmation: "Are you sure you want to remove this file?",
errors: {
filesLimit: "Only {{fi-limit}} files are allowed to be uploaded.",
filesType: "Only Images are allowed to be uploaded.",
filesSize: "{{fi-name}} is too large! Please upload file up to {{fi-maxSize}} MB.",
filesSizeAll: "Files you've choosed are too large! Please upload files up to {{fi-maxSize}} MB."
}
}
});
});