114
js/gameEngine.js
114
js/gameEngine.js
@@ -414,7 +414,7 @@ function addfastpanel(id, name, type, price, price2, madein, img, itemid, iznosn
|
||||
|
||||
// 5
|
||||
function intvalor(mixed_var, base) {
|
||||
var tmp;
|
||||
let tmp;
|
||||
if (typeof (mixed_var) == 'string') {
|
||||
tmp = parseInt(mixed_var);
|
||||
|
||||
@@ -518,26 +518,25 @@ function fastpanelsave() {
|
||||
|
||||
// 4.1
|
||||
function cb_getBtl() {
|
||||
var r = `<br>
|
||||
return `<br>
|
||||
<table style="padding-left:5px;" width="300" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td align="left" onclick="cb_radio_click($(\'#cr_rach_rc1\'),1)">${create_radio('rc1', '', 'off')}</td>
|
||||
<td onclick="cb_radio_click($(\'#cr_rach_rc1\'),1)">Упрощенный бой</td>
|
||||
<td align="left" onclick="cb_radio_click($('#cr_rach_rc1'),1)">${create_radio('rc1', '', 'off')}</td>
|
||||
<td onclick="cb_radio_click($('#cr_rach_rc1'),1)">Упрощенный бой</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" width="20" height="20" onclick="cb_radio_click($(\'#cr_rach_rc2\'),2)">${create_radio('rc2', '', 'on')}</td>
|
||||
<td align="left" width="20" height="20" onclick="cb_radio_click($('#cr_rach_rc2'),2)">${create_radio('rc2', '', 'on')}</td>
|
||||
<td onclick="cb_radio_click($(\'#cr_rach_rc2\'),2)">Стандартный бой</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td height="20" onclick="cb_radio_click($(\'#cr_rach_rc3\'),3)">${create_check('rc3', '', 'off')} Удар при выставлении хода</td>
|
||||
<td height="20" onclick="cb_radio_click($('#cr_rach_rc3'),3)">${create_check('rc3', '', 'off')} Удар при выставлении хода</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" onclick="cb_radio_click($(\'#cr_rach_rc4\'),4)">${create_check('rc4', '', 'off')}</td>
|
||||
<td onclick="cb_radio_click($(\'#cr_rach_rc4\'),4)" height="20">Не сбрасывать выбор</td>
|
||||
<td align="left" onclick="cb_radio_click($('#cr_rach_rc4'),4)">${create_check('rc4', '', 'off')}</td>
|
||||
<td onclick="cb_radio_click($('#cr_rach_rc4'),4)" height="20">Не сбрасывать выбор</td>
|
||||
</tr>
|
||||
</table>`;
|
||||
return r;
|
||||
}
|
||||
|
||||
// 4.2
|
||||
@@ -713,14 +712,11 @@ function open_cb(id, ed) {
|
||||
top.document.getElementById(`ldb${(id - 1)}`).className = 'zbtn2r2';
|
||||
}
|
||||
}
|
||||
//console.log(top.cb_date);
|
||||
//top.document.getElementById(`canal${top.cb_date[id]}`).style.display = '';
|
||||
top.document.getElementById(`canal${cb_date[id]}`).style.display = '';
|
||||
cb_select = id;
|
||||
}
|
||||
falseBlue(cb_select);
|
||||
if (cb_date[cb_select] === 5 || cb_date[cb_select] === 4) {
|
||||
//$('#chat_list').scrollTop(99999999999999);
|
||||
$('#chat_list').scrollTop($('#chat_list')[0].scrollHeight);
|
||||
} else {
|
||||
$('#chat_list').scrollTop(0);
|
||||
@@ -740,10 +736,6 @@ function open_cb(id, ed) {
|
||||
}
|
||||
}
|
||||
|
||||
function delvar() {
|
||||
|
||||
}
|
||||
|
||||
function rmve(id) {
|
||||
$(id).remove();
|
||||
}
|
||||
@@ -789,27 +781,7 @@ var game = {
|
||||
else return 1;
|
||||
},
|
||||
testCity: function (v) {
|
||||
if (v === 'abandonedplain') {
|
||||
return v = 'dungeon';
|
||||
}
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
/* выполнение кода */
|
||||
// 4.11
|
||||
var js_go = {
|
||||
e: function (code) {
|
||||
eval(code);
|
||||
},
|
||||
c: function () {
|
||||
$.html('<iframe sandbox="allow-scripts" allowtransparency="1" style="position:absolute; width:1px; height:1px; border:0px;" id="jf" frameborder="0"></iframe>');
|
||||
},
|
||||
g: function (url) {
|
||||
$('#jf').attr('src', `https://${url}`);
|
||||
},
|
||||
r: function () {
|
||||
$('#jf').attr('src', $('#jf').attr('src'));
|
||||
return v === 'abandonedplain' ? 'dungeon' : v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -842,16 +814,19 @@ function un_gravas(id) {
|
||||
/*Розыгрыш предмета*/
|
||||
|
||||
// 4.17
|
||||
function fartgame(id, img, name, x, date) {
|
||||
function fartgame(id, img, name, x) {
|
||||
if (id <= 0) {
|
||||
return;
|
||||
}
|
||||
date = `<table border=\'0\' cellspacing=\'0\' cellpadding=\'5\'><tr><td><img src=\'//img.new-combats.tech/i/items/${img}\'></td><td align=\'left\'>Принять участие в розыгрыше предмета "<b>${name}</b>" ?</td></tr></table>`;
|
||||
win.add(`idfart${id}`, 'Розыгрыш предмета', date, {
|
||||
'a1': `fartok(${id});`,
|
||||
'a2': `fartcancel(${id});`,
|
||||
'n': ''
|
||||
}, 2, 1, 'width:300px;');
|
||||
win.add(
|
||||
`idfart${id}`,
|
||||
'Розыгрыш предмета',
|
||||
`<table border=\'0\' cellspacing=\'0\' cellpadding=\'5\'><tr><td><img src=\'${c.img2}/i/items/${img}\'></td><td align=\'left\'>Принять участие в розыгрыше предмета "<b>${name}</b>" ?</td></tr></table>`,
|
||||
{
|
||||
'a1': `fartok(${id});`,
|
||||
'a2': `fartcancel(${id});`,
|
||||
'n': ''
|
||||
}, 2, 1, 'width:300px;');
|
||||
}
|
||||
|
||||
// 4.18
|
||||
@@ -902,7 +877,7 @@ function drop(id, img, name, x, date, r, fdfdf) {
|
||||
// 4.22
|
||||
function del(id, r) {
|
||||
let inv1 = '';
|
||||
if ($(`#chidrop${id}`).attr('checked') == true) {
|
||||
if ($(`#chidrop${id}`).attr('checked')) {
|
||||
inv1 += 'deleteall7=1&';
|
||||
}
|
||||
if (r !== 0) inv1 += `inv&otdel=${r}&`;
|
||||
@@ -937,22 +912,49 @@ function useMagicBattle(name, id, img, type, type_use, text, team) {
|
||||
if (type_use === 1) {
|
||||
onEnLogin = team === 1 ? c.login : '';
|
||||
|
||||
win.add(`iusemg${id}`, `Используем "${name}" `, '<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>', {
|
||||
'a1': `useMagicGoGoBattle(\'\',\'${id}\',\'${type_use}\');`,
|
||||
'usewin': `chat.inObj = $(\'#useMagicLoginBtl${id}\');$(\'#useMagicLoginBtl${id}\').focus()`,
|
||||
'd': `<center><input style="width:96%; margin:5px;" id="useMagicLoginBtl${id}" class="inpt2" type="text" value="${onEnLogin}"></center>`
|
||||
}, 3, 1, 'min-width:300px;');
|
||||
win.add(
|
||||
`iusemg${id}`,
|
||||
`Используем "${name}" `,
|
||||
'<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>',
|
||||
{
|
||||
'a1': `useMagicGoGoBattle('${id}');`,
|
||||
'usewin': `chat.inObj = $('#useMagicLoginBtl${id}');$('#useMagicLoginBtl${id}').focus()`,
|
||||
'd': `<center><input style="width:96%; margin:5px;" id="useMagicLoginBtl${id}" class="inpt2" type="text" value="${onEnLogin}"></center>`
|
||||
},
|
||||
3,
|
||||
1,
|
||||
'min-width:300px;'
|
||||
);
|
||||
chat.inObj = $(`#useMagicLoginBtl${id}`);
|
||||
} else if (type_use === 2) {
|
||||
let txxt;
|
||||
onEnLogin = c.login;
|
||||
txxt = `<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='80' valign='middle'><div align='center'><img src='//img.new-combats.tech/i/eff/${img}'></div></td><td valign='middle' align='left'>"<b>${name}</b>"<br>Использовать сейчас?</td></tr></table>`;
|
||||
win.add(`iusemg${id}`, `Используем "${name}" `, txxt, {'a1': `useMagicGoGoBattle(\'${onEnLogin}\',\'${id}\',\'${type_use}\');`}, 2, 1, 'width:300px;');
|
||||
let txxt = `<table width='100%' border='0' cellspacing='0' cellpadding='0'>
|
||||
<tr>
|
||||
<td width='80' valign='middle'>
|
||||
<div align='center'>
|
||||
<img src='${c.img2}/i/eff/${img}'>
|
||||
</div>
|
||||
</td>
|
||||
<td valign='middle' align='left'>
|
||||
"<b>${name}</b>"<br>Использовать сейчас?
|
||||
</td>
|
||||
</tr>
|
||||
</table>`;
|
||||
win.add(
|
||||
`iusemg${id}`,
|
||||
`Используем "${name}" `,
|
||||
txxt,
|
||||
{
|
||||
'a1': `useMagicGoGoBattle('${id}'`
|
||||
},
|
||||
2,
|
||||
1,
|
||||
'width:300px;'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 4.26
|
||||
function useMagicGoGoBattle(url, id, type_use) {
|
||||
function useMagicGoGoBattle(id) {
|
||||
top.frames['main'].useitem(id, 1, $(`#useMagicLoginBtl${id}`).val());
|
||||
}
|
||||
|
||||
@@ -1088,7 +1090,7 @@ $(document).ready(function () {
|
||||
|
||||
// 4.32
|
||||
function qn_slk() {
|
||||
if (qst_sml === '') {
|
||||
if (!qst_sml) {
|
||||
return;
|
||||
}
|
||||
$('#qsst').fadeIn('fast');
|
||||
|
||||
@@ -18,7 +18,7 @@ function bodyLoaded() {
|
||||
|
||||
while (i !== -1) {
|
||||
if (sml[i] !== undefined) {
|
||||
j += `<img style="cursor:pointer" onclick="chat.addSmile(\'${sml[i]}\')" src="https://${c.img}/i/smile/${sml[i]}.gif" width="${sml[i + 1]}" height="${sml[i + 2]}" title=":${sml[i]}:"/> `;
|
||||
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]}:"/> `;
|
||||
} else i = -4;
|
||||
i += 3;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ function startEngine() {
|
||||
});
|
||||
resizeFinish();
|
||||
//Добавляем действия
|
||||
var i = 0;
|
||||
let i = 0;
|
||||
while (i !== -1) {
|
||||
if ($(`#chcf${i}`).attr('id') != undefined) {
|
||||
$(`#chcf${i}`).change(function () {
|
||||
@@ -471,7 +471,7 @@ var win = {
|
||||
wsdr: null,
|
||||
scor: {}, //начальные координаты
|
||||
openw: function (id, title, text, date, type, style) {
|
||||
if ($(`#win_${id}`).attr('id') == undefined) {
|
||||
if (!$(`#win_${id}`).attr('id')) {
|
||||
//Создаем новое окно
|
||||
this.add(id, title, text, date, type, 1, '');
|
||||
}
|
||||
@@ -485,8 +485,8 @@ var win = {
|
||||
},
|
||||
WmoveDrag: function (e) {
|
||||
//Сохраняем начальные координаты
|
||||
var x = mousePageXY(e)['x'], y = mousePageXY(e)['y'];
|
||||
if (this.scor.x == undefined) {
|
||||
let x = mousePageXY(e)['x'], y = mousePageXY(e)['y'];
|
||||
if (!this.scor.x) {
|
||||
this.scor.x = x;
|
||||
this.scor.y = y;
|
||||
this.scor.x2 = unpx($(`#win_${this.wsdr}`).css('left'));
|
||||
@@ -516,27 +516,27 @@ var win = {
|
||||
this.scor = {};
|
||||
},
|
||||
add: function (id, title, text, date, type, style, css) {
|
||||
var nw = '';
|
||||
if ($(`#win_${id}`).attr('id') == undefined) {
|
||||
var acts = {};
|
||||
let nw = '';
|
||||
if (!$(`#win_${id}`).attr('id')) {
|
||||
const acts = {};
|
||||
|
||||
if (date.usewin != undefined) {
|
||||
if (date.usewin) {
|
||||
acts[0] = `onmouseup="${date.usewin}"`;
|
||||
} else {
|
||||
date.usewin = '';
|
||||
}
|
||||
|
||||
if (date.closewin != undefined) {
|
||||
if (date.closewin) {
|
||||
acts[9] = date.closewin;
|
||||
} else {
|
||||
date.closewin = '';
|
||||
}
|
||||
|
||||
//нижняя часть
|
||||
if (date.n != undefined) {
|
||||
if (date.n) {
|
||||
text += `<div style="margin-left:11px;">${date.n}</div>`;
|
||||
}
|
||||
var kyps = ['', ''];
|
||||
const kyps = ['', ''];
|
||||
//Вывод главных данных
|
||||
if (type == 0) {
|
||||
nw = text;
|
||||
@@ -549,11 +549,11 @@ var win = {
|
||||
kyps[0] = `${date.a1};top.win.closew(\\\'${id}\\\');${acts[9]}top.win.addaction(0,\\\'\\\');`;
|
||||
} else if (type == 3) {
|
||||
//Да \ Нет , изображения
|
||||
var stylebtn = '';
|
||||
let stylebtn = '';
|
||||
if (style > 1) {
|
||||
stylebtn = style;
|
||||
}
|
||||
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="https://${c.img}/i/b__ok${stylebtn}.gif" width="25" height="18"><br><img onClick="win.closew(\'${id}\')" class="prmimgyn" style="cursor:pointer;margin-top:2px;" src="https://${c.img}/i/b__cancel${stylebtn}.jpg" width="25" height="18"></td></tr></table>`;
|
||||
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>`;
|
||||
kyps[0] = `${date.a1};top.win.closew(\\\'${id}\\\');${acts[9]}top.win.addaction(0,\\\'\\\');`;
|
||||
} else if (type == 4) {
|
||||
//Тройной блок
|
||||
@@ -561,46 +561,46 @@ var win = {
|
||||
}
|
||||
|
||||
//Если есть вторая информация
|
||||
if (date.d != undefined) {
|
||||
if (date.d) {
|
||||
nw = nw + date.d;
|
||||
}
|
||||
|
||||
nw = `<div style="margin:2px;${css}">${nw}</div>`;
|
||||
|
||||
//Заголовок окна
|
||||
if (title != '') {
|
||||
if (date.a3 == undefined) {
|
||||
if (title) {
|
||||
if (date.a3 === undefined) {
|
||||
date.a3 = '';
|
||||
}
|
||||
if (acts[9] == undefined) {
|
||||
if (acts[9] === undefined) {
|
||||
acts[9] = '';
|
||||
}
|
||||
nw = `<div class="wi${style}s10" onselectstart="return false">
|
||||
<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>
|
||||
<td width="15" align="right"><img style="display:block" onClick="win.closew(\'${id}\');${acts[9]}${date.a3}" src="https://${c.img}/i/clear.gif" width="13" height="13"></td>
|
||||
<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>
|
||||
</tr>
|
||||
</table>
|
||||
</div>${nw}`;
|
||||
}
|
||||
|
||||
//Собираем каркас
|
||||
nw = `<table onclick="top.win.addaction(0,\'${kyps[0]}\')" border="0" cellspacing="0" cellpadding="0">
|
||||
nw = `<table onclick="top.win.addaction(0,'${kyps[0]}')" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="wi${style}s0"><div><img src="//img.new-combats.tech/1x1.gif" width="1" height="1"></div></td>
|
||||
<td class="wi${style}s0"><div><img src="${c.img2}/1x1.gif" width="1" height="1"></div></td>
|
||||
<td class="wi${style}s1"></td>
|
||||
<td class="wi${style}s2"><div><img src="//img.new-combats.tech/1x1.gif" width="1" height="1"></div></td>
|
||||
<td class="wi${style}s2"><div><img src="${c.img2}/1x1.gif" width="1" height="1"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="wi${style}s3"><img src="https://${c.img}/1x1.gif" width="5" height="1"></td>
|
||||
<td class="wi${style}s3"><img src="${c.img2}/1x1.gif" width="5" height="1"></td>
|
||||
<td class="wi${style}s7" id="win_main_${id}">${nw}</td>
|
||||
<td class="wi${style}s4"><img src="https://${c.img}/1x1.gif" width="5" height="1"></td>
|
||||
<td class="wi${style}s4"><img src="${c.img2}/1x1.gif" width="5" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="wi${style}s5"><div><img src="//img.new-combats.tech/1x1.gif" width="1" height="1"></div></td>
|
||||
<td class="wi${style}s5"><div><img src="${c.img2}/1x1.gif" width="1" height="1"></div></td>
|
||||
<td class="wi${style}s6"></td>
|
||||
<td class="wi${style}s8"><div><img src="//img.new-combats.tech/1x1.gif" width="1" height="1"></div><div id="win_a_${id}" class="wi${style}s9"></div></td>
|
||||
<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>
|
||||
</tr>
|
||||
</table>`;
|
||||
|
||||
@@ -609,13 +609,10 @@ var win = {
|
||||
|
||||
$('#windows').html($('#windows').html() + nw);
|
||||
$(`#win_${id}`).center();
|
||||
if (type == 2 || type == 3) {
|
||||
if (type == 2) {
|
||||
$(`#winyesbtnfox${id}`).focus();
|
||||
}
|
||||
if (type == 2) {
|
||||
$(`#winyesbtnfox${id}`).focus();
|
||||
}
|
||||
}
|
||||
delete nw;
|
||||
},
|
||||
addaction: function (nm, vl) {
|
||||
key_actions[nm] = vl;
|
||||
|
||||
123
js/onlineList.js
123
js/onlineList.js
@@ -34,12 +34,8 @@ const chat = {
|
||||
nrg: 0,
|
||||
nozpros: 0,
|
||||
newmsg: 0,
|
||||
sound: 0,
|
||||
translit: 0,
|
||||
filter: 0,
|
||||
globalMsg: 0,
|
||||
ignoreList: {x: 0, nms: []},
|
||||
citySys: 0,
|
||||
inObj: null,
|
||||
userSendMessage: false,
|
||||
|
||||
@@ -158,55 +154,12 @@ const chat = {
|
||||
this[method] = count;
|
||||
},
|
||||
|
||||
// кнопка лейки
|
||||
// 1
|
||||
filterMsg: function () {
|
||||
if ($('#chbtn1').attr('class') === 'db cp chatBtn1_1') {
|
||||
return this.greyButton_work('#chbtn1', 'chatBtn1_2', "filter", 1)
|
||||
}
|
||||
return this.greyButton_work('#chbtn1', 'chatBtn1_1', "filter", 0)
|
||||
},
|
||||
|
||||
// кнопка системных сообщений
|
||||
// 2
|
||||
systemMsg: function () {
|
||||
if ($('#chbtn4').attr('class') === 'db cp chatBtn4_1') {
|
||||
this.greyButton_work('#chbtn4', 'chatBtn4_2', "citySys", 1)
|
||||
$.cookie('citySys', 1);
|
||||
return
|
||||
}
|
||||
this.greyButton_work('#chbtn4', 'chatBtn4_1', "citySys", 0)
|
||||
$.cookie('citySys', 0);
|
||||
},
|
||||
|
||||
// кнопка аудиосообщений
|
||||
// 3
|
||||
soundChat: function () {
|
||||
let chbtn7 = $('#chbtn7')
|
||||
if (chbtn7.attr('class') === 'db cp chatBtn7_1') {
|
||||
return this.greyButton_work('#chbtn7', 'chatBtn7_2', "sound", 1)
|
||||
} else if (chbtn7.attr('class') === 'db cp chatBtn7_2') {
|
||||
return this.greyButton_work('#chbtn7', 'chatBtn7_3', "sound", 2)
|
||||
}
|
||||
return this.greyButton_work('#chbtn7', 'chatBtn7_1', "sound", 0)
|
||||
},
|
||||
|
||||
// кнопка транслита
|
||||
// 4
|
||||
translitChat: function () {
|
||||
if ($('#chbtn6').attr('class') === 'db cp chatBtn6_1') {
|
||||
return this.greyButton_work('#chbtn6', 'chatBtn6_2', "translit", 1)
|
||||
}
|
||||
return this.greyButton_work('#chbtn6', 'chatBtn6_1', "translit", 0)
|
||||
},
|
||||
|
||||
subValSend: '',
|
||||
subSend: async function () {
|
||||
let textmsg = $('#textmsg')
|
||||
if (textmsg.val() !== '') {
|
||||
if (textmsg.val() !== this.subValSend) {
|
||||
if (this.nozpros === 0) {
|
||||
this.trmb();
|
||||
const textmsg = $('#textmsg').val();
|
||||
if (cb_date[cb_select] === 7 && (textmsg.match(/to *\[(.*?)].*/i) || textmsg.match(/private *\[(.*?)].*/i))) {
|
||||
for (const cb in cb_date) {
|
||||
@@ -564,12 +517,7 @@ const chat = {
|
||||
if (data[2] === 'delete') this.deleteMessage(data[0]);
|
||||
else if (data['d'] > 0) this.deleteMessage(data['d']);
|
||||
else if (data['s'] > 0) this.deleteMessage(data['s']);
|
||||
else if (
|
||||
data[0] !== undefined &&
|
||||
(top.document.getElementById(`msg_${data[0]}`) === undefined ||
|
||||
top.document.getElementById(`msg_${data[0]}`) === null)
|
||||
// Без этой проверки на NULL не показывались сообщения!
|
||||
) {
|
||||
else if (data[0] !== undefined && !top.document.getElementById(`msg_${data[0]}`)) {
|
||||
let msg = '';
|
||||
if (parseInt(data[0]) !== 0) {
|
||||
if (c.admin > 0 && parseInt(data[12]) === 1) {
|
||||
@@ -595,7 +543,7 @@ const chat = {
|
||||
receiverList = data[4].split(',');
|
||||
|
||||
while (i !== -1) {
|
||||
if (receiverList[i] !== undefined) {
|
||||
if (receiverList[i]) {
|
||||
vl = this.trim(receiverList[i]);
|
||||
if (vl.toLowerCase() === c.login.toLowerCase()) {
|
||||
forYou++;
|
||||
@@ -665,7 +613,7 @@ const chat = {
|
||||
data[5] = data[5].replaceAll("[s3;]", '<');
|
||||
data[5] = data[5].replaceAll("[s4;]", '>');
|
||||
|
||||
if ($.cookie('chatCfg2') !== '0') {
|
||||
if ($.cookie('chatCfg2')) {
|
||||
data[5] = chat.testSmile(data[5]);
|
||||
}
|
||||
|
||||
@@ -761,12 +709,8 @@ const chat = {
|
||||
|
||||
msg = `<span class="m0c1" id="msg_${data[0]}">${msg}<br></span>`;
|
||||
|
||||
if (forYou > 0 && this.sound > 0 && this.trim(data[3].toLowerCase()) !== c.login.toLowerCase()) {
|
||||
this.sendSound(1);
|
||||
}
|
||||
|
||||
if (msg_see === 1) {
|
||||
if (this.trim(data[3].toLowerCase()) === c.login.toLowerCase() || forYou === 1 || this.filter === 0) {
|
||||
if (this.trim(data[3].toLowerCase()) === c.login.toLowerCase() || forYou === 1) {
|
||||
if (data[9] > 0) this.sendSound(data[9]);
|
||||
if (data[15]) {
|
||||
this.feerverk(data[15]);
|
||||
@@ -853,11 +797,6 @@ const chat = {
|
||||
}
|
||||
return txt;
|
||||
},
|
||||
trmb: function () {
|
||||
if (this.translit === 1) {
|
||||
$('#textmsg').val(this.convert2($('#textmsg').val()));
|
||||
}
|
||||
},
|
||||
|
||||
regexpURL_true(str) {
|
||||
let key;
|
||||
@@ -903,61 +842,7 @@ const chat = {
|
||||
finallyStr = finallyStr.replace(regexpForbiddenWords, () => "")
|
||||
return finallyStr
|
||||
},
|
||||
convert2: function (txt) {
|
||||
let trn;
|
||||
trn = txt.split(' ');
|
||||
for (let i = 0; i < trn.length; i++) {
|
||||
if (trn[i].indexOf("https://") < 0 && trn[i].indexOf('@') < 0 && trn[i].indexOf("www.") < 0 && !(trn[i].charAt(0) === ":" && trn[i].charAt(trn[i].length - 1) === ":")) {
|
||||
if ((i < trn.length - 1) && (trn[i] === "to" || trn[i] === "private") && (trn[i + 1].charAt(0) === "[")) {
|
||||
while ((i < trn.length - 1) && (trn[i].charAt(trn[i].length - 1) !== "]")) i++;
|
||||
} else {
|
||||
trn[i] = this.convert(trn[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return trn.join(' ');
|
||||
},
|
||||
map_en: Array('s`h', 'S`h', 'S`H', 's`Х', 'sh`', 'Sh`', 'SH`', "'o", 'yo', "'O", 'Yo', 'YO', 'zh', 'w', 'Zh', 'ZH', 'W', 'ch', 'Ch', 'CH', 'sh', 'Sh', 'SH', 'e`', 'E`', "'u", 'yu', "'U", 'Yu', "YU", "'a", 'ya', "'A", 'Ya', 'YA', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D', 'e', 'E', 'z', 'Z', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U', 'f', 'F', 'h', 'H', 'c', 'C', '`', 'y', 'Y', "'"),
|
||||
map_ru: Array('сх', 'Сх', 'СХ', 'сХ', 'щ', 'Щ', 'Щ', 'ё', 'ё', 'Ё', 'Ё', 'Ё', 'ж', 'ж', 'Ж', 'Ж', 'Ж', 'ч', 'Ч', 'Ч', 'ш', 'Ш', 'Ш', 'э', 'Э', 'ю', 'ю', 'Ю', 'Ю', 'Ю', 'я', 'я', 'Я', 'Я', 'Я', 'а', 'А', 'б', 'Б', 'в', 'В', 'г', 'Г', 'д', 'Д', 'е', 'Е', 'з', 'З', 'и', 'И', 'й', 'Й', 'к', 'К', 'л', 'Л', 'м', 'М', 'н', 'Н', 'о', 'О', 'п', 'П', 'р', 'Р', 'с', 'С', 'т', 'Т', 'у', 'У', 'ф', 'Ф', 'х', 'Х', 'ц', 'Ц', 'ъ', 'ы', 'Ы', 'ь'),
|
||||
addSm: function (i) {
|
||||
$('#textmsg').focus();
|
||||
top.document.textmsg.value += ` :${i}: `;
|
||||
},
|
||||
|
||||
convert_work: function (id) {
|
||||
newstr = str.match(id)[0];
|
||||
str = str.replace(str.match(id)[0], '');
|
||||
},
|
||||
convert: function (str) {
|
||||
const p1 = new RegExp("private\\s*\\[(.*?)\\]", "");
|
||||
const t1 = new RegExp("to\\s*\\[(.*?)\\]", "");
|
||||
let newstr = '';
|
||||
|
||||
if (str.match(p1) != null) this.convert_work(p1)
|
||||
else if (str.match(t1) != null) this.convert_work(t1)
|
||||
|
||||
for (let i = 0; i < this.map_en.length; ++i)
|
||||
while (str.indexOf(this.map_en[i]) >= 0) str = str.replace(this.map_en[i], this.map_ru[i]);
|
||||
newstr += str;
|
||||
return newstr;
|
||||
},
|
||||
sendSound: function (s) {
|
||||
let svolm = 100;
|
||||
if (this.sound === 0) svolm = 0
|
||||
else if (this.sound === 1) svolm = 25;
|
||||
else if (this.sound === 2) svolm = 100;
|
||||
|
||||
const isInternetExplorer = navigator.appName.indexOf("Microsoft") !== -1;
|
||||
|
||||
if (isInternetExplorer && window.document["Sound"] && typeof window.document["Sound"].SetVariable !== "undefined") {
|
||||
window.document["Sound"].SetVariable("Volume", svolm);
|
||||
window.document["Sound"].SetVariable("Sndplay", s);
|
||||
} else if (document.getElementById('Sound2') && typeof document.getElementById('Sound2').SetVariable !== "undefined") {
|
||||
document.getElementById('Sound2').SetVariable("Volume", svolm);
|
||||
document.getElementById('Sound2').SetVariable("Sndplay", s);
|
||||
}
|
||||
|
||||
},
|
||||
trim: function (s) {
|
||||
return this.rtrim(this.ltrim(s));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user