Initial commit

This commit is contained in:
2020-10-07 10:37:15 +02:00
commit ce5f440392
28157 changed files with 4429172 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
!function(e){"use strict";var t=function(t,n){this.options=n;this.$element=e(t).delegate('[data-dismiss="lightbox"]',"click.dismiss.lightbox",e.proxy(this.hide,this));this.options.remote&&this.$element.find(".lightbox-body").load(this.options.remote)};t.prototype=e.extend({},e.fn.modal.Constructor.prototype);t.prototype.constructor=t;t.prototype.enforceFocus=function(){var t=this;e(document).on("focusin.lightbox",function(e){if(t.$element[0]!==e.target&&!t.$element.has(e.target).length){t.$element.focus()}})};t.prototype.show=function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=true;this.escape();this.preloadSize(function(){t.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");if(!t.$element.parent().length){t.$element.appendTo(document.body)}hide_animation();t.$element.show();if(n){t.$element[0].offsetWidth}t.$element.addClass("in").attr("aria-hidden",false);t.enforceFocus();n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})})};t.prototype.hide=function(t){t&&t.preventDefault();var n=this;t=e.Event("hide");this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=false;this.escape();e(document).off("focusin.lightbox");this.$element.removeClass("in").attr("aria-hidden",true);e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()};t.prototype.escape=function(){var e=this;if(this.isShown&&this.options.keyboard){this.$element.on("keyup.dismiss.lightbox",function(t){t.which==27&&e.hide()})}else if(!this.isShown){this.$element.off("keyup.dismiss.lightbox")}};t.prototype.preloadSize=function(t){var n=e.Callbacks();if(t)n.add(t);var r=this;var i,s,o,u,a,f,l,c,h,p;i=e(window).height();s=e(window).width();o=parseInt(r.$element.find(".lightbox-content").css("padding-top"),10);u=parseInt(r.$element.find(".lightbox-content").css("padding-bottom"),10);a=parseInt(r.$element.find(".lightbox-content").css("padding-left"),10);f=parseInt(r.$element.find(".lightbox-content").css("padding-right"),10);l=r.$element.find(".lightbox-content").find("img:first");c=new Image;c.onload=function(){if(c.width+a+f>=s){h=c.width;p=c.height;c.width=s-a-f;c.height=p/h*c.width}if(c.height+o+u>=i){h=c.width;p=c.height;c.height=i-o-u;c.width=h/p*c.height}r.$element.css({position:"fixed",width:c.width+a+f,height:c.height+o+u,top:i/2-(c.height+o+u)/2,left:"50%","margin-left":-1*(c.width+a+f)/2});r.$element.find(".lightbox-content").css({width:c.width,height:c.height});n.fire()};c.src=l.attr("src")};var n=e.fn.lightbox;e.fn.lightbox=function(n){return this.each(function(){var r=e(this);var i=r.data("lightbox");var s=e.extend({},e.fn.lightbox.defaults,r.data(),typeof n=="object"&&n);if(!i)r.data("lightbox",i=new t(this,s));if(typeof n=="string")i[n]();else if(s.show)i.show()})};e.fn.lightbox.defaults={backdrop:true,keyboard:true,show:true};e.fn.lightbox.Constructor=t;e.fn.lightbox.noConflict=function(){e.fn.lightbox=n;return this};e(document).on("click.lightbox.data-api",'[data-toggle="lightbox"]',function(t){var n=e(this);var r=n.attr("href");var i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,""));var s=i.data("lightbox")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault();i.lightbox(s).one("hide",function(){n.focus()})})}(window.jQuery)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,824 @@
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:<br/><br/><input type="text" style="height:30px; width:100%;" value="'+m+'" />');
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: "<strong>"+$('#lang_file_info').val()+"</strong>", 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('<center><img src="img/logo.png" alt="responsive filemanager"/><br/><br/><p><strong>RESPONSIVE filemanager v.'+version+'</strong><br/><a href="http://www.responsivefilemanager.com">responsivefilemanager.com</a></p><br/><p>Copyright © <a href="http://www.tecrail.com" alt="tecrail">Tecrail</a> - Alberto Peripolli. All rights reserved.</p><br/><p>License<br/><small><img alt="Creative Commons License" style="border-width:0" src="http://responsivefilemanager.com/license.php" /><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">Creative Commons Attribution-NonCommercial 3.0 Unported License</a>.</small></p></center>');
});
$('#uploader-btn').on('click',function(){
var path=$('#sub_folder').val()+$('#fldr_value').val()+"/";
path=path.substring(0, path.length - 1);
$('#iframe-container').html($('<iframe />', {
name: 'JUpload',
id: 'uploader_frame',
src: "uploader/index.php?path="+path,
frameborder: 0,
width: "100%",
height: 360
}));
});
$('.upload-btn').on('click',function(){
$('.uploader').show(500);
});
var sortDescending=$('#descending').val()=== 'true';
$('.sorter').on('click',function(){
_this=$(this);
sortDescending=!sortDescending;
if (js_script) {
$.ajax({
url: "ajax_calls.php?action=sort&sort_by="+_this.attr('data-sort')+"&descending="+sortDescending
}).done(function( msg ) {
});
sortUnorderedList('ul.grid',sortDescending,"."+_this.attr('data-sort'));
$(' a.sorter').removeClass('descending').removeClass('ascending');
if (sortDescending)
$('.sort-'+_this.attr('data-sort')).addClass("descending");
else
$('.sort-'+_this.attr('data-sort')).addClass("ascending");
}else{
window.location.href=$('#current_url').val()+"&sort_by="+_this.attr('data-sort')+"&descending="+sortDescending;
}
});
$('.close-uploader').on('click',function(){
$('.uploader').hide(500);
window.location.href = $('#refresh').attr('href') + '&' + new Date().getTime();
});
$('ul.grid').on('click','.preview',function(){
var _this = $(this);
$('#full-img').attr('src',decodeURIComponent(_this.attr('data-url')));
if(_this.hasClass('disabled')==false){
show_animation();
}
return true;
});
$('body').on('keypress',function(e){
var c = String.fromCharCode(e.which);
if (c=="'" || c=='"' || c=="\\" || c=='/') {
return false;
}
});
$('ul.grid').on('click','.rename-file',function(){
var _this = $(this);
var file_container=_this.parent().parent().parent();
var file_title=file_container.find('h4');
var old_name=$.trim(file_title.text());
bootbox.prompt($('#rename').val(),$('#cancel').val(),$('#ok').val(), function(name) {
if (name !== null){
name=fix_filename(name);
if (name!=old_name) {
execute_action('rename_file',_this.attr('data-path'),_this.attr('data-thumb'),name,file_container,'apply_file_rename');
}
}
},old_name);
});
$('ul.grid').on('click','.rename-folder',function(){
var _this = $(this);
var file_container=_this.parent().parent().parent();
var file_title=file_container.find('h4');
var old_name=$.trim(file_title.text());
bootbox.prompt($('#rename').val(),$('#cancel').val(),$('#ok').val(), function(name) {
if (name !== null){
name=fix_filename(name).replace('.','');
if (name!=old_name) {
execute_action('rename_folder',_this.attr('data-path'),_this.attr('data-thumb'),name,file_container,'apply_folder_rename');
}
}
},old_name);
});
$('ul.grid').on('click','.delete-file',function(){
var _this = $(this);
bootbox.confirm(_this.attr('data-confirm'),$('#cancel').val(),$('#ok').val(), function(result) {
if (result==true) {
execute_action('delete_file',_this.attr('data-path'),_this.attr('data-thumb'),'','','');
_this.parent().parent().parent().parent().remove();
}
});
});
$('ul.grid').on('click','.delete-folder',function(){
var _this = $(this);
bootbox.confirm(_this.attr('data-confirm'),$('#cancel').val(),$('#ok').val(), function(result) {
if (result==true) {
execute_action('delete_folder',_this.attr('data-path'),_this.attr('data-thumb'),'','','');
_this.parent().parent().parent().remove();
}
});
});
$('.new-folder').on('click',function(){
bootbox.prompt($('#insert_folder_name').val(),$('#cancel').val(),$('#ok').val(), function(name) {
if (name !== null) {
name=fix_filename(name).replace('.','');
var folder_path=$('#sub_folder').val()+$('#fldr_value').val()+ name;
var folder_path_thumb=$('#cur_dir_thumb').val()+ name;
$.ajax({
type: "POST",
url: "execute.php?action=create_folder",
data: {path: folder_path, path_thumb: folder_path_thumb}
}).done(function( msg ) {
setTimeout(function(){window.location.href = $('#refresh').attr('href') + '&' + new Date().getTime();},300);
});
}
},$('#new_folder').val());
});
$('.view-controller button').on('click',function(){
var _this = $(this);
$('.view-controller button').removeClass('btn-inverse');
$('.view-controller i').removeClass('icon-white');
_this.addClass('btn-inverse');
_this.find('i').addClass('icon-white');
$.ajax({
url: "ajax_calls.php?action=view&type="+_this.attr('data-value')
}).done(function( msg ) {
if (msg!="") {
bootbox.alert(msg);
}
});
if (typeof $('ul.grid')[0] !== "undefined" && $('ul.grid')[0])
$('ul.grid')[0].className = $('ul.grid')[0].className.replace(/\blist-view.*?\b/g, '');
if (typeof $('.sorter-container')[0] !== "undefined" && $('.sorter-container')[0])
$('.sorter-container')[0].className = $('.sorter-container')[0].className.replace(/\blist-view.*?\b/g, '');
var value=_this.attr('data-value');
$('#view').val(value);
$('ul.grid').addClass('list-view'+value);
$('.sorter-container').addClass('list-view'+value);
if (_this.attr('data-value')>=1){
fix_colums(14);
}
else{
$('ul.grid li').css( "width",126);
$('ul.grid figure').css( "width",122);
}
});
if (!Modernizr.touch) {
$('.tip').tooltip({placement: "bottom"});
$('.tip-left').tooltip({placement: "left"});
$('.tip-right').tooltip({placement: "right"});
$('body').addClass('no-touch');
}else{
$('#help').show();
//Enable swiping...
$(".box:not(.no-effect)").swipe( {
//Generic swipe handler for all directions
swipeLeft:swipe_reaction,
swipeRight:swipe_reaction,
//Default is 75px, set to 0 for demo so any distance triggers swipe
threshold:30
});
}
if(!Modernizr.csstransforms) { // Test if CSS transform are supported
$('figure').bind('mouseover',function(){
if ($('#view').val()==0) {
$(this).find('.box:not(.no-effect)').animate({top: "-30px"} ,{queue:false,duration:300});
}
});
$('figure').mouseout(function(){
if ($('#view').val()==0) {
$(this).find('.box:not(.no-effect)').animate({top: "0px"} ,{queue:false,duration:300});
}
});
}
$(window).resize(function(){fix_colums(28); });
fix_colums(14);
$('ul.grid').on('click','.link',function(){
var _this = $(this);
window[_this.attr('data-function')](_this.attr('data-file'),_this.attr('data-field_id'));
});
});
function fix_colums(adding) {
var width=$('.breadcrumb').width()+adding;
$('.uploader').css('width',width);
if($('#view').val()>0){
if ($('#view').val()==1) {
$('ul.grid li, ul.grid figure').css( "width", '100%');
}else{
var col=Math.floor(width/380);
if (col==0){
col=1;
$('h4').css('font-size',12);
}
width=Math.floor((width/col)-3);
$('ul.grid li, ul.grid figure').css( "width", width);
}
$('#help').hide();
}else{if(Modernizr.touch) {
$('#help').show();
}}
}
function swipe_reaction(event, direction, distance, duration, fingerCount) {
var _this = $(this);
if ($('#view').val()==0) {
if (_this.attr('toggle')==1) {
_this.attr('toggle',0);
_this.animate({top: "0px"} ,{queue:false,duration:300});
}else{
_this.attr('toggle',1);
_this.animate({top: "-30px"} ,{queue:false,duration:300});
}
}
}
function apply(file,external){
if ($('#popup').val()==1) var window_parent=window.opener; else var window_parent=window.parent;
var path = $('#cur_dir').val();
//path = path.replace('\\', '/');
var base_url = $('#base_url').val();
var alt_name=file.substr(0, file.lastIndexOf('.'));
var ext=file.split('.').pop();
ext=ext.toLowerCase();
var fill='';
var ext_audio=new Array('ogg','mp3','wav');
var ext_video=new Array('mp4','ogg','webm');
if($.inArray(ext, ext_img) > -1){
fill='<img src="'+base_url+path+file+'" alt="'+alt_name+'" />';
}else{
if($.inArray(ext, ext_video) > -1){
fill='<video controls source src="'+base_url+path+file+'" type="video/'+ext+'">'+alt_name+'</video>';
}else{
if($.inArray(ext, ext_audio) > -1 ){
if (ext=='mp3') { ext='mpeg'; }
fill='<audio controls src="'+base_url+path+file+'" type="audio/'+ext+'">'+alt_name+'</audio>';
}else{
fill='<a href="'+base_url+path+file+'" title="'+alt_name+'">'+alt_name+'</a>';
}
}
}
parent.tinymce.activeEditor.insertContent(fill);
parent.tinymce.activeEditor.windowManager.close();
}
function apply_link(file,external){
if ($('#popup').val()==1) var window_parent=window.opener; else var window_parent=window.parent;
var path = $('#cur_dir').val();
path = path.replace('\\', '/');
var base_url = $('#base_url').val();
if (external!=""){
var target = $('#'+external,window_parent.document);
$(target).val(base_url+path+file);
$(target).trigger( "change" );
close_window();
}
else
apply_any(base_url+path, file);
}
function apply_img(file,external){
if ($('#popup').val()==1) var window_parent=window.opener; else var window_parent=window.parent;
var path = $('#cur_dir').val();
path = path.replace('\\', '/');
var base_url = $('#base_url').val();
if (external!=""){
var target = $('#'+external, window_parent.document);
$(target).val(base_url+path+file);
$(target).trigger( "change" );
close_window();
}
else
apply_any(base_url+path, file);
}
function apply_video(file,external){
if ($('#popup').val()==1) var window_parent=window.opener; else var window_parent=window.parent;
var path = $('#cur_dir').val();
path = path.replace('\\', '/');
var base_url = $('#base_url').val();
if (external!=""){
var target = $('#'+external,window_parent.document);
$(target).val(base_url+path+file);
$(target).trigger( "change" );
close_window();
}
else
apply_any(path, file);
}
function apply_none(file,external){
var _this=$('li[data-name="'+file+'"]').find('.preview');
if (_this.html()!="" && _this.html()!==undefined) {
$('#full-img').attr('src',decodeURIComponent(_this.attr('data-url')));
if(_this.hasClass('disabled')==false){
show_animation();
$('#previewLightbox').lightbox();
}
}else{
var _this=$('li[data-name="'+file+'"]').find('.modalAV');
$('#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: decodeURIComponent(_this.attr('data-url')),
success: function(data) {
$(".body-preview").html(data);
}
});
}
return;
}
function apply_any(path, file) {
path = path.replace('\\', '/');
parent.tinymce.activeEditor.windowManager.getParams().setUrl(path+file);
parent.tinymce.activeEditor.windowManager.close();
return false;
}
function close_window() {
if ($('#popup').val()==1) window.close();
else{
if ( typeof parent.jQuery !== "undefined" && parent.jQuery) {
parent.jQuery.fancybox.close();
}else{
parent.$.fancybox.close();
}
}
}
function apply_file_duplicate(container,name){
var li_container=container.parent().parent().parent().parent();
li_container.after("<li class='"+li_container.attr('class')+"' data-name='"+li_container.attr('data-name')+"'>"+li_container.html()+"</li>");
var cont=li_container.next();
apply_file_rename(cont.find('figure'),name);
var form=cont.find('.download-form');
var new_form_id='form'+new Date().getTime();
form.attr('id',new_form_id);
form.find('.tip-right').attr('onclick',"$('#"+new_form_id+"').submit();");
}
function apply_file_rename(container,name) {
container.attr('data-name',name);
container.parent().attr('data-name',name);
container.find('h4').find('a').text(name);
//select link
var link=container.find('a.link');
var file=link.attr('data-file');
var old_name=file.substring(file.lastIndexOf('/') + 1);
var extension=file.substring(file.lastIndexOf('.') + 1);
link.each(function(){
$(this).attr('data-file',encodeURIComponent(name+"."+extension));
});
//thumbnails
container.find('img').each(function(){
var src =$(this).attr('src');
$(this).attr('src',src.replace(old_name,name+"."+extension));
$(this).attr('alt',name+" thumbnails");
});
//preview link
var link2=container.find('a.preview');
var file= link2.attr('data-url');
if (typeof file !=="undefined" && file) {
link2.attr('data-url',file.replace(encodeURIComponent(old_name),encodeURIComponent(name+"."+extension)));
}
//li data-name
container.parent().attr('data-name',name+"."+extension);
container.attr('data-name',name+"."+extension);
//download link
container.find('.name_download').val(name+"."+extension);
//rename link && delete link
var link3=container.find('a.rename-file');
var link4=container.find('a.delete-file');
var path_old=link3.attr('data-path');
var path_thumb=link3.attr('data-thumb');
var new_path=path_old.replace(old_name,name+"."+extension);
var new_thumb=path_thumb.replace(old_name,name+"."+extension);
link3.attr('data-path',new_path);
link3.attr('data-thumb',new_thumb);
link4.attr('data-path',new_path);
link4.attr('data-thumb',new_thumb);
}
function apply_folder_rename(container,name) {
container.attr('data-name',name);
container.find('figure').attr('data-name',name);
var old_name=container.find('h4').find('a').text();
container.find('h4 > a').text(name);
//select link
var link=container.find('.folder-link');
var url=link.attr('href');
var fldr=$('#fldr_value').val();
var new_url=url.replace('fldr='+fldr+encodeURIComponent(old_name),'fldr='+fldr+encodeURIComponent(name));
link.each(function(){
$(this).attr('href',new_url);
});
//rename link && delete link
var link2=container.find('a.delete-folder');
var link3=container.find('a.rename-folder');
var path_old=link3.attr('data-path');
var thumb_old=link3.attr('data-thumb');
var index = path_old.lastIndexOf('/');
var new_path = path_old.substr(0, index + 1)+name;
link2.attr('data-path',new_path);
link3.attr('data-path',new_path);
var index = thumb_old.lastIndexOf('/');
var new_path = thumb_old.substr(0, index + 1)+name;
link2.attr('data-thumb',new_path);
link3.attr('data-thumb',new_path);
}
function replace_last(str,find,replace) {
var re= new RegExp(find+"$");
return str.replace(re, replace);
}
function replaceDiacritics(s)
{
var s;
var diacritics =[
/[\300-\306]/g, /[\340-\346]/g, // A, a
/[\310-\313]/g, /[\350-\353]/g, // E, e
/[\314-\317]/g, /[\354-\357]/g, // I, i
/[\322-\330]/g, /[\362-\370]/g, // O, o
/[\331-\334]/g, /[\371-\374]/g, // U, u
/[\321]/g, /[\361]/g, // N, n
/[\307]/g, /[\347]/g, // C, c
];
var chars = ['A','a','E','e','I','i','O','o','U','u','N','n','C','c'];
for (var i = 0; i < diacritics.length; i++)
{
s = s.replace(diacritics[i],chars[i]);
}
return s;
}
function fix_filename(stri) {
if (stri!=null) {
if ($('#transliteration').val()=="true") {
stri=replaceDiacritics(stri);
stri=stri.replace(/[^A-Za-z0-9\.\-\[\]\ \_]+/g, '');
}
stri=stri.replace('"','');
stri=stri.replace("'",'');
stri=stri.replace("/",'');
stri=stri.replace("\\",'');
stri=stri.replace(/<\/?[^>]+(>|$)/g, "");
return $.trim(stri);
}
return null;
}
function execute_action(action,file1,file2,name,container,function_name){
if (name!==null) {
name=fix_filename(name);
$.ajax({
type: "POST",
url: "execute.php?action="+action,
data: {path: file1, path_thumb: file2, name: name.replace('/','')}
}).done(function( msg ) {
if (msg!="") {
bootbox.alert(msg);
return false;
}else{
if (function_name!="") {
window[function_name](container,name);
}
}
return true;
});
}
}
function sortUnorderedList(ul, sortDescending,sort_field) {
if(typeof ul == "string")
ul = $(ul);
var lis_dir = ul.find("li.dir");
var lis_file = ul.find("li.file");
var vals_dir = [];
var values_dir = [];
var vals_file = [];
var values_file = [];
$.each(lis_dir,function(index){
var _this=$(this);
var value=_this.find(sort_field).val();
if ($.isNumeric(value)) {
value=parseFloat(value);
while (typeof vals_dir[value] !== "undefined" && vals_dir[value] ) {
value=parseFloat(parseFloat(value)+parseFloat(0.001));
}
}else{
value=value+"a"+_this.find('h4 a').attr('data-file');
}
vals_dir[value]=_this.html();
values_dir.push(value);
});
$.each(lis_file,function(index){
var _this=$(this);
var value=_this.find(sort_field).val();
if ($.isNumeric(value)) {
value=parseFloat(value);
while (typeof vals_file[value] !== "undefined" && vals_file[value] ) {
value=parseFloat(parseFloat(value)+parseFloat(0.001));
}
}else{
value=value+"a"+_this.find('h4 a').attr('data-file');
}
vals_file[value]=_this.html();
values_file.push(value);
});
if ($.isNumeric(values_dir[0])) {
values_dir.sort(function(a,b){return parseFloat(a)-parseFloat(b);});
}else{
values_dir.sort();
}
if ($.isNumeric(values_file[0])) {
values_file.sort(function(a,b){return parseFloat(a)-parseFloat(b); });
}else{
values_file.sort();
}
if(sortDescending){
values_dir.reverse();
values_file.reverse();
}
$.each(lis_dir,function(index){
var _this=$(this);
_this.html(vals_dir[values_dir[index]]);
});
$.each(lis_file,function(index){
var _this=$(this);
_this.html(vals_file[values_file[index]]);
});
}
function show_animation()
{
$('#loading_container').css('display', 'block');
$('#loading').css('opacity', '.7');
}
function hide_animation()
{
$('#loading_container').fadeOut();
}
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src,
});
return false;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2019 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2019 PrestaShop SA and Contributors
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(function(e){e.queryLoader2=function(t,n){var r=this;r.$el=e(t);r.el=t;r.$el.data("queryLoader2",r);r.qLimageContainer="";r.qLoverlay="";r.qLbar="";r.qLpercentage="";r.qLimages=[];r.qLbgimages=[];r.qLimageCounter=0;r.qLdone=0;r.qLdestroyed=false;r.init=function(){r.options=e.extend({},e.queryLoader2.defaultOptions,n);r.findImageInElement(r.el);if(r.options.deepSearch==true){r.$el.find("*:not(script)").each(function(){r.findImageInElement(this)})}r.createPreloadContainer();r.createOverlayLoader()};r.createPreloadContainer=function(){r.qLimageContainer=e("<div></div>").appendTo("body").css({display:"none",width:0,height:0,overflow:"hidden"});for(var t=0;r.qLbgimages.length>t;t++){e.ajax({url:r.qLbgimages[t],type:"HEAD",complete:function(e){if(!r.qLdestroyed){r.addImageForPreload(this["url"])}}})}};r.addImageForPreload=function(t){var n=e("<img />").attr("src",t);r.bindLoadEvent(n);n.appendTo(r.qLimageContainer)};r.createOverlayLoader=function(){var t="absolute";if(r.$el.prop("tagName")=="BODY"){t="fixed"}else{r.$el.css("position","relative")}r.qLoverlay=e("<div id='"+r.options.overlayId+"'></div>").css({width:"100%",height:"100%",backgroundColor:r.options.backgroundColor,backgroundPosition:"fixed",position:t,zIndex:666999,top:0,left:0}).appendTo(r.$el);r.qLbar=e("<div id='qLbar'></div>").css({height:"35px",marginTop:"0px",width:"0%",position:"absolute"}).appendTo(r.qLoverlay);if(r.options.percentage==true){r.qLpercentage=e("<div id='qLpercentage'></div>").text("0%").css({position:"absolute",bottom:"10px",right:"10px",textAlign:"center"}).appendTo(r.qLoverlay)}if(!r.qLimages.length){r.destroyContainers()}};r.destroyContainers=function(){r.qLdestroyed=true;r.qLimageContainer.remove();r.qLoverlay.remove()};r.findImageInElement=function(t){var n="";var i=e(t);var s="normal";if(i.css("background-image")!="none"){n=i.css("background-image");s="background"}else if(typeof i.attr("src")!="undefined"&&t.nodeName.toLowerCase()=="img"){n=i.attr("src")}if(n.indexOf("gradient")==-1){n=n.replace(/url\(\"/g,"");n=n.replace(/url\(/g,"");n=n.replace(/\"\)/g,"");n=n.replace(/\)/g,"");var o=n.split(", ");for(var u=0;u<o.length;u++){if(o[u].length>0&&r.qLimages.indexOf(o[u])==-1&&!o[u].match(/^(data:)/i)){var a="";if(r.isIE()||r.isOpera()){a="?rand="+Math.random();r.qLbgimages.push(o[u]+a)}else{if(s=="background"){r.qLbgimages.push(o[u])}else{r.bindLoadEvent(i)}}r.qLimages.push(o[u])}}}};r.isIE=function(){return navigator.userAgent.match(/msie/i)};r.isOpera=function(){return navigator.userAgent.match(/Opera/i)};r.bindLoadEvent=function(e){r.qLimageCounter++;imagesLoaded(e,function(){r.completeImageLoading(this)})};r.completeImageLoading=function(e){r.qLdone++;var t=r.qLdone/r.qLimageCounter*100;r.qLbar.stop().animate({width:t+"%",minWidth:t+"%"},200);if(r.options.percentage==true){r.qLpercentage.text(Math.ceil(t)+"%")}if(r.qLdone==r.qLimageCounter){r.endLoader()}};r.endLoader=function(){r.qLdestroyed=true;r.onLoadComplete()};r.onLoadComplete=function(){if(r.options.completeAnimation=="grow"){var t=500;r.qLbar.stop().animate({width:"100%"},t,function(){e(this).animate({top:"0%",width:"100%",height:"100%"},500,function(){e("#"+r.options.overlayId).fadeOut(500,function(){e(this).remove();r.destroyContainers();r.options.onComplete()})})})}else{e("#"+r.options.overlayId).fadeOut(500,function(){e("#"+r.options.overlayId).remove();r.destroyContainers();r.options.onComplete()})}};r.init()};e.queryLoader2.defaultOptions={onComplete:function(){},backgroundColor:"#000",barColor:"#fff",overlayId:"qLoverlay",barHeight:1,percentage:false,deepSearch:true,completeAnimation:"fade",minimumTime:500};e.fn.queryLoader2=function(t){return this.each(function(){new e.queryLoader2(this,t)})}})(jQuery);if(!Array.prototype.indexOf){Array.prototype.indexOf=function(e){var t=this.length>>>0;var n=Number(arguments[1])||0;n=n<0?Math.ceil(n):Math.floor(n);if(n<0)n+=t;for(;n<t;n++){if(n in this&&this[n]===e)return n}return-1}}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,497 @@
/*!
* jQuery UI Position v1.10.0
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/position/
*/
(function( $, undefined ) {
$.ui = $.ui || {};
var cachedScrollbarWidth,
max = Math.max,
abs = Math.abs,
round = Math.round,
rhorizontal = /left|center|right/,
rvertical = /top|center|bottom/,
roffset = /[\+\-]\d+%?/,
rposition = /^\w+/,
rpercent = /%$/,
_position = $.fn.position;
function getOffsets( offsets, width, height ) {
return [
parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
];
}
function parseCss( element, property ) {
return parseInt( $.css( element, property ), 10 ) || 0;
}
function getDimensions( elem ) {
var raw = elem[0];
if ( raw.nodeType === 9 ) {
return {
width: elem.width(),
height: elem.height(),
offset: { top: 0, left: 0 }
};
}
if ( $.isWindow( raw ) ) {
return {
width: elem.width(),
height: elem.height(),
offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
};
}
if ( raw.preventDefault ) {
return {
width: 0,
height: 0,
offset: { top: raw.pageY, left: raw.pageX }
};
}
return {
width: elem.outerWidth(),
height: elem.outerHeight(),
offset: elem.offset()
};
}
$.position = {
scrollbarWidth: function() {
if ( cachedScrollbarWidth !== undefined ) {
return cachedScrollbarWidth;
}
var w1, w2,
div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
innerDiv = div.children()[0];
$( "body" ).append( div );
w1 = innerDiv.offsetWidth;
div.css( "overflow", "scroll" );
w2 = innerDiv.offsetWidth;
if ( w1 === w2 ) {
w2 = div[0].clientWidth;
}
div.remove();
return (cachedScrollbarWidth = w1 - w2);
},
getScrollInfo: function( within ) {
var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ),
overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ),
hasOverflowX = overflowX === "scroll" ||
( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
hasOverflowY = overflowY === "scroll" ||
( overflowY === "auto" && within.height < within.element[0].scrollHeight );
return {
width: hasOverflowX ? $.position.scrollbarWidth() : 0,
height: hasOverflowY ? $.position.scrollbarWidth() : 0
};
},
getWithinInfo: function( element ) {
var withinElement = $( element || window ),
isWindow = $.isWindow( withinElement[0] );
return {
element: withinElement,
isWindow: isWindow,
offset: withinElement.offset() || { left: 0, top: 0 },
scrollLeft: withinElement.scrollLeft(),
scrollTop: withinElement.scrollTop(),
width: isWindow ? withinElement.width() : withinElement.outerWidth(),
height: isWindow ? withinElement.height() : withinElement.outerHeight()
};
}
};
$.fn.position = function( options ) {
if ( !options || !options.of ) {
return _position.apply( this, arguments );
}
// make a copy, we don't want to modify arguments
options = $.extend( {}, options );
var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
target = $( options.of ),
within = $.position.getWithinInfo( options.within ),
scrollInfo = $.position.getScrollInfo( within ),
collision = ( options.collision || "flip" ).split( " " ),
offsets = {};
dimensions = getDimensions( target );
if ( target[0].preventDefault ) {
// force left top to allow flipping
options.at = "left top";
}
targetWidth = dimensions.width;
targetHeight = dimensions.height;
targetOffset = dimensions.offset;
// clone to reuse original targetOffset later
basePosition = $.extend( {}, targetOffset );
// force my and at to have valid horizontal and vertical positions
// if a value is missing or invalid, it will be converted to center
$.each( [ "my", "at" ], function() {
var pos = ( options[ this ] || "" ).split( " " ),
horizontalOffset,
verticalOffset;
if ( pos.length === 1) {
pos = rhorizontal.test( pos[ 0 ] ) ?
pos.concat( [ "center" ] ) :
rvertical.test( pos[ 0 ] ) ?
[ "center" ].concat( pos ) :
[ "center", "center" ];
}
pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
// calculate offsets
horizontalOffset = roffset.exec( pos[ 0 ] );
verticalOffset = roffset.exec( pos[ 1 ] );
offsets[ this ] = [
horizontalOffset ? horizontalOffset[ 0 ] : 0,
verticalOffset ? verticalOffset[ 0 ] : 0
];
// reduce to just the positions without the offsets
options[ this ] = [
rposition.exec( pos[ 0 ] )[ 0 ],
rposition.exec( pos[ 1 ] )[ 0 ]
];
});
// normalize collision option
if ( collision.length === 1 ) {
collision[ 1 ] = collision[ 0 ];
}
if ( options.at[ 0 ] === "right" ) {
basePosition.left += targetWidth;
} else if ( options.at[ 0 ] === "center" ) {
basePosition.left += targetWidth / 2;
}
if ( options.at[ 1 ] === "bottom" ) {
basePosition.top += targetHeight;
} else if ( options.at[ 1 ] === "center" ) {
basePosition.top += targetHeight / 2;
}
atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
basePosition.left += atOffset[ 0 ];
basePosition.top += atOffset[ 1 ];
return this.each(function() {
var collisionPosition, using,
elem = $( this ),
elemWidth = elem.outerWidth(),
elemHeight = elem.outerHeight(),
marginLeft = parseCss( this, "marginLeft" ),
marginTop = parseCss( this, "marginTop" ),
collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
position = $.extend( {}, basePosition ),
myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
if ( options.my[ 0 ] === "right" ) {
position.left -= elemWidth;
} else if ( options.my[ 0 ] === "center" ) {
position.left -= elemWidth / 2;
}
if ( options.my[ 1 ] === "bottom" ) {
position.top -= elemHeight;
} else if ( options.my[ 1 ] === "center" ) {
position.top -= elemHeight / 2;
}
position.left += myOffset[ 0 ];
position.top += myOffset[ 1 ];
// if the browser doesn't support fractions, then round for consistent results
if ( !$.support.offsetFractions ) {
position.left = round( position.left );
position.top = round( position.top );
}
collisionPosition = {
marginLeft: marginLeft,
marginTop: marginTop
};
$.each( [ "left", "top" ], function( i, dir ) {
if ( $.ui.position[ collision[ i ] ] ) {
$.ui.position[ collision[ i ] ][ dir ]( position, {
targetWidth: targetWidth,
targetHeight: targetHeight,
elemWidth: elemWidth,
elemHeight: elemHeight,
collisionPosition: collisionPosition,
collisionWidth: collisionWidth,
collisionHeight: collisionHeight,
offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
my: options.my,
at: options.at,
within: within,
elem : elem
});
}
});
if ( options.using ) {
// adds feedback as second argument to using callback, if present
using = function( props ) {
var left = targetOffset.left - position.left,
right = left + targetWidth - elemWidth,
top = targetOffset.top - position.top,
bottom = top + targetHeight - elemHeight,
feedback = {
target: {
element: target,
left: targetOffset.left,
top: targetOffset.top,
width: targetWidth,
height: targetHeight
},
element: {
element: elem,
left: position.left,
top: position.top,
width: elemWidth,
height: elemHeight
},
horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
};
if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
feedback.horizontal = "center";
}
if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
feedback.vertical = "middle";
}
if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
feedback.important = "horizontal";
} else {
feedback.important = "vertical";
}
options.using.call( this, props, feedback );
};
}
elem.offset( $.extend( position, { using: using } ) );
});
};
$.ui.position = {
fit: {
left: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
outerWidth = within.width,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
overLeft = withinOffset - collisionPosLeft,
overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
newOverRight;
// element is wider than within
if ( data.collisionWidth > outerWidth ) {
// element is initially over the left side of within
if ( overLeft > 0 && overRight <= 0 ) {
newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
position.left += overLeft - newOverRight;
// element is initially over right side of within
} else if ( overRight > 0 && overLeft <= 0 ) {
position.left = withinOffset;
// element is initially over both left and right sides of within
} else {
if ( overLeft > overRight ) {
position.left = withinOffset + outerWidth - data.collisionWidth;
} else {
position.left = withinOffset;
}
}
// too far left -> align with left edge
} else if ( overLeft > 0 ) {
position.left += overLeft;
// too far right -> align with right edge
} else if ( overRight > 0 ) {
position.left -= overRight;
// adjust based on position and margin
} else {
position.left = max( position.left - collisionPosLeft, position.left );
}
},
top: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
outerHeight = data.within.height,
collisionPosTop = position.top - data.collisionPosition.marginTop,
overTop = withinOffset - collisionPosTop,
overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
newOverBottom;
// element is taller than within
if ( data.collisionHeight > outerHeight ) {
// element is initially over the top of within
if ( overTop > 0 && overBottom <= 0 ) {
newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
position.top += overTop - newOverBottom;
// element is initially over bottom of within
} else if ( overBottom > 0 && overTop <= 0 ) {
position.top = withinOffset;
// element is initially over both top and bottom of within
} else {
if ( overTop > overBottom ) {
position.top = withinOffset + outerHeight - data.collisionHeight;
} else {
position.top = withinOffset;
}
}
// too far up -> align with top
} else if ( overTop > 0 ) {
position.top += overTop;
// too far down -> align with bottom edge
} else if ( overBottom > 0 ) {
position.top -= overBottom;
// adjust based on position and margin
} else {
position.top = max( position.top - collisionPosTop, position.top );
}
}
},
flip: {
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
overLeft = collisionPosLeft - offsetLeft,
overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
myOffset = data.my[ 0 ] === "left" ?
-data.elemWidth :
data.my[ 0 ] === "right" ?
data.elemWidth :
0,
atOffset = data.at[ 0 ] === "left" ?
data.targetWidth :
data.at[ 0 ] === "right" ?
-data.targetWidth :
0,
offset = -2 * data.offset[ 0 ],
newOverRight,
newOverLeft;
if ( overLeft < 0 ) {
newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
position.left += myOffset + atOffset + offset;
}
}
else if ( overRight > 0 ) {
newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
position.left += myOffset + atOffset + offset;
}
}
},
top: function( position, data ) {
var within = data.within,
withinOffset = within.offset.top + within.scrollTop,
outerHeight = within.height,
offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
collisionPosTop = position.top - data.collisionPosition.marginTop,
overTop = collisionPosTop - offsetTop,
overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
top = data.my[ 1 ] === "top",
myOffset = top ?
-data.elemHeight :
data.my[ 1 ] === "bottom" ?
data.elemHeight :
0,
atOffset = data.at[ 1 ] === "top" ?
data.targetHeight :
data.at[ 1 ] === "bottom" ?
-data.targetHeight :
0,
offset = -2 * data.offset[ 1 ],
newOverTop,
newOverBottom;
if ( overTop < 0 ) {
newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
position.top += myOffset + atOffset + offset;
}
}
else if ( overBottom > 0 ) {
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
position.top += myOffset + atOffset + offset;
}
}
}
},
flipfit: {
left: function() {
$.ui.position.flip.left.apply( this, arguments );
$.ui.position.fit.left.apply( this, arguments );
},
top: function() {
$.ui.position.flip.top.apply( this, arguments );
$.ui.position.fit.top.apply( this, arguments );
}
}
};
// fraction support test
(function () {
var testElement, testElementParent, testElementStyle, offsetLeft, i,
body = document.getElementsByTagName( "body" )[ 0 ],
div = document.createElement( "div" );
//Create a "fake body" for testing based on method used in jQuery.support
testElement = document.createElement( body ? "div" : "body" );
testElementStyle = {
visibility: "hidden",
width: 0,
height: 0,
border: 0,
margin: 0,
background: "none"
};
if ( body ) {
$.extend( testElementStyle, {
position: "absolute",
left: "-1000px",
top: "-1000px"
});
}
for ( i in testElementStyle ) {
testElement.style[ i ] = testElementStyle[ i ];
}
testElement.appendChild( div );
testElementParent = body || document.documentElement;
testElementParent.insertBefore( testElement, testElementParent.firstChild );
div.style.cssText = "position: absolute; left: 10.7432222px;";
offsetLeft = $( div ).offset().left;
$.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
testElement.innerHTML = "";
testElementParent.removeChild( testElement );
})();
}( jQuery ) );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long