';
content = content+'';
content = content+'';
content = content+'';
content = content+'';
content = content+'';
content = content+'
';
}
}
return content;
}
$('.no_form_submit').on('submit', function(event) {
event.preventDefault();
});
$('body').on('click', '.openlink', function(e) {
var url = $(this).attr("url");
var pattern = /^((http|https|ftp):\/\/)/;
if (!pattern.test(url)) {
url = baseurl+url;
}
if ($(this).attr('newtab') == undefined) {
window.location = url;
} else {
window.open(url, '_blank');
}
return false;
});
function randomColor(lum) {
var randomColor = Math.floor(Math.random()*16777215).toString(16);
randomColor = String(randomColor).replace(/[^0-9a-f]/gi, '');
if (randomColor.length < 6) {
randomColor = randomColor[0]+randomColor[0]+randomColor[1]+randomColor[1]+randomColor[2]+randomColor[2];
}
lum = lum || 0;
var rgb = "#", c, i;
for (i = 0; i < 3; i++) {
c = parseInt(randomColor.substr(i*2, 2), 16);
c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);
rgb += ("00"+c).substr(c.length);
}
return rgb;
}
$("body").on('click', '.toggle_side_navigation', function(e) {
toggle_side_navigation();
});
function toggle_side_navigation() {
$('.main .chat_page_container > .side_navigation').removeClass('animate__animated animate__slideInLeft animate__faster animate__slideInRight');
if ($('.main .chat_page_container').hasClass('show_navigation')) {
$('.main .chat_page_container').removeClass('show_navigation');
} else {
if ($(window).width() < 1200) {
if ($('body').hasClass('ltr_language')) {
$('.main .chat_page_container > .side_navigation').addClass('animate__animated animate__slideInLeft animate__faster');
} else {
$('.main .chat_page_container > .side_navigation').addClass('animate__animated animate__slideInRight animate__faster');
}
}
$('.main .chat_page_container').addClass('show_navigation');
}
}
$("body").on('click', '.download_file', function(e) {
if (!$(this).hasClass('processing') && $(this).attr('download') !== undefined) {
$(this).addClass('processing');
var element = $(this);
var data = {
process: "download",
validate: true,
download: $(this).attr('download')
};
data = $.extend(data, $(this).data());
if (user_csrf_token !== null) {
data["csrf_token"] = user_csrf_token;
}
if (user_login_session_id !== null && user_access_code !== null && user_session_time_stamp !== null) {
data["login_session_id"] = user_login_session_id;
data["access_code"] = user_access_code;
data["session_time_stamp"] = user_session_time_stamp;
}
$.ajax({
type: 'POST',
url: api_request_url,
data: data,
async: true,
success: function(data) {}
}).done(function(data) {
if (isJSON(data)) {
data = $.parseJSON(data);
if (data.error != undefined) {
alert(decode_specialchars(data.error));
} else if (data.download_link != undefined) {
window.location.href = data.download_link;
}
} else {
console.log('ERROR : ' + data);
}
element.removeClass('processing');
}) .fail(function(qXHR, textStatus, errorThrown) {
element.removeClass('processing');
console.log('ERROR : ' + errorThrown);
});
}
});
$("body").on('click', '.preview_image', function(e) {
$('#preview_image').removeAttr('id');
var index = $(this).parent().parent().index();
var prev_btn = next_btn = navbar = 0;
if ($(this).parents('.files').length > 0) {
$(this).parent().parent().parent().attr('id', 'preview_image');
} else {
$(this).attr('id', 'preview_image');
}
if ($(this).parent().parent().parent().find('li').length > 1) {
navbar = 1;
}
var image_data = {
title: 0,
navbar: navbar,
toolbar: {
zoomIn: {
show: 1,
size: 'large',
},
zoomOut: {
show: 1,
size: 'large',
},
oneToOne: 0,
play: 0,
prev: prev_btn,
next: next_btn,
rotateLeft: {
show: 1,
size: 'large',
},
reset: {
show: 1,
size: 'large',
},
rotateRight: {
show: 1,
size: 'large',
},
flipHorizontal: {
show: 1,
size: 'large',
},
flipVertical: {
show: 1,
size: 'large',
},
},
hidden: function () {
viewer.destroy();
},
url(image) {
return image.getAttribute("original");
},
};
if ($(this).attr('load_image') === undefined) {
var viewerjs = viewer = new Viewer(document.getElementById('preview_image'), image_data);
} else {
image_data['url'] = 'src';
var load_image = new Image();
load_image.src = $(this).attr('load_image');
var viewerjs = viewer = new Viewer(load_image, image_data);
}
viewer.view(index)
viewer.show();
});
$("body").on('click', '.ask_confirmation', function(e) {
var column = 'first';
if ($(this).attr('column') === undefined || $(this).attr('column') === 'first') {
$('.main .aside > .site_records > .records').addClass('blur');
$('.main .aside > .site_records > .records > .list > li').removeClass('selected');
$('.main .aside > .site_records > .tools').addClass('d-none');
} else {
column = $(this).attr('column');
}
var confirm_box = $('.main .page_column[column="'+column+'"] .confirm_box');
var submit_button = '