├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── .prettierignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example ├── example.js ├── forms.html ├── index.html ├── page2.html └── page3.html ├── index.d.ts ├── index.js ├── lib ├── abort-request.js ├── eval-script.js ├── events │ ├── off.js │ ├── on.js │ └── trigger.js ├── execute-scripts.js ├── foreach-els.js ├── foreach-selectors.js ├── is-supported.js ├── parse-options.js ├── proto │ ├── attach-form.js │ ├── attach-link.js │ ├── handle-response.js │ ├── log.js │ └── parse-element.js ├── send-request.js ├── switches-selectors.js ├── switches.js ├── uniqueid.js └── util │ ├── clone.js │ ├── contains.js │ ├── extend.js │ ├── noop.js │ └── update-query-string.js ├── package.json ├── pjax.js ├── pjax.min.js └── tests ├── lib ├── abort-request.js ├── eval-scripts.js ├── events.js ├── execute-scripts.js ├── foreach-els.js ├── foreach-selectors.js ├── is-supported.js ├── parse-options.js ├── proto │ ├── attach-form.js │ ├── attach-link.js │ ├── handle-response.js │ └── parse-element.js ├── send-request.js ├── switch-selectors.js ├── switches.js ├── uniqueid.js └── util │ ├── clone.js │ ├── contains.js │ ├── extend.js │ ├── noop.js │ └── update-query-string.js ├── setup.js └── test.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | indent_style = space 10 | indent_size = 2 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [Makefile] 16 | indent_style = tab 17 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | pjax.js 2 | pjax.min.js 3 | *.json 4 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["eslint-config-i-am-meticulous/es5"], 3 | "rules": { 4 | "import/order": "off", 5 | "import/max-dependencies": "off", 6 | "import/extensions": ["error", "never"] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | .nyc_output/ 4 | .idea/ 5 | dist/ 6 | coverage/ 7 | tests/scripts/index.html 8 | package-lock.json 9 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | pjax.js 2 | pjax.min.js 3 | *.json 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: "node_js" 2 | node_js: 3 | - "10" 4 | 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 0.2.8 - 2019-03-09 2 | 3 | - Fixed: Edge form support. 4 | ([#178](https://github.com/MoOx/pjax/pull/178) - @robinnorth) 5 | - Fixed: Removed keyup event listener for forms. 6 | ([#184](https://github.com/MoOx/pjax/pull/184) - @BehindTheMath) 7 | - Fixed: Bugs in evalScripts(). 8 | ([#186](https://github.com/MoOx/pjax/pull/186) - @BehindTheMath) 9 | - Fixed: Handle non-string HTML passed to loadContent(). 10 | ([#200](https://github.com/MoOx/pjax/pull/200) - @BehindTheMath) 11 | - Tooling: Switch linting to ESLint and Prettier. 12 | ([#191](https://github.com/MoOx/pjax/pull/191) - @BehindTheMath) 13 | 14 | # 0.2.7 - 2018-08-15 15 | 16 | - Fixed: Parsing values of option elements in forms. 17 | ([#162](https://github.com/MoOx/pjax/pull/162) - @BehindTheMath) 18 | - Fixed: Added index.d.ts to package.json so it will be installed by npm. 19 | ([c589ab9](https://github.com/MoOx/pjax/commit/c589ab9c25bee6161bf3e557eaca44e51c14fb89) - @BehindTheMath) 20 | - Fixed: `options.history` to correctly parse being set to false. 21 | ([#165](https://github.com/MoOx/pjax/pull/165) - @BehindTheMath). 22 | - Fixed: Pass the current `options` object to `loadContent()`. 23 | ([#171](https://github.com/MoOx/pjax/pull/171) - @BehindTheMath) 24 | - Fixed: Ensure correct XHR encoding for multipart/form-data forms 25 | ([#174](https://github.com/MoOx/pjax/pull/174) - @BehindTheMath) 26 | - Added: More documentation. 27 | ([#160](https://github.com/MoOx/pjax/pull/160), [#171](https://github.com/MoOx/pjax/pull/171) - @robinnorth, @BehindTheMath) 28 | 29 | # 0.2.6 - 2018-04-30 30 | 31 | - Fixed: Form submission for GET requests. 32 | ([#129](https://github.com/MoOx/pjax/pull/129) - @robinnorth) 33 | - Fixed: Refactor `loadUrl()` to make manually calling simpler. 34 | ([#134](https://github.com/MoOx/pjax/pull/134) - @robinnorth) 35 | - Fixed: Support multiple select fields in form submissions. 36 | ([#147](https://github.com/MoOx/pjax/pull/147) - @robinnorth) 37 | - Fixed: Use the same options object in `handle-response` as in `send-request`. This way, `pjax.state.options` will also have the request options. 38 | ([#148](https://github.com/MoOx/pjax/pull/148) - @BehindTheMath) 39 | - Added: Move the XHR callback to a separate method, and trigger an error event if the response cannot be parsed. 40 | ([#137](https://github.com/MoOx/pjax/pull/137) - @BehindTheMath) 41 | - Added: TypeScript definitions. 42 | ([#138](https://github.com/MoOx/pjax/pull/138) - @BehindTheMath) 43 | - Added: `replaceNode` switch, as an alternative to the `outerHTML` switch. 44 | ([#141](https://github.com/MoOx/pjax/pull/141) - @BehindTheMath) 45 | - Added: `X-PJAX-Selectors` HTTP header. This is a serialized JSON array of selectors, taken from `options.selectors`. You can use this to send back only the elements that Pjax will use to switch, instead of sending the whole page. 46 | ([#144](https://github.com/MoOx/pjax/pull/144) - @BehindTheMath) 47 | - Added: An option to use `FormData` to submit forms. 48 | ([#153](https://github.com/MoOx/pjax/pull/153) - @BehindTheMath) 49 | - Added: Tests. 50 | ([f98f2dd](https://github.com/MoOx/pjax/commit/f98f2dd63b48113ff91b6bd8808257bfc723ef6b), [#145](https://github.com/MoOx/pjax/pull/145) - @robinnorth, @BehindTheMath) 51 | 52 | # 0.2.5 - 2018-02-02 53 | 54 | - Fixed: Async switch functions now work correctly, because the DOM is now parsed after all the switches finish. 55 | ([#79](https://github.com/MoOx/pjax/pull/79), [#110](https://github.com/MoOx/pjax/pull/110) - @oskarrough, @BehindTheMath, @robinnorth) 56 | - Fixed: Bug on IE11 preventing AJAX page refresh. 57 | ([#81](https://github.com/MoOx/pjax/pull/81) - @CPTechnikVX) 58 | - Fixed: Default switches are now available as `Pjax.switches`. 59 | ([#92](https://github.com/MoOx/pjax/pull/92) - @BehindTheMath) 60 | - Fixed: An error that was caused by a missing `switchElementsAlt`. 61 | ([#93](https://github.com/MoOx/pjax/pull/93), [#104](https://github.com/MoOx/pjax/pull/104) - @BehindTheMath, @robinnorth) 62 | - Fixed: Incorrect `main` field in npm package 63 | ([#105](https://github.com/MoOx/pjax/pull/105) - @robinnorth) 64 | - Fixed: A pending XHR is now aborted if the user navigates somewhere else before the request is finished. 65 | ([#114](https://github.com/MoOx/pjax/pull/114) - @robinnorth) 66 | - Fixed: When rendering new content, focus will now be removed only from elements within one of the containers manipulated by Pjax. 67 | ([#116](https://github.com/MoOx/pjax/pull/116) - @BehindTheMath) 68 | - Fixed: Stop dispatching extraneous `pjax:complete` events when external scripts load 69 | ([#118](https://github.com/MoOx/pjax/pull/118) - @robinnorth) 70 | - Added: Send the `X-PJAX` header with XHR requests. 71 | ([#80](https://github.com/MoOx/pjax/pull/80) - @bram1028) 72 | - Added: Direct download link for script tags. (@MoOx) 73 | - Added: Pass the element that triggered Pjax to the `pjax:send` event. 74 | ([#94](https://github.com/MoOx/pjax/pull/94) - @BehindTheMath) 75 | - Added: An option to set a timeout for XHR requests. 76 | ([#95](https://github.com/MoOx/pjax/pull/95) - @BehindTheMath) 77 | - Added: Checks for XHR redirects 78 | ([#101](https://github.com/MoOx/pjax/pull/101) - @BehindTheMath) 79 | - Added: Save scroll position with history, and restore when navigating backwards or forwards. 80 | ([#110](https://github.com/MoOx/pjax/pull/110), [#119](https://github.com/MoOx/pjax/pull/119) - @BehindTheMath, @robinnorth) 81 | - Added: Scroll to element position when URL contains a hash 82 | ([#110](https://github.com/MoOx/pjax/pull/110) - @BehindTheMath) 83 | - Added: Minified version of the Pjax bundle. 84 | ([#115](https://github.com/MoOx/pjax/pull/115) - @BehindTheMath) 85 | - Changed: Miscellaneous code and tests cleanup. 86 | ([#96](https://github.com/MoOx/pjax/pull/96), [#98](https://github.com/MoOx/pjax/pull/98), [#99](https://github.com/MoOx/pjax/pull/99), [#100](https://github.com/MoOx/pjax/pull/1070), [#107](https://github.com/MoOx/pjax/pull/107), [#113](https://github.com/MoOx/pjax/pull/113), [#120](https://github.com/MoOx/pjax/pull/120) - @BehindTheMath, @MoOx, @robinnorth) 87 | 88 | # 0.2.4 - 2016-06-28 89 | 90 | - Fixed: ``refresh`` should now work (use `this.parseDOM` for refresh) 91 | ([#67](https://github.com/MoOx/pjax/pull/67) - @compressed) 92 | - Fixed: Some attributes, such as `itemscope` have no corresponding value. 93 | This change allows them to still be set. 94 | ([#67](https://github.com/MoOx/pjax/pull/67) - @compressed) 95 | - Added: ``cacheBust`` option 96 | ([#71](https://github.com/MoOx/pjax/pull/71) - @tremby) 97 | 98 | # 0.2.3 - 2016-03-24 99 | 100 | - Fixed: ``currentUrlFullReload`` option now works 101 | - Fixed: ``this.reload`` is now a Function 102 | ([#65](https://github.com/MoOx/pjax/issues/65)) 103 | 104 | # 0.2.2 - 2016-03-12 105 | 106 | - Fixed: added back standalone version in `./pjax.js` 107 | ([#57](https://github.com/MoOx/pjax/issues/57) 108 | - Fixed: error when using pjax with google analytics (``options`` was undefined) 109 | ([#59](https://github.com/MoOx/pjax/pull/59)) 110 | - Fixed: HierarchyRequestError error 111 | ([#49](https://github.com/MoOx/pjax/pull/49)) 112 | - Fixed: ``TypeError: Pjax.forEachEls is not a function`` 113 | ([#52](https://github.com/MoOx/pjax/pull/52)) 114 | - Fixed: ``TypeError: Pjax.executeScripts is not a function`` 115 | ([#52](https://github.com/MoOx/pjax/pull/52)) 116 | - Fixed: ``TypeError: Pjax.clone is not a function`` 117 | ([#52](https://github.com/MoOx/pjax/pull/52)) 118 | - Added: Ignore events with prevented defaults 119 | ([#50](https://github.com/MoOx/pjax/pull/50)) 120 | 121 | # 0.2.1 - 2015-02-04 122 | 123 | - Fixed: it's better when a release have actual files. 124 | 125 | # 0.2.0 - 2015-02-04 126 | 127 | - Fixed: prevent scrollTo from being converted from false to 0 ([#33](https://github.com/MoOx/pjax/pull/33)) 128 | - Changed: code exploded in commonjs style 129 | - Added: lots of tests 130 | - Added: `refresh` method to force update a DOM element ([#36](https://github.com/MoOx/pjax/pull/36)) 131 | 132 | # 0.1.4 - 2014-10-14 133 | 134 | - Fixed: allow to load pages without any attributes on `` element (fix [#6](https://github.com/MoOx/pjax/issues/6)) 135 | - Fixed: make `Pjax.switches.sideBySide` method usable (fix [#13](https://github.com/MoOx/pjax/issues/13)) 136 | 137 | # 0.1.3 - 2014-09-16 138 | 139 | - Fixed: clicking on the current url somewhere does not produce a full reload by default (see option `currentUrlFullReload`) 140 | - Fixed: `document.implementation.createHTMLDocument` error (in IE10, ref [#16](https://github.com/MoOx/pjax/pull/16)) 141 | 142 | # 0.1.2 - 2014-04-03 143 | 144 | - Changed: `pjax.js` relocated in `src/` 145 | - Fixed: `` attributes of pjaxified document are now available 146 | 147 | # 0.1.1 - 2014-04-02 148 | 149 | - Fixed: safer UMD wrapper (fix concat issue) 150 | 151 | # 0.1.0 - 2014-03-24 152 | 153 | ✨ Initial release 154 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Maxime Thirouin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
158 | Thanks for stopping by! 159 | 160 | Click Here to find out more about me. 161 |
162 |