From e58b4e2c07b1364c3675d1334f26360937ca1e9c Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Thu, 2 Apr 2020 23:46:30 +0800 Subject: [PATCH] chore: remove legacy pjax --- packages/pjax/.editorconfig | 16 - packages/pjax/.gitignore | 6 - packages/pjax/.jscsrc | 132 - packages/pjax/.jshintrc | 9 - packages/pjax/.travis.yml | 7 - packages/pjax/CHANGELOG.md | 125 - packages/pjax/LICENSE | 20 - packages/pjax/README.md | 670 --- packages/pjax/index.d.ts | 210 - packages/pjax/index.js | 262 - packages/pjax/lib/abort-request.js | 8 - packages/pjax/lib/eval-script.js | 41 - packages/pjax/lib/events/off.js | 11 - packages/pjax/lib/events/on.js | 11 - packages/pjax/lib/events/trigger.js | 31 - packages/pjax/lib/execute-scripts.js | 18 - packages/pjax/lib/foreach-els.js | 9 - packages/pjax/lib/foreach-selectors.js | 8 - packages/pjax/lib/is-supported.js | 8 - packages/pjax/lib/parse-options.js | 41 - packages/pjax/lib/proto/attach-form.js | 132 - packages/pjax/lib/proto/attach-link.js | 82 - packages/pjax/lib/proto/handle-response.js | 70 - packages/pjax/lib/proto/log.js | 11 - packages/pjax/lib/proto/parse-element.js | 18 - packages/pjax/lib/send-request.js | 87 - packages/pjax/lib/switches-selectors.js | 37 - packages/pjax/lib/switches.js | 122 - packages/pjax/lib/uniqueid.js | 8 - packages/pjax/lib/util/clone.js | 13 - packages/pjax/lib/util/contains.js | 12 - packages/pjax/lib/util/extend.js | 21 - packages/pjax/lib/util/noop.js | 1 - packages/pjax/lib/util/update-query-string.js | 10 - packages/pjax/package.json | 56 - packages/pjax/tests/lib/abort-request.js | 56 - packages/pjax/tests/lib/eval-scripts.js | 23 - packages/pjax/tests/lib/events.js | 110 - packages/pjax/tests/lib/execute-scripts.js | 29 - packages/pjax/tests/lib/foreach-els.js | 45 - packages/pjax/tests/lib/foreach-selectors.js | 24 - packages/pjax/tests/lib/is-supported.js | 8 - packages/pjax/tests/lib/parse-options.js | 49 - packages/pjax/tests/lib/proto/attach-form.js | 184 - packages/pjax/tests/lib/proto/attach-link.js | 143 - .../pjax/tests/lib/proto/handle-response.js | 208 - .../pjax/tests/lib/proto/parse-element.js | 27 - packages/pjax/tests/lib/send-request.js | 137 - packages/pjax/tests/lib/switch-selectors.js | 74 - packages/pjax/tests/lib/switches.js | 78 - packages/pjax/tests/lib/uniqueid.js | 12 - packages/pjax/tests/lib/util/clone.js | 17 - packages/pjax/tests/lib/util/contains.js | 16 - packages/pjax/tests/lib/util/extend.js | 17 - packages/pjax/tests/lib/util/noop.js | 9 - .../tests/lib/util/update-query-string.js | 21 - packages/pjax/tests/setup.js | 6 - packages/pjax/tests/test.ts | 41 - packages/pjax/yarn.lock | 4242 ----------------- 59 files changed, 7899 deletions(-) delete mode 100644 packages/pjax/.editorconfig delete mode 100644 packages/pjax/.gitignore delete mode 100644 packages/pjax/.jscsrc delete mode 100644 packages/pjax/.jshintrc delete mode 100644 packages/pjax/.travis.yml delete mode 100644 packages/pjax/CHANGELOG.md delete mode 100644 packages/pjax/LICENSE delete mode 100644 packages/pjax/README.md delete mode 100644 packages/pjax/index.d.ts delete mode 100644 packages/pjax/index.js delete mode 100644 packages/pjax/lib/abort-request.js delete mode 100644 packages/pjax/lib/eval-script.js delete mode 100644 packages/pjax/lib/events/off.js delete mode 100644 packages/pjax/lib/events/on.js delete mode 100644 packages/pjax/lib/events/trigger.js delete mode 100644 packages/pjax/lib/execute-scripts.js delete mode 100644 packages/pjax/lib/foreach-els.js delete mode 100644 packages/pjax/lib/foreach-selectors.js delete mode 100644 packages/pjax/lib/is-supported.js delete mode 100644 packages/pjax/lib/parse-options.js delete mode 100644 packages/pjax/lib/proto/attach-form.js delete mode 100644 packages/pjax/lib/proto/attach-link.js delete mode 100644 packages/pjax/lib/proto/handle-response.js delete mode 100644 packages/pjax/lib/proto/log.js delete mode 100644 packages/pjax/lib/proto/parse-element.js delete mode 100644 packages/pjax/lib/send-request.js delete mode 100644 packages/pjax/lib/switches-selectors.js delete mode 100644 packages/pjax/lib/switches.js delete mode 100644 packages/pjax/lib/uniqueid.js delete mode 100644 packages/pjax/lib/util/clone.js delete mode 100644 packages/pjax/lib/util/contains.js delete mode 100644 packages/pjax/lib/util/extend.js delete mode 100644 packages/pjax/lib/util/noop.js delete mode 100644 packages/pjax/lib/util/update-query-string.js delete mode 100644 packages/pjax/package.json delete mode 100644 packages/pjax/tests/lib/abort-request.js delete mode 100644 packages/pjax/tests/lib/eval-scripts.js delete mode 100644 packages/pjax/tests/lib/events.js delete mode 100644 packages/pjax/tests/lib/execute-scripts.js delete mode 100644 packages/pjax/tests/lib/foreach-els.js delete mode 100644 packages/pjax/tests/lib/foreach-selectors.js delete mode 100644 packages/pjax/tests/lib/is-supported.js delete mode 100644 packages/pjax/tests/lib/parse-options.js delete mode 100644 packages/pjax/tests/lib/proto/attach-form.js delete mode 100644 packages/pjax/tests/lib/proto/attach-link.js delete mode 100644 packages/pjax/tests/lib/proto/handle-response.js delete mode 100644 packages/pjax/tests/lib/proto/parse-element.js delete mode 100644 packages/pjax/tests/lib/send-request.js delete mode 100644 packages/pjax/tests/lib/switch-selectors.js delete mode 100644 packages/pjax/tests/lib/switches.js delete mode 100644 packages/pjax/tests/lib/uniqueid.js delete mode 100644 packages/pjax/tests/lib/util/clone.js delete mode 100644 packages/pjax/tests/lib/util/contains.js delete mode 100644 packages/pjax/tests/lib/util/extend.js delete mode 100644 packages/pjax/tests/lib/util/noop.js delete mode 100644 packages/pjax/tests/lib/util/update-query-string.js delete mode 100644 packages/pjax/tests/setup.js delete mode 100644 packages/pjax/tests/test.ts delete mode 100644 packages/pjax/yarn.lock diff --git a/packages/pjax/.editorconfig b/packages/pjax/.editorconfig deleted file mode 100644 index 8978b44..0000000 --- a/packages/pjax/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# editorconfig.org -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.md] -trim_trailing_whitespace = false - -[Makefile] -indent_style = tab diff --git a/packages/pjax/.gitignore b/packages/pjax/.gitignore deleted file mode 100644 index 561eeb2..0000000 --- a/packages/pjax/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.DS_Store -node_modules/ -tests/scripts/index.html -pjax.js -.nyc_output/ -pjax.min.js diff --git a/packages/pjax/.jscsrc b/packages/pjax/.jscsrc deleted file mode 100644 index 27bc03b..0000000 --- a/packages/pjax/.jscsrc +++ /dev/null @@ -1,132 +0,0 @@ -{ - "excludeFiles": [ - "node_modules/**", - "pjax.js", - "pjax.min.js" - ], - "fileExtensions": [ - ".js" - ], - "requireCurlyBraces": [ - "if", - "else", - "for", - "while", - "do", - "try", - "catch" - ], - "requireSpaceAfterKeywords": [ - "if", - "else", - "for", - "while", - "do", - "switch", - "return", - "try", - "catch" - ], - "requireSpaceBeforeBlockStatements": true, - "requireParenthesesAroundIIFE": true, - "requireSpacesInConditionalExpression": { - "afterTest": true, - "beforeConsequent": true, - "afterConsequent": true, - "beforeAlternate": true - }, - "requireSpacesInFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "disallowSpacesInFunctionExpression": { - "beforeOpeningRoundBrace": true - }, - "disallowMultipleVarDecl": true, - "requireBlocksOnNewline": 1, - "disallowPaddingNewlinesInBlocks": true, - "disallowEmptyBlocks": true, - "disallowSpacesInsideObjectBrackets": true, - "disallowSpacesInsideArrayBrackets": true, - "disallowSpacesInsideParentheses": true, - "disallowQuotedKeysInObjects": "allButReserved", - "disallowSpaceAfterObjectKeys": true, - "requireCommaBeforeLineBreak": true, - "requireOperatorBeforeLineBreak": [ - "?", - "+", - "-", - "/", - "*", - "=", - "==", - "===", - "!=", - "!==", - ">", - ">=", - "<", - "<=" - ], - "disallowSpaceAfterPrefixUnaryOperators": [ - "++", - "--", - "+", - "-", - "~", - "!" - ], - "disallowSpaceBeforePostfixUnaryOperators": [ - "++", - "--" - ], - "requireSpaceBeforeBinaryOperators": [ - "+", - "-", - "/", - "*", - "=", - "==", - "===", - "!=", - "!==" - ], - "requireSpaceAfterBinaryOperators": [ - "+", - "-", - "/", - "*", - "=", - "==", - "===", - "!=", - "!==" - ], - "disallowImplicitTypeConversion": [ - "numeric", - "boolean", - "binary", - "string" - ], - "requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties", - "disallowKeywords": [ - "with" - ], - "disallowMultipleLineStrings": true, - "validateQuoteMarks": "\"", - "validateIndentation": 2, - "disallowMixedSpacesAndTabs": true, - "disallowTrailingWhitespace": true, - "requireKeywordsOnNewLine": [ - "else" - ], - "requireLineFeedAtFileEnd": true, - "requireCapitalizedConstructors": true, - "safeContextKeyword": "that", - "requireDotNotation": true, - "jsDoc": { - "checkParamNames": true, - "checkRedundantParams": true, - "requireParamTypes": true - }, - "requireSpaceAfterLineComment": true -} diff --git a/packages/pjax/.jshintrc b/packages/pjax/.jshintrc deleted file mode 100644 index 9f268f7..0000000 --- a/packages/pjax/.jshintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "newcap": false, - "undef": true, - "unused": true, - "asi": true, - "esnext": true, - "node": true, - "browser": true -} diff --git a/packages/pjax/.travis.yml b/packages/pjax/.travis.yml deleted file mode 100644 index 9c9521d..0000000 --- a/packages/pjax/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: "node_js" -node_js: - - "6" - - "8" -# Force Travis to use npm v5 -# https://github.com/travis-ci/travis-ci/issues/4653#issuecomment-194051953 -before_install: if [[ `npm -v` != 5* ]]; then npm i -g npm@5; fi diff --git a/packages/pjax/CHANGELOG.md b/packages/pjax/CHANGELOG.md deleted file mode 100644 index 7909fff..0000000 --- a/packages/pjax/CHANGELOG.md +++ /dev/null @@ -1,125 +0,0 @@ -# 0.2.6 - 2018-04-30 - -- Fixed: Form submission for GET requests. - ([#129](https://github.com/MoOx/pjax/pull/129) - @robinnorth) -- Fixed: Refactor `loadUrl()` to make manually calling simpler. - ([#134](https://github.com/MoOx/pjax/pull/134) - @robinnorth) -- Fixed: Support multiple select fields in form submissions. - ([#147](https://github.com/MoOx/pjax/pull/147) - @robinnorth) -- Fixed: Use the same options object in `handle-response` as in `send-request`. This way, `pjax.state.options` will also have the request options. - ([#148](https://github.com/MoOx/pjax/pull/148) - @BehindTheMath) -- Added: Move the XHR callback to a separate method, and trigger an error event if the response cannot be parsed. - ([#137](https://github.com/MoOx/pjax/pull/137) - @BehindTheMath) -- Added: TypeScript definitions. - ([#138](https://github.com/MoOx/pjax/pull/138) - @BehindTheMath) -- Added: `replaceNode` switch, as an alternative to the `outerHTML` switch. - ([#141](https://github.com/MoOx/pjax/pull/141) - @BehindTheMath) -- 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. - ([#144](https://github.com/MoOx/pjax/pull/144) - @BehindTheMath) -- Added: An option to use `FormData` to submit forms. - ([#153](https://github.com/MoOx/pjax/pull/153) - @BehindTheMath) -- Added: Tests. - ([f98f2dd](https://github.com/MoOx/pjax/commit/f98f2dd63b48113ff91b6bd8808257bfc723ef6b), [#145](https://github.com/MoOx/pjax/pull/145) - @robinnorth, @BehindTheMath) - -# 0.2.5 - 2018-02-02 - -- Fixed: Async switch functions now work correctly, because the DOM is now parsed after all the switches finish. - ([#79](https://github.com/MoOx/pjax/pull/79), [#110](https://github.com/MoOx/pjax/pull/110) - @oskarrough, @BehindTheMath, @robinnorth) -- Fixed: Bug on IE11 preventing AJAX page refresh. - ([#81](https://github.com/MoOx/pjax/pull/81) - @CPTechnikVX) -- Fixed: Default switches are now available as `Pjax.switches`. - ([#92](https://github.com/MoOx/pjax/pull/92) - @BehindTheMath) -- Fixed: An error that was caused by a missing `switchElementsAlt`. - ([#93](https://github.com/MoOx/pjax/pull/93), [#104](https://github.com/MoOx/pjax/pull/104) - @BehindTheMath, @robinnorth) -- Fixed: Incorrect `main` field in npm package - ([#105](https://github.com/MoOx/pjax/pull/105) - @robinnorth) -- Fixed: A pending XHR is now aborted if the user navigates somewhere else before the request is finished. - ([#114](https://github.com/MoOx/pjax/pull/114) - @robinnorth) -- Fixed: When rendering new content, focus will now be removed only from elements within one of the containers manipulated by Pjax. - ([#116](https://github.com/MoOx/pjax/pull/116) - @BehindTheMath) -- Fixed: Stop dispatching extraneous `pjax:complete` events when external scripts load - ([#118](https://github.com/MoOx/pjax/pull/118) - @robinnorth) -- Added: Send the `X-PJAX` header with XHR requests. - ([#80](https://github.com/MoOx/pjax/pull/80) - @bram1028) -- Added: Direct download link for script tags. (@MoOx) -- Added: Pass the element that triggered Pjax to the `pjax:send` event. - ([#94](https://github.com/MoOx/pjax/pull/94) - @BehindTheMath) -- Added: An option to set a timeout for XHR requests. - ([#95](https://github.com/MoOx/pjax/pull/95) - @BehindTheMath) -- Added: Checks for XHR redirects - ([#101](https://github.com/MoOx/pjax/pull/101) - @BehindTheMath) -- Added: Save scroll position with history, and restore when navigating backwards or forwards. - ([#110](https://github.com/MoOx/pjax/pull/110), [#119](https://github.com/MoOx/pjax/pull/119) - @BehindTheMath, @robinnorth) -- Added: Scroll to element position when URL contains a hash - ([#110](https://github.com/MoOx/pjax/pull/110) - @BehindTheMath) -- Added: Minified version of the Pjax bundle. - ([#115](https://github.com/MoOx/pjax/pull/115) - @BehindTheMath) -- Changed: Miscellaneous code and tests cleanup. - ([#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) - -# 0.2.4 - 2016-06-28 - -- Fixed: ``refresh`` should now work (use `this.parseDOM` for refresh) - ([#67](https://github.com/MoOx/pjax/pull/67) - @compressed) -- Fixed: Some attributes, such as `itemscope` have no corresponding value. - This change allows them to still be set. - ([#67](https://github.com/MoOx/pjax/pull/67) - @compressed) -- Added: ``cacheBust`` option - ([#71](https://github.com/MoOx/pjax/pull/71) - @tremby) - -# 0.2.3 - 2016-03-24 - -- Fixed: ``currentUrlFullReload`` option now works -- Fixed: ``this.reload`` is now a Function - ([#65](https://github.com/MoOx/pjax/issues/65)) - -# 0.2.2 - 2016-03-12 - -- Fixed: added back standalone version in `./pjax.js` -([#57](https://github.com/MoOx/pjax/issues/57) -- Fixed: error when using pjax with google analytics (``options`` was undefined) -([#59](https://github.com/MoOx/pjax/pull/59)) -- Fixed: HierarchyRequestError error -([#49](https://github.com/MoOx/pjax/pull/49)) -- Fixed: ``TypeError: Pjax.forEachEls is not a function`` -([#52](https://github.com/MoOx/pjax/pull/52)) -- Fixed: ``TypeError: Pjax.executeScripts is not a function`` -([#52](https://github.com/MoOx/pjax/pull/52)) -- Fixed: ``TypeError: Pjax.clone is not a function`` -([#52](https://github.com/MoOx/pjax/pull/52)) -- Added: Ignore events with prevented defaults -([#50](https://github.com/MoOx/pjax/pull/50)) - -# 0.2.1 - 2015-02-04 - -- Fixed: it's better when a release have actual files. - -# 0.2.0 - 2015-02-04 - -- Fixed: prevent scrollTo from being converted from false to 0 ([#33](https://github.com/MoOx/pjax/pull/33)) -- Changed: code exploded in commonjs style -- Added: lots of tests -- Added: `refresh` method to force update a DOM element ([#36](https://github.com/MoOx/pjax/pull/36)) - -# 0.1.4 - 2014-10-14 - -- Fixed: allow to load pages without any attributes on `` element (fix [#6](https://github.com/MoOx/pjax/issues/6)) -- Fixed: make `Pjax.switches.sideBySide` method usable (fix [#13](https://github.com/MoOx/pjax/issues/13)) - -# 0.1.3 - 2014-09-16 - -- Fixed: clicking on the current url somewhere does not produce a full reload by default (see option `currentUrlFullReload`) -- Fixed: `document.implementation.createHTMLDocument` error (in IE10, ref [#16](https://github.com/MoOx/pjax/pull/16)) - -# 0.1.2 - 2014-04-03 - -- Changed: `pjax.js` relocated in `src/` -- Fixed: `` attributes of pjaxified document are now available - -# 0.1.1 - 2014-04-02 - -- Fixed: safer UMD wrapper (fix concat issue) - -# 0.1.0 - 2014-03-24 - -✨ Initial release diff --git a/packages/pjax/LICENSE b/packages/pjax/LICENSE deleted file mode 100644 index 8b39b8f..0000000 --- a/packages/pjax/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Maxime Thirouin - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/pjax/README.md b/packages/pjax/README.md deleted file mode 100644 index c056a03..0000000 --- a/packages/pjax/README.md +++ /dev/null @@ -1,670 +0,0 @@ -# Pjax - -[![Build Status](https://img.shields.io/travis/MoOx/pjax.svg)](https://travis-ci.org/MoOx/pjax). - -> Easily enable fast AJAX navigation on any website (using pushState() + XHR) - -Pjax is **a standalone JavaScript module** that uses -AJAX (XmlHttpRequest) and -[pushState()](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history) -to deliver a fast browsing experience. - -_It allows you to completely transform the user experience of standard websites -(server-side generated or static ones) to make them feel like they are browsing an app, -especially for users with low bandwidth connection._ - -**No more full page reloads. No more multiple HTTP requests.** - -_Pjax does not rely on other libraries, like jQuery or similar. It is written entirely in vanilla JS._ - -## Installation - -- You can install Pjax from **npm**: - ```shell - npm install pjax - ``` - -- You can also link directly to the [bundle](https://cdn.jsdelivr.net/npm/pjax/pjax.js): - ```html - - ``` - Or the [minified bundle](https://cdn.jsdelivr.net/npm/pjax/pjax.min.js): - ```html - - ``` - -## How Pjax works - -Pjax loads pages using AJAX and updates the browser's current URL using `pushState()` without reloading your page's layout or any resources (JS, CSS), giving a fast page load. - -_But under the hood, it's just ONE HTTP request with a `pushState()` call._ - -Obviously, for [browsers that don't support `history.pushState()`](http://caniuse.com/#search=pushstate) Pjax gracefully degrades and does not do anything at all. - -It simply works with all permalinks and can update all parts of the page you -want (including HTML metas, title, and navigation state). - -- It's not limited to one container, like jQuery-Pjax is. -- It fully supports browser history (back and forward buttons). -- It supports keyboard browsing. -- Automatically falls back to standard navigation for external pages (thanks to Captain Obvious's help). -- Automatically falls back to standard navigation for internal pages that do not have an appropriate DOM tree. -- You can add pretty cool CSS transitions (animations) very easily. -- It's around 4kb (minified and gzipped). - -### Under the hood - -- It listens to every click on links _you want_ (by default all of them). -- When an internal link is clicked, Pjax grabs HTML from your server via AJAX. -- Pjax renders the page's DOM tree (without loading any resources - images, CSS, JS...). -- It checks that all defined parts can be replaced: - - If the page doesn't meet the requirements, standard navigation is used. - - If the page meets the requirements, Pjax does all defined DOM replacements. -- Then it updates the browser's current URL using `pushState()`. - -## Overview - -Pjax is fully automatic. You don't need to setup anything in the existing HTML. -You just need to designate some elements on your page that will be replaced when -you navigate your site. - -Consider the following page. - -```html - - - - - - -
-
- Sha blah blah. -
- - - - - - -``` - -We want Pjax to intercept the URL `/blah`, and replace `.my-Content` with the results of the request. -Oh and the `