Skip to content

feat(pdoPage): remove jQuery dependency (#315) - #20

Open
Ibochkarev wants to merge 3 commits into
masterfrom
feat/remove-jquery-pdopage
Open

feat(pdoPage): remove jQuery dependency (#315)#20
Ibochkarev wants to merge 3 commits into
masterfrom
feat/remove-jquery-pdopage

Conversation

@Ibochkarev

Copy link
Copy Markdown
Member

Summary

  • Закрывает #315 для линейки MODX 3 (pdoTools3).
  • Один vanilla pdopage.js (const/let): fetch + URLSearchParams + CSS sticky + IntersectionObserver.
  • Удалены jquery.pdopage.js, jquery.sticky.js и связанные Grunt-цели.
  • Событие pdopage_load (jQuery) → CustomEvent('pdopage:load').
  • Версия пакета: 3.1.0-pl.

Breaking

  • Сайты с ручным frontend_js = jquery.pdopage.js или $(...).pdoPage() нужно перевести на pdoPage.initialize.
  • Слушатели $(document).on('pdopage_load', …)document.addEventListener('pdopage:load', …).
  • Удалён pdoPage.Hash / IE hash history.

Preserved

  • pdoPage.initialize(config), pdoPage.callbacks.before|after
  • POST на connector.php + hash / pageId
  • Заголовок X-Requested-With: XMLHttpRequest
  • Режимы default / button / scroll

Test plan

  • ajaxMode=default — клик по страницам, history, scrollTop
  • ajaxMode=button — more скрывается на последней / пустой выдаче
  • ajaxMode=scroll — подгрузка через IntersectionObserver, стоп на последней
  • Без jQuery на странице ajax работает
  • pdoPage.callbacks.before/after и pdopage:load
  • npx grunt собирает pdopage.min.js / css

Replace dual jQuery frontends with one vanilla pdopage.js using fetch,
URLSearchParams, CSS sticky, and IntersectionObserver. Drop sticky plugin
and jquery.pdopage.js; emit CustomEvent pdopage:load.
Document public hooks, connector contract, and Controller methods.
Normalize instances when PHP already created pdoPage, restore Hash
helpers, abort for latest-wins loads, continue scroll while the
sentinel stays visible, and commit/rollback page state on empty or
failed responses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant