Рефакторинг яваскриптов. Уборка jQuery.

This commit is contained in:
Ivor Barhansky 2024-05-10 16:54:18 +03:00
parent f3d475a0b8
commit a1408072d6
2 changed files with 13 additions and 16 deletions

View File

@ -235,18 +235,18 @@ if (!$isBattle) {
echo <<<HTML echo <<<HTML
<script> <script>
eatk = $atk1; eatk = $atk1;
$('#nabito').html('$nabito'); getElementByIdInMainFrame('nabito').innerHTML = `$nabito`;
$('#expmaybe').html('$expmaybe'); getElementByIdInMainFrame('expmaybe').innerHTML = `$expmaybe`;
$('#timer_out').html('$tmr'); getElementByIdInMainFrame('timer_out').innerHTML = `$tmr`;
$('#pers_magic').html('$persMagic'); getElementByIdInMainFrame('pers_magic').innerHTML = `$persMagic`;
$('#priems').html(`$mypriems`); getElementByIdInMainFrame('priems').innerHTML = `$mypriems`;
g_iCount = 30; g_iCount = 30;
noconnect = 15; noconnect = 15;
connect = 1; connect = 1;
$('#go_btn').show(); getElementByIdInMainFrame('go_btn').style.display = '';
$('#reflesh_btn').show(); getElementByIdInMainFrame('reflesh_btn').style.display = '';
za = '$za'; genZoneAtack(); za = $za; genZoneAtack();
zb = '$zb'; genZoneBlock(); zb = $zb; genZoneBlock();
refleshPoints(); refleshPoints();
tactic(1,'$tactic1'); tactic(1,'$tactic1');
tactic(2,'$tactic2'); tactic(2,'$tactic2');
@ -260,9 +260,7 @@ if (!$isBattle) {
smena_alls = '0'; smena_alls = '0';
ggcode='$ggcode'; ggcode='$ggcode';
$js $js
</script> </script>
HTML; HTML;
@ -273,5 +271,4 @@ HTML;
unset($atk1); unset($atk1);
} }
echo '<script>ggcode="' . PassGen::new() . '";</script>'; echo '<script>ggcode="' . PassGen::new() . '";</script>';
} }

View File

@ -188,10 +188,10 @@ $allprice = Battle::getType($allprice, $thisBattle['smert'] == 1);
<script src="//img.new-combats.tech/js/jx/jquery.form.js" type="text/javascript"></script> <script src="//img.new-combats.tech/js/jx/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/jquery.cookie.js"></script> <script type="text/javascript" src="/js/jquery.cookie.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var login = '<?= $u->info['login']; ?>'; let login = '<?= $u->info['login']; ?>';
var za = <?= (int)$u->stats['zona']; ?>; let za = <?= (int)$u->stats['zona']; ?>;
var zb = <?= (int)$u->stats['zonb']; ?>; let zb = <?= (int)$u->stats['zonb']; ?>;
var level = <?= $u->info['level']; ?>; let level = <?= $u->info['level']; ?>;
function replaceAll(find, replace, str) { function replaceAll(find, replace, str) {
return str.replace(new RegExp(find, 'g'), replace); return str.replace(new RegExp(find, 'g'), replace);