MoOx / pjax

Easily enable fast Ajax navigation on any website (using pushState + xhr)
MIT License
1.46k stars 125 forks source link

Add default switches to Pjax.switches #92

Closed BehindTheMath closed 6 years ago

BehindTheMath commented 6 years ago

Fixes #68 and reverts #74

BehindTheMath commented 6 years ago

74 fixed #68 in one instance in the README, by changing Pjax.switches.sideBySide to require("pjax/lib/switches.js").sideBySide.

However, there are still 5 other places in the README where the old syntax is still used (Pjax.switches.*).
Additionally, using require precludes users from using Pjax as a simple drop-in script tag, and requires the use of a bundler like Browserify, as mentioned here.

This PR restores the original functionality by attaching the default switches as Pjax.switches.*.

BehindTheMath commented 6 years ago

I tried running the tests locally, but I ran into multiple issues.

JSCS wouldn't run with a wildcard path, no matter how I tried setting it. When I ran it with a loop on all files, it found style warnings, but nothing created by this commit.

Testling crashed immediately with no descriptive error message.

However, the Travis build passed.

MoOx commented 6 years ago

Sorry this project is clearly not actively maintained. JSCS should be remove (and replaced with prettier imo - I love the standard + "no config" approach). I am also not surprised that there is some errors with tests...