2022-06-06 21:30:34 +00:00
|
|
|
$(document).ready(function () {
|
2023-02-13 17:24:48 +00:00
|
|
|
$('a#copy-description').zclip({
|
|
|
|
path: 'js/ZeroClipboard.swf',
|
|
|
|
copy: $('p#description').text()
|
|
|
|
});
|
|
|
|
$('a#copy-dynamic').zclip({
|
|
|
|
path: 'js/ZeroClipboard.swf',
|
|
|
|
copy: function () {
|
|
|
|
return $('input#dynamic').val();
|
|
|
|
}
|
|
|
|
});
|
2022-06-06 21:30:34 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function bodyLoaded() {
|
2023-02-13 17:24:48 +00:00
|
|
|
//генерируем смайлики
|
|
|
|
let i = 0,
|
|
|
|
j = '';
|
2023-06-11 11:50:52 +00:00
|
|
|
|
|
|
|
while (i !== -1) {
|
|
|
|
if (sml[i] !== undefined) {
|
2023-06-13 00:44:13 +00:00
|
|
|
j += `<img style="cursor:pointer" onclick="chat.addSmile(\'${sml[i]}\')" src="${c.img2}/i/smile/${sml[i]}.gif" width="${sml[i + 1]}" height="${sml[i + 2]}" title=":${sml[i]}:"/> `;
|
2023-02-13 17:24:48 +00:00
|
|
|
} else i = -4;
|
|
|
|
i += 3;
|
|
|
|
}
|
|
|
|
$('#smilesDiv').html(j);
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function startEngine() {
|
2023-02-13 17:24:48 +00:00
|
|
|
//стандартные настройки
|
2023-06-11 11:50:52 +00:00
|
|
|
if ($.cookie('chatCfg0') === undefined) {
|
2023-02-13 17:24:48 +00:00
|
|
|
$.cookie('chatCfg0', 2, {expires: 320});
|
|
|
|
$.cookie('chatCfg1', 'Black', {expires: 320});
|
|
|
|
}
|
|
|
|
$('#reline1').mousedown(function () {
|
|
|
|
start_NRESize({
|
|
|
|
generalArgs: {cssName: 'reline1', whatSee: 'height', whereTo: 'top'},
|
|
|
|
nowArgs: {clientAxis: 'clientY', axisCount: 31},
|
|
|
|
stopArgs: {jCount: 35, cssNameExt: 'chat'},
|
|
|
|
stopTrue: true
|
|
|
|
})
|
|
|
|
});
|
|
|
|
$('#reline2').mousedown(function () {
|
|
|
|
start_NRESize({
|
|
|
|
generalArgs: {cssName: 'reline2', whatSee: 'width', whereTo: 'left'},
|
|
|
|
nowArgs: {clientAxis: 'clientX', axisCount: 40},
|
|
|
|
stopArgs: {jCount: 18, cssNameExt: 'online'},
|
|
|
|
stopTrue: true
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
$(window).resize(function () {
|
|
|
|
resizeFinish()
|
|
|
|
});
|
|
|
|
resizeFinish();
|
|
|
|
//Добавляем действия
|
2023-06-13 00:44:13 +00:00
|
|
|
let i = 0;
|
2023-06-11 11:50:52 +00:00
|
|
|
while (i !== -1) {
|
2023-02-13 17:24:48 +00:00
|
|
|
if ($(`#chcf${i}`).attr('id') != undefined) {
|
|
|
|
$(`#chcf${i}`).change(function () {
|
|
|
|
saveChatConfig();
|
|
|
|
if (this.id == 'chcf10') {
|
|
|
|
chat.reflesh()
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if (i > 1) {
|
|
|
|
if ($.cookie(`chatCfg${i}`) == 1) {
|
|
|
|
$('#chcf' + i).attr('checked', true);
|
|
|
|
if (i == 11) chat.globalMsg = 1;
|
|
|
|
} else if ($.cookie(`chatCfg${i}`) == 0) {
|
|
|
|
$(`#chcf${i}`).attr('checked', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else i = -2;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
//загрузка сохраненных настроек
|
|
|
|
if ($('#chcf0').val().length >= 1) {
|
|
|
|
srcv = $.cookie('chatCfg0');
|
|
|
|
$('#chcf0 option:selected').each(function (id) {
|
|
|
|
$(this).removeAttr('selected');
|
|
|
|
});
|
|
|
|
$('#chcf0 option').each(function () {
|
|
|
|
if ($(this).val().indexOf(srcv) > -1) {
|
|
|
|
$(this).attr('selected', 'yes');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if ($('#chcf8').val().length >= 1) {
|
|
|
|
srcv = $.cookie('chatCfg8');
|
|
|
|
$('#chcf8 option:selected').each(function (id) {
|
|
|
|
$(this).removeAttr('selected');
|
|
|
|
});
|
|
|
|
$('#chcf8 option').each(function () {
|
|
|
|
if ($(this).val().indexOf(srcv) > -1) {
|
|
|
|
$(this).attr('selected', 'yes');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function saveChatConfig() {
|
2023-02-13 17:24:48 +00:00
|
|
|
var i = 0;
|
|
|
|
while (i != -1) {
|
|
|
|
if ($('#chcf' + i).attr('id') != undefined) {
|
2023-04-08 15:14:19 +00:00
|
|
|
if (i < 2 || i == 8) {
|
2023-02-13 17:24:48 +00:00
|
|
|
$.cookie(`chatCfg${i}`, $(`#chcf${i}`).val(), {
|
|
|
|
expires: 320
|
|
|
|
});
|
|
|
|
} else {
|
2023-04-08 15:14:19 +00:00
|
|
|
if ($(`#chcf${i}`).attr('checked') == true) {
|
2023-02-13 17:24:48 +00:00
|
|
|
$.cookie(`chatCfg${i}`, 1, {
|
|
|
|
expires: 320
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
$.cookie(`chatCfg${i}`, 0, {
|
|
|
|
expires: 320
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else i = -2;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if ($('#chcf11').attr('checked') == true) {
|
|
|
|
return saveChatConfig_work(chat, 1, '')
|
|
|
|
}
|
|
|
|
|
|
|
|
return saveChatConfig_work(chat, 0, 'none')
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
2023-02-13 17:24:48 +00:00
|
|
|
|
|
|
|
function saveChatConfig_work(chatObj, count, display) {
|
|
|
|
$('#globalMode').css({'display': display});
|
|
|
|
chatObj.globalMsg = count;
|
|
|
|
chatObj.genchatData(null);
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function unpx(v) {
|
2023-02-13 17:24:48 +00:00
|
|
|
return Number(v.replace('px', ''));
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GENERAL
|
2023-02-13 17:24:48 +00:00
|
|
|
function start_NRESize(objArgs) {
|
|
|
|
|
|
|
|
var {generalArgs, nowArgs, stopArgs, stopTrue} = objArgs
|
|
|
|
|
|
|
|
var {cssName, whatSee, whereTo} = generalArgs
|
|
|
|
var {clientAxis, axisCount} = nowArgs
|
|
|
|
var {jCount, cssNameExt} = stopArgs
|
|
|
|
|
|
|
|
$(cssName).css({'z-index': 1003}); // reline2 или 1
|
|
|
|
$('#upbox').css({'display': 'block'});
|
|
|
|
|
|
|
|
$('#upbox').mousemove(function (event) {
|
|
|
|
now_NRESize({
|
|
|
|
element: event,
|
|
|
|
clientAxis: clientAxis,
|
|
|
|
axisCount: axisCount,
|
|
|
|
whatSee: whatSee,
|
|
|
|
cssName: cssName,
|
|
|
|
whereTo: whereTo
|
|
|
|
});
|
|
|
|
|
|
|
|
stop_NRESize({
|
|
|
|
jCount: jCount,
|
|
|
|
cssNameExt: cssNameExt,
|
|
|
|
whatSee: whatSee,
|
|
|
|
cssName: cssName,
|
|
|
|
whereTo: whereTo
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
$(`${cssName}`).mouseup(function () {
|
|
|
|
stop2_NRESize({stopTrue: stopTrue, cssName: cssName})
|
|
|
|
});
|
|
|
|
$('#upbox').mouseup(function () {
|
|
|
|
stop2_NRESize({stopTrue: stopTrue, cssName: cssName})
|
|
|
|
});
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GENERAL 2
|
2023-02-13 17:24:48 +00:00
|
|
|
function now_NRESize(objArgs) {
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
// 1: 'clientY', 31, 'heigth', '#reline1', 'top'
|
|
|
|
// 2: 'clientX', 40, 'width', '#reline2', 'left'
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
var {element, clientAxis, axisCount, whatSee, cssName, whereTo} = objArgs
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
if (element[clientAxis] > axisCount && element[clientAxis] < $(window)[whatSee]() - 40) {
|
|
|
|
$(`#${cssName}`).css({
|
|
|
|
[whereTo]: element[clientAxis]
|
|
|
|
});
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GENERAL 3
|
2023-02-13 17:24:48 +00:00
|
|
|
function stop_NRESize(objArgs) {
|
|
|
|
|
|
|
|
// 1: 35, 'chat', 'heigth', 'reline1', 'top'
|
|
|
|
// 2: 18, 'online', 'width', 'reline2', 'left'
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
var {jCount, cssNameExt, whatSee, cssName, whereTo} = objArgs
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
j = jCount;
|
|
|
|
if ($.browser.msie == true) j += 2;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
$(`#${cssNameExt}`).css({
|
|
|
|
[whatSee]: Math.round(($(window)[whatSee]() - unpx($(`#${cssName}`).css(whereTo)) - j) / $(window)[whatSee]() * 100) + '%'
|
|
|
|
});
|
|
|
|
resizeFinish();
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GENERAL 4
|
2023-02-13 17:24:48 +00:00
|
|
|
function stop2_NRESize(objArgs) {
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
// 1: true, 'resize1', 'reline1'
|
|
|
|
// 2: false, 'resize2', 'resize2'
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
var {stopTrue, cssName} = objArgs
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
$('#upbox').css({'display': 'none'});
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
if (stopTrue) {
|
|
|
|
stop_NRESize({
|
|
|
|
jCount: 35,
|
|
|
|
cssNameExt: 'chat',
|
|
|
|
whatSee: 'height',
|
|
|
|
cssName: 'reline1',
|
|
|
|
whereTo: 'top'
|
|
|
|
})
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
$(cssName).css({'z-index': 1001});
|
|
|
|
$('#upbox').unbind('mouseup');
|
|
|
|
$('#upbox').unbind('mousemove');
|
|
|
|
$(`#${cssName}`).unbind('mouseup');
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function resizeFinish() {
|
2023-02-13 17:24:48 +00:00
|
|
|
j = 30;
|
|
|
|
i = 3;
|
|
|
|
if ($.browser.msie == true) {
|
|
|
|
j += 1;
|
|
|
|
i += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#main').css({'width': '20px', 'height': '20px'});
|
|
|
|
$('#touchmain').css({'width': '20px', 'height': '20px'});
|
|
|
|
|
|
|
|
$('#chat_list').css({'width': '20px', 'height': '20px'});
|
|
|
|
$('#online_list').css({'width': '20px', 'height': '20px'});
|
|
|
|
|
|
|
|
$('#chat_list').css({'width': ($('#chat').width() - $('#online').width() - 4), 'height': $('#online').height()});
|
|
|
|
$('#online_list').css({'width': $('#online').width() - 5, 'height': $('#online').height()});
|
|
|
|
$('#main').css({
|
|
|
|
'height': ($(window).height() - j - $('#chat_block').height() - 42),
|
|
|
|
'width': ($(window).width() - 19)
|
|
|
|
});
|
|
|
|
$('#touchmain').css({
|
|
|
|
'height': ($(window).height() - j - $('#chat_block').height() - 42),
|
|
|
|
'width': ($(window).width() - 19)
|
|
|
|
});
|
|
|
|
$('#reline1').css({'top': ($(window).height() - j - $('#chat').height() - 6) + 'px'});
|
|
|
|
$('#reline2').css({
|
|
|
|
'left': ($(window).width() - i - $('#online').width() - 9) + 'px',
|
|
|
|
'height': ($('#chat').height()) + 'px',
|
|
|
|
'top': ($('#main_td').height() + j + 2) + 'px'
|
|
|
|
});
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function showtable(id) {
|
2023-02-13 17:24:48 +00:00
|
|
|
hidesel(id);
|
|
|
|
hidemenu(0);
|
|
|
|
document.getElementById(`menu${id}`).style.display = '';
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
function hidemenu(time) {
|
|
|
|
for (var i = 1; i <= 2; i++) {
|
|
|
|
document.getElementById(`menu${i}`).style.display = 'none';
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
function hidesel(id) {
|
|
|
|
for (var i = 1; i <= 2; i++) {
|
|
|
|
if (i != id) {
|
|
|
|
document.getElementById(`el${i}`).style.backgroundColor = '';
|
|
|
|
document.getElementById(`el${i}`).style.color = '';
|
|
|
|
}
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function chconf() {
|
2023-02-13 17:24:48 +00:00
|
|
|
if ($('#chconfig').css('display') == 'none') {
|
|
|
|
$('#brnchcf').attr('class', 'db cp chatBtn18_2');
|
|
|
|
$('#chconfig').css('display', 'block');
|
|
|
|
return
|
|
|
|
}
|
|
|
|
$('#chconfig').hide("fast");
|
|
|
|
$('#brnchcf').attr('class', 'db cp chatBtn18_1');
|
|
|
|
return
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var doTest;
|
2023-02-13 17:24:48 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
function MBcMenu() {
|
2023-02-13 17:24:48 +00:00
|
|
|
T_cm = setTimeout("if(doTest){ top.infoMenuClose(1); clearTimeout(T_cm);}", 100);
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getNameBrouser() {
|
2023-02-13 17:24:48 +00:00
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
2023-06-11 11:50:52 +00:00
|
|
|
if (ua.indexOf("msie") !== -1 && ua.indexOf("opera") === -1 && ua.indexOf("webtv") === -1) {
|
2023-02-13 17:24:48 +00:00
|
|
|
return "msie"
|
|
|
|
}
|
2023-06-11 11:50:52 +00:00
|
|
|
if (ua.indexOf("opera") !== -1) {
|
2023-02-13 17:24:48 +00:00
|
|
|
return "opera"
|
|
|
|
}
|
2023-06-11 11:50:52 +00:00
|
|
|
if (ua.indexOf("gecko") !== -1) {
|
2023-02-13 17:24:48 +00:00
|
|
|
return "gecko";
|
|
|
|
}
|
2023-06-11 11:50:52 +00:00
|
|
|
if (ua.indexOf("safari") !== -1) {
|
2023-02-13 17:24:48 +00:00
|
|
|
return "safari";
|
|
|
|
}
|
2023-06-11 11:50:52 +00:00
|
|
|
if (ua.indexOf("konqueror") !== -1) {
|
2023-02-13 17:24:48 +00:00
|
|
|
return "konqueror";
|
|
|
|
}
|
|
|
|
return "unknown";
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function mousePageXY(e) {
|
2023-02-13 17:24:48 +00:00
|
|
|
var x = 0,
|
|
|
|
y = 0;
|
|
|
|
if (e.pageX || e.pageY) {
|
|
|
|
x = e.pageX;
|
|
|
|
y = e.pageY;
|
|
|
|
} else if (e.clientX || e.clientY) {
|
|
|
|
x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
|
|
|
|
y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
"x": x,
|
|
|
|
"y": y
|
|
|
|
};
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
function infoMenu(u, e, f) {
|
|
|
|
if (!e) e = window.event;
|
2023-06-11 11:50:52 +00:00
|
|
|
const d = top.document.getElementById('persmenu');
|
|
|
|
const d2 = top.document.getElementById('upbox');
|
|
|
|
if (d) {
|
|
|
|
let dptop = -5;
|
|
|
|
const dpleft = -5;
|
|
|
|
if (f === 'main') {
|
2023-02-13 17:24:48 +00:00
|
|
|
dptop += 30;
|
|
|
|
}
|
2023-06-11 11:50:52 +00:00
|
|
|
const dp = top;
|
|
|
|
const s = d.style;
|
2023-02-13 17:24:48 +00:00
|
|
|
d2.style.display = '';
|
|
|
|
d.className = 'topusermenu';
|
|
|
|
s.display = '';
|
2023-06-11 11:50:52 +00:00
|
|
|
let obtop = mousePageXY(e)['y'] + dptop;
|
|
|
|
if (getNameBrouser() === 'msie') {
|
2023-02-13 17:24:48 +00:00
|
|
|
obtop -= dp.document.body.scrollTop;
|
|
|
|
} else {
|
|
|
|
obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop;
|
|
|
|
}
|
2023-06-11 11:50:52 +00:00
|
|
|
let obleft = mousePageXY(e)['x'] + dpleft;
|
2023-02-13 17:24:48 +00:00
|
|
|
d.style.top = `${obtop}px`;
|
|
|
|
d.style.left = `${obleft}px`;
|
2023-06-11 11:50:52 +00:00
|
|
|
let hmmmt = `<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();">
|
|
|
|
<div onClick="top.chat.addto(\'${u}\',\'to\'); infoMenuClose(4);" class="topusermenuBtn">TO</div>
|
|
|
|
<div onClick="top.chat.addto(\'${u}\',\'private\'); infoMenuClose(4);" class="topusermenuBtn">PRIVATE</div>
|
|
|
|
<div onClick="window.open(\'inf.php?login=${u}\'); infoMenuClose(4);" class="topusermenuBtn">INFO</div>
|
|
|
|
<div onClick="top.infoMenuClose(4);" class="topusermenuBtn"><div id="d_clip_button">COPY</div></div>`;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-06-11 11:50:52 +00:00
|
|
|
if (!top.iusrno[u]) {
|
2023-02-13 17:24:48 +00:00
|
|
|
hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">IGNORE</div>`;
|
|
|
|
} else {
|
|
|
|
hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">- IGNORE</div>`;
|
|
|
|
}
|
|
|
|
hmmmt = `${hmmmt}</DIV>`;
|
|
|
|
d.innerHTML = hmmmt;
|
|
|
|
|
2023-06-11 11:50:52 +00:00
|
|
|
const bdx = document.body.clientWidth;
|
|
|
|
const bdy = document.body.clientHeight;
|
|
|
|
const obx = d.clientWidth;
|
|
|
|
const oby = d.clientHeight;
|
|
|
|
const ots = bdy - obtop - oby;
|
|
|
|
const ols = bdx - obleft - obx;
|
2023-02-13 17:24:48 +00:00
|
|
|
if (ots < 10) {
|
|
|
|
obtop = bdy - 10 - oby;
|
|
|
|
d.style.top = `${obtop}px`;
|
|
|
|
}
|
|
|
|
if (ols < 10) {
|
|
|
|
obleft = bdx - 10 - obx;
|
|
|
|
d.style.left = `${obleft}px`;
|
|
|
|
}
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
2023-02-13 17:24:48 +00:00
|
|
|
function infoMenuClose(id) {
|
2023-06-11 11:50:52 +00:00
|
|
|
const d = top.document.getElementById('persmenu');
|
|
|
|
const d2 = top.document.getElementById('upbox');
|
|
|
|
if (d) {
|
2023-02-13 17:24:48 +00:00
|
|
|
if (id > 0 && id < 5) {
|
|
|
|
d.className = `topusermenu inviseMen${id}`;
|
|
|
|
T_mn = setTimeout(`top.infoMenuClose(${(id + 1)})`, 30);
|
2023-06-11 11:50:52 +00:00
|
|
|
} else if (id === 5) {
|
|
|
|
const s = d.style;
|
2023-02-13 17:24:48 +00:00
|
|
|
s.display = 'none';
|
|
|
|
d2.style.display = 'none';
|
|
|
|
d.innerHTML = '';
|
|
|
|
d.className = '';
|
|
|
|
d.style.left = '-1000px';
|
|
|
|
clearTimeout(T_mn);
|
|
|
|
}
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function infoMenuMy(u, e, f, dtm) {
|
2023-02-13 17:24:48 +00:00
|
|
|
if (!e) e = window.event;
|
2023-06-11 11:50:52 +00:00
|
|
|
const d = top.document.getElementById('persmenu');
|
|
|
|
const d2 = top.document.getElementById('upbox');
|
|
|
|
if (d) {
|
|
|
|
const dptop = -5;
|
|
|
|
const dpleft = -5;
|
|
|
|
const dp = top;
|
|
|
|
const s = d.style;
|
2023-02-13 17:24:48 +00:00
|
|
|
d2.style.display = '';
|
|
|
|
d.className = 'topusermenu';
|
|
|
|
s.display = '';
|
2023-06-11 11:50:52 +00:00
|
|
|
let obtop = mousePageXY(e)['y'] + dptop;
|
|
|
|
if (getNameBrouser() === 'msie') {
|
2023-02-13 17:24:48 +00:00
|
|
|
obtop -= dp.document.body.scrollTop;
|
|
|
|
} else {
|
|
|
|
obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop;
|
|
|
|
}
|
2023-06-11 11:50:52 +00:00
|
|
|
let obleft = mousePageXY(e)['x'] + dpleft;
|
2023-02-13 17:24:48 +00:00
|
|
|
d.style.top = `${obtop}px`;
|
|
|
|
d.style.left = `${obleft}px`;
|
2023-06-11 11:50:52 +00:00
|
|
|
let hmmmt = '<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();">';
|
|
|
|
let i = 0;
|
|
|
|
while (i !== -1) {
|
|
|
|
if (dtm[i] !== undefined && dtm[i] !== null) {
|
2023-02-13 17:24:48 +00:00
|
|
|
hmmmt += `<div onClick="${dtm[i][0]} infoMenuClose(4);" class="topusermenuBtn">${dtm[i][1]}</div>`;
|
|
|
|
i++;
|
|
|
|
} else i = -1;
|
|
|
|
}
|
|
|
|
hmmmt = `${hmmmt}</DIV>`;
|
|
|
|
d.innerHTML = hmmmt;
|
|
|
|
|
2023-06-11 11:50:52 +00:00
|
|
|
const bdx = document.body.clientWidth;
|
|
|
|
const bdy = document.body.clientHeight;
|
|
|
|
const obx = d.clientWidth;
|
|
|
|
const oby = d.clientHeight;
|
|
|
|
const ots = bdy - obtop - oby;
|
|
|
|
const ols = bdx - obleft - obx;
|
2023-02-13 17:24:48 +00:00
|
|
|
if (ots < 10) {
|
|
|
|
obtop = bdy - 10 - oby;
|
|
|
|
d.style.top = `${obtop}px`;
|
|
|
|
}
|
|
|
|
if (ols < 10) {
|
|
|
|
obleft = bdx - 10 - obx;
|
|
|
|
d.style.left = `${obleft}px`;
|
|
|
|
}
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
//Окна
|
2022-06-06 21:30:34 +00:00
|
|
|
var win = {
|
2023-02-13 17:24:48 +00:00
|
|
|
winc: {}, //координаты окон
|
|
|
|
wsdr: null,
|
|
|
|
scor: {}, //начальные координаты
|
|
|
|
openw: function (id, title, text, date, type, style) {
|
2023-06-13 00:44:13 +00:00
|
|
|
if (!$(`#win_${id}`).attr('id')) {
|
2023-02-13 17:24:48 +00:00
|
|
|
//Создаем новое окно
|
|
|
|
this.add(id, title, text, date, type, 1, '');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
WstartDrag: function (id) {
|
|
|
|
$('#wupbox').css({'display': 'block', 'cursor': 'move'});
|
|
|
|
this.wsdr = id;
|
|
|
|
$('.w1').css({'z-index': 1102});
|
|
|
|
$(`#win_${id}`).css({'z-index': 1103});
|
|
|
|
delete cm;
|
|
|
|
},
|
|
|
|
WmoveDrag: function (e) {
|
|
|
|
//Сохраняем начальные координаты
|
2023-06-13 00:44:13 +00:00
|
|
|
let x = mousePageXY(e)['x'], y = mousePageXY(e)['y'];
|
|
|
|
if (!this.scor.x) {
|
2023-02-13 17:24:48 +00:00
|
|
|
this.scor.x = x;
|
|
|
|
this.scor.y = y;
|
|
|
|
this.scor.x2 = unpx($(`#win_${this.wsdr}`).css('left'));
|
|
|
|
this.scor.y2 = unpx($(`#win_${this.wsdr}`).css('top'));
|
|
|
|
}
|
|
|
|
x = x - this.scor.x;
|
|
|
|
y = y - this.scor.y;
|
|
|
|
x += this.scor.x2;
|
|
|
|
y += this.scor.y2;
|
|
|
|
if (x < 9) {
|
|
|
|
x = 9;
|
|
|
|
}
|
|
|
|
if (x + $(`#win_${this.wsdr}`).width() > $(window).width() - 9) {
|
|
|
|
x = $(window).width() - 9 - $(`#win_${this.wsdr}`).width();
|
|
|
|
}
|
|
|
|
if (y < 35) {
|
|
|
|
y = 35;
|
|
|
|
}
|
|
|
|
if (y + $(`#win_${this.wsdr}`).height() > $(window).height() - 35) {
|
|
|
|
y = $(window).height() - 35 - $(`#win_${this.wsdr}`).height();
|
|
|
|
}
|
|
|
|
$(`#win_${this.wsdr}`).css({'top': `${y}px`, 'left': `${x}px`});
|
|
|
|
},
|
|
|
|
WstopDrag: function () {
|
|
|
|
$('#wupbox').css({'display': 'none', 'cursor': 'move'});
|
|
|
|
this.wsdr = null;
|
|
|
|
this.scor = {};
|
|
|
|
},
|
|
|
|
add: function (id, title, text, date, type, style, css) {
|
2023-06-13 00:44:13 +00:00
|
|
|
let nw = '';
|
|
|
|
if (!$(`#win_${id}`).attr('id')) {
|
|
|
|
const acts = {};
|
2023-02-13 17:24:48 +00:00
|
|
|
|
2023-06-13 00:44:13 +00:00
|
|
|
if (date.usewin) {
|
2023-02-13 17:24:48 +00:00
|
|
|
acts[0] = `onmouseup="${date.usewin}"`;
|
|
|
|
} else {
|
|
|
|
date.usewin = '';
|
|
|
|
}
|
|
|
|
|
2023-06-13 00:44:13 +00:00
|
|
|
if (date.closewin) {
|
2023-02-13 17:24:48 +00:00
|
|
|
acts[9] = date.closewin;
|
|
|
|
} else {
|
|
|
|
date.closewin = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
//нижняя часть
|
2023-06-13 00:44:13 +00:00
|
|
|
if (date.n) {
|
2023-02-13 17:24:48 +00:00
|
|
|
text += `<div style="margin-left:11px;">${date.n}</div>`;
|
|
|
|
}
|
2023-06-13 00:44:13 +00:00
|
|
|
const kyps = ['', ''];
|
2023-02-13 17:24:48 +00:00
|
|
|
//Вывод главных данных
|
|
|
|
if (type == 0) {
|
|
|
|
nw = text;
|
|
|
|
} else if (type == 1) {
|
|
|
|
//Просто вывод данных
|
|
|
|
nw = text;
|
|
|
|
} else if (type == 2) {
|
|
|
|
//Да \ Нет
|
|
|
|
nw = `<div>${text}</div><div style="padding:5px"><div style="float:left"><button onClick="${date.a1};win.closew(\'${id}\');${acts[9]}" class="btnnew wi${style}sbtn11" id="winyesbtnfox${id}" style="width:100px">Да</button></div><div style="float:right"><button class="btnnew wi${style}sbtn12" onClick="${date.a2};win.closew(\'${id}\')" style="width:100px">Нет</button></div><br></div>`;
|
|
|
|
kyps[0] = `${date.a1};top.win.closew(\\\'${id}\\\');${acts[9]}top.win.addaction(0,\\\'\\\');`;
|
|
|
|
} else if (type == 3) {
|
|
|
|
//Да \ Нет , изображения
|
2023-06-13 00:44:13 +00:00
|
|
|
let stylebtn = '';
|
2023-02-13 17:24:48 +00:00
|
|
|
if (style > 1) {
|
|
|
|
stylebtn = style;
|
|
|
|
}
|
2023-06-13 00:44:13 +00:00
|
|
|
nw = `<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>${text}</td><td width="40" align="center" valign="middle"><img class="prmimgyn" style="margin-top:5px;cursor:pointer" onClick="${date.a1};win.closew(\'${id}\');" src="${c.img2}/i/b__ok${stylebtn}.gif" width="25" height="18"><br><img onClick="win.closew(\'${id}\')" class="prmimgyn" style="cursor:pointer;margin-top:2px;" src="${c.img2}/i/b__cancel${stylebtn}.jpg" width="25" height="18"></td></tr></table>`;
|
2023-02-13 17:24:48 +00:00
|
|
|
kyps[0] = `${date.a1};top.win.closew(\\\'${id}\\\');${acts[9]}top.win.addaction(0,\\\'\\\');`;
|
|
|
|
} else if (type == 4) {
|
|
|
|
//Тройной блок
|
|
|
|
nw = text[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
//Если есть вторая информация
|
2023-06-13 00:44:13 +00:00
|
|
|
if (date.d) {
|
2023-02-13 17:24:48 +00:00
|
|
|
nw = nw + date.d;
|
|
|
|
}
|
|
|
|
|
|
|
|
nw = `<div style="margin:2px;${css}">${nw}</div>`;
|
|
|
|
|
|
|
|
//Заголовок окна
|
2023-06-13 00:44:13 +00:00
|
|
|
if (title) {
|
|
|
|
if (date.a3 === undefined) {
|
2023-02-13 17:24:48 +00:00
|
|
|
date.a3 = '';
|
|
|
|
}
|
2023-06-13 00:44:13 +00:00
|
|
|
if (acts[9] === undefined) {
|
2023-02-13 17:24:48 +00:00
|
|
|
acts[9] = '';
|
|
|
|
}
|
|
|
|
nw = `<div class="wi${style}s10" onselectstart="return false">
|
2022-06-06 21:30:34 +00:00
|
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
|
<tr>
|
|
|
|
<td rowspan="2" style="cursor:move" onmousedown="win.WstartDrag(\'${id}\')" ${acts[0]}><b>${title}</b></td>
|
2023-06-13 00:44:13 +00:00
|
|
|
<td width="15" align="right"><img style="display:block" onClick="win.closew(\'${id}\');${acts[9]}${date.a3}" src="${c.img2}/i/clear.gif" width="13" height="13"></td>
|
2022-06-06 21:30:34 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>${nw}`;
|
2023-02-13 17:24:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//Собираем каркас
|
2023-06-13 00:44:13 +00:00
|
|
|
nw = `<table onclick="top.win.addaction(0,'${kyps[0]}')" border="0" cellspacing="0" cellpadding="0">
|
2022-06-06 21:30:34 +00:00
|
|
|
<tr>
|
2023-06-13 00:44:13 +00:00
|
|
|
<td class="wi${style}s0"><div><img src="${c.img2}/1x1.gif" width="1" height="1"></div></td>
|
2022-06-06 21:30:34 +00:00
|
|
|
<td class="wi${style}s1"></td>
|
2023-06-13 00:44:13 +00:00
|
|
|
<td class="wi${style}s2"><div><img src="${c.img2}/1x1.gif" width="1" height="1"></div></td>
|
2022-06-06 21:30:34 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2023-06-13 00:44:13 +00:00
|
|
|
<td class="wi${style}s3"><img src="${c.img2}/1x1.gif" width="5" height="1"></td>
|
2022-06-06 21:30:34 +00:00
|
|
|
<td class="wi${style}s7" id="win_main_${id}">${nw}</td>
|
2023-06-13 00:44:13 +00:00
|
|
|
<td class="wi${style}s4"><img src="${c.img2}/1x1.gif" width="5" height="1"></td>
|
2022-06-06 21:30:34 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2023-06-13 00:44:13 +00:00
|
|
|
<td class="wi${style}s5"><div><img src="${c.img2}/1x1.gif" width="1" height="1"></div></td>
|
2022-06-06 21:30:34 +00:00
|
|
|
<td class="wi${style}s6"></td>
|
2023-06-13 00:44:13 +00:00
|
|
|
<td class="wi${style}s8"><div><img src="${c.img2}/1x1.gif" width="1" height="1"></div><div id="win_a_${id}" class="wi${style}s9"></div></td>
|
2022-06-06 21:30:34 +00:00
|
|
|
</tr>
|
|
|
|
</table>`;
|
2023-02-13 17:24:48 +00:00
|
|
|
|
|
|
|
//Вешаем окно
|
|
|
|
nw = `<div class="w1" ${acts[0]} id="win_${id}">${nw}</div>`;
|
|
|
|
|
|
|
|
$('#windows').html($('#windows').html() + nw);
|
|
|
|
$(`#win_${id}`).center();
|
2023-06-13 00:44:13 +00:00
|
|
|
if (type == 2) {
|
|
|
|
$(`#winyesbtnfox${id}`).focus();
|
2023-02-13 17:24:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
addaction: function (nm, vl) {
|
2023-06-11 11:50:52 +00:00
|
|
|
key_actions[nm] = vl;
|
2023-02-13 17:24:48 +00:00
|
|
|
if (nm != 2) {
|
2023-06-11 11:50:52 +00:00
|
|
|
key_actions[2] = 1;
|
2023-02-13 17:24:48 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
closew: function (id) {
|
|
|
|
$(`#win_${id}`).html('');
|
|
|
|
$(`#win_${id}`).remove();
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|