var version="9.3.3"; var active_contextmenu=true; if(loading_bar){ if(!(/MSIE (\d+\.\d+);/.test(navigator.userAgent))){ window.addEventListener('DOMContentLoaded', function() { $("body").queryLoader2({ 'backgroundColor':'none','minimumTime':100,'percentage':true}); }); }else{ $(document).ready(function () { $("body").queryLoader2({ 'backgroundColor':'none','minimumTime':100,'percentage':true}); }); } } $(document).ready(function(){ if (active_contextmenu) { $.contextMenu({ selector:'figure:not(.back-directory), .list-view2 figure:not(.back-directory)', autoHide:true, build: function($trigger) { $trigger.addClass('selected'); var options = { callback: function(key, options) { switch (key) { case "copy_url": var m =""; m+=$('#base_url').val()+$('#cur_dir').val(); add=$trigger.find('a.link').attr('data-file'); if (add!="" && add!=null) { m+=add; } bootbox.alert('URL:

'); break; case "unzip": var m=$('#sub_folder').val()+$('#fldr_value').val()+$trigger.find('a.link').attr('data-file'); $.ajax({ type: "POST", url: "ajax_calls.php?action=extract", data: { path: m } }).done(function( msg ) { if (msg!="") bootbox.alert(msg); else window.location.href = $('#refresh').attr('href') + '&' + new Date().getTime(); }); break; case "edit_img": var filename=$trigger.attr('data-name'); var full_path=$('#base_url_true').val()+$('#cur_dir').val()+filename; $('#aviary_img').attr('data-name',filename); $('#aviary_img').attr('src',full_path).load(launchEditor('aviary_img', full_path)); break; case "duplicate": var old_name=$trigger.find('h4').text().trim(); bootbox.prompt($('#lang_duplicate').val(),$('#cancel').val(),$('#ok').val(), function(name) { if (name !== null){ name=fix_filename(name); if (name!=old_name) { var _this=$trigger.find('.rename-file'); execute_action('duplicate_file',_this.attr('data-path'),_this.attr('data-thumb'),name,_this,'apply_file_duplicate'); } } },old_name); break; } }, items: {} }; if (($trigger.find('.img-precontainer-mini .filetype').hasClass('png') || $trigger.find('.img-precontainer-mini .filetype').hasClass('jpg') || $trigger.find('.img-precontainer-mini .filetype').hasClass('jpeg')) && image_editor ) options.items.edit_img = {name: $('#lang_edit_image').val(),icon:"edit_img", disabled:false }; options.items.copy_url = {name: $('#lang_show_url').val(),icon:"url", disabled:false }; if ($trigger.find('.img-precontainer-mini .filetype').hasClass('zip') || $trigger.find('.img-precontainer-mini .filetype').hasClass('tar') || $trigger.find('.img-precontainer-mini .filetype').hasClass('gz') ) { options.items.unzip = {name: $('#lang_extract').val(),icon:"extract", disabled:false }; } if (!$trigger.hasClass('directory') && $('#duplicate').val()==1) { options.items.duplicate = {name: $('#lang_duplicate').val(),icon:"duplicate", disabled:false }; } options.items.sep = '----'; options.items.info = {name: ""+$('#lang_file_info').val()+"", disabled:true }; options.items.name = {name: $trigger.attr('data-name'),icon:'label', disabled:true }; if ($trigger.attr('data-type')=="img") { options.items.dimension = {name: $trigger.find('.img-dimension').html(),icon:"dimension", disabled:true }; } options.items.size = {name: $trigger.find('.file-size').html(),icon:"size", disabled:true }; options.items.date = {name: $trigger.find('.file-date').html(),icon:"date", disabled:true }; return options; }, events: { hide: function(opt){ $('figure').removeClass('selected'); } } }); $(document).on('contextmenu', function(e) { if (!$(e.target).is("figure")) return false; }); } $('#full-img').on('click',function(){ $('#previewLightbox').lightbox('hide'); }); $('ul.grid').on('click','.modalAV', function(e) { _this=$(this); e.preventDefault(); $('#previewAV').removeData("modal"); $('#previewAV').modal({ backdrop: 'static', keyboard: false }); if (_this.hasClass('audio')) { $(".body-preview").css('height','80px'); }else{ $(".body-preview").css('height','345px'); } $.ajax({ url: _this.attr('data-url'), success: function(data) { $(".body-preview").html(data); } }); }); $('input[name=radio-sort]').on('click',function(){ var li=$(this).attr('data-item'); $('.filters label').removeClass("btn-inverse"); $('.filters label').find('i').removeClass('icon-white'); $('#filter-input').val(''); $('#'+li).addClass("btn-inverse"); $('#'+li).find('i').addClass('icon-white'); if(li=='ff-item-type-all'){ $('.grid li').show(300); }else{ if($(this).is(':checked')){ $('.grid li').not('.'+li).hide(300); $('.grid li.'+li).show(300); } } }); var delay = (function(){ var timer = 0; return function(callback, ms){ clearTimeout (timer); timer = setTimeout(callback, ms); }; })(); if (parseInt($('#file_number').val()) > parseInt($('#file_number_limit_js').val())) var js_script=false; else var js_script=true; $('#filter-input').on('keyup',function(){ $('.filters label').removeClass("btn-inverse"); $('.filters label').find('i').removeClass('icon-white'); $('#ff-item-type-all').addClass("btn-inverse"); $('#ff-item-type-all').find('i').addClass('icon-white'); var val=fix_filename($(this).val()); $(this).val(val); delay(function(){ if (js_script) { $('ul.grid li').each(function(){ var _this = $(this); if (val!="" && _this.attr('data-name').toString().toLowerCase().indexOf(val.toLowerCase())==-1) { _this.hide(100); }else{ _this.show(100); } }); } }, 300 ); }).keypress(function(e) { if(e.which == 13) { $('#filter').trigger('click'); } }); $('#filter').on('click',function(){ var val=fix_filename($('#filter-input').val()); window.location.href=$('#current_url').val()+"&filter="+val; }); $('#info').on('click',function(){ bootbox.alert('
responsive filemanager

RESPONSIVE filemanager v.'+version+'
responsivefilemanager.com


Copyright © Tecrail - Alberto Peripolli. All rights reserved.


License
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.

'); }); $('#uploader-btn').on('click',function(){ var path=$('#sub_folder').val()+$('#fldr_value').val()+"/"; path=path.substring(0, path.length - 1); $('#iframe-container').html($('