自動採番プラグインのプラグインのjQuery削除#230
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the jQuery dependency from the autonum (auto-numbering) plugin's desktop.js and config.js, replacing jQuery DOM/event/AJAX-helper calls with native DOM APIs (document.querySelector, addEventListener, classList, style, closest, etc.). jsRender ($.templates) usage is intentionally kept. The manifest version is bumped accordingly.
Changes:
- Replace jQuery DOM/event calls in
desktop.js(alert popup creation) with native DOM APIs and drop thejQueryIIFE parameter. - Replace jQuery in
config.js(form value access, listeners, validation alerts, layout sizing, radio group handling) with native DOM APIs and drop thejQueryIIFE parameter. - Bump plugin version from
2.4.4to2.4.5.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| examples/autonum/manifest.json | Version bump to 2.4.5. |
| examples/autonum/js/desktop.js | Rewrites alertMessage popup construction with native DOM APIs; removes $ from IIFE. |
| examples/autonum/js/config.js | Migrates form/value/event/layout/radio operations to native DOM APIs; removes $ from IIFE (jsRender $.templates retained). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| alert: function(element, mess) { | ||
| const elementParrent = $(element).parent(); | ||
| elementParrent.parent().find('.kintoneplugin-alert').remove(); | ||
| if ($('.kintoneplugin-alert').length === 0) { | ||
| $(element).focus(); | ||
| const elementParrent = element.parentElement; | ||
| elementParrent.parentElement.querySelectorAll('.kintoneplugin-alert').forEach((el) => { | ||
| el.remove(); | ||
| }); | ||
| if (document.querySelectorAll('.kintoneplugin-alert').length === 0) { | ||
| element.focus(); | ||
| } | ||
| elementParrent.after('<div class=\'kintoneplugin-alert\'><p>' + mess + '</p></div>'); | ||
| elementParrent.insertAdjacentHTML('afterend', '<div class=\'kintoneplugin-alert\'><p>' + mess + '</p></div>'); |
There was a problem hiding this comment.
これは既存の不具合ですね。
今回の修正と一緒に追加で対策していただけるとありがたいです。
| const alertMessage = document.createElement('div'); | ||
| alertMessage.className = 'kintoneplugin-alert popup'; | ||
| alertMessage.innerHTML = '<span>' + message + '</span>'; |
There was a problem hiding this comment.
これも既存の不具合ですね。
今回の修正と一緒に追加で対策していただけるとありがたいです。
レビューコメント1.
|
jsRender以外のjQueryをはがしました。