Untitled diff

Creado El diff nunca expira
276 eliminaciones
472 líneas
98 adiciones
488 líneas
<script>
<script>
<!--
<!--
var pics_displayed = 0;
var pics_displayed = 0;
function display_pics(id, path)
function display_pics(id, path)
{
{
if( pics_displayed != id )
if( pics_displayed != id )
{
{
document.getElementById('pics_max').innerHTML = '<img src="' + path + '" alt="' + path + '" />';
document.getElementById('pics_max').innerHTML = '<img src="' + path + '" alt="' + path + '" />';
pics_displayed = id;
pics_displayed = id;
}
}
else
else
{
{
document.getElementById('pics_max').innerHTML = '';
document.getElementById('pics_max').innerHTML = '';
pics_displayed = 0;
pics_displayed = 0;
}
}
}
}
function display_pics_popup(path, width, height)
function display_pics_popup(path, width, height)
{
{
width = parseInt(width);
width = parseInt(width);
height = parseInt(height);
height = parseInt(height);
if( height == 0 )
if( height == 0 )
height = screen.height - 150;
height = screen.height - 150;
if( width == 0 )
if( width == 0 )
width = screen.width - 200;
width = screen.width - 200;
window.open(path, '', 'width='+(width+17)+', height='+(height+17)+', location=no, status=no, toolbar=no, scrollbars=1, resizable=yes');
window.open(path, '', 'width='+(width+17)+', height='+(height+17)+', location=no, status=no, toolbar=no, scrollbars=1, resizable=yes');
}
}
function display_rename_file(id, previous_name, previous_cut_name)
function display_rename_file(id, previous_name, previous_cut_name)
{
{
if( document.getElementById('fi' + id) )
if( document.getElementById('fi' + id) )
{
{
document.getElementById('fi_' + id).style.display = 'none';
document.getElementById('fi_' + id).style.display = 'none';
document.getElementById('fi' + id).style.display = 'inline';
document.getElementById('fi' + id).style.display = 'inline';
document.getElementById('fi' + id).innerHTML = '<input type="text" name="fiinput' + id + '" id="fiinput' + id + '" value="' + previous_name.replace(/\"/g, "&quot;") + '" onblur="rename_file(\'' + id + '\', \'' + previous_cut_name.replace(/\'/g, "\\\'").replace(/\"/g, "&quot;") + '\');">';
document.getElementById('fi' + id).innerHTML = '<input type="text" name="fiinput' + id + '" id="fiinput' + id + '" value="' + previous_name.replace(/\"/g, "&quot;") + '" onblur="rename_file(\'' + id + '\', \'' + previous_cut_name.replace(/\'/g, "\\\'").replace(/\"/g, "&quot;") + '\');">';
document.getElementById('fiinput' + id).focus();
document.getElementById('fiinput' + id).focus();
}
}
}
}
function rename_file(id_file, previous_cut_name)
function rename_file(id_file, previous_cut_name)
{
{
var name = document.getElementById("fiinput" + id_file).value;
var name = document.getElementById("fiinput" + id_file).value;
var regex = /\/|\\|\||\?|<|>/;
var regex = /\/|\\|\||\?|<|>/;
if( regex.test(name) ) //interdiction des caractères spéciaux dans le nom.
if( regex.test(name) ) //interdiction des caractères spéciaux dans le nom.
{
{
alert("{L_FILE_FORBIDDEN_CHARS}");
alert("{L_FILE_FORBIDDEN_CHARS}");
document.getElementById('fi_' + id_file).style.display = 'inline';
document.getElementById('fi_' + id_file).style.display = 'inline';
document.getElementById('fi' + id_file).style.display = 'none';
document.getElementById('fi' + id_file).style.display = 'none';
}
}
else
else
{
{
document.getElementById('img' + id_file).innerHTML = '<i class="fa fa-spinner fa-spin"></i>';
document.getElementById('img' + id_file).innerHTML = '<i class="fa fa-spinner fa-spin"></i>';
data = "id_file=" + id_file + "&name=" + name.replace(/&/g, "%26") + "&previous_name=" + previous_cut_name.replace(/&/g, "%26");
data = "id_file=" + id_file + "&name=" + name.replace(/&/g, "%26") + "&previous_name=" + previous_cut_name.replace(/&/g, "%26");
var xhr_object = xmlhttprequest_init('{PATH_TO_ROOT}/gallery/xmlhttprequest.php?token={TOKEN}&rename_pics=1');
var xhr_object = xmlhttprequest_init('{PATH_TO_ROOT}/gallery/xmlhttprequest.php?token={TOKEN}&rename_pics=1');
xhr_object.onreadystatechange = function()
xhr_object.onreadystatechange = function()
{
{
if( xhr_object.readyState == 4 && xhr_object.status == 200 && xhr_object.responseText != '0' )
if( xhr_object.readyState == 4 && xhr_object.status == 200 && xhr_object.responseText != '0' )
{
{
document.getElementById('fi' + id_file).style.display = 'none';
document.getElementById('fi' + id_file).style.display = 'none';
document.getElementById('fi_' + id_file).style.display = 'inline';
document.getElementById('fi_' + id_file).style.display = 'inline';
document.getElementById('fi_' + id_file).innerHTML = xhr_object.responseText;
document.getElementById('fi_' + id_file).innerHTML = xhr_object.responseText;
html_protected_name = name.replace(/\'/g, "\\\'").replace(/\"/g, "&quot;");
html_protected_name = name.replace(/\'/g, "\\\'").replace(/\"/g, "&quot;");
html_protected_name2 = xhr_object.responseText.replace(/\'/g, "\\\'").replace(/\"/g, "&quot;");
html_protected_name2 = xhr_object.responseText.replace(/\'/g, "\\\'").replace(/\"/g, "&quot;");
document.getElementById('fihref' + id_file).innerHTML = '<a href="javascript:display_rename_file(\'' + id_file + '\', \'' + html_protected_name + '\', \'' + html_protected_name2 + '\');" class="basic-button" title="{L_EDIT}"><i class="fa fa-edit"></i></a>';
document.getElementById('fihref' + id_file).innerHTML = '<a href="javascript:display_rename_file(\'' + id_file + '\', \'' + html_protected_name + '\', \'' + html_protected_name2 + '\');" class="basic-button" title="{L_EDIT}"><i class="fa fa-edit"></i></a>';
document.getElementById('img' + id_file).innerHTML = '';
document.getElementById('img' + id_file).innerHTML = '';
}
}
else if( xhr_object.readyState == 4 && xhr_object.responseText == '0' )
else if( xhr_object.readyState == 4 && xhr_object.responseText == '0' )
document.getElementById('img' + id_file).innerHTML = '';
document.getElementById('img' + id_file).innerHTML = '';
}
}
xmlhttprequest_sender(xhr_object, data);
xmlhttprequest_sender(xhr_object, data);
}
}
}
}
function pics_aprob(id_file, aprob)
function pics_aprob(id_file, aprob)
{
{
document.getElementById('img' + id_file).innerHTML = '<i class="fa fa-spinner fa-spin"></i>';
document.getElementById('img' + id_file).innerHTML = '<i class="fa fa-spinner fa-spin"></i>';
data = 'id_file=' + id_file;
data = 'id_file=' + id_file;
var xhr_object = xmlhttprequest_init('{PATH_TO_ROOT}/gallery/xmlhttprequest.php?token={TOKEN}&aprob_pics=1');
var xhr_object = xmlhttprequest_init('{PATH_TO_ROOT}/gallery/xmlhttprequest.php?token={TOKEN}&aprob_pics=1');
xhr_object.onreadystatechange = function()
xhr_object.onreadystatechange = function()
{
{
if( xhr_object.readyState == 4 && xhr_object.status == 200 && xhr_object.responseText != '-1' )
if( xhr_object.readyState == 4 && xhr_object.status == 200 && xhr_object.responseText != '-1' )
{
{
var img_aprob, title_aprob;
var img_aprob, title_aprob;
if( xhr_object.responseText == 0 )
if( xhr_object.responseText == 0 )
{
{
img_aprob = 'fa-eye-slash';
img_aprob = 'fa-eye-slash';
title_aprob = '{L_UNAPROB}';
title_aprob = '{L_UNAPROB}';
}
}
else
else
{
{
img_aprob = 'fa-eye';
img_aprob = 'fa-eye';
title_aprob = '{L_APROB}';
title_aprob = '{L_APROB}';
}
}
document.getElementById('img' + id_file).innerHTML = '';
document.getElementById('img' + id_file).innerHTML = '';
if( document.getElementById('img_aprob' + id_file) )
if( document.getElementById('img_aprob' + id_file) )
{
{
if(document.getElementById('img_aprob' + id_file).className == "fa fa-eye-slash"){
if(document.getElementById('img_aprob' + id_file).className == "fa fa-eye-slash"){
document.getElementById('img_aprob' + id_file).className = "fa fa-eye";
document.getElementById('img_aprob' + id_file).className = "fa fa-eye";