MediaWiki talk:Gadget-AdvancedSiteNotices.js
添加话题Gadget throwing JS errors on the mobile site
[编辑]This gadget is throwing errors on mobile site e.g. https://zh.m.wikipedia.org/wiki/%E7%AC%AC%E4%BA%8C%E6%AC%A1%E4%B8%96%E7%95%8C%E5%A4%A7%E6%88%98:
Uncaught SyntaxError: Unexpected token ) at testCriteria (<anonymous>:235:177) at matchCriteria (<anonymous>:235:195) at loadNotices (<anonymous>:235:451) at Object.success (<anonymous>:236:699) at fire (load.php?lang=zh-hk&modules=jquery&skin=minerva&version=0hmxo20:45) at Object.fireWith [as resolveWith] (load.php?lang=zh-hk&modules=jquery&skin=minerva&version=0hmxo20:47) at done (load.php?lang=zh-hk&modules=jquery&skin=minerva&version=0hmxo20:126) at XMLHttpRequest.<anonymous> (load.php?lang=zh-hk&modules=jquery&skin=minerva&version=0hmxo20:130)
Jdlrobson(留言) 2019年8月7日 (三) 17:26 (UTC)
- Fixed in Special:Diff/55559839. --Xiplus#Talk 2019年8月8日 (四) 00:14 (UTC)
在上方的消息「跑馬燈」
[编辑]以前在上面的消息「跑馬燈」只要按 [關閉] 之後,在維基百科的頁面之間就不會再出現了(直到下次),但現在按下 [關閉] 卻只有單次有效,轉到其他頁面仍然出現?是強迫收看嗎?--Tp0910(留言) 2020年10月3日 (六) 20:46 (UTC)
- @Xiplus:最后一个版本被改坏了。
rev === cval
应该是不能用===
的,因为$.cookie(cname)
获取不到内容的时候返回的是null
。同时我也不太明白为什么上面的if (cval == '') { cval = -1 }
会这样写,null == ''
这始终是false
的。 --安忆Talk 2020年10月4日 (日) 04:05 (UTC)- 已回退。--Xiplus#Talk 2020年10月4日 (日) 04:19 (UTC)
- 感謝各位。--Tp0910(留言) 2020年10月4日 (日) 14:42 (UTC)
- 已回退。--Xiplus#Talk 2020年10月4日 (日) 04:19 (UTC)
too much recursion
[编辑]This error is thrown on https://zh.wikipedia.org/wiki/%E5%A4%A7%E9%B1%BC%E6%B5%B7%E6%A3%A0 Anoymized stack trace:
at html/< URL1:222:664 at access URL1:193:243 at html URL1:222:504 at loadNotices/< URL2:4:168 at jQuery.speed/opt.complete URL1:242:22 at fire URL1:186:191 at fireWith URL1:187:402 at tick URL1:239:241 at jQuery.fx.tick URL1:244:750 at schedule URL1:234:991
Jon (WMF)(留言) 2020年10月20日 (二) 21:09 (UTC)
編輯請求 2021-08-18
[编辑] 请求已处理。--安忆Talk 2021年8月18日 (三) 02:59 (UTC)
把第71行的jQuery.trim
改成String.prototype.trim
,控制台一堆deprecate警告-- Sunny00217 2021年8月18日 (三) 02:52 (UTC)
The gadget is not in real time when using with numbers
[编辑]Hello, in ckb:Template:AdvancedSiteNotices, we used if expression with two deletion categories (for admins only). It is obvious that category members increase and decrease. The problem here is that the AdvancedSiteNotices does not update at all and is not real time. I just investigated the problem a little bit and went to the ckb:Template:AdvancedSiteNotices/ajax. I cleaned it's cache up and it updated in the AdvancedSiteNotices, but I wasn't sure if it was updated only for me or for other administrators and it will updated for all admins. Can you fix this problem?--Aram(留言) 2023年1月10日 (二) 19:29 (UTC)
編輯請求 2025-01-26
[编辑] 请求已处理
- 优化外观及移动版布局,关闭操作使用真按钮;
- 去屎山代码。
部署方法:
- 小工具定义加上
AdvancedSiteNotices.css
; - https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Gadget-AdvancedSiteNotices.css => MediaWiki:Gadget-AdvancedSiteNotices.css;
- https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Gadget-AdvancedSiteNotices.js => MediaWiki:Gadget-AdvancedSiteNotices.js。
以上。--碟之舞📀💿 2025年1月26日 (日) 08:59 (UTC)
編輯請求 2025-03-21
[编辑] 请求已处理。--安忆Talk 2025年3月24日 (一) 06:32 (UTC)
初步解决phab:T384827,修改内容:
- https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Gadget-AdvancedSiteNotices.js => MediaWiki:Gadget-AdvancedSiteNotices.js
- https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Gadget-AdvancedSiteNotices.css => MediaWiki:Gadget-AdvancedSiteNotices.css
附知@SunAfterRain。--碟之舞📀💿 2025年3月21日 (五) 14:10 (UTC)
- 这个工单大体是什么内容?我这边无权查看。--安忆Talk 2025年3月22日 (六) 08:11 (UTC)
- I reviewed the email. I believe that if we operate on zhwiki with a clear usage method, established expressions, controllable pages, and trusted administrators, using
eval()
for execution does not present a security risk. Whileeval()
can raise security concerns in uncontrolled environments where arbitrary expressions may be executed, this is not the case under the conditions mentioned. Like "Setting aside the facts, is there really no problem with XXX?", is unreasonable and disregards these facts.--安忆Talk 2025年3月24日 (一) 05:52 (UTC)- @AnYiLin:见Telegram私信。--碟之舞📀💿 2025年3月24日 (一) 06:07 (UTC)
- Given the assumption that "administrators are not entirely trustworthy," I agree to adopt a more controllable parsing method.--安忆Talk 2025年3月24日 (一) 06:36 (UTC)
- @AnYiLin:见Telegram私信。--碟之舞📀💿 2025年3月24日 (一) 06:07 (UTC)
- I reviewed the email. I believe that if we operate on zhwiki with a clear usage method, established expressions, controllable pages, and trusted administrators, using
編輯請求 2025-04-12
[编辑] 请求已处理。--安忆Talk 2025年4月12日 (六) 07:12 (UTC)
新JS位于[1],CSS无变更。
变化:
- 确保先处理
&&
再处理||
。 - 加入文档中缺失的测试方法(主要为了兼容临时账号)。
- 修正Cookie有效时间为正确的30天而非1800天。
- 顶部加入警告消息要求其他wiki的导入者保护相关页面。
以上。--碟之舞📀💿 2025年4月12日 (六) 07:00 (UTC)
- @Diskdance:其实我觉得Cookie时间那里直接用本地存储也可以。除非有新公告,用户选择不显示就一直保持不显示,不然关都关了某段时间之后又自己显示了感觉上有些奇怪。--安忆Talk 2025年4月12日 (六) 07:19 (UTC)
- 我也觉得是,但是考虑到先前的代码已经生成很多遗留Cookie了,所以当时就没改。--碟之舞📀💿 2025年4月12日 (六) 07:21 (UTC)