feat(pdoPage): remove jQuery dependency (#315) - #20
Open
Ibochkarev wants to merge 3 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pdoTools3).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|afterPOSTнаconnector.php+hash/pageIdX-Requested-With: XMLHttpRequestdefault/button/scrollTest plan
ajaxMode=default— клик по страницам, history, scrollTopajaxMode=button— more скрывается на последней / пустой выдачеajaxMode=scroll— подгрузка через IntersectionObserver, стоп на последнейpdoPage.callbacks.before/afterиpdopage:loadnpx gruntсобираетpdopage.min.js/ css