fomantic-ui 2.9.0-beta.283 → 2.9.0-beta.286
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.all-contributorsrc +9 -0
- package/.github/dependabot.yml +10 -0
- package/.github/workflows/ci.yml +2 -2
- package/.github/workflows/nightly.yml +2 -2
- package/.github/workflows/release.yml +2 -2
- package/CONTRIBUTORS.md +1 -0
- package/FAQ.md +38 -38
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +2 -2
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +1 -1
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +1 -1
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +1 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +1 -1
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +38 -60
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/emoji.css +8 -10
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +8 -8
- package/dist/components/flag.min.css +1 -1
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +9 -5
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +1 -1
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +1 -1
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +1 -1
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +1 -1
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +1 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +1 -1
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +4 -1
- package/dist/components/toast.js +9 -5
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +75 -67
- package/dist/semantic.js +71 -89
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/dist/themes/{default → famfamfam}/assets/images/flags.png +0 -0
- package/examples/components/button.html +1 -1
- package/examples/components/card.html +1 -1
- package/examples/components/input.html +1 -1
- package/examples/components/menu.html +1 -1
- package/examples/components/site.html +1 -1
- package/examples/components/table.html +1 -1
- package/package.json +1 -1
- package/src/definitions/behaviors/api.js +1 -1
- package/src/definitions/elements/emoji.less +23 -0
- package/src/definitions/elements/flag.less +45 -0
- package/src/definitions/elements/label.less +7 -4
- package/src/definitions/modules/accordion.less +371 -371
- package/src/definitions/modules/dropdown.js +37 -59
- package/src/definitions/modules/toast.js +8 -4
- package/src/definitions/modules/toast.less +3 -0
- package/src/themes/default/elements/emoji.overrides +0 -3592
- package/src/themes/default/elements/emoji.variables +3574 -0
- package/src/themes/default/elements/flag.overrides +0 -1646
- package/src/themes/default/elements/flag.variables +1602 -0
- package/src/themes/{default → famfamfam}/assets/images/flags.png +0 -0
- package/src/themes/famfamfam/elements/flag.variables +8 -1
- package/src/themes/joypixels/elements/emoji.overrides +0 -3591
- package/src/themes/joypixels/elements/emoji.variables +3573 -4
- package/src/themes/twitter/elements/emoji.overrides +0 -3593
- package/src/themes/twitter/elements/emoji.variables +3570 -6
- package/tasks/admin/distributions/create.js +1 -1
- package/tasks/admin/publish.js +1 -1
- package/tasks/admin/release.js +1 -1
- package/tasks/build/assets.js +1 -1
- package/tasks/build/css.js +1 -1
- package/tasks/build/javascript.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/README.md +1 -1
- package/tasks/collections/admin.js +1 -1
- package/tasks/config/admin/oauth.example.js +1 -1
- package/tasks/config/admin/templates/composer.json +1 -1
- package/tasks/rtl/watch.js +1 -1
- package/tasks/version.js +1 -1
- package/test/fixtures/accordion.html +1 -1
- package/test/fixtures/checkbox.html +1 -1
- package/test/fixtures/dropdown.html +1 -1
- package/test/fixtures/modal.html +1 -1
- package/test/fixtures/popup.html +1 -1
- package/test/fixtures/rating.html +1 -1
- package/test/fixtures/shape.html +1 -1
- package/test/fixtures/sidebar.html +1 -1
- package/test/fixtures/tab.html +1 -1
- package/test/fixtures/transition.html +1 -1
- package/test/fixtures/video.html +1 -1
- package/test/helpers/jasmine-jquery.js +1 -1
- package/test/helpers/jasmine-sinon.js +1 -1
- package/test/helpers/jquery-events.js +1 -1
- package/test/helpers/sinon.js +1 -1
- package/test/meteor/fonts.js +1 -1
- package/test/modules/accordion.spec.js +1 -1
- package/test/modules/checkbox.spec.js +1 -1
- package/test/modules/dropdown.spec.js +1 -1
- package/test/modules/modal.spec.js +1 -1
- package/test/modules/module.spec.js +1 -1
- package/test/modules/popup.spec.js +1 -1
- package/test/modules/search.spec.js +1 -1
- package/test/modules/shape.spec.js +1 -1
- package/test/modules/sidebar.spec.js +1 -1
- package/test/modules/tab.spec.js +1 -1
- package/test/modules/transition.spec.js +1 -1
- package/test/modules/video.spec.js +1 -1
package/.all-contributorsrc
CHANGED
@@ -609,6 +609,15 @@
|
|
609
609
|
"contributions": [
|
610
610
|
"security"
|
611
611
|
]
|
612
|
+
},
|
613
|
+
{
|
614
|
+
"login": "mvorisek",
|
615
|
+
"name": "Michael Voříšek",
|
616
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/2228672?v=4",
|
617
|
+
"profile": "https://www.mvorisek.com/",
|
618
|
+
"contributions": [
|
619
|
+
"code"
|
620
|
+
]
|
612
621
|
}
|
613
622
|
],
|
614
623
|
"contributorsPerLine": 4,
|
package/.github/dependabot.yml
CHANGED
@@ -15,3 +15,13 @@ updates:
|
|
15
15
|
- dependency-name: gulp-replace
|
16
16
|
versions:
|
17
17
|
- 1.1.0
|
18
|
+
- package-ecosystem: github-actions
|
19
|
+
directory: "/"
|
20
|
+
schedule:
|
21
|
+
interval: daily
|
22
|
+
time: "06:00"
|
23
|
+
open-pull-requests-limit: 99
|
24
|
+
target-branch: develop
|
25
|
+
labels:
|
26
|
+
- type/dependencies
|
27
|
+
- state/awaiting-reviews
|
package/.github/workflows/ci.yml
CHANGED
@@ -12,9 +12,9 @@ jobs:
|
|
12
12
|
matrix:
|
13
13
|
node-version: [12, 14, 16]
|
14
14
|
steps:
|
15
|
-
- uses: actions/checkout@
|
15
|
+
- uses: actions/checkout@v3
|
16
16
|
- name: Use Node.js ${{ matrix.node-version }}
|
17
|
-
uses: actions/setup-node@
|
17
|
+
uses: actions/setup-node@v3
|
18
18
|
with:
|
19
19
|
node-version: ${{ matrix.node-version }}
|
20
20
|
- name: pre-install
|
@@ -13,10 +13,10 @@ jobs:
|
|
13
13
|
outputs:
|
14
14
|
shouldPublish: ${{ steps.nightly-version.outputs.shouldPublish }}
|
15
15
|
steps:
|
16
|
-
- uses: actions/checkout@
|
16
|
+
- uses: actions/checkout@v3
|
17
17
|
with:
|
18
18
|
ref: develop
|
19
|
-
- uses: actions/setup-node@
|
19
|
+
- uses: actions/setup-node@v3
|
20
20
|
with:
|
21
21
|
node-version: 16
|
22
22
|
registry-url: https://registry.npmjs.org/
|
@@ -11,10 +11,10 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
if: github.repository == 'fomantic/Fomantic-UI'
|
13
13
|
steps:
|
14
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v3
|
15
15
|
with:
|
16
16
|
ref: master
|
17
|
-
- uses: actions/setup-node@
|
17
|
+
- uses: actions/setup-node@v3
|
18
18
|
with:
|
19
19
|
node-version: 14
|
20
20
|
registry-url: https://registry.npmjs.org/
|
package/CONTRIBUTORS.md
CHANGED
@@ -98,6 +98,7 @@ This is a list of all project contributors powered by [All Contributors](https:/
|
|
98
98
|
</tr>
|
99
99
|
<tr>
|
100
100
|
<td align="center"><a href="https://naveensrinivasan.dev"><img src="https://avatars.githubusercontent.com/u/172697?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Naveen</b></sub></a><br /><a href="#security-naveensrinivasan" title="Security">🛡️</a></td>
|
101
|
+
<td align="center"><a href="https://www.mvorisek.com/"><img src="https://avatars.githubusercontent.com/u/2228672?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Michael Voříšek</b></sub></a><br /><a href="https://github.com/fomantic/Fomantic-UI/commits?author=mvorisek" title="Code">💻</a></td>
|
101
102
|
</tr>
|
102
103
|
</table>
|
103
104
|
|
package/FAQ.md
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
# FAQ
|
2
|
-
|
3
|
-
### What is Fomantic-UI?
|
4
|
-
Fomantic is a community fork of the popular [Semantic-UI](https://github.com/Semantic-Org/Semantic-UI) framework.
|
5
|
-
|
6
|
-
### Why was Fomantic-UI created?
|
7
|
-
Fomantic was created to continue active development of Semantic-UI and has the intent to be merged back into the master repository once active development can restart. For more info please read the following issues:
|
8
|
-
- https://github.com/Semantic-Org/Semantic-UI/issues/6109
|
9
|
-
- https://github.com/Semantic-Org/Semantic-UI/issues/6413
|
10
|
-
|
11
|
-
> *EDIT:* Lots has changed since we started this project and we are now starting the development of FUI v3. You can read more about the > v3 proposals [here](https://github.com/fomantic/Fomantic-UI/issues/319).
|
12
|
-
>
|
13
|
-
> To be clear merging back into SUI is still our intention, read [this comment](https://github.com/fomantic/Fomantic-UI/issues/319#issuecomment-461736399) for more info
|
14
|
-
|
15
|
-
### How do I contribute to Fomantic?
|
16
|
-
We welcome anyone who wants to help make Fomantic great to come help us. If you are wanting to start contributing please read the [CONTRIBUTING.md](CONTRIBUTING.md) guide before opening any pull request's this helps us keep PR's simple and efficient allowing us to merge and release new features and fixes quicker.
|
17
|
-
|
18
|
-
### How do I report an issue with the framework?
|
19
|
-
If you have an issue with FUI we encourage you to [open an issue](https://github.com/fomantic/Fomantic-UI/issues/new) and let us know, if you just need some simple help join the FUI [Discord server](https://discordapp.com/invite/YChxjJ3) and ask the community for help.
|
20
|
-
|
21
|
-
---
|
22
|
-
|
23
|
-
## Fomantic-UI Links:
|
24
|
-
- Website/Documentation: [fomantic-ui.com](https://fomantic-ui.com)
|
25
|
-
- GitHub Organisation: [github.com/fomantic](https://github.com/fomantic)
|
26
|
-
- Repository: [github.com/fomantic/Fomantic-UI](https://github.com/fomantic/Fomantic-UI)
|
27
|
-
- Docs Repository: [github.com/fomantic/Fomantic-UI-Docs](https://github.com/fomantic/Fomantic-UI-Docs)
|
28
|
-
- CSS Repository: [github.com/fomantic/Fomantic-UI-CSS](https://github.com/fomantic/Fomantic-UI-CSS)
|
29
|
-
- LESS Repository: [github.com/fomantic/Fomantic-UI-LESS](https://github.com/fomantic/Fomantic-UI-LESS)
|
30
|
-
- SASS Repository: [github.com/fomantic/Fomantic-UI-SASS](https://github.com/fomantic/Fomantic-UI-SASS)
|
31
|
-
- Branding Repository: [github.com/fomantic/branding](https://github.com/fomantic/branding)
|
32
|
-
- npm: [npmjs.com/package/fomantic-ui](https://npmjs.com/package/fomantic-ui)
|
33
|
-
- CSS Package: [npmjs.com/package/fomantic-ui-css](https://npmjs.com/package/fomantic-ui-css)
|
34
|
-
- LESS Package: [npmjs.com/package/fomantic-ui-less](https://npmjs.com/package/fomantic-ui-less)
|
35
|
-
- JSFiddle: [jsfiddle.net/31d6y7mn](https://jsfiddle.net/31d6y7mn)
|
36
|
-
- Discord: [discordapp.com/invite/YChxjJ3](https://discordapp.com/invite/YChxjJ3)
|
37
|
-
- Twitter: [twitter.com/fomanticui](https://twitter.com/fomanticui)
|
38
|
-
- Medium: [medium.com/@fomantic](https://medium.com/@fomantic)
|
1
|
+
# FAQ
|
2
|
+
|
3
|
+
### What is Fomantic-UI?
|
4
|
+
Fomantic is a community fork of the popular [Semantic-UI](https://github.com/Semantic-Org/Semantic-UI) framework.
|
5
|
+
|
6
|
+
### Why was Fomantic-UI created?
|
7
|
+
Fomantic was created to continue active development of Semantic-UI and has the intent to be merged back into the master repository once active development can restart. For more info please read the following issues:
|
8
|
+
- https://github.com/Semantic-Org/Semantic-UI/issues/6109
|
9
|
+
- https://github.com/Semantic-Org/Semantic-UI/issues/6413
|
10
|
+
|
11
|
+
> *EDIT:* Lots has changed since we started this project and we are now starting the development of FUI v3. You can read more about the > v3 proposals [here](https://github.com/fomantic/Fomantic-UI/issues/319).
|
12
|
+
>
|
13
|
+
> To be clear merging back into SUI is still our intention, read [this comment](https://github.com/fomantic/Fomantic-UI/issues/319#issuecomment-461736399) for more info
|
14
|
+
|
15
|
+
### How do I contribute to Fomantic?
|
16
|
+
We welcome anyone who wants to help make Fomantic great to come help us. If you are wanting to start contributing please read the [CONTRIBUTING.md](CONTRIBUTING.md) guide before opening any pull request's this helps us keep PR's simple and efficient allowing us to merge and release new features and fixes quicker.
|
17
|
+
|
18
|
+
### How do I report an issue with the framework?
|
19
|
+
If you have an issue with FUI we encourage you to [open an issue](https://github.com/fomantic/Fomantic-UI/issues/new) and let us know, if you just need some simple help join the FUI [Discord server](https://discordapp.com/invite/YChxjJ3) and ask the community for help.
|
20
|
+
|
21
|
+
---
|
22
|
+
|
23
|
+
## Fomantic-UI Links:
|
24
|
+
- Website/Documentation: [fomantic-ui.com](https://fomantic-ui.com)
|
25
|
+
- GitHub Organisation: [github.com/fomantic](https://github.com/fomantic)
|
26
|
+
- Repository: [github.com/fomantic/Fomantic-UI](https://github.com/fomantic/Fomantic-UI)
|
27
|
+
- Docs Repository: [github.com/fomantic/Fomantic-UI-Docs](https://github.com/fomantic/Fomantic-UI-Docs)
|
28
|
+
- CSS Repository: [github.com/fomantic/Fomantic-UI-CSS](https://github.com/fomantic/Fomantic-UI-CSS)
|
29
|
+
- LESS Repository: [github.com/fomantic/Fomantic-UI-LESS](https://github.com/fomantic/Fomantic-UI-LESS)
|
30
|
+
- SASS Repository: [github.com/fomantic/Fomantic-UI-SASS](https://github.com/fomantic/Fomantic-UI-SASS)
|
31
|
+
- Branding Repository: [github.com/fomantic/branding](https://github.com/fomantic/branding)
|
32
|
+
- npm: [npmjs.com/package/fomantic-ui](https://npmjs.com/package/fomantic-ui)
|
33
|
+
- CSS Package: [npmjs.com/package/fomantic-ui-css](https://npmjs.com/package/fomantic-ui-css)
|
34
|
+
- LESS Package: [npmjs.com/package/fomantic-ui-less](https://npmjs.com/package/fomantic-ui-less)
|
35
|
+
- JSFiddle: [jsfiddle.net/31d6y7mn](https://jsfiddle.net/31d6y7mn)
|
36
|
+
- Discord: [discordapp.com/invite/YChxjJ3](https://discordapp.com/invite/YChxjJ3)
|
37
|
+
- Twitter: [twitter.com/fomanticui](https://twitter.com/fomanticui)
|
38
|
+
- Medium: [medium.com/@fomantic](https://medium.com/@fomantic)
|
package/dist/components/ad.css
CHANGED
package/dist/components/api.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.0-beta.
|
2
|
+
* # Fomantic-UI 2.9.0-beta.286+d72943e - API
|
3
3
|
* http://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -1208,7 +1208,7 @@ $.api.settings = {
|
|
1208
1208
|
regExp : {
|
1209
1209
|
required : /\{\$*[A-z0-9]+\}/g,
|
1210
1210
|
optional : /\{\/\$*[A-z0-9]+\}/g,
|
1211
|
-
validate: /^[a-z_][a-z0-9_-]*(?:\[
|
1211
|
+
validate: /^[a-z_][a-z0-9_-]*(?:\[[a-z0-9_-]*\])*$/i,
|
1212
1212
|
key: /[a-z0-9_-]+|(?=\[\])/gi,
|
1213
1213
|
push: /^$/,
|
1214
1214
|
fixed: /^\d+$/,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.0-beta.
|
2
|
+
* # Fomantic UI - 2.9.0-beta.286+d72943e
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* http://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(P,O,j){"use strict";P.isWindow=P.isWindow||function(e){return null!=e&&e===e.window},O=void 0!==O&&O.Math==Math?O:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),P.api=P.fn.api=function(q){var x,e=P.isFunction(this)?P(O):P(this),A=e.selector||"",k=(new Date).getTime(),S=[],T=q,w="string"==typeof T,D=[].slice.call(arguments,1);return e.each(function(){var s,n,r,e,a,o,f=P.isPlainObject(q)?P.extend(!0,{},P.fn.api.settings,q):P.extend({},P.fn.api.settings),t=f.namespace,i=f.metadata,u=f.selector,c=f.error,d=f.className,l="."+t,g="module-"+t,p=P(this),m=p.closest(u.form),b=f.stateContext?P(f.stateContext):p,v=this,h=b[0],y=p.data(g),R={initialize:function(){w||(o=f.data,R.bind.events()),R.instantiate()},instantiate:function(){R.verbose("Storing instance of module",R),y=R,p.data(g,y)},destroy:function(){R.verbose("Destroying previous module for",v),p.removeData(g).off(l)},bind:{events:function(){var e=R.get.event();e?(R.verbose("Attaching API events to element",e),p.on(e+l,R.event.trigger)):"now"==f.on&&(R.debug("Querying API endpoint immediately"),R.query())}},decode:{json:function(e){if(e!==j&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(O.Storage!==j)return t=sessionStorage.getItem(e+R.get.normalizedData()),R.debug("Using cached response",e,f.data,t),R.decode.json(t);R.error(c.noStorage)}},write:{cachedResponse:function(e,t){t&&""===t?R.debug("Response empty, not caching",t):O.Storage===j?R.error(c.noStorage):(P.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+R.get.normalizedData(),t),R.verbose("Storing cached response for url",e,f.data,t))}},query:function(){if(R.is.disabled())R.debug("Element is disabled API request aborted");else{if(R.is.loading()){if(!f.interruptRequests)return void R.debug("Cancelling request, previous request is still pending");R.debug("Interrupting previous request"),R.abort()}if(f.defaultData&&P.extend(!0,f.urlData,R.get.defaultData()),f.serializeForm&&(f.data=R.add.formData(o||f.data)),!1===(n=R.get.settings()))return R.cancelled=!0,void R.error(c.beforeSend);if(R.cancelled=!1,(r=R.get.templatedURL())||R.is.mocked()){if((r=R.add.urlData(r))||R.is.mocked()){if(n.url=f.base+r,s=P.extend(!0,{},f,{type:f.method||f.type,data:e,url:f.base+r,beforeSend:f.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),R.debug("Querying URL",s.url),R.verbose("Using AJAX settings",s),"local"===f.cache&&R.read.cachedResponse(r))return R.debug("Response returned from local cache"),R.request=R.create.request(),void R.request.resolveWith(h,[R.read.cachedResponse(r)]);f.throttle?f.throttleFirstRequest||R.timer?(R.debug("Throttling request",f.throttle),clearTimeout(R.timer),R.timer=setTimeout(function(){R.timer&&delete R.timer,R.debug("Sending throttled request",e,s.method),R.send.request()},f.throttle)):(R.debug("Sending request",e,s.method),R.send.request(),R.timer=setTimeout(function(){},f.throttle)):(R.debug("Sending request",e,s.method),R.send.request())}}else R.error(c.missingURL)}},should:{removeError:function(){return!0===f.hideError||"auto"===f.hideError&&!R.is.form()}},is:{disabled:function(){return 0<p.filter(u.disabled).length},expectingJSON:function(){return"json"===f.dataType||"jsonp"===f.dataType},form:function(){return p.is("form")||b.is("form")},mocked:function(){return f.mockResponse||f.mockResponseAsync||f.response||f.responseAsync},input:function(){return p.is("input")},loading:function(){return!!R.request&&"pending"==R.request.state()},abortedRequest:function(e){return e&&e.readyState!==j&&0===e.readyState?(R.verbose("XHR request determined to be aborted"),!0):(R.verbose("XHR request was not aborted"),!1)},validResponse:function(e){return R.is.expectingJSON()&&P.isFunction(f.successTest)?(R.debug("Checking JSON returned success",f.successTest,e),f.successTest(e)?(R.debug("Response passed success test",e),!0):(R.debug("Response failed success test",e),!1)):(R.verbose("Response is not JSON, skipping validation",f.successTest,e),!0)}},was:{cancelled:function(){return R.cancelled||!1},successful:function(){return R.request&&"resolved"==R.request.state()},failure:function(){return R.request&&"rejected"==R.request.state()},complete:function(){return R.request&&("resolved"==R.request.state()||"rejected"==R.request.state())}},add:{urlData:function(o,s){var e,t;return o&&(e=o.match(f.regExp.required),t=o.match(f.regExp.optional),s=s||f.urlData,e&&(R.debug("Looking for required URL variables",e),P.each(e,function(e,t){var r=-1!==t.indexOf("$")?t.slice(2,-1):t.slice(1,-1),n=P.isPlainObject(s)&&s[r]!==j?s[r]:p.data(r)!==j?p.data(r):b.data(r)!==j?b.data(r):s[r];if(n===j)return R.error(c.requiredParameter,r,o),o=!1;R.verbose("Found required variable",r,n),n=f.encodeParameters?R.get.urlEncodedValue(n):n,o=o.replace(t,n)})),t&&(R.debug("Looking for optional URL variables",e),P.each(t,function(e,t){var r=-1!==t.indexOf("$")?t.slice(3,-1):t.slice(2,-1),n=P.isPlainObject(s)&&s[r]!==j?s[r]:p.data(r)!==j?p.data(r):b.data(r)!==j?b.data(r):s[r];o=n!==j?(R.verbose("Optional variable Found",r,n),o.replace(t,n)):(R.verbose("Optional variable not found",r),-1!==o.indexOf("/"+t)?o.replace("/"+t,""):o.replace(t,""))}))),o},formData:function(r){var e,n,u,c,d,l={},t="formdata"===f.serializeForm;return r=r||o||f.data,e=P.isPlainObject(r),t?(l=new FormData(m[0]),f.processData=void 0!==f.processData&&f.processData,f.contentType=void 0!==f.contentType&&f.contentType):(n=m.serializeArray(),u={},c={},d=function(e,t,r){return e[t]=r,e},P.each(P('input[type="file"]',m),function(e,r){P.each(P(r)[0].files,function(e,t){n.push({name:r.name,value:t})})}),P.each(n,function(e,t){if(f.regExp.validate.test(t.name)){var r,n="checkbox"===P('[name="'+t.name+'"]',m).attr("type"),o=parseFloat(t.value),s=n&&"on"===t.value||"true"===t.value||(String(o)===t.value?o:"false"!==t.value&&t.value),a=t.name.match(f.regExp.key)||[],i=t.name.replace(/\[\]$/,"");i in u?Array.isArray(c[i])?c[i].push(s):c[i]=[c[i],s]:(u[i]=0,c[i]=s),s=c[i];for(;(r=a.pop())!==j;)""!=r||Array.isArray(s)?f.regExp.fixed.test(r)?s=d([],r,s):f.regExp.named.test(r)&&(s=d({},r,s)):s=d([],u[i]++,s);l=P.extend(!0,l,s)}})),r=e?(R.debug("Extending existing data with form data",r,l),t?(P.each(Object.keys(r),function(e,t){l.append(t,r[t])}),l):P.extend(!0,{},r,l)):(R.debug("Adding form data",l),l)}},send:{request:function(){R.set.loading(),R.request=R.create.request(),R.is.mocked()?R.mockedXHR=R.create.mockedXHR():R.xhr=R.create.xhr(),f.onRequest.call(h,R.request,R.xhr)}},event:{trigger:function(e){R.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(e,t,r){var n=this,o=(new Date).getTime()-a,o=f.loadingDuration-o,s=!!P.isFunction(f.onResponse)&&(R.is.expectingJSON()&&!f.rawResponse?f.onResponse.call(n,P.extend(!0,{},e)):f.onResponse.call(n,e)),o=0<o?o:0;s&&(R.debug("Modified API response in onResponse callback",f.onResponse,s,e),e=s),0<o&&R.debug("Response completed early delaying state change by",o),setTimeout(function(){R.is.validResponse(e)?R.request.resolveWith(n,[e,r]):R.request.rejectWith(n,[r,"invalid"])},o)},fail:function(e,t,r){var n=this,o=(new Date).getTime()-a,o=f.loadingDuration-o;0<(o=0<o?o:0)&&R.debug("Response completed early delaying state change by",o),setTimeout(function(){R.is.abortedRequest(e)?R.request.rejectWith(n,[e,"aborted",r]):R.request.rejectWith(n,[e,"error",t,r])},o)}},request:{done:function(e,t){R.debug("Successful API Response",e),"local"===f.cache&&r&&(R.write.cachedResponse(r,e),R.debug("Saving server response locally",R.cache)),f.onSuccess.call(h,e,p,t)},complete:function(e,t){var r,n;R.was.successful()?(n=e,r=t):n=R.get.responseFromXHR(r=e),R.remove.loading(),f.onComplete.call(h,n,p,r)},fail:function(e,t,r){var n=R.get.responseFromXHR(e),o=R.get.errorFromRequest(n,t,r);if("aborted"==t)return R.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,r),f.onAbort.call(h,t,p,e),!0;"invalid"==t?R.debug("JSON did not pass success test. A server-side error has most likely occurred",n):"error"==t&&e!==j&&(R.debug("XHR produced a server error",t,r),(e.status<200||300<=e.status)&&r!==j&&""!==r&&R.error(c.statusMessage+r,s.url),f.onError.call(h,o,p,e)),f.errorDuration&&"aborted"!==t&&(R.debug("Adding error state"),R.set.error(),R.should.removeError()&&setTimeout(R.remove.error,f.errorDuration)),R.debug("API Request failed",o,e),f.onFailure.call(h,n,p,e)}}},create:{request:function(){return P.Deferred().always(R.event.request.complete).done(R.event.request.done).fail(R.event.request.fail)},mockedXHR:function(){var e=f.mockResponse||f.response,t=f.mockResponseAsync||f.responseAsync,r=P.Deferred().always(R.event.xhr.complete).done(R.event.xhr.done).fail(R.event.xhr.fail);return e?(e=P.isFunction(e)?(R.debug("Using specified synchronous callback",e),e.call(h,n)):(R.debug("Using settings specified response",e),e),r.resolveWith(h,[e,!1,{responseText:e}])):P.isFunction(t)&&(e=function(e){R.debug("Async callback returned response",e),e?r.resolveWith(h,[e,!1,{responseText:e}]):r.rejectWith(h,[{responseText:e},!1,!1])},R.debug("Using specified async response callback",t),t.call(h,n,e)),r},xhr:function(){var e=P.ajax(s).always(R.event.xhr.always).done(R.event.xhr.done).fail(R.event.xhr.fail);return R.verbose("Created server request",e,s),e}},set:{error:function(){R.verbose("Adding error state to element",b),b.addClass(d.error)},loading:function(){R.verbose("Adding loading state to element",b),b.addClass(d.loading),a=(new Date).getTime()}},remove:{error:function(){R.verbose("Removing error state from element",b),b.removeClass(d.error)},loading:function(){R.verbose("Removing loading state from element",b),b.removeClass(d.loading)}},get:{normalizedData:function(){return"string"==typeof f.data?f.data:JSON.stringify(f.data,Object.keys(f.data).sort())},responseFromXHR:function(e){return!!P.isPlainObject(e)&&(R.is.expectingJSON()?R.decode.json(e.responseText):e.responseText)},errorFromRequest:function(e,t,r){return P.isPlainObject(e)&&e.error!==j?e.error:f.error[t]!==j?f.error[t]:r},request:function(){return R.request||!1},xhr:function(){return R.xhr||!1},settings:function(){var e=f.beforeSend.call(p,f);return e&&(e.success!==j&&(R.debug("Legacy success callback detected",e),R.error(c.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==j&&(R.debug("Legacy failure callback detected",e),R.error(c.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==j&&(R.debug("Legacy complete callback detected",e),R.error(c.legacyParameters,e.complete),e.onComplete=e.complete)),e===j&&R.error(c.noReturnedValue),!1===e?e:e!==j?P.extend(!0,{},e):P.extend(!0,{},f)},urlEncodedValue:function(e){var t=O.decodeURIComponent(e),r=O.encodeURIComponent(e);return t!==e?(R.debug("URL value is already encoded, avoiding double encoding",e),e):(R.verbose("Encoding value using encodeURIComponent",e,r),r)},defaultData:function(){var e={};return P.isWindow(v)||(R.is.input()?e.value=p.val():R.is.form()||(e.text=p.text())),e},event:function(){return P.isWindow(v)||"now"==f.on?(R.debug("API called without element, no events attached"),!1):"auto"==f.on?p.is("input")?v.oninput!==j?"input":v.onpropertychange!==j?"propertychange":"keyup":p.is("form")?"submit":"click":f.on},templatedURL:function(e){if(e=e||p.data(i.action)||f.action||!1,r=p.data(i.url)||f.url||!1)return R.debug("Using specified url",r),r;if(e){if(R.debug("Looking up url for action",e,f.api),f.api[e]===j&&!R.is.mocked())return void R.error(c.missingAction,f.action,f.api);r=f.api[e]}else R.is.form()&&(r=p.attr("action")||b.attr("action")||!1,R.debug("No url or action specified, defaulting to form action",r));return r}},abort:function(){var e=R.get.xhr();e&&"resolved"!==e.state()&&(R.debug("Cancelling API request"),e.abort())},reset:function(){R.remove.error(),R.remove.loading()},setting:function(e,t){if(R.debug("Changing setting",e,t),P.isPlainObject(e))P.extend(!0,f,e);else{if(t===j)return f[e];P.isPlainObject(f[e])?P.extend(!0,f[e],t):f[e]=t}},internal:function(e,t){if(P.isPlainObject(e))P.extend(!0,R,e);else{if(t===j)return R[e];R[e]=t}},debug:function(){!f.silent&&f.debug&&(f.performance?R.performance.log(arguments):(R.debug=Function.prototype.bind.call(console.info,console,f.name+":"),R.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?R.performance.log(arguments):(R.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),R.verbose.apply(console,arguments)))},error:function(){f.silent||(R.error=Function.prototype.bind.call(console.error,console,f.name+":"),R.error.apply(console,arguments))},performance:{log:function(e){var t,r;f.performance&&(r=(t=(new Date).getTime())-(k||t),k=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":r})),clearTimeout(R.performance.timer),R.performance.timer=setTimeout(R.performance.display,500)},display:function(){var e=f.name+":",r=0;k=!1,clearTimeout(R.performance.timer),P.each(S,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",A&&(e+=" '"+A+"'"),(console.group!==j||console.table!==j)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):P.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(n,e,t){var o,s,r,a=y;return e=e||D,t=v||t,"string"==typeof n&&a!==j&&(n=n.split(/[\. ]/),o=n.length-1,P.each(n,function(e,t){var r=e!=o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(P.isPlainObject(a[r])&&e!=o)a=a[r];else{if(a[r]!==j)return s=a[r],!1;{if(!P.isPlainObject(a[t])||e==o)return a[t]!==j?s=a[t]:R.error(c.method,n),!1;a=a[t]}}})),P.isFunction(s)?r=s.apply(t,e):s!==j&&(r=s),Array.isArray(x)?x.push(r):x!==j?x=[x,r]:r!==j&&(x=r),s}};w?(y===j&&R.initialize(),R.invoke(T)):(y!==j&&y.invoke("destroy"),R.initialize())}),x!==j?x:this},P.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,rawResponse:!0,beforeSend:function(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g,validate:/^[a-z_][a-z0-9_-]*(?:\[(?:\d*|[a-z0-9_-]+)\])*$/i,key:/[a-z0-9_-]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_-]+$/i},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,void document);
|
11
|
+
!function(P,O,j){"use strict";P.isWindow=P.isWindow||function(e){return null!=e&&e===e.window},O=void 0!==O&&O.Math==Math?O:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),P.api=P.fn.api=function(q){var x,e=P.isFunction(this)?P(O):P(this),A=e.selector||"",k=(new Date).getTime(),S=[],T=q,w="string"==typeof T,D=[].slice.call(arguments,1);return e.each(function(){var s,n,r,e,a,o,f=P.isPlainObject(q)?P.extend(!0,{},P.fn.api.settings,q):P.extend({},P.fn.api.settings),t=f.namespace,i=f.metadata,u=f.selector,c=f.error,d=f.className,l="."+t,g="module-"+t,p=P(this),m=p.closest(u.form),b=f.stateContext?P(f.stateContext):p,v=this,h=b[0],y=p.data(g),R={initialize:function(){w||(o=f.data,R.bind.events()),R.instantiate()},instantiate:function(){R.verbose("Storing instance of module",R),y=R,p.data(g,y)},destroy:function(){R.verbose("Destroying previous module for",v),p.removeData(g).off(l)},bind:{events:function(){var e=R.get.event();e?(R.verbose("Attaching API events to element",e),p.on(e+l,R.event.trigger)):"now"==f.on&&(R.debug("Querying API endpoint immediately"),R.query())}},decode:{json:function(e){if(e!==j&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(O.Storage!==j)return t=sessionStorage.getItem(e+R.get.normalizedData()),R.debug("Using cached response",e,f.data,t),R.decode.json(t);R.error(c.noStorage)}},write:{cachedResponse:function(e,t){t&&""===t?R.debug("Response empty, not caching",t):O.Storage===j?R.error(c.noStorage):(P.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+R.get.normalizedData(),t),R.verbose("Storing cached response for url",e,f.data,t))}},query:function(){if(R.is.disabled())R.debug("Element is disabled API request aborted");else{if(R.is.loading()){if(!f.interruptRequests)return void R.debug("Cancelling request, previous request is still pending");R.debug("Interrupting previous request"),R.abort()}if(f.defaultData&&P.extend(!0,f.urlData,R.get.defaultData()),f.serializeForm&&(f.data=R.add.formData(o||f.data)),!1===(n=R.get.settings()))return R.cancelled=!0,void R.error(c.beforeSend);if(R.cancelled=!1,(r=R.get.templatedURL())||R.is.mocked()){if((r=R.add.urlData(r))||R.is.mocked()){if(n.url=f.base+r,s=P.extend(!0,{},f,{type:f.method||f.type,data:e,url:f.base+r,beforeSend:f.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),R.debug("Querying URL",s.url),R.verbose("Using AJAX settings",s),"local"===f.cache&&R.read.cachedResponse(r))return R.debug("Response returned from local cache"),R.request=R.create.request(),void R.request.resolveWith(h,[R.read.cachedResponse(r)]);f.throttle?f.throttleFirstRequest||R.timer?(R.debug("Throttling request",f.throttle),clearTimeout(R.timer),R.timer=setTimeout(function(){R.timer&&delete R.timer,R.debug("Sending throttled request",e,s.method),R.send.request()},f.throttle)):(R.debug("Sending request",e,s.method),R.send.request(),R.timer=setTimeout(function(){},f.throttle)):(R.debug("Sending request",e,s.method),R.send.request())}}else R.error(c.missingURL)}},should:{removeError:function(){return!0===f.hideError||"auto"===f.hideError&&!R.is.form()}},is:{disabled:function(){return 0<p.filter(u.disabled).length},expectingJSON:function(){return"json"===f.dataType||"jsonp"===f.dataType},form:function(){return p.is("form")||b.is("form")},mocked:function(){return f.mockResponse||f.mockResponseAsync||f.response||f.responseAsync},input:function(){return p.is("input")},loading:function(){return!!R.request&&"pending"==R.request.state()},abortedRequest:function(e){return e&&e.readyState!==j&&0===e.readyState?(R.verbose("XHR request determined to be aborted"),!0):(R.verbose("XHR request was not aborted"),!1)},validResponse:function(e){return R.is.expectingJSON()&&P.isFunction(f.successTest)?(R.debug("Checking JSON returned success",f.successTest,e),f.successTest(e)?(R.debug("Response passed success test",e),!0):(R.debug("Response failed success test",e),!1)):(R.verbose("Response is not JSON, skipping validation",f.successTest,e),!0)}},was:{cancelled:function(){return R.cancelled||!1},successful:function(){return R.request&&"resolved"==R.request.state()},failure:function(){return R.request&&"rejected"==R.request.state()},complete:function(){return R.request&&("resolved"==R.request.state()||"rejected"==R.request.state())}},add:{urlData:function(o,s){var e,t;return o&&(e=o.match(f.regExp.required),t=o.match(f.regExp.optional),s=s||f.urlData,e&&(R.debug("Looking for required URL variables",e),P.each(e,function(e,t){var r=-1!==t.indexOf("$")?t.slice(2,-1):t.slice(1,-1),n=P.isPlainObject(s)&&s[r]!==j?s[r]:p.data(r)!==j?p.data(r):b.data(r)!==j?b.data(r):s[r];if(n===j)return R.error(c.requiredParameter,r,o),o=!1;R.verbose("Found required variable",r,n),n=f.encodeParameters?R.get.urlEncodedValue(n):n,o=o.replace(t,n)})),t&&(R.debug("Looking for optional URL variables",e),P.each(t,function(e,t){var r=-1!==t.indexOf("$")?t.slice(3,-1):t.slice(2,-1),n=P.isPlainObject(s)&&s[r]!==j?s[r]:p.data(r)!==j?p.data(r):b.data(r)!==j?b.data(r):s[r];o=n!==j?(R.verbose("Optional variable Found",r,n),o.replace(t,n)):(R.verbose("Optional variable not found",r),-1!==o.indexOf("/"+t)?o.replace("/"+t,""):o.replace(t,""))}))),o},formData:function(r){var e,n,u,c,d,l={},t="formdata"===f.serializeForm;return r=r||o||f.data,e=P.isPlainObject(r),t?(l=new FormData(m[0]),f.processData=void 0!==f.processData&&f.processData,f.contentType=void 0!==f.contentType&&f.contentType):(n=m.serializeArray(),u={},c={},d=function(e,t,r){return e[t]=r,e},P.each(P('input[type="file"]',m),function(e,r){P.each(P(r)[0].files,function(e,t){n.push({name:r.name,value:t})})}),P.each(n,function(e,t){if(f.regExp.validate.test(t.name)){var r,n="checkbox"===P('[name="'+t.name+'"]',m).attr("type"),o=parseFloat(t.value),s=n&&"on"===t.value||"true"===t.value||(String(o)===t.value?o:"false"!==t.value&&t.value),a=t.name.match(f.regExp.key)||[],i=t.name.replace(/\[\]$/,"");i in u?Array.isArray(c[i])?c[i].push(s):c[i]=[c[i],s]:(u[i]=0,c[i]=s),s=c[i];for(;(r=a.pop())!==j;)""!=r||Array.isArray(s)?f.regExp.fixed.test(r)?s=d([],r,s):f.regExp.named.test(r)&&(s=d({},r,s)):s=d([],u[i]++,s);l=P.extend(!0,l,s)}})),r=e?(R.debug("Extending existing data with form data",r,l),t?(P.each(Object.keys(r),function(e,t){l.append(t,r[t])}),l):P.extend(!0,{},r,l)):(R.debug("Adding form data",l),l)}},send:{request:function(){R.set.loading(),R.request=R.create.request(),R.is.mocked()?R.mockedXHR=R.create.mockedXHR():R.xhr=R.create.xhr(),f.onRequest.call(h,R.request,R.xhr)}},event:{trigger:function(e){R.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(e,t,r){var n=this,o=(new Date).getTime()-a,o=f.loadingDuration-o,s=!!P.isFunction(f.onResponse)&&(R.is.expectingJSON()&&!f.rawResponse?f.onResponse.call(n,P.extend(!0,{},e)):f.onResponse.call(n,e)),o=0<o?o:0;s&&(R.debug("Modified API response in onResponse callback",f.onResponse,s,e),e=s),0<o&&R.debug("Response completed early delaying state change by",o),setTimeout(function(){R.is.validResponse(e)?R.request.resolveWith(n,[e,r]):R.request.rejectWith(n,[r,"invalid"])},o)},fail:function(e,t,r){var n=this,o=(new Date).getTime()-a,o=f.loadingDuration-o;0<(o=0<o?o:0)&&R.debug("Response completed early delaying state change by",o),setTimeout(function(){R.is.abortedRequest(e)?R.request.rejectWith(n,[e,"aborted",r]):R.request.rejectWith(n,[e,"error",t,r])},o)}},request:{done:function(e,t){R.debug("Successful API Response",e),"local"===f.cache&&r&&(R.write.cachedResponse(r,e),R.debug("Saving server response locally",R.cache)),f.onSuccess.call(h,e,p,t)},complete:function(e,t){var r,n;R.was.successful()?(n=e,r=t):n=R.get.responseFromXHR(r=e),R.remove.loading(),f.onComplete.call(h,n,p,r)},fail:function(e,t,r){var n=R.get.responseFromXHR(e),o=R.get.errorFromRequest(n,t,r);if("aborted"==t)return R.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,r),f.onAbort.call(h,t,p,e),!0;"invalid"==t?R.debug("JSON did not pass success test. A server-side error has most likely occurred",n):"error"==t&&e!==j&&(R.debug("XHR produced a server error",t,r),(e.status<200||300<=e.status)&&r!==j&&""!==r&&R.error(c.statusMessage+r,s.url),f.onError.call(h,o,p,e)),f.errorDuration&&"aborted"!==t&&(R.debug("Adding error state"),R.set.error(),R.should.removeError()&&setTimeout(R.remove.error,f.errorDuration)),R.debug("API Request failed",o,e),f.onFailure.call(h,n,p,e)}}},create:{request:function(){return P.Deferred().always(R.event.request.complete).done(R.event.request.done).fail(R.event.request.fail)},mockedXHR:function(){var e=f.mockResponse||f.response,t=f.mockResponseAsync||f.responseAsync,r=P.Deferred().always(R.event.xhr.complete).done(R.event.xhr.done).fail(R.event.xhr.fail);return e?(e=P.isFunction(e)?(R.debug("Using specified synchronous callback",e),e.call(h,n)):(R.debug("Using settings specified response",e),e),r.resolveWith(h,[e,!1,{responseText:e}])):P.isFunction(t)&&(e=function(e){R.debug("Async callback returned response",e),e?r.resolveWith(h,[e,!1,{responseText:e}]):r.rejectWith(h,[{responseText:e},!1,!1])},R.debug("Using specified async response callback",t),t.call(h,n,e)),r},xhr:function(){var e=P.ajax(s).always(R.event.xhr.always).done(R.event.xhr.done).fail(R.event.xhr.fail);return R.verbose("Created server request",e,s),e}},set:{error:function(){R.verbose("Adding error state to element",b),b.addClass(d.error)},loading:function(){R.verbose("Adding loading state to element",b),b.addClass(d.loading),a=(new Date).getTime()}},remove:{error:function(){R.verbose("Removing error state from element",b),b.removeClass(d.error)},loading:function(){R.verbose("Removing loading state from element",b),b.removeClass(d.loading)}},get:{normalizedData:function(){return"string"==typeof f.data?f.data:JSON.stringify(f.data,Object.keys(f.data).sort())},responseFromXHR:function(e){return!!P.isPlainObject(e)&&(R.is.expectingJSON()?R.decode.json(e.responseText):e.responseText)},errorFromRequest:function(e,t,r){return P.isPlainObject(e)&&e.error!==j?e.error:f.error[t]!==j?f.error[t]:r},request:function(){return R.request||!1},xhr:function(){return R.xhr||!1},settings:function(){var e=f.beforeSend.call(p,f);return e&&(e.success!==j&&(R.debug("Legacy success callback detected",e),R.error(c.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==j&&(R.debug("Legacy failure callback detected",e),R.error(c.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==j&&(R.debug("Legacy complete callback detected",e),R.error(c.legacyParameters,e.complete),e.onComplete=e.complete)),e===j&&R.error(c.noReturnedValue),!1===e?e:e!==j?P.extend(!0,{},e):P.extend(!0,{},f)},urlEncodedValue:function(e){var t=O.decodeURIComponent(e),r=O.encodeURIComponent(e);return t!==e?(R.debug("URL value is already encoded, avoiding double encoding",e),e):(R.verbose("Encoding value using encodeURIComponent",e,r),r)},defaultData:function(){var e={};return P.isWindow(v)||(R.is.input()?e.value=p.val():R.is.form()||(e.text=p.text())),e},event:function(){return P.isWindow(v)||"now"==f.on?(R.debug("API called without element, no events attached"),!1):"auto"==f.on?p.is("input")?v.oninput!==j?"input":v.onpropertychange!==j?"propertychange":"keyup":p.is("form")?"submit":"click":f.on},templatedURL:function(e){if(e=e||p.data(i.action)||f.action||!1,r=p.data(i.url)||f.url||!1)return R.debug("Using specified url",r),r;if(e){if(R.debug("Looking up url for action",e,f.api),f.api[e]===j&&!R.is.mocked())return void R.error(c.missingAction,f.action,f.api);r=f.api[e]}else R.is.form()&&(r=p.attr("action")||b.attr("action")||!1,R.debug("No url or action specified, defaulting to form action",r));return r}},abort:function(){var e=R.get.xhr();e&&"resolved"!==e.state()&&(R.debug("Cancelling API request"),e.abort())},reset:function(){R.remove.error(),R.remove.loading()},setting:function(e,t){if(R.debug("Changing setting",e,t),P.isPlainObject(e))P.extend(!0,f,e);else{if(t===j)return f[e];P.isPlainObject(f[e])?P.extend(!0,f[e],t):f[e]=t}},internal:function(e,t){if(P.isPlainObject(e))P.extend(!0,R,e);else{if(t===j)return R[e];R[e]=t}},debug:function(){!f.silent&&f.debug&&(f.performance?R.performance.log(arguments):(R.debug=Function.prototype.bind.call(console.info,console,f.name+":"),R.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?R.performance.log(arguments):(R.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),R.verbose.apply(console,arguments)))},error:function(){f.silent||(R.error=Function.prototype.bind.call(console.error,console,f.name+":"),R.error.apply(console,arguments))},performance:{log:function(e){var t,r;f.performance&&(r=(t=(new Date).getTime())-(k||t),k=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":r})),clearTimeout(R.performance.timer),R.performance.timer=setTimeout(R.performance.display,500)},display:function(){var e=f.name+":",r=0;k=!1,clearTimeout(R.performance.timer),P.each(S,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",A&&(e+=" '"+A+"'"),(console.group!==j||console.table!==j)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):P.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(n,e,t){var o,s,r,a=y;return e=e||D,t=v||t,"string"==typeof n&&a!==j&&(n=n.split(/[\. ]/),o=n.length-1,P.each(n,function(e,t){var r=e!=o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(P.isPlainObject(a[r])&&e!=o)a=a[r];else{if(a[r]!==j)return s=a[r],!1;{if(!P.isPlainObject(a[t])||e==o)return a[t]!==j?s=a[t]:R.error(c.method,n),!1;a=a[t]}}})),P.isFunction(s)?r=s.apply(t,e):s!==j&&(r=s),Array.isArray(x)?x.push(r):x!==j?x=[x,r]:r!==j&&(x=r),s}};w?(y===j&&R.initialize(),R.invoke(T)):(y!==j&&y.invoke("destroy"),R.initialize())}),x!==j?x:this},P.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,rawResponse:!0,beforeSend:function(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g,validate:/^[a-z_][a-z0-9_-]*(?:\[[a-z0-9_-]*\])*$/i,key:/[a-z0-9_-]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_-]+$/i},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,void document);
|
package/dist/components/card.css
CHANGED