Ремонт чата и рефакторинг js.

This commit is contained in:
Ivor Barhansky 2023-06-11 14:50:52 +03:00
parent a073a02176
commit 2440ad3cc1
8 changed files with 1864 additions and 1765 deletions

View File

@ -25,7 +25,6 @@ function er($e)
exit($err); exit($err);
} }
Config::init();
Database::init(); Database::init();
define('IP', UserIp::get()); define('IP', UserIp::get());
@ -72,7 +71,8 @@ $u->stats = $u->getStats($u->info['id'], 0);
<link rel="stylesheet" href="css/windows.css"/> <link rel="stylesheet" href="css/windows.css"/>
<link rel="stylesheet" href="css/hack.css"/> <link rel="stylesheet" href="css/hack.css"/>
<script> <script>
const des = 1; window.des = 1;
const c = { const c = {
noEr: 0, noEr: 0,
noErTmr: 0, noErTmr: 0,
@ -95,22 +95,22 @@ $u->stats = $u->getStats($u->info['id'], 0);
money: <?= $u->info['money'] ?> money: <?= $u->info['money'] ?>
}, },
sd4key = "<?= $u->info['nextAct'] ?>", sd4key = "<?= $u->info['nextAct'] ?>",
lafstReg = {}, lafstReg = {};
enterUse = 0;
// Проверка на совпедение города. // Проверка на совпедение города.
function ctest(city) { function ctest(city) {
if (city != c['city']) { if (city !== c['city']) {
top.location = '/bk'; top.location = '/bk';
} }
} }
let enterUse = 0;
function testKey(event) { function testKey(event) {
if (event.keyCode == 10 || event.keyCode == 13) { if (event.keyCode === 10 || event.keyCode === 13) {
if (top.enterUse == 0) { if (enterUse === 0) {
chat.subSend(); chat.subSend();
top.enterUse = 1; enterUse = 1;
setTimeout('top.enterUse = 0', 1000); setTimeout('enterUse = 0', 1000);
} }
} }
} }
@ -123,10 +123,12 @@ $u->stats = $u->getStats($u->info['id'], 0);
$(window).error(function () { $(window).error(function () {
return true; return true;
}); });
let iusrno = {};
//Есть зависимость в interface.js - infoMenu()!
window.iusrno = {};
function ignoreUser(u) { function ignoreUser(u) {
if (iusrno[u] == undefined || iusrno[u] == 0) { if (iusrno[u] === undefined || iusrno[u] === 0) {
$('#main').attr({'src': 'main.php?friends=1&ignore=' + u + ''}); $('#main').attr({'src': 'main.php?friends=1&ignore=' + u + ''});
} else { } else {
$('#main').attr({'src': 'main.php?friends=1&ignore=' + u + ''}); $('#main').attr({'src': 'main.php?friends=1&ignore=' + u + ''});
@ -140,7 +142,6 @@ $u->stats = $u->getStats($u->info['id'], 0);
<script type="text/javascript" src="js/gameEngine.js?<?= time() ?>"></script> <script type="text/javascript" src="js/gameEngine.js?<?= time() ?>"></script>
<script type="text/javascript" src="js/interface.js"></script> <script type="text/javascript" src="js/interface.js"></script>
<script type="text/javascript" src="js/dataCenter.js"></script>
<script type="text/javascript" src="js/onlineList.js"></script> <script type="text/javascript" src="js/onlineList.js"></script>
<script type="text/javascript" src="js/hpregen.js"></script> <script type="text/javascript" src="js/hpregen.js"></script>
@ -493,7 +494,6 @@ $u->stats = $u->getStats($u->info['id'], 0);
.proza { .proza {
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87); /* IE 5.5+*/ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87); /* IE 5.5+*/
-moz-opacity: 0.87; /* Mozilla 1.6 и ниже */ -moz-opacity: 0.87; /* Mozilla 1.6 и ниже */
-khtml-opacity: 0.87; /* Konqueror 3.1, Safari 1.1 */
opacity: 0.87; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9+ */ opacity: 0.87; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9+ */
} }
@ -562,21 +562,22 @@ $u->stats = $u->getStats($u->info['id'], 0);
</head> </head>
<body> <body>
<div style="display:none" class="qel0" id="qel0"></div> <div style="display:none" class="qel0" id="qel0"></div>
<noscript>В вашем браузере отсутствует поддержка <strong>javascript<strong></noscript> <noscript>В вашем браузере отсутствует поддержка <strong>javascript</strong></noscript>
<script> <script>
window.onLoad = function () { window.onLoad = function () {
bodyLoaded(); bodyLoaded();
chat.sendMsg(["new", "<?=time()?>", "1", "", "<?=$u->info['login']?>", "global:<b style='background-color:#ffcccc'>&nbsp; Приветствуем в игре, не забываем поздороваться и прочесть новости проекта! <a href='/n' target='_blank'>читать новости</a> &nbsp;</b>", "red", "1", "1", "0"]); chat.sendMsg(["new", "<?=time()?>", "1", "", "<?=$u->info['login']?>", "global:<b style='background-color:#ffcccc'>&nbsp; Приветствуем в игре, не забываем поздороваться и прочесть новости проекта! <a href='/n' target='_blank'>читать новости</a> &nbsp;</b>", "red", "1", "1", "0"]);
} }
if (window.top != window.self) { if (window.top !== window.self) {
document.write = ""; document.write = "";
window.top.location = window.self.location; window.top.location = window.self.location;
setTimeout(function () { setTimeout(function () {
document.body.innerHTML = 'Ошибка доступа.'; document.body.innerHTML = 'Ошибка доступа.';
}, 500); }, 500);
window.self.onload = function (evt) { window.self.onload = function () {
document.body.innerHTML = 'Ошибка доступа.'; document.body.innerHTML = 'Ошибка доступа.';
}; };
} }
@ -592,7 +593,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
$(window).resize(); $(window).resize();
} }
var lasts = [-1, -1]; const lasts = [-1, -1];
function myexpLineTop27(e1, e2) { function myexpLineTop27(e1, e2) {
$('#exp23mkrtkm').attr('title', "Опыт персонажа" + "\n" + e1 + " / " + e2); $('#exp23mkrtkm').attr('title', "Опыт персонажа" + "\n" + e1 + " / " + e2);
@ -603,7 +604,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
if (lasts[1] < e2) { if (lasts[1] < e2) {
$('#myexplin233').css('width', '1%'); $('#myexplin233').css('width', '1%');
} }
if (lasts[0] != e1 || lasts[1] != e2) { if (lasts[0] !== e1 || lasts[1] !== e2) {
$('#myexplin233').animate({'width': Math.ceil(e1 / e2 * 100) + '%'}, 3000); $('#myexplin233').animate({'width': Math.ceil(e1 / e2 * 100) + '%'}, 3000);
} }
} }
@ -614,7 +615,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
let smlk1 = 0; let smlk1 = 0;
function smiles1load() { function smiles1load() {
if (smlk1 == 0) { if (smlk1 === 0) {
$('#btnsmlrz').html('<small>&nbsp; Общие смайлики &nbsp;</small>'); $('#btnsmlrz').html('<small>&nbsp; Общие смайлики &nbsp;</small>');
smlk1 = 1; smlk1 = 1;
$('#smilesDiv').hide(); $('#smilesDiv').hide();
@ -802,7 +803,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
<tr> <tr>
<td id="chat_block" style="position:relative;border-top:1px solid #808080; vertical-align: top;"> <td id="chat_block" style="position:relative;border-top:1px solid #808080; vertical-align: top;">
<!-- display:block;--> <!-- display:block;-->
<div id="mini_qsst" onClick="top.qn_slk()" style="cursor:pointer"></div> <div id="mini_qsst" onClick='qn_slk()' style="cursor:pointer"></div>
<div id="onbon"></div> <div id="onbon"></div>
<div id="chat_menus" unselectable="on" onselectstart="return false;" <div id="chat_menus" unselectable="on" onselectstart="return false;"
style="display:block;position:absolute; right:0; top:3px; padding-right:20px; height:18px; text-align:right; white-space:nowrap;"> style="display:block;position:absolute; right:0; top:3px; padding-right:20px; height:18px; text-align:right; white-space:nowrap;">
@ -1110,7 +1111,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
return { return {
date: divFullDateTime(objDate), date: divFullDateTime(objDate),
time: mskTime, time: mskTime,
redDay: todayDay == 5 || todayDay == 6 || todayDay == 0 redDay: todayDay === 5 || todayDay === 6 || todayDay === 0
} }
} }
} }
@ -1169,7 +1170,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
document.getElementById("dateRed").style.color = redDay ? "red" : "" document.getElementById("dateRed").style.color = redDay ? "red" : ""
} }
$button.addEventListener("mouseover", function (event) { $button.addEventListener("mouseover", function () {
timeoutClear = setTimeout(() => { timeoutClear = setTimeout(() => {
@ -1186,7 +1187,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
}, 550) }, 550)
}) })
$button.addEventListener("mouseout", function (event) { $button.addEventListener("mouseout", function () {
$div.hidden = true $div.hidden = true
clearInterval(intervalClear) clearInterval(intervalClear)
clearTimeout(timeoutClear) clearTimeout(timeoutClear)

View File

@ -418,7 +418,7 @@ $dost = [
--> -->
</style> </style>
<script> <script>
var c = { let c = {
url: '<?=$c['host']?>', url: '<?=$c['host']?>',
img: '<?=$c['img']?>', img: '<?=$c['img']?>',
uid: <?=(0 + $f->user['id'])?>, uid: <?=(0 + $f->user['id'])?>,
@ -437,12 +437,12 @@ $dost = [
}, sd4key = "0f27a8a6a79921703aee0ba6ff02e4c2", lafstReg = {}, enterUse = 0; }, sd4key = "0f27a8a6a79921703aee0ba6ff02e4c2", lafstReg = {}, enterUse = 0;
function ctest(city) { function ctest(city) {
if (city != c['city']) { if (city !== c['city']) {
top.location = 'club'; top.location = 'club';
} }
} }
var key_actions = {}; let key_actions = {};
<!-- <!--
function MM_jumpMenu(targ, selObj, restore) { //v3.0 function MM_jumpMenu(targ, selObj, restore) { //v3.0
eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'"); eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");

View File

File diff suppressed because it is too large Load Diff

View File

@ -1,97 +1,100 @@
var timerHP = 0; let timerHP = 0;
var lasttimeHP = 0; let lasttimeHP = 0;
let tt1 = '';
function startHpRegen(f, id, hpnow, hpmax, mpnow, mpmax, sec_h, sec_m, speed_hp, speed_mp, news, tmr) { function startHpRegen(f, id, hpnow, hpmax, mpnow, mpmax, sec_h, sec_m, speed_hp, speed_mp, news, tmr) {
var d = document; let d = document;
if (news != 0) { if (news !== 0) {
lasttimeHP++; lasttimeHP++;
tmr = lasttimeHP; tmr = lasttimeHP;
timerHP = tmr; timerHP = tmr;
} }
if (news === 1 && tt1 !== undefined) {
if (news == 1 && tt1 != undefined) {
clearTimeout(tt1); clearTimeout(tt1);
} }
if (lasttimeHP != tmr) { if (lasttimeHP !== tmr) {
return;
} else { }
if (f == 'top') d = top.document; if (f === 'top') d = top.document;
else if (f == 'main') d = top.frames['main'].document; else if (f === 'main') d = top.frames['main'].document;
if (d !== undefined && lafstReg[id]) {
if (d != undefined && lafstReg[id] != undefined && lafstReg[id] != 0) {
//здоровье //здоровье
var h1 = d.getElementById(`vhp${id}`); const h1 = d.getElementById(`vhp${id}`);
var m1 = d.getElementById(`vmp${id}`); const m1 = d.getElementById(`vmp${id}`);
var widb1 = h1 ? parseInt(h1.style.width) : 0; const widb1 = h1 ? parseInt(h1.style.width) : 0;
if (h1) {
const h2 = d.getElementById(`lhp${id}`);
if (h2) {
if (h1 != undefined) {
var h2 = d.getElementById(`lhp${id}`);
if (h2 != undefined) {
//Восстанавливаем НР //Восстанавливаем НР
var newHP = ''; let newHP = sec_h * speed_hp;
newHP = sec_h * speed_hp;
function newHP_work (ifTrue) { function newHP_work(ifTrue) {
if (ifTrue) hpnow += newHP; if (ifTrue) hpnow += newHP;
if (hpnow < 0) hpnow = 0; if (hpnow < 0) hpnow = 0;
if (hpnow > hpmax) hpnow = hpmax; if (hpnow > hpmax) hpnow = hpmax;
var formuleNewHP = Math.floor(hpnow / hpmax * widb1) const formuleNewHP = Math.floor(hpnow / hpmax * widb1);
h1.innerHTML = ' ' + Math.floor(hpnow) + '/' + hpmax + ''; h1.innerHTML = ' ' + Math.floor(hpnow) + '/' + hpmax + '';
switch (true) { switch (true) {
case (formuleNewHP < 1): h2.className = 'hp_none'; case (formuleNewHP < 1):
case (formuleNewHP > 0): h2.className = 'hp_1'; h2.className = 'hp_none';
case (formuleNewHP > 32): h2.className = 'hp_2'; case (formuleNewHP > 0):
case (formuleNewHP > 65): h2.className = 'hp_3'; h2.className = 'hp_1';
case (formuleNewHP > 32):
h2.className = 'hp_2';
case (formuleNewHP > 65):
h2.className = 'hp_3';
case (formuleNewHP <= widb1): case (formuleNewHP <= widb1):
h2.style.width = `${formuleNewHP}px`; h2.style.width = `${formuleNewHP}px`;
break break
} }
} }
if (newHP != 0) newHP_work(true) if (newHP !== 0) newHP_work(true)
else newHP_work(false) else newHP_work(false)
} }
} }
//мана //мана
if (m1 != undefined) { if (m1) {
var m2 = d.getElementById(`lmp${id}`); const m2 = d.getElementById(`lmp${id}`);
if (m2 != undefined) { if (m2) {
//Восстанавливаем MP //Восстанавливаем MP
var newMP = ''; let newMP = sec_m * speed_mp;
newMP = sec_m * speed_mp;
function newMP_work (ifTrue) { function newMP_work(ifTrue) {
if (ifTrue) mpnow += newMP; if (ifTrue) mpnow += newMP;
if (mpnow < 0) mpnow = 0; if (mpnow < 0) mpnow = 0;
if (mpnow > mpmax) mpnow = mpmax; if (mpnow > mpmax) mpnow = mpmax;
var formuleNewMP = Math.floor(mpnow / mpmax * widb1) const formuleNewMP = Math.floor(mpnow / mpmax * widb1);
m1.innerHTML = ' ' + Math.floor(mpnow) + '/' + mpmax + ''; m1.innerHTML = ' ' + Math.floor(mpnow) + '/' + mpmax + '';
switch (true) { switch (true) {
case (formuleNewMP < 1): m2.className = 'hp_none'; case (formuleNewMP < 1):
case (formuleNewMP != 1): m2.className = 'hp_mp'; m2.className = 'hp_none';
case (formuleNewMP !== 1):
m2.className = 'hp_mp';
case (formuleNewMP <= widb1): case (formuleNewMP <= widb1):
m2.style.width = `${formuleNewMP}px`; m2.style.width = `${formuleNewMP}px`;
break break
} }
} }
if (newMP != 0) newMP_work(true) if (newMP !== 0) newMP_work(true)
else newMP_work(false) else newMP_work(false)
} }
} }
lafstReg[id] = 0 + lafstReg[id] + 1; lafstReg[id] = 0 + lafstReg[id] + 1;
var tt1 = setTimeout(`top.startHpRegen("${f}",${id},${hpnow},${hpmax},${mpnow},${mpmax},1,1,${speed_hp},${speed_mp},0,${timerHP});`, 1000); tt1 = setTimeout(`top.startHpRegen("${f}", ${id}, ${hpnow}, ${hpmax}, ${mpnow}, ${mpmax}, 1, 1, ${speed_hp}, ${speed_mp}, 0, ${timerHP});`, 1000);
} }
if (lafstReg[id] == 0 || lafstReg[id] == undefined) { if (!lafstReg[id]) {
lafstReg[id] = 0 + lafstReg[id] + 1; lafstReg[id] = 0 + lafstReg[id] + 1;
var tt1 = setTimeout(`top.startHpRegen("${f}",${id},${hpnow},${hpmax},${mpnow},${mpmax},1,1,${speed_hp},${speed_mp},0,${timerHP});`, 1000); tt1 = setTimeout(`top.startHpRegen("${f}", ${id}, ${hpnow}, ${hpmax}, ${mpnow}, ${mpmax}, 1, 1, ${speed_hp}, ${speed_mp}, 0, ${timerHP});`, 1000);
}
} }
} }

View File

@ -12,23 +12,22 @@ $(document).ready(function () {
}); });
function bodyLoaded() { function bodyLoaded() {
top.recounter();
//генерируем смайлики //генерируем смайлики
let i = 0, let i = 0,
j = ''; j = '';
while (i != -1) {
if (top.sml[i] != undefined) { while (i !== -1) {
j += `<img style="cursor:pointer" onclick="chat.addSmile(\'${top.sml[i]}\')" src="https://${c['img']}/i/smile/${top.sml[i]}.gif" width="${top.sml[i + 1]}" height="${top.sml[i + 2]}" title=":${top.sml[i]}:"/> `; 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]}:"/> `;
} else i = -4; } else i = -4;
i += 3; i += 3;
} }
$('#smilesDiv').html(j); $('#smilesDiv').html(j);
delete i, j;
} }
function startEngine() { function startEngine() {
//стандартные настройки //стандартные настройки
if ($.cookie('chatCfg0') == undefined) { if ($.cookie('chatCfg0') === undefined) {
$.cookie('chatCfg0', 2, {expires: 320}); $.cookie('chatCfg0', 2, {expires: 320});
$.cookie('chatCfg1', 'Black', {expires: 320}); $.cookie('chatCfg1', 'Black', {expires: 320});
} }
@ -55,7 +54,7 @@ function startEngine() {
resizeFinish(); resizeFinish();
//Добавляем действия //Добавляем действия
var i = 0; var i = 0;
while (i != -1) { while (i !== -1) {
if ($(`#chcf${i}`).attr('id') != undefined) { if ($(`#chcf${i}`).attr('id') != undefined) {
$(`#chcf${i}`).change(function () { $(`#chcf${i}`).change(function () {
saveChatConfig(); saveChatConfig();
@ -309,19 +308,19 @@ function MBcMenu() {
function getNameBrouser() { function getNameBrouser() {
var ua = navigator.userAgent.toLowerCase(); var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1) { if (ua.indexOf("msie") !== -1 && ua.indexOf("opera") === -1 && ua.indexOf("webtv") === -1) {
return "msie" return "msie"
} }
if (ua.indexOf("opera") != -1) { if (ua.indexOf("opera") !== -1) {
return "opera" return "opera"
} }
if (ua.indexOf("gecko") != -1) { if (ua.indexOf("gecko") !== -1) {
return "gecko"; return "gecko";
} }
if (ua.indexOf("safari") != -1) { if (ua.indexOf("safari") !== -1) {
return "safari"; return "safari";
} }
if (ua.indexOf("konqueror") != -1) { if (ua.indexOf("konqueror") !== -1) {
return "konqueror"; return "konqueror";
} }
return "unknown"; return "unknown";
@ -345,35 +344,35 @@ function mousePageXY(e) {
function infoMenu(u, e, f) { function infoMenu(u, e, f) {
if (!e) e = window.event; if (!e) e = window.event;
var d = top.document.getElementById('persmenu'); const d = top.document.getElementById('persmenu');
var d2 = top.document.getElementById('upbox'); const d2 = top.document.getElementById('upbox');
if (d != undefined) { if (d) {
var dptop = -5; let dptop = -5;
var dpleft = -5; const dpleft = -5;
if (f == 'main') { if (f === 'main') {
dptop += 30; dptop += 30;
} }
var dp = top; const dp = top;
var s = d.style; const s = d.style;
d2.style.display = ''; d2.style.display = '';
d.className = 'topusermenu'; d.className = 'topusermenu';
s.display = ''; s.display = '';
var obtop = mousePageXY(e)['y'] + dptop; let obtop = mousePageXY(e)['y'] + dptop;
if (getNameBrouser() == 'msie') { if (getNameBrouser() === 'msie') {
obtop -= dp.document.body.scrollTop; obtop -= dp.document.body.scrollTop;
} else { } else {
obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop; obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop;
} }
var obleft = mousePageXY(e)['x'] + dpleft; let obleft = mousePageXY(e)['x'] + dpleft;
d.style.top = `${obtop}px`; d.style.top = `${obtop}px`;
d.style.left = `${obleft}px`; d.style.left = `${obleft}px`;
var hmmmt = `<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();"> 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}\',\'to\'); infoMenuClose(4);" class="topusermenuBtn">TO</div>
<div onClick="top.chat.addto(\'${u}\',\'private\'); infoMenuClose(4);" class="topusermenuBtn">PRIVATE</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="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>`; <div onClick="top.infoMenuClose(4);" class="topusermenuBtn"><div id="d_clip_button">COPY</div></div>`;
if (top.iusrno[u] == undefined || top.iusrno[u] == 0) { if (!top.iusrno[u]) {
hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">IGNORE</div>`; hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">IGNORE</div>`;
} else { } else {
hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">- IGNORE</div>`; hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">- IGNORE</div>`;
@ -381,12 +380,12 @@ function infoMenu(u, e, f) {
hmmmt = `${hmmmt}</DIV>`; hmmmt = `${hmmmt}</DIV>`;
d.innerHTML = hmmmt; d.innerHTML = hmmmt;
var bdx = document.body.clientWidth; const bdx = document.body.clientWidth;
var bdy = document.body.clientHeight; const bdy = document.body.clientHeight;
var obx = d.clientWidth; const obx = d.clientWidth;
var oby = d.clientHeight; const oby = d.clientHeight;
var ots = bdy - obtop - oby; const ots = bdy - obtop - oby;
var ols = bdx - obleft - obx; const ols = bdx - obleft - obx;
if (ots < 10) { if (ots < 10) {
obtop = bdy - 10 - oby; obtop = bdy - 10 - oby;
d.style.top = `${obtop}px`; d.style.top = `${obtop}px`;
@ -395,24 +394,18 @@ function infoMenu(u, e, f) {
obleft = bdx - 10 - obx; obleft = bdx - 10 - obx;
d.style.left = `${obleft}px`; d.style.left = `${obleft}px`;
} }
$("#d_clip_button").zclip({
path: "js/ZeroClipboard.swf",
copy: function () {
return u;
}
});
} }
} }
function infoMenuClose(id) { function infoMenuClose(id) {
var d = top.document.getElementById('persmenu'); const d = top.document.getElementById('persmenu');
var d2 = top.document.getElementById('upbox'); const d2 = top.document.getElementById('upbox');
if (d != undefined) { if (d) {
if (id > 0 && id < 5) { if (id > 0 && id < 5) {
d.className = `topusermenu inviseMen${id}`; d.className = `topusermenu inviseMen${id}`;
T_mn = setTimeout(`top.infoMenuClose(${(id + 1)})`, 30); T_mn = setTimeout(`top.infoMenuClose(${(id + 1)})`, 30);
} else if (id == 5) { } else if (id === 5) {
var s = d.style; const s = d.style;
s.display = 'none'; s.display = 'none';
d2.style.display = 'none'; d2.style.display = 'none';
d.innerHTML = ''; d.innerHTML = '';
@ -425,29 +418,29 @@ function infoMenuClose(id) {
function infoMenuMy(u, e, f, dtm) { function infoMenuMy(u, e, f, dtm) {
if (!e) e = window.event; if (!e) e = window.event;
var d = top.document.getElementById('persmenu'); const d = top.document.getElementById('persmenu');
var d2 = top.document.getElementById('upbox'); const d2 = top.document.getElementById('upbox');
if (d != undefined) { if (d) {
var dptop = -5; const dptop = -5;
var dpleft = -5; const dpleft = -5;
var dp = top; const dp = top;
var s = d.style; const s = d.style;
d2.style.display = ''; d2.style.display = '';
d.className = 'topusermenu'; d.className = 'topusermenu';
s.display = ''; s.display = '';
var obtop = mousePageXY(e)['y'] + dptop; let obtop = mousePageXY(e)['y'] + dptop;
if (getNameBrouser() == 'msie') { if (getNameBrouser() === 'msie') {
obtop -= dp.document.body.scrollTop; obtop -= dp.document.body.scrollTop;
} else { } else {
obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop; obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop;
} }
var obleft = mousePageXY(e)['x'] + dpleft; let obleft = mousePageXY(e)['x'] + dpleft;
d.style.top = `${obtop}px`; d.style.top = `${obtop}px`;
d.style.left = `${obleft}px`; d.style.left = `${obleft}px`;
var hmmmt = '<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();">'; let hmmmt = '<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();">';
var i = 0; let i = 0;
while (i != -1) { while (i !== -1) {
if (dtm[i] != undefined) { if (dtm[i] !== undefined && dtm[i] !== null) {
hmmmt += `<div onClick="${dtm[i][0]} infoMenuClose(4);" class="topusermenuBtn">${dtm[i][1]}</div>`; hmmmt += `<div onClick="${dtm[i][0]} infoMenuClose(4);" class="topusermenuBtn">${dtm[i][1]}</div>`;
i++; i++;
} else i = -1; } else i = -1;
@ -455,12 +448,12 @@ function infoMenuMy(u, e, f, dtm) {
hmmmt = `${hmmmt}</DIV>`; hmmmt = `${hmmmt}</DIV>`;
d.innerHTML = hmmmt; d.innerHTML = hmmmt;
var bdx = document.body.clientWidth; const bdx = document.body.clientWidth;
var bdy = document.body.clientHeight; const bdy = document.body.clientHeight;
var obx = d.clientWidth; const obx = d.clientWidth;
var oby = d.clientHeight; const oby = d.clientHeight;
var ots = bdy - obtop - oby; const ots = bdy - obtop - oby;
var ols = bdx - obleft - obx; const ols = bdx - obleft - obx;
if (ots < 10) { if (ots < 10) {
obtop = bdy - 10 - oby; obtop = bdy - 10 - oby;
d.style.top = `${obtop}px`; d.style.top = `${obtop}px`;
@ -469,12 +462,6 @@ function infoMenuMy(u, e, f, dtm) {
obleft = bdx - 10 - obx; obleft = bdx - 10 - obx;
d.style.left = `${obleft}px`; d.style.left = `${obleft}px`;
} }
$("#d_clip_button").zclip({
path: "js/ZeroClipboard.swf",
copy: function () {
return u;
}
});
} }
} }
@ -631,9 +618,9 @@ var win = {
delete nw; delete nw;
}, },
addaction: function (nm, vl) { addaction: function (nm, vl) {
top.key_actions[nm] = vl; key_actions[nm] = vl;
if (nm != 2) { if (nm != 2) {
top.key_actions[2] = 1; key_actions[2] = 1;
} }
}, },
closew: function (id) { closew: function (id) {

File diff suppressed because it is too large Load Diff

BIN
tab.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B