From 10037184268d297a1ba8a1db5964426d727b8b86 Mon Sep 17 00:00:00 2001 From: shijian <2954700422@qq.com> Date: Fri, 21 Jul 2023 20:59:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8Dfor=20in=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E4=BC=9A=E5=87=BA=E7=8E=B0game.js=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E6=95=B0=E7=BB=84=E5=8E=9F=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=822.=E5=A2=9E=E5=8A=A0Array.prototype.?= =?UTF-8?q?includes=E7=9A=84polyfill=E3=80=823.=E4=BF=AE=E5=A4=8Dlayout.cs?= =?UTF-8?q?s=E7=9A=84=E4=B8=80=E4=B8=AA=E6=97=A0=E6=84=8F=E4=B9=89?= =?UTF-8?q?=E5=A4=A7=E6=8B=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 261 +++++++++++++++++++++++++------------- layout/default/layout.css | 1 - 2 files changed, 175 insertions(+), 87 deletions(-) diff --git a/game/game.js b/game/game.js index 40bbdaaab..1183611c7 100644 --- a/game/game.js +++ b/game/game.js @@ -7232,109 +7232,198 @@ return this.childNodes[row].childNodes[col]; } }; - Array.prototype.filterInD=function(pos){ - if(!pos) pos='o'; - var list=[]; - for(var i=0;ithis.length){ + num=this.length; + } + var arr=this.slice(0); var list=[]; for(var i=0;ithis.length){ - num=this.length; - } - var arr=this.slice(0); - var list=[]; - for(var i=0;i>> 0; + if (len === 0) { + return false; + } + var n = fromIndex | 0; + var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); + function sameValueZero(x, y) { + return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y)); + } + while (k < len) { + if (sameValueZero(o[k], searchElement)) { + return true; + } + k++; + } + return false; + } + }); + } if(!Array.from){ - Array.from=function(args){ - var list=[]; - if(args&&args.length){ - for(var i=0;i Date: Sat, 22 Jul 2023 00:40:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8Dgame.print=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=89=93=E5=8D=B0=E9=83=A8=E5=88=86=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=822.=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E8=87=AA=E5=B8=A6=E6=8E=A7=E5=88=B6=E5=8F=B0?= =?UTF-8?q?=E7=A7=8D=E7=9A=84=E6=96=87=E5=AD=97=E5=8F=AF=E8=83=BD=E4=BC=9A?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=80=89=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/game/game.js b/game/game.js index 1183611c7..4df159172 100644 --- a/game/game.js +++ b/game/game.js @@ -7408,7 +7408,7 @@ return false; } }); - } + } if(!Array.from){ Object.defineProperty(Array, "from", { configurable:true, @@ -44914,6 +44914,7 @@ pre.style.margin=0; pre.style.padding=0; pre.style.position='relative'; + pre.style.webkitUserSelect = pre.style.userSelect = 'text'; lib.setScroll(pre); page.appendChild(text); @@ -45010,26 +45011,28 @@ }); page.appendChild(text2); game.print=function(){ - var textstr=''; - for(var i=0;i{ + if(get.is.object(arg)){ + var argi=get.stringify(arg); if(argi&&argi.length<5000){ textstr+=argi; } else{ - textstr+=arguments[i].toString(); + textstr+=arg.toString(); } + }else{ + var str=String(arg); + if (!/<[a-zA-Z]+[^>]*?\/?>.*?(?=<\/[a-zA-Z]+[^>]*?>|$)/.exec(str)) return String(arg) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + else return str; } - else{ - textstr+=arguments[i]; - } - if(i'; text.scrollTop=text.scrollHeight; } if(_status.toprint){