跳转到内容

MediaWiki talk:Gadget-AdvancedSiteNotices.js

页面内容不支持其他语言。
添加话题
维基百科,自由的百科全书
Diskdance在话题“編輯請求 2025-04-12”中的最新留言:2天前

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)回复

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

[编辑]

请求已处理

  1. 优化外观及移动版布局,关闭操作使用真按钮;
  2. 去屎山代码。

部署方法:

  1. 小工具定义加上AdvancedSiteNotices.css
  2. https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Gadget-AdvancedSiteNotices.css => MediaWiki:Gadget-AdvancedSiteNotices.css
  3. https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Gadget-AdvancedSiteNotices.js => MediaWiki:Gadget-AdvancedSiteNotices.js

以上。--碟之舞📀💿 2025年1月26日 (日) 08:59 (UTC)回复

完成--百無一用是書生 () 2025年1月27日 (一) 11:00 (UTC)回复

編輯請求 2025-03-21

[编辑]

请求已处理。--安忆Talk 2025年3月24日 (一) 06:32 (UTC)回复

初步解决phab:T384827,修改内容:

  1. https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Gadget-AdvancedSiteNotices.js => MediaWiki:Gadget-AdvancedSiteNotices.js
  2. 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. While eval() 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)回复

編輯請求 2025-04-12

[编辑]

请求已处理。--安忆Talk 2025年4月12日 (六) 07:12 (UTC)回复

新JS位于[1],CSS无变更。

变化:

  1. 确保先处理&&再处理||
  2. 加入文档中缺失的测试方法(主要为了兼容临时账号)。
  3. 修正Cookie有效时间为正确的30天而非1800天。
  4. 顶部加入警告消息要求其他wiki的导入者保护相关页面。

以上。--碟之舞📀💿 2025年4月12日 (六) 07:00 (UTC)回复

@Diskdance:其实我觉得Cookie时间那里直接用本地存储也可以。除非有新公告,用户选择不显示就一直保持不显示,不然关都关了某段时间之后又自己显示了感觉上有些奇怪。--安忆Talk 2025年4月12日 (六) 07:19 (UTC)回复
我也觉得是,但是考虑到先前的代码已经生成很多遗留Cookie了,所以当时就没改。--碟之舞📀💿 2025年4月12日 (六) 07:21 (UTC)回复