From 56a43c64b1977ed401083da581b22e726b603d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Thu, 18 Jan 2024 00:07:39 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix(table):=20=E4=BF=AE=E5=A4=8D=20Chrome?= =?UTF-8?q?=20DevTools=20=E5=AE=A1=E6=9F=A5=20iframe=20=E4=B8=AD=20table?= =?UTF-8?q?=20=E5=85=83=E7=B4=A0=E6=97=B6=E5=AF=BC=E8=87=B4=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/modules/table.js b/src/modules/table.js index 94011e7c..ab427969 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1750,7 +1750,24 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ lay.getStyleRules(style, function(item){ if (item.selectorText === ('.laytable-cell-'+ key)) { - return callback(item), true; + callback(item); + + /* 以下代码为防止 Chrome DevTools 审查 iframe 中的 table 元素时出现的页面崩溃 + * closes https://gitee.com/layui/layui/issues/I8N08M + * 具体原因不明,可能是初始操作 cssRules 触发了 DevTools inspect 的解析报错 + * 后续若浏览器本身修复了该问题,下述补丁也将会剔除 + */ + (function PatcheToCssRulesInDevTools(){ + if (self === parent) return; + var input = lay.elem('input', { + style: 'position: absolute; left: 0; top: 0; opacity: 0.01;' + }); + document.body.appendChild(input); + input.focus(); + document.body.removeChild(input); + })(); + + return true; } }); }; From a493cb5a7163581559611b9d4b0ca87f57a981a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Tue, 23 Jan 2024 23:26:39 +0800 Subject: [PATCH 2/7] =?UTF-8?q?chore(table):=20=E7=A7=BB=E9=99=A4=E5=AF=B9?= =?UTF-8?q?=20DevTools=20=E7=9A=84=E4=B8=B4=E6=97=B6=E6=80=A7=E8=A1=A5?= =?UTF-8?q?=E4=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index 871615b2..29cbe239 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1758,22 +1758,6 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ lay.getStyleRules(style, function(item){ if (item.selectorText === ('.laytable-cell-'+ key)) { callback(item); - - /* 以下代码为防止 Chrome DevTools 审查 iframe 中的 table 元素时出现的页面崩溃 - * closes https://gitee.com/layui/layui/issues/I8N08M - * 具体原因不明,可能是初始操作 cssRules 触发了 DevTools inspect 的解析报错 - * 后续若浏览器本身修复了该问题,下述补丁也将会剔除 - */ - (function PatcheToCssRulesInDevTools(){ - if (self === parent) return; - var input = lay.elem('input', { - style: 'position: absolute; left: 0; top: 0; opacity: 0.01;' - }); - document.body.appendChild(input); - input.focus(); - document.body.removeChild(input); - })(); - return true; } }); From 209544f35167d3cfcaf9f3a36345b90480fbf8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 4 Feb 2024 15:21:17 +0800 Subject: [PATCH 3/7] =?UTF-8?q?chore(upload):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=9B=BE=E7=89=87=20webp=20=E9=BB=98=E8=AE=A4=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/upload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/upload.js b/src/modules/upload.js index 1ec113ff..8ebcf718 100644 --- a/src/modules/upload.js +++ b/src/modules/upload.js @@ -510,7 +510,7 @@ layui.define(['lay', 'layer'], function(exports){ break; default: // 图片文件 layui.each(value, function(i, item){ - if(!RegExp('.\\.('+ (exts || 'jpg|png|gif|bmp|jpeg|svg') +')$', 'i').test(escape(item))){ + if(!RegExp('.\\.('+ (exts || 'jpg|png|gif|bmp|jpeg|svg|webp') +')$', 'i').test(escape(item))){ return check = true; } }); From 6d8f147cc126530751357cf5460df5b9b3711706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 31 Mar 2024 21:58:31 +0800 Subject: [PATCH 4/7] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=20form=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/form.html b/examples/form.html index 0bed4744..d05e3fef 100644 --- a/examples/form.html +++ b/examples/form.html @@ -121,7 +121,7 @@