-
Notifications
You must be signed in to change notification settings - Fork 1
fix(wiki-editor): no duplicate buttons #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WikiEditor toolbars are automatically loaded for textareas with `id="wpTextbox1"`. close #11
审阅者指南 (在小型 PRs 中折叠)审阅者指南此 PR 重新组织了 ext.wikiEditor 模块的加载方式,通过在检查 addWikiEditor 函数是否存在之后才延迟加载器,确保 addWikiEditor 只被调用一次,从而防止重复的工具栏按钮。 WikiEditor 工具栏初始化逻辑的序列图sequenceDiagram
participant Plugin as "WikiEditor Plugin"
participant mw as "window.mw"
participant Loader as "mw.loader"
participant Textarea as "wpTextbox1 textarea"
Plugin->>Textarea: Check for textarea and registration
alt addWikiEditor exists
Plugin->>mw: Call addWikiEditor($(textarea))
else addWikiEditor does not exist
Plugin->>Loader: Load 'ext.wikiEditor'
end
文件级别变更
相关问题评估
可能相关的问题
提示和命令与 Sourcery 互动
自定义您的体验访问您的 仪表盘 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR reorganizes the loading of the ext.wikiEditor module so that addWikiEditor is invoked only once, preventing duplicate toolbar buttons by deferring the loader until after checking for the existence of the addWikiEditor function. Sequence diagram for WikiEditor toolbar initialization logicsequenceDiagram
participant Plugin as "WikiEditor Plugin"
participant mw as "window.mw"
participant Loader as "mw.loader"
participant Textarea as "wpTextbox1 textarea"
Plugin->>Textarea: Check for textarea and registration
alt addWikiEditor exists
Plugin->>mw: Call addWikiEditor($(textarea))
else addWikiEditor does not exist
Plugin->>Loader: Load 'ext.wikiEditor'
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你好 - 我已经审阅了你的修改,它们看起来很棒!
帮助我更有用!请在每条评论上点击 👍 或 👎,我将利用这些反馈来改进你的评论。
Original comment in English
Hey there - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Deploying ipe-plugin-registry with
|
| Latest commit: |
331ad25
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://743c403a.plugin-registry.pages.dev |
| Branch Preview URL: | https://bhsd-wiki-editor.plugin-registry.pages.dev |
There are two entries of `@bhsd/codemirror-mediawiki`: [wiki.min.js](https://cdn.jsdelivr.net/npm/@bhsd/codemirror-mediawiki/dist/wiki.min.js) is IIFE and [mw.min.js](https://cdn.jsdelivr.net/npm/@bhsd/codemirror-mediawiki/dist/mw.min.js) is ESM. Wikiplus uses wiki.min.js while IPE uses mw.min.js, which means the package may be loaded twice on the same page.
|
我需要确认一下,是否可以移除 IPE 的 |
WikiEditor toolbars are automatically loaded for textareas with
id="wpTextbox1".close #11
Sourcery 总结
错误修复:
Original summary in English
Summary by Sourcery
Bug Fixes: