fomantic-ui 2.9.0-beta.30 → 2.9.0-beta.302
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 +251 -3
- package/.github/codeql/codeql-config.yml +4 -0
- package/.github/dependabot.yml +10 -0
- package/.github/workflows/ci.yml +10 -6
- package/.github/workflows/codeql.yml +68 -0
- package/.github/workflows/nightly.yml +16 -8
- package/.github/workflows/release.yml +34 -0
- package/CONTRIBUTORS.md +82 -37
- package/FAQ.md +38 -38
- package/README.md +8 -8
- package/dist/components/accordion.css +176 -36
- package/dist/components/accordion.js +6 -3
- package/dist/components/accordion.min.css +2 -2
- package/dist/components/accordion.min.js +3 -3
- package/dist/components/ad.css +4 -4
- package/dist/components/ad.min.css +2 -2
- package/dist/components/api.js +89 -30
- package/dist/components/api.min.js +3 -3
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +204 -157
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +18 -1
- package/dist/components/calendar.js +85 -68
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +3 -3
- package/dist/components/card.css +754 -117
- package/dist/components/card.min.css +2 -2
- package/dist/components/checkbox.css +92 -91
- package/dist/components/checkbox.js +17 -11
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +3 -3
- package/dist/components/comment.css +12 -12
- package/dist/components/comment.min.css +2 -2
- package/dist/components/container.css +98 -4
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +29 -14
- package/dist/components/dimmer.js +11 -5
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +3 -3
- package/dist/components/divider.css +31 -31
- package/dist/components/divider.min.css +2 -2
- package/dist/components/dropdown.css +90 -50
- package/dist/components/dropdown.js +151 -116
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +3 -3
- package/dist/components/embed.css +5 -5
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +2 -2
- package/dist/components/embed.min.js +3 -3
- package/dist/components/emoji.css +10847 -8841
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +29 -29
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +1011 -902
- package/dist/components/flag.min.css +2 -2
- package/dist/components/form.css +160 -83
- package/dist/components/form.js +39 -30
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +3 -3
- package/dist/components/grid.css +25 -21
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +6 -4
- package/dist/components/header.min.css +2 -2
- package/dist/components/icon.css +2063 -1984
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +759 -22
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +17 -17
- package/dist/components/item.min.css +2 -2
- package/dist/components/label.css +72 -68
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +31 -31
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +352 -352
- package/dist/components/loader.min.css +2 -2
- package/dist/components/menu.css +108 -76
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +43 -43
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +29 -4
- package/dist/components/modal.js +128 -50
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +3 -3
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +2 -2
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +3 -3
- package/dist/components/placeholder.css +33 -33
- package/dist/components/placeholder.min.css +2 -2
- package/dist/components/popup.css +100 -104
- package/dist/components/popup.js +11 -11
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +3 -3
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +4 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +3 -3
- 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 +3 -3
- package/dist/components/reset.css +5 -4
- package/dist/components/reset.min.css +2 -2
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +6 -6
- package/dist/components/search.js +23 -7
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +3 -3
- package/dist/components/segment.css +118 -34
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +3 -3
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +3 -3
- package/dist/components/sidebar.css +7 -5
- package/dist/components/sidebar.js +14 -12
- package/dist/components/sidebar.min.css +2 -2
- package/dist/components/sidebar.min.js +3 -3
- package/dist/components/site.css +139 -42
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +3 -3
- package/dist/components/slider.css +17 -17
- package/dist/components/slider.js +68 -51
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +3 -3
- package/dist/components/state.js +2 -2
- package/dist/components/state.min.js +3 -3
- package/dist/components/statistic.css +4 -4
- package/dist/components/statistic.min.css +2 -2
- package/dist/components/step.css +31 -31
- package/dist/components/step.min.css +2 -2
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +4 -4
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +3 -3
- package/dist/components/tab.css +5 -5
- package/dist/components/tab.js +24 -6
- package/dist/components/tab.min.css +2 -2
- package/dist/components/tab.min.js +3 -3
- package/dist/components/table.css +1684 -272
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +42 -1
- package/dist/components/toast.js +63 -31
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +3 -3
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +21 -16
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +3 -3
- package/dist/components/visibility.js +2 -2
- package/dist/components/visibility.min.js +3 -3
- package/dist/semantic.css +20183 -13376
- package/dist/semantic.js +772 -466
- package/dist/semantic.min.css +3 -3
- package/dist/semantic.min.js +3 -3
- package/dist/themes/default/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/themes/default/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/themes/default/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
- package/dist/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
- package/dist/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
- package/dist/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
- package/dist/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
- package/dist/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
- package/dist/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
- package/dist/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
- package/dist/themes/default/assets/fonts/brand-icons.eot +0 -0
- package/dist/themes/default/assets/fonts/brand-icons.svg +801 -654
- package/dist/themes/default/assets/fonts/brand-icons.ttf +0 -0
- package/dist/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/dist/themes/default/assets/fonts/brand-icons.woff2 +0 -0
- package/dist/themes/default/assets/fonts/icons.eot +0 -0
- package/dist/themes/default/assets/fonts/icons.svg +1175 -1079
- package/dist/themes/default/assets/fonts/icons.ttf +0 -0
- package/dist/themes/default/assets/fonts/icons.woff +0 -0
- package/dist/themes/default/assets/fonts/icons.woff2 +0 -0
- package/dist/themes/default/assets/fonts/outline-icons.eot +0 -0
- package/dist/themes/default/assets/fonts/outline-icons.svg +93 -95
- package/dist/themes/default/assets/fonts/outline-icons.ttf +0 -0
- package/dist/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/dist/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- package/dist/themes/{default → famfamfam}/assets/images/flags.png +0 -0
- package/examples/assets/library/iframe-content.js +8 -8
- package/examples/assets/library/iframe.js +3 -3
- 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 +18 -16
- package/scripts/nightly-version.js +47 -38
- package/src/definitions/behaviors/api.js +88 -29
- package/src/definitions/behaviors/form.js +38 -29
- package/src/definitions/behaviors/state.js +1 -1
- package/src/definitions/behaviors/visibility.js +1 -1
- package/src/definitions/collections/form.less +229 -165
- package/src/definitions/collections/grid.less +723 -687
- package/src/definitions/collections/menu.less +232 -170
- package/src/definitions/collections/message.less +49 -47
- package/src/definitions/collections/table.less +882 -272
- package/src/definitions/elements/button.less +611 -469
- package/src/definitions/elements/container.less +145 -8
- package/src/definitions/elements/divider.less +24 -24
- package/src/definitions/elements/emoji.less +39 -10
- package/src/definitions/elements/flag.less +53 -18
- package/src/definitions/elements/header.less +46 -37
- package/src/definitions/elements/icon.less +39 -32
- package/src/definitions/elements/input.less +281 -33
- package/src/definitions/elements/label.less +132 -128
- package/src/definitions/elements/list.less +84 -75
- package/src/definitions/elements/loader.less +99 -98
- package/src/definitions/elements/placeholder.less +32 -32
- package/src/definitions/elements/segment.less +177 -56
- package/src/definitions/elements/step.less +76 -72
- package/src/definitions/elements/text.less +17 -15
- package/src/definitions/globals/reset.less +2 -2
- package/src/definitions/globals/site.less +25 -2
- package/src/definitions/modules/accordion.js +5 -2
- package/src/definitions/modules/accordion.less +371 -219
- package/src/definitions/modules/calendar.js +84 -67
- package/src/definitions/modules/calendar.less +20 -0
- package/src/definitions/modules/checkbox.js +16 -10
- package/src/definitions/modules/checkbox.less +83 -227
- package/src/definitions/modules/dimmer.js +10 -4
- package/src/definitions/modules/dimmer.less +22 -8
- package/src/definitions/modules/dropdown.js +150 -115
- package/src/definitions/modules/dropdown.less +191 -136
- package/src/definitions/modules/embed.less +4 -4
- package/src/definitions/modules/modal.js +127 -49
- package/src/definitions/modules/modal.less +66 -33
- package/src/definitions/modules/nag.js +1 -1
- package/src/definitions/modules/nag.less +20 -19
- package/src/definitions/modules/popup.js +10 -10
- package/src/definitions/modules/popup.less +86 -90
- package/src/definitions/modules/progress.js +3 -0
- package/src/definitions/modules/progress.less +19 -18
- package/src/definitions/modules/rating.less +35 -34
- package/src/definitions/modules/search.js +22 -6
- package/src/definitions/modules/search.less +35 -19
- package/src/definitions/modules/shape.js +2 -2
- package/src/definitions/modules/sidebar.js +13 -11
- package/src/definitions/modules/sidebar.less +36 -22
- package/src/definitions/modules/slider.js +67 -50
- package/src/definitions/modules/slider.less +48 -47
- package/src/definitions/modules/sticky.js +3 -3
- package/src/definitions/modules/sticky.less +3 -1
- package/src/definitions/modules/tab.js +23 -5
- package/src/definitions/modules/tab.less +4 -4
- package/src/definitions/modules/toast.js +62 -30
- package/src/definitions/modules/toast.less +51 -16
- package/src/definitions/modules/transition.js +20 -15
- package/src/definitions/views/ad.less +3 -3
- package/src/definitions/views/card.less +522 -375
- package/src/definitions/views/comment.less +93 -82
- package/src/definitions/views/feed.less +164 -144
- package/src/definitions/views/item.less +251 -198
- package/src/definitions/views/statistic.less +91 -89
- package/src/theme.less +13 -2
- package/src/themes/amazon/globals/site.variables +1 -0
- package/src/themes/basic/elements/icon.overrides +149 -149
- package/src/themes/basic/elements/step.overrides +2 -2
- package/src/themes/bookish/elements/header.overrides +1 -1
- package/src/themes/chubby/elements/button.overrides +1 -1
- package/src/themes/chubby/elements/header.overrides +1 -1
- package/src/themes/default/assets/fonts/Lato-Bold.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
- package/src/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/src/themes/default/assets/fonts/Lato-Italic.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
- package/src/themes/default/assets/fonts/Lato-Regular.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
- package/src/themes/default/assets/fonts/brand-icons.eot +0 -0
- package/src/themes/default/assets/fonts/brand-icons.svg +801 -654
- package/src/themes/default/assets/fonts/brand-icons.ttf +0 -0
- package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/src/themes/default/assets/fonts/brand-icons.woff2 +0 -0
- package/src/themes/default/assets/fonts/icons.eot +0 -0
- package/src/themes/default/assets/fonts/icons.svg +1175 -1079
- package/src/themes/default/assets/fonts/icons.ttf +0 -0
- package/src/themes/default/assets/fonts/icons.woff +0 -0
- package/src/themes/default/assets/fonts/icons.woff2 +0 -0
- package/src/themes/default/assets/fonts/outline-icons.eot +0 -0
- package/src/themes/default/assets/fonts/outline-icons.svg +93 -95
- package/src/themes/default/assets/fonts/outline-icons.ttf +0 -0
- package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/src/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- package/src/themes/default/collections/form.variables +4 -0
- package/src/themes/default/collections/menu.variables +6 -0
- package/src/themes/default/collections/table.variables +52 -0
- package/src/themes/default/elements/button.variables +7 -1
- package/src/themes/default/elements/container.variables +12 -0
- package/src/themes/default/elements/divider.overrides +7 -7
- package/src/themes/default/elements/emoji.overrides +0 -3090
- package/src/themes/default/elements/emoji.variables +3575 -1
- package/src/themes/default/elements/flag.overrides +0 -991
- package/src/themes/default/elements/flag.variables +1609 -5
- package/src/themes/default/elements/icon.overrides +1975 -1949
- package/src/themes/default/elements/icon.variables +1 -0
- package/src/themes/default/elements/input.variables +15 -0
- package/src/themes/default/elements/segment.variables +8 -0
- package/src/themes/default/elements/step.overrides +3 -3
- package/src/themes/default/globals/site.variables +109 -8
- package/src/themes/default/globals/variation.variables +143 -6
- package/src/themes/default/modules/accordion.overrides +6 -5
- package/src/themes/default/modules/accordion.variables +49 -2
- package/src/themes/default/modules/calendar.variables +3 -0
- package/src/themes/default/modules/checkbox.overrides +9 -9
- package/src/themes/default/modules/checkbox.variables +5 -5
- package/src/themes/default/modules/dimmer.variables +1 -1
- package/src/themes/default/modules/dropdown.overrides +5 -5
- package/src/themes/default/modules/dropdown.variables +4 -10
- package/src/themes/default/modules/modal.variables +14 -0
- package/src/themes/default/modules/popup.variables +0 -2
- package/src/themes/default/modules/toast.variables +3 -0
- package/src/themes/default/views/card.variables +8 -0
- package/src/themes/{default → famfamfam}/assets/images/flags.png +0 -0
- package/src/themes/famfamfam/elements/flag.overrides +1026 -0
- package/src/themes/famfamfam/elements/flag.variables +20 -0
- package/src/themes/github/elements/icon.overrides +206 -206
- package/src/themes/github/elements/step.overrides +5 -5
- package/src/themes/github/globals/site.variables +1 -0
- package/src/themes/github/modules/dropdown.overrides +6 -6
- package/src/themes/instagram/views/card.overrides +1 -1
- package/src/themes/joypixels/elements/emoji.overrides +0 -3089
- package/src/themes/joypixels/elements/emoji.variables +3574 -5
- package/src/themes/material/collections/menu.overrides +1 -1
- package/src/themes/material/elements/button.overrides +1 -1
- package/src/themes/material/elements/header.overrides +1 -1
- package/src/themes/material/elements/icon.overrides +932 -932
- package/src/themes/material/globals/site.variables +0 -1
- package/src/themes/material/modules/dropdown.overrides +1 -1
- package/src/themes/material/modules/modal.overrides +1 -1
- package/src/themes/pulsar/elements/loader.overrides +2 -2
- package/src/themes/resetcss/globals/reset.overrides +3 -3
- package/src/themes/rtl/globals/site.overrides +1 -1
- package/src/themes/striped/modules/progress.overrides +1 -1
- package/src/themes/systemfont/globals/reset.overrides +8 -0
- package/src/themes/systemfont/globals/site.variables +10 -0
- package/src/themes/twitter/elements/emoji.overrides +0 -3091
- 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 +9 -4
- package/tasks/build/javascript.js +3 -3
- 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/config/project/install.js +15 -13
- package/tasks/install.js +1 -0
- 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 +2 -2
- package/test/helpers/jasmine-sinon.js +1 -1
- package/test/helpers/jquery-events.js +1 -1
- package/test/helpers/sinon.js +3 -3
- 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/dist/semantic.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.0-beta.
|
2
|
+
* # Fomantic UI - 2.9.0-beta.302+091bcb0
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* http://fomantic-ui.com/
|
5
5
|
*
|
6
|
-
* Copyright
|
6
|
+
* Copyright 2022 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
11
|
/*!
|
12
|
-
* # Fomantic-UI 2.9.0-beta.
|
12
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Site
|
13
13
|
* http://github.com/fomantic/Fomantic-UI/
|
14
14
|
*
|
15
15
|
*
|
@@ -503,7 +503,7 @@ $.extend($.expr[ ":" ], {
|
|
503
503
|
})( jQuery, window, document );
|
504
504
|
|
505
505
|
/*!
|
506
|
-
* # Fomantic-UI 2.9.0-beta.
|
506
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Form Validation
|
507
507
|
* http://github.com/fomantic/Fomantic-UI/
|
508
508
|
*
|
509
509
|
*
|
@@ -635,6 +635,11 @@ $.fn.form = function(parameters) {
|
|
635
635
|
$reset = $module.find(selector.reset);
|
636
636
|
},
|
637
637
|
|
638
|
+
refreshEvents: function() {
|
639
|
+
module.removeEvents();
|
640
|
+
module.bindEvents();
|
641
|
+
},
|
642
|
+
|
638
643
|
submit: function() {
|
639
644
|
module.verbose('Submitting form', $module);
|
640
645
|
submitting = true;
|
@@ -895,7 +900,6 @@ $.fn.form = function(parameters) {
|
|
895
900
|
$module.off(eventNamespace);
|
896
901
|
$field.off(eventNamespace);
|
897
902
|
$submit.off(eventNamespace);
|
898
|
-
$field.off(eventNamespace);
|
899
903
|
},
|
900
904
|
|
901
905
|
event: {
|
@@ -923,6 +927,7 @@ $.fn.form = function(parameters) {
|
|
923
927
|
$field.one('keyup' + eventNamespace, module.event.field.keyup);
|
924
928
|
module.submit();
|
925
929
|
module.debug('Enter pressed on input submitting form');
|
930
|
+
event.preventDefault();
|
926
931
|
}
|
927
932
|
keyHeldDown = true;
|
928
933
|
}
|
@@ -1047,7 +1052,7 @@ $.fn.form = function(parameters) {
|
|
1047
1052
|
parts,
|
1048
1053
|
suffixPrompt
|
1049
1054
|
;
|
1050
|
-
if(ancillary && ancillary.indexOf('..') >= 0) {
|
1055
|
+
if(ancillary && ['integer', 'decimal', 'number'].indexOf(ruleName) >= 0 && ancillary.indexOf('..') >= 0) {
|
1051
1056
|
parts = ancillary.split('..', 2);
|
1052
1057
|
if(!rule.prompt) {
|
1053
1058
|
suffixPrompt = (
|
@@ -1089,7 +1094,7 @@ $.fn.form = function(parameters) {
|
|
1089
1094
|
if(isLegacySettings) {
|
1090
1095
|
// 1.x (ducktyped)
|
1091
1096
|
settings = $.extend(true, {}, $.fn.form.settings, legacyParameters);
|
1092
|
-
validation = $.extend({}, $.fn.form.settings.defaults, parameters);
|
1097
|
+
validation = $.extend(true, {}, $.fn.form.settings.defaults, parameters);
|
1093
1098
|
module.error(settings.error.oldSyntax, element);
|
1094
1099
|
module.verbose('Extending settings from legacy parameters', validation, settings);
|
1095
1100
|
}
|
@@ -1099,13 +1104,13 @@ $.fn.form = function(parameters) {
|
|
1099
1104
|
parameters.fields = module.get.fieldsFromShorthand(parameters.fields);
|
1100
1105
|
}
|
1101
1106
|
settings = $.extend(true, {}, $.fn.form.settings, parameters);
|
1102
|
-
validation = $.extend({}, $.fn.form.settings.defaults, settings.fields);
|
1107
|
+
validation = $.extend(true, {}, $.fn.form.settings.defaults, settings.fields);
|
1103
1108
|
module.verbose('Extending settings', validation, settings);
|
1104
1109
|
}
|
1105
1110
|
}
|
1106
1111
|
else {
|
1107
|
-
settings = $.fn.form.settings;
|
1108
|
-
validation = $.fn.form.settings.defaults;
|
1112
|
+
settings = $.extend(true, {}, $.fn.form.settings);
|
1113
|
+
validation = $.extend(true, {}, $.fn.form.settings.defaults);
|
1109
1114
|
module.verbose('Using default form validation', validation, settings);
|
1110
1115
|
}
|
1111
1116
|
|
@@ -1367,9 +1372,11 @@ $.fn.form = function(parameters) {
|
|
1367
1372
|
}
|
1368
1373
|
});
|
1369
1374
|
module.debug('Adding rules', newValidation.rules, validation);
|
1375
|
+
module.refreshEvents();
|
1370
1376
|
},
|
1371
1377
|
fields: function(fields) {
|
1372
|
-
validation = $.extend({}, validation, module.get.fieldsFromShorthand(fields));
|
1378
|
+
validation = $.extend(true, {}, validation, module.get.fieldsFromShorthand(fields));
|
1379
|
+
module.refreshEvents();
|
1373
1380
|
},
|
1374
1381
|
prompt: function(identifier, errors, internal) {
|
1375
1382
|
var
|
@@ -1390,13 +1397,13 @@ $.fn.form = function(parameters) {
|
|
1390
1397
|
}
|
1391
1398
|
if(settings.inline) {
|
1392
1399
|
if(!promptExists) {
|
1393
|
-
$prompt =
|
1400
|
+
$prompt = $('<div/>').addClass(className.label);
|
1394
1401
|
$prompt
|
1395
1402
|
.appendTo($fieldGroup)
|
1396
1403
|
;
|
1397
1404
|
}
|
1398
1405
|
$prompt
|
1399
|
-
.html(errors
|
1406
|
+
.html(settings.templates.prompt(errors))
|
1400
1407
|
;
|
1401
1408
|
if(!promptExists) {
|
1402
1409
|
if(settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
|
@@ -1466,6 +1473,7 @@ $.fn.form = function(parameters) {
|
|
1466
1473
|
$.each(fields, function(index, field) {
|
1467
1474
|
module.remove.rule(field);
|
1468
1475
|
});
|
1476
|
+
module.refreshEvents();
|
1469
1477
|
},
|
1470
1478
|
// alias
|
1471
1479
|
rules: function(field, rules) {
|
@@ -1589,12 +1597,15 @@ $.fn.form = function(parameters) {
|
|
1589
1597
|
}
|
1590
1598
|
else if(isCheckbox) {
|
1591
1599
|
module.verbose('Setting checkbox value', value, $element);
|
1592
|
-
if(value === true || value === 1) {
|
1600
|
+
if(value === true || value === 1 || value === 'on') {
|
1593
1601
|
$element.checkbox('check');
|
1594
1602
|
}
|
1595
1603
|
else {
|
1596
1604
|
$element.checkbox('uncheck');
|
1597
1605
|
}
|
1606
|
+
if(typeof value === 'string') {
|
1607
|
+
$field.val(value);
|
1608
|
+
}
|
1598
1609
|
}
|
1599
1610
|
else if(isDropdown) {
|
1600
1611
|
module.verbose('Setting dropdown value', value, $element);
|
@@ -1707,10 +1718,10 @@ $.fn.form = function(parameters) {
|
|
1707
1718
|
if(event && $module.data('moduleApi') !== undefined) {
|
1708
1719
|
event.stopImmediatePropagation();
|
1709
1720
|
}
|
1710
|
-
if(settings.errorFocus) {
|
1721
|
+
if(settings.errorFocus && ignoreCallbacks !== true) {
|
1711
1722
|
var focusElement, hasTabIndex = true;
|
1712
1723
|
if (typeof settings.errorFocus === 'string') {
|
1713
|
-
focusElement = $(settings.errorFocus);
|
1724
|
+
focusElement = $(document).find(settings.errorFocus);
|
1714
1725
|
hasTabIndex = focusElement.is('[tabindex]');
|
1715
1726
|
// to be able to focus/scroll into non input elements we need a tabindex
|
1716
1727
|
if (!hasTabIndex) {
|
@@ -2030,7 +2041,7 @@ $.fn.form.settings = {
|
|
2030
2041
|
|
2031
2042
|
autoCheckRequired : false,
|
2032
2043
|
preventLeaving : false,
|
2033
|
-
errorFocus :
|
2044
|
+
errorFocus : true,
|
2034
2045
|
dateHandling : 'date', // 'date', 'input', 'formatter'
|
2035
2046
|
|
2036
2047
|
onValid : function() {},
|
@@ -2086,7 +2097,6 @@ $.fn.form.settings = {
|
|
2086
2097
|
doesntContain : '{name} cannot contain "{ruleValue}"',
|
2087
2098
|
doesntContainExactly : '{name} cannot contain exactly "{ruleValue}"',
|
2088
2099
|
minLength : '{name} must be at least {ruleValue} characters',
|
2089
|
-
length : '{name} must be at least {ruleValue} characters',
|
2090
2100
|
exactLength : '{name} must be exactly {ruleValue} characters',
|
2091
2101
|
maxLength : '{name} cannot be longer than {ruleValue} characters',
|
2092
2102
|
match : '{name} must match {ruleValue} field',
|
@@ -2100,7 +2110,7 @@ $.fn.form.settings = {
|
|
2100
2110
|
selector : {
|
2101
2111
|
checkbox : 'input[type="checkbox"], input[type="radio"]',
|
2102
2112
|
clear : '.clear',
|
2103
|
-
field : 'input:not(.search):not([type="file"]), textarea, select',
|
2113
|
+
field : 'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',
|
2104
2114
|
group : '.field',
|
2105
2115
|
input : 'input:not([type="file"])',
|
2106
2116
|
message : '.error.message',
|
@@ -2141,15 +2151,22 @@ $.fn.form.settings = {
|
|
2141
2151
|
html += '<li>' + value + '</li>';
|
2142
2152
|
});
|
2143
2153
|
html += '</ul>';
|
2144
|
-
return
|
2154
|
+
return html;
|
2145
2155
|
},
|
2146
2156
|
|
2147
|
-
// template that produces label
|
2148
|
-
prompt: function(errors
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2157
|
+
// template that produces label content
|
2158
|
+
prompt: function(errors) {
|
2159
|
+
if(errors.length === 1){
|
2160
|
+
return errors[0];
|
2161
|
+
}
|
2162
|
+
var
|
2163
|
+
html = '<ul class="ui list">'
|
2152
2164
|
;
|
2165
|
+
$.each(errors, function(index, value) {
|
2166
|
+
html += '<li>' + value + '</li>';
|
2167
|
+
});
|
2168
|
+
html += '</ul>';
|
2169
|
+
return html;
|
2153
2170
|
}
|
2154
2171
|
},
|
2155
2172
|
|
@@ -2359,14 +2376,6 @@ $.fn.form.settings = {
|
|
2359
2376
|
;
|
2360
2377
|
},
|
2361
2378
|
|
2362
|
-
// see rls notes for 2.0.6 (this is a duplicate of minLength)
|
2363
|
-
length: function(value, requiredLength) {
|
2364
|
-
return (value !== undefined)
|
2365
|
-
? (value.length >= requiredLength)
|
2366
|
-
: false
|
2367
|
-
;
|
2368
|
-
},
|
2369
|
-
|
2370
2379
|
// is exactly length
|
2371
2380
|
exactLength: function(value, requiredLength) {
|
2372
2381
|
return (value !== undefined)
|
@@ -2575,7 +2584,7 @@ $.fn.form.settings = {
|
|
2575
2584
|
})( jQuery, window, document );
|
2576
2585
|
|
2577
2586
|
/*!
|
2578
|
-
* # Fomantic-UI 2.9.0-beta.
|
2587
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Accordion
|
2579
2588
|
* http://github.com/fomantic/Fomantic-UI/
|
2580
2589
|
*
|
2581
2590
|
*
|
@@ -2693,8 +2702,10 @@ $.fn.accordion = function(parameters) {
|
|
2693
2702
|
},
|
2694
2703
|
|
2695
2704
|
event: {
|
2696
|
-
click: function() {
|
2697
|
-
|
2705
|
+
click: function(event) {
|
2706
|
+
if($(event.target).closest(selector.ignore).length === 0) {
|
2707
|
+
module.toggle.call(this);
|
2708
|
+
}
|
2698
2709
|
}
|
2699
2710
|
},
|
2700
2711
|
|
@@ -3178,6 +3189,7 @@ $.fn.accordion.settings = {
|
|
3178
3189
|
accordion : '.accordion',
|
3179
3190
|
title : '.title',
|
3180
3191
|
trigger : '.title',
|
3192
|
+
ignore : '.ui.dropdown',
|
3181
3193
|
content : '.content'
|
3182
3194
|
}
|
3183
3195
|
|
@@ -3194,7 +3206,7 @@ $.extend( $.easing, {
|
|
3194
3206
|
|
3195
3207
|
|
3196
3208
|
/*!
|
3197
|
-
* # Fomantic-UI 2.9.0-beta.
|
3209
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Calendar
|
3198
3210
|
* http://github.com/fomantic/Fomantic-UI/
|
3199
3211
|
*
|
3200
3212
|
*
|
@@ -3317,7 +3329,7 @@ $.fn.calendar = function(parameters) {
|
|
3317
3329
|
module.set.maxDate($module.data(metadata.maxDate));
|
3318
3330
|
}
|
3319
3331
|
module.setting('type', module.get.type());
|
3320
|
-
module.setting('on', settings.on ||
|
3332
|
+
module.setting('on', settings.on || 'click');
|
3321
3333
|
},
|
3322
3334
|
popup: function () {
|
3323
3335
|
if (settings.inline) {
|
@@ -3517,7 +3529,7 @@ $.fn.calendar = function(parameters) {
|
|
3517
3529
|
var headerDate = isYear || isMonth ? new Date(year, 0, 1) :
|
3518
3530
|
isDay ? new Date(year, month, 1) : new Date(year, month, day, hour, minute);
|
3519
3531
|
var headerText = $('<span/>').addClass(className.link).appendTo(cell);
|
3520
|
-
headerText.text(
|
3532
|
+
headerText.text(module.helper.dateFormat(formatter[mode+'Header'], headerDate));
|
3521
3533
|
var newMode = isMonth ? (settings.disableYear ? 'day' : 'year') :
|
3522
3534
|
isDay ? (settings.disableMonth ? 'year' : 'month') : 'day';
|
3523
3535
|
headerText.data(metadata.mode, newMode);
|
@@ -3565,7 +3577,7 @@ $.fn.calendar = function(parameters) {
|
|
3565
3577
|
isHour ? new Date(year, month, day, i) : new Date(year, month, day, hour, i * settings.minTimeGap);
|
3566
3578
|
var cellText = isYear ? i :
|
3567
3579
|
isMonth ? settings.text.monthsShort[i] : isDay ? cellDate.getDate() :
|
3568
|
-
|
3580
|
+
module.helper.dateFormat(formatter.cellTime,cellDate);
|
3569
3581
|
cell = $('<td/>').addClass(className.cell).appendTo(row);
|
3570
3582
|
cell.text(cellText);
|
3571
3583
|
cell.data(metadata.date, cellDate);
|
@@ -3697,7 +3709,7 @@ $.fn.calendar = function(parameters) {
|
|
3697
3709
|
var winWidth = $(window).width();
|
3698
3710
|
$container.find('td[data-position]').each(function () {
|
3699
3711
|
var cell = $(this);
|
3700
|
-
var tooltipWidth = window.getComputedStyle(cell[0], '
|
3712
|
+
var tooltipWidth = window.getComputedStyle(cell[0], '::after').width.replace(/[^0-9\.]/g,'');
|
3701
3713
|
var tooltipPosition = cell.attr('data-position');
|
3702
3714
|
// use a fallback width of 250 (calendar width) for IE/Edge (which return "auto")
|
3703
3715
|
var calcPosition = (winWidth - cell.width() - (parseInt(tooltipWidth,10) || 250)) > cell.offset().left ? 'right' : 'left';
|
@@ -3846,7 +3858,7 @@ $.fn.calendar = function(parameters) {
|
|
3846
3858
|
$container.removeClass(className.active);
|
3847
3859
|
if (settings.formatInput) {
|
3848
3860
|
var date = module.get.date();
|
3849
|
-
var text = formatter.
|
3861
|
+
var text = module.helper.dateFormat(formatter[settings.type], date);
|
3850
3862
|
$input.val(text);
|
3851
3863
|
}
|
3852
3864
|
if(selectionComplete){
|
@@ -3917,6 +3929,9 @@ $.fn.calendar = function(parameters) {
|
|
3917
3929
|
return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1;
|
3918
3930
|
}();
|
3919
3931
|
},
|
3932
|
+
formattedDate: function(format, date) {
|
3933
|
+
return module.helper.dateFormat(format || formatter[settings.type], date || module.get.date());
|
3934
|
+
},
|
3920
3935
|
date: function () {
|
3921
3936
|
return module.helper.sanitiseDate($module.data(metadata.date)) || null;
|
3922
3937
|
},
|
@@ -3941,7 +3956,7 @@ $.fn.calendar = function(parameters) {
|
|
3941
3956
|
return $module.data(metadata.maxDate) || null;
|
3942
3957
|
},
|
3943
3958
|
monthOffset: function () {
|
3944
|
-
return $module.data(metadata.monthOffset) || 0;
|
3959
|
+
return $module.data(metadata.monthOffset) || settings.monthOffset || 0;
|
3945
3960
|
},
|
3946
3961
|
mode: function () {
|
3947
3962
|
//only returns valid modes for the current settings
|
@@ -3995,7 +4010,7 @@ $.fn.calendar = function(parameters) {
|
|
3995
4010
|
return null;
|
3996
4011
|
}
|
3997
4012
|
if (!(selector instanceof $)) {
|
3998
|
-
selector = $(selector).first();
|
4013
|
+
selector = $(document).find(selector).first();
|
3999
4014
|
}
|
4000
4015
|
//assume range related calendars are using the same namespace
|
4001
4016
|
return selector.data(moduleNamespace);
|
@@ -4010,7 +4025,7 @@ $.fn.calendar = function(parameters) {
|
|
4010
4025
|
date = module.helper.dateInRange(date);
|
4011
4026
|
|
4012
4027
|
var mode = module.get.mode();
|
4013
|
-
var text = formatter.
|
4028
|
+
var text = module.helper.dateFormat(formatter[settings.type],date);
|
4014
4029
|
|
4015
4030
|
if (fireChange && settings.onBeforeChange.call(element, date, text, mode) === false) {
|
4016
4031
|
return false;
|
@@ -4181,6 +4196,60 @@ $.fn.calendar = function(parameters) {
|
|
4181
4196
|
},
|
4182
4197
|
|
4183
4198
|
helper: {
|
4199
|
+
dateFormat: function(format,date) {
|
4200
|
+
if (!(date instanceof Date)) {
|
4201
|
+
return '';
|
4202
|
+
}
|
4203
|
+
if(typeof format === 'function') {
|
4204
|
+
return format.call(module, date, settings);
|
4205
|
+
}
|
4206
|
+
|
4207
|
+
var D = date.getDate(),
|
4208
|
+
M = date.getMonth(),
|
4209
|
+
Y = date.getFullYear(),
|
4210
|
+
d = date.getDay(),
|
4211
|
+
H = date.getHours(),
|
4212
|
+
m = date.getMinutes(),
|
4213
|
+
s = date.getSeconds(),
|
4214
|
+
w = module.get.weekOfYear(Y,M,D+1-settings.firstDayOfWeek),
|
4215
|
+
h = H % 12 || 12,
|
4216
|
+
a = H < 12 ? settings.text.am.toLowerCase() : settings.text.pm.toLowerCase(),
|
4217
|
+
tokens = {
|
4218
|
+
D: D,
|
4219
|
+
DD: ('0'+D).slice(-2),
|
4220
|
+
M: M + 1,
|
4221
|
+
MM: ('0'+(M+1)).slice(-2),
|
4222
|
+
MMM: settings.text.monthsShort[M],
|
4223
|
+
MMMM: settings.text.months[M],
|
4224
|
+
Y: Y,
|
4225
|
+
YY: String(Y).slice(2),
|
4226
|
+
YYYY: Y,
|
4227
|
+
d: d,
|
4228
|
+
dd: settings.text.dayNamesShort[d].slice(0,2),
|
4229
|
+
ddd: settings.text.dayNamesShort[d],
|
4230
|
+
dddd: settings.text.dayNames[d],
|
4231
|
+
h: h,
|
4232
|
+
hh: ('0'+h).slice(-2),
|
4233
|
+
H: H,
|
4234
|
+
HH: ('0'+H).slice(-2),
|
4235
|
+
m: m,
|
4236
|
+
mm: ('0'+m).slice(-2),
|
4237
|
+
s: s,
|
4238
|
+
ss: ('0'+s).slice(-2),
|
4239
|
+
a: a,
|
4240
|
+
A: a.toUpperCase(),
|
4241
|
+
S: ['th', 'st', 'nd', 'rd'][D % 10 > 3 ? 0 : (D % 100 - D % 10 !== 10) * D % 10],
|
4242
|
+
w: w,
|
4243
|
+
ww: ('0'+w).slice(-2)
|
4244
|
+
}
|
4245
|
+
;
|
4246
|
+
return format.replace(settings.regExp.token, function (match) {
|
4247
|
+
if (match in tokens) {
|
4248
|
+
return tokens[match];
|
4249
|
+
}
|
4250
|
+
return match.slice(1, match.length - 1);
|
4251
|
+
});
|
4252
|
+
},
|
4184
4253
|
isDisabled: function(date, mode) {
|
4185
4254
|
return (mode === 'day' || mode === 'month' || mode === 'year' || mode === 'hour') && (((mode === 'day' && settings.disabledDaysOfWeek.indexOf(date.getDay()) !== -1) || settings.disabledDates.some(function(d){
|
4186
4255
|
if(typeof d === 'string') {
|
@@ -4631,7 +4700,7 @@ $.fn.calendar.settings = {
|
|
4631
4700
|
constantHeight : true, // add rows to shorter months to keep day calendar height consistent (6 rows)
|
4632
4701
|
today : false, // show a 'today/now' button at the bottom of the calendar
|
4633
4702
|
closable : true, // close the popup after selecting a date/time
|
4634
|
-
monthFirst : true, // month before day when parsing
|
4703
|
+
monthFirst : true, // month before day when parsing date from text
|
4635
4704
|
touchReadonly : true, // set input to readonly on touch devices
|
4636
4705
|
inline : false, // create the calendar inline instead of inside a popup
|
4637
4706
|
on : null, // when to show the popup (defaults to 'focus' for input, 'click' for others)
|
@@ -4639,7 +4708,6 @@ $.fn.calendar.settings = {
|
|
4639
4708
|
startMode : false, // display mode to start in, can be 'year', 'month', 'day', 'hour', 'minute' (false = 'day')
|
4640
4709
|
minDate : null, // minimum date/time that can be selected, dates/times before are disabled
|
4641
4710
|
maxDate : null, // maximum date/time that can be selected, dates/times after are disabled
|
4642
|
-
ampm : true, // show am/pm in time mode
|
4643
4711
|
disableYear : false, // disable year selection mode
|
4644
4712
|
disableMonth : false, // disable month selection mode
|
4645
4713
|
disableMinute : false, // disable minute selection mode
|
@@ -4647,8 +4715,9 @@ $.fn.calendar.settings = {
|
|
4647
4715
|
startCalendar : null, // jquery object or selector for another calendar that represents the start date of a date range
|
4648
4716
|
endCalendar : null, // jquery object or selector for another calendar that represents the end date of a date range
|
4649
4717
|
multiMonth : 1, // show multiple months when in 'day' mode
|
4718
|
+
monthOffset : 0, // position current month by offset when multimonth > 1
|
4650
4719
|
minTimeGap : 5,
|
4651
|
-
showWeekNumbers :
|
4720
|
+
showWeekNumbers : false, // show Number of Week at the very first column of a dayView
|
4652
4721
|
disabledHours : [], // specific hour(s) which won't be selectable and contain additional information.
|
4653
4722
|
disabledDates : [], // specific day(s) which won't be selectable and contain additional information.
|
4654
4723
|
disabledDaysOfWeek : [], // day(s) which won't be selectable(s) (0 = Sunday)
|
@@ -4662,11 +4731,14 @@ $.fn.calendar.settings = {
|
|
4662
4731
|
position: 'bottom left',
|
4663
4732
|
lastResort: 'bottom left',
|
4664
4733
|
prefer: 'opposite',
|
4734
|
+
observeChanges: false,
|
4665
4735
|
hideOnScroll: false
|
4666
4736
|
},
|
4667
4737
|
|
4668
4738
|
text: {
|
4669
4739
|
days: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
4740
|
+
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
4741
|
+
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
4670
4742
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
4671
4743
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
4672
4744
|
today: 'Today',
|
@@ -4677,67 +4749,23 @@ $.fn.calendar.settings = {
|
|
4677
4749
|
},
|
4678
4750
|
|
4679
4751
|
formatter: {
|
4680
|
-
header: function (date, mode, settings) {
|
4681
|
-
return mode === 'year' ? settings.formatter.yearHeader(date, settings) :
|
4682
|
-
mode === 'month' ? settings.formatter.monthHeader(date, settings) :
|
4683
|
-
mode === 'day' ? settings.formatter.dayHeader(date, settings) :
|
4684
|
-
mode === 'hour' ? settings.formatter.hourHeader(date, settings) :
|
4685
|
-
settings.formatter.minuteHeader(date, settings);
|
4686
|
-
},
|
4687
4752
|
yearHeader: function (date, settings) {
|
4688
4753
|
var decadeYear = Math.ceil(date.getFullYear() / 10) * 10;
|
4689
4754
|
return (decadeYear - 9) + ' - ' + (decadeYear + 2);
|
4690
4755
|
},
|
4691
|
-
monthHeader:
|
4692
|
-
|
4693
|
-
|
4694
|
-
|
4695
|
-
var month = settings.text.months[date.getMonth()];
|
4696
|
-
var year = date.getFullYear();
|
4697
|
-
return month + ' ' + year;
|
4698
|
-
},
|
4699
|
-
hourHeader: function (date, settings) {
|
4700
|
-
return settings.formatter.date(date, settings);
|
4701
|
-
},
|
4702
|
-
minuteHeader: function (date, settings) {
|
4703
|
-
return settings.formatter.date(date, settings);
|
4704
|
-
},
|
4756
|
+
monthHeader: 'YYYY',
|
4757
|
+
dayHeader: 'MMMM YYYY',
|
4758
|
+
hourHeader: 'MMMM D, YYYY',
|
4759
|
+
minuteHeader: 'MMMM D, YYYY',
|
4705
4760
|
dayColumnHeader: function (day, settings) {
|
4706
4761
|
return settings.text.days[day];
|
4707
4762
|
},
|
4708
|
-
datetime:
|
4709
|
-
|
4710
|
-
|
4711
|
-
|
4712
|
-
|
4713
|
-
|
4714
|
-
var separator = settings.type === 'datetime' ? ' ' : '';
|
4715
|
-
return day + separator + time;
|
4716
|
-
},
|
4717
|
-
date: function (date, settings) {
|
4718
|
-
if (!date) {
|
4719
|
-
return '';
|
4720
|
-
}
|
4721
|
-
var day = date.getDate();
|
4722
|
-
var month = settings.text.months[date.getMonth()];
|
4723
|
-
var year = date.getFullYear();
|
4724
|
-
return settings.type === 'year' ? year :
|
4725
|
-
settings.type === 'month' ? month + ' ' + year :
|
4726
|
-
(settings.monthFirst ? month + ' ' + day : day + ' ' + month) + ', ' + year;
|
4727
|
-
},
|
4728
|
-
time: function (date, settings, forCalendar) {
|
4729
|
-
if (!date) {
|
4730
|
-
return '';
|
4731
|
-
}
|
4732
|
-
var hour = date.getHours();
|
4733
|
-
var minute = date.getMinutes();
|
4734
|
-
var ampm = '';
|
4735
|
-
if (settings.ampm) {
|
4736
|
-
ampm = ' ' + (hour < 12 ? settings.text.am : settings.text.pm);
|
4737
|
-
hour = hour === 0 ? 12 : hour > 12 ? hour - 12 : hour;
|
4738
|
-
}
|
4739
|
-
return hour + ':' + (minute < 10 ? '0' : '') + minute + ampm;
|
4740
|
-
},
|
4763
|
+
datetime: 'MMMM D, YYYY h:mm A',
|
4764
|
+
date: 'MMMM D, YYYY',
|
4765
|
+
time: 'h:mm A',
|
4766
|
+
cellTime: 'h:mm A',
|
4767
|
+
month: 'MMMM YYYY',
|
4768
|
+
year: 'YYYY',
|
4741
4769
|
today: function (settings) {
|
4742
4770
|
return settings.type === 'date' ? settings.text.today : settings.text.now;
|
4743
4771
|
},
|
@@ -4753,7 +4781,7 @@ $.fn.calendar.settings = {
|
|
4753
4781
|
if (!text) {
|
4754
4782
|
return null;
|
4755
4783
|
}
|
4756
|
-
text = String(text).trim();
|
4784
|
+
text = String(text).trim().replace(/([.:\/\-])\s+/g,'$1').replace(/\s+([.:\/-])/g,'$1').replace(/\s+/g,' ');
|
4757
4785
|
if (text.length === 0) {
|
4758
4786
|
return null;
|
4759
4787
|
}
|
@@ -5006,7 +5034,8 @@ $.fn.calendar.settings = {
|
|
5006
5034
|
|
5007
5035
|
regExp: {
|
5008
5036
|
dateWords: /[^A-Za-z\u00C0-\u024F]+/g,
|
5009
|
-
dateNumbers: /[^\d:]+/g
|
5037
|
+
dateNumbers: /[^\d:]+/g,
|
5038
|
+
token: /d{1,4}|D{1,2}|M{1,4}|YY(?:YY)?|([Hhmsw])\1?|[SAaY]|"[^"]*"|'[^']*'/g
|
5010
5039
|
},
|
5011
5040
|
|
5012
5041
|
error: {
|
@@ -5066,7 +5095,7 @@ $.fn.calendar.settings = {
|
|
5066
5095
|
})(jQuery, window, document);
|
5067
5096
|
|
5068
5097
|
/*!
|
5069
|
-
* # Fomantic-UI 2.9.0-beta.
|
5098
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Checkbox
|
5070
5099
|
* http://github.com/fomantic/Fomantic-UI/
|
5071
5100
|
*
|
5072
5101
|
*
|
@@ -5306,18 +5335,26 @@ $.fn.checkbox = function(parameters) {
|
|
5306
5335
|
}
|
5307
5336
|
}
|
5308
5337
|
|
5338
|
+
shortcutPressed = false;
|
5309
5339
|
if(key == keyCode.escape) {
|
5310
5340
|
module.verbose('Escape key pressed blurring field');
|
5311
5341
|
$input.blur();
|
5312
5342
|
shortcutPressed = true;
|
5313
5343
|
}
|
5314
|
-
else if(!event.ctrlKey &&
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5344
|
+
else if(!event.ctrlKey && module.can.change()) {
|
5345
|
+
if( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey) ) {
|
5346
|
+
module.verbose('Enter/space key pressed, toggling checkbox');
|
5347
|
+
module.toggle();
|
5348
|
+
shortcutPressed = true;
|
5349
|
+
} else if($module.is('.toggle, .slider') && !module.is.radio()) {
|
5350
|
+
if(key == keyCode.left && module.is.checked()) {
|
5351
|
+
module.uncheck();
|
5352
|
+
shortcutPressed = true;
|
5353
|
+
} else if(key == keyCode.right && module.is.unchecked()) {
|
5354
|
+
module.check();
|
5355
|
+
shortcutPressed = true;
|
5356
|
+
}
|
5357
|
+
}
|
5321
5358
|
}
|
5322
5359
|
},
|
5323
5360
|
keyup: function(event) {
|
@@ -5390,7 +5427,6 @@ $.fn.checkbox = function(parameters) {
|
|
5390
5427
|
settings.onEnable.call(input);
|
5391
5428
|
// preserve legacy callbacks
|
5392
5429
|
settings.onEnabled.call(input);
|
5393
|
-
module.trigger.change();
|
5394
5430
|
}
|
5395
5431
|
},
|
5396
5432
|
|
@@ -5405,7 +5441,6 @@ $.fn.checkbox = function(parameters) {
|
|
5405
5441
|
settings.onDisable.call(input);
|
5406
5442
|
// preserve legacy callbacks
|
5407
5443
|
settings.onDisabled.call(input);
|
5408
|
-
module.trigger.change();
|
5409
5444
|
}
|
5410
5445
|
},
|
5411
5446
|
|
@@ -5933,7 +5968,7 @@ $.fn.checkbox.settings = {
|
|
5933
5968
|
|
5934
5969
|
selector : {
|
5935
5970
|
checkbox : '.ui.checkbox',
|
5936
|
-
label : 'label
|
5971
|
+
label : 'label',
|
5937
5972
|
input : 'input[type="checkbox"], input[type="radio"]',
|
5938
5973
|
link : 'a[href]'
|
5939
5974
|
}
|
@@ -5943,7 +5978,7 @@ $.fn.checkbox.settings = {
|
|
5943
5978
|
})( jQuery, window, document );
|
5944
5979
|
|
5945
5980
|
/*!
|
5946
|
-
* # Fomantic-UI 2.9.0-beta.
|
5981
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Dimmer
|
5947
5982
|
* http://github.com/fomantic/Fomantic-UI/
|
5948
5983
|
*
|
5949
5984
|
*
|
@@ -6136,11 +6171,14 @@ $.fn.dimmer = function(parameters) {
|
|
6136
6171
|
? callback
|
6137
6172
|
: function(){}
|
6138
6173
|
;
|
6139
|
-
module.debug('Showing dimmer', $dimmer, settings);
|
6140
|
-
module.set.variation();
|
6141
6174
|
if( (!module.is.dimmed() || module.is.animating()) && module.is.enabled() ) {
|
6175
|
+
if(settings.onShow.call(element) === false) {
|
6176
|
+
module.verbose('Show callback returned false cancelling dimmer show');
|
6177
|
+
return;
|
6178
|
+
}
|
6179
|
+
module.debug('Showing dimmer', $dimmer, settings);
|
6180
|
+
module.set.variation();
|
6142
6181
|
module.animate.show(callback);
|
6143
|
-
settings.onShow.call(element);
|
6144
6182
|
settings.onChange.call(element);
|
6145
6183
|
}
|
6146
6184
|
else {
|
@@ -6154,9 +6192,12 @@ $.fn.dimmer = function(parameters) {
|
|
6154
6192
|
: function(){}
|
6155
6193
|
;
|
6156
6194
|
if( module.is.dimmed() || module.is.animating() ) {
|
6195
|
+
if(settings.onHide.call(element) === false) {
|
6196
|
+
module.verbose('Hide callback returned false cancelling dimmer hide');
|
6197
|
+
return;
|
6198
|
+
}
|
6157
6199
|
module.debug('Hiding dimmer', $dimmer);
|
6158
6200
|
module.animate.hide(callback);
|
6159
|
-
settings.onHide.call(element);
|
6160
6201
|
settings.onChange.call(element);
|
6161
6202
|
}
|
6162
6203
|
else {
|
@@ -6700,7 +6741,7 @@ $.fn.dimmer.settings = {
|
|
6700
6741
|
})( jQuery, window, document );
|
6701
6742
|
|
6702
6743
|
/*!
|
6703
|
-
* # Fomantic-UI 2.9.0-beta.
|
6744
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Dropdown
|
6704
6745
|
* http://github.com/fomantic/Fomantic-UI/
|
6705
6746
|
*
|
6706
6747
|
*
|
@@ -6731,11 +6772,6 @@ $.fn.dropdown = function(parameters) {
|
|
6731
6772
|
|
6732
6773
|
moduleSelector = $allModules.selector || '',
|
6733
6774
|
|
6734
|
-
hasTouch = ('ontouchstart' in document.documentElement),
|
6735
|
-
clickEvent = hasTouch
|
6736
|
-
? 'touchstart'
|
6737
|
-
: 'click',
|
6738
|
-
|
6739
6775
|
time = new Date().getTime(),
|
6740
6776
|
performance = [],
|
6741
6777
|
|
@@ -6767,7 +6803,7 @@ $.fn.dropdown = function(parameters) {
|
|
6767
6803
|
moduleNamespace = 'module-' + namespace,
|
6768
6804
|
|
6769
6805
|
$module = $(this),
|
6770
|
-
$context = $(settings.context),
|
6806
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context),
|
6771
6807
|
$text = $module.find(selector.text),
|
6772
6808
|
$search = $module.find(selector.search),
|
6773
6809
|
$sizer = $module.find(selector.sizer),
|
@@ -6901,6 +6937,7 @@ $.fn.dropdown = function(parameters) {
|
|
6901
6937
|
select: function() {
|
6902
6938
|
if(module.has.input() && selectObserver) {
|
6903
6939
|
selectObserver.observe($module[0], {
|
6940
|
+
attributes: true,
|
6904
6941
|
childList : true,
|
6905
6942
|
subtree : true
|
6906
6943
|
});
|
@@ -6925,7 +6962,7 @@ $.fn.dropdown = function(parameters) {
|
|
6925
6962
|
|
6926
6963
|
create: {
|
6927
6964
|
id: function() {
|
6928
|
-
id = (Math.random().toString(16) + '000000000').
|
6965
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
6929
6966
|
elementNamespace = '.' + id;
|
6930
6967
|
module.verbose('Creating unique id for element', id);
|
6931
6968
|
},
|
@@ -7122,6 +7159,9 @@ $.fn.dropdown = function(parameters) {
|
|
7122
7159
|
module.debug('Disabling dropdown');
|
7123
7160
|
$module.addClass(className.disabled);
|
7124
7161
|
}
|
7162
|
+
if($input.is('[required]')) {
|
7163
|
+
settings.forceSelection = true;
|
7164
|
+
}
|
7125
7165
|
$input
|
7126
7166
|
.removeAttr('required')
|
7127
7167
|
.removeAttr('class')
|
@@ -7238,9 +7278,7 @@ $.fn.dropdown = function(parameters) {
|
|
7238
7278
|
}
|
7239
7279
|
if(settings.onShow.call(element) !== false) {
|
7240
7280
|
module.animate.show(function() {
|
7241
|
-
|
7242
|
-
module.bind.intent();
|
7243
|
-
}
|
7281
|
+
module.bind.intent();
|
7244
7282
|
if(module.has.search() && !preventFocus) {
|
7245
7283
|
module.focusSearch();
|
7246
7284
|
}
|
@@ -7267,8 +7305,17 @@ $.fn.dropdown = function(parameters) {
|
|
7267
7305
|
}
|
7268
7306
|
callback.call(element);
|
7269
7307
|
});
|
7308
|
+
// Hide submenus explicitly. On some browsers (esp. mobile), they will not automatically receive a
|
7309
|
+
// mouseleave event
|
7310
|
+
var $subMenu = $module.find(selector.menu);
|
7311
|
+
if($subMenu.length > 0) {
|
7312
|
+
module.verbose('Hiding sub-menu', $subMenu);
|
7313
|
+
$subMenu.each(function() {
|
7314
|
+
module.animate.hide(false, $(this));
|
7315
|
+
});
|
7316
|
+
}
|
7270
7317
|
}
|
7271
|
-
} else
|
7318
|
+
} else {
|
7272
7319
|
module.unbind.intent();
|
7273
7320
|
}
|
7274
7321
|
iconClicked = false;
|
@@ -7326,13 +7373,18 @@ $.fn.dropdown = function(parameters) {
|
|
7326
7373
|
$module
|
7327
7374
|
.on('change' + eventNamespace, selector.input, module.event.change)
|
7328
7375
|
;
|
7376
|
+
if(module.is.multiple() && module.is.searchSelection()) {
|
7377
|
+
$module
|
7378
|
+
.on('paste' + eventNamespace, selector.search, module.event.paste)
|
7379
|
+
;
|
7380
|
+
}
|
7329
7381
|
},
|
7330
7382
|
mouseEvents: function() {
|
7331
7383
|
module.verbose('Binding mouse events');
|
7332
7384
|
if(module.is.multiple()) {
|
7333
7385
|
$module
|
7334
|
-
.on(
|
7335
|
-
.on(
|
7386
|
+
.on('click' + eventNamespace, selector.label, module.event.label.click)
|
7387
|
+
.on('click' + eventNamespace, selector.remove, module.event.remove.click)
|
7336
7388
|
;
|
7337
7389
|
}
|
7338
7390
|
if( module.is.searchSelection() ) {
|
@@ -7341,31 +7393,33 @@ $.fn.dropdown = function(parameters) {
|
|
7341
7393
|
.on('mouseup' + eventNamespace, module.event.mouseup)
|
7342
7394
|
.on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown)
|
7343
7395
|
.on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup)
|
7344
|
-
.on(
|
7345
|
-
.on(
|
7396
|
+
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
|
7397
|
+
.on('click' + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
|
7346
7398
|
.on('focus' + eventNamespace, selector.search, module.event.search.focus)
|
7347
|
-
.on(
|
7399
|
+
.on('click' + eventNamespace, selector.search, module.event.search.focus)
|
7348
7400
|
.on('blur' + eventNamespace, selector.search, module.event.search.blur)
|
7349
|
-
.on(
|
7401
|
+
.on('click' + eventNamespace, selector.text, module.event.text.focus)
|
7350
7402
|
;
|
7351
7403
|
if(module.is.multiple()) {
|
7352
7404
|
$module
|
7353
|
-
.on(
|
7354
|
-
.on(
|
7405
|
+
.on('click' + eventNamespace, module.event.click)
|
7406
|
+
.on('click' + eventNamespace, module.event.search.focus)
|
7355
7407
|
;
|
7356
7408
|
}
|
7357
7409
|
}
|
7358
7410
|
else {
|
7359
7411
|
if(settings.on == 'click') {
|
7360
7412
|
$module
|
7361
|
-
.on(
|
7362
|
-
.on(
|
7413
|
+
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
|
7414
|
+
.on('click' + eventNamespace, module.event.test.toggle)
|
7363
7415
|
;
|
7364
7416
|
}
|
7365
7417
|
else if(settings.on == 'hover') {
|
7366
7418
|
$module
|
7367
7419
|
.on('mouseenter' + eventNamespace, module.delay.show)
|
7368
7420
|
.on('mouseleave' + eventNamespace, module.delay.hide)
|
7421
|
+
.on('touchstart' + eventNamespace, module.event.test.toggle)
|
7422
|
+
.on('touchstart' + eventNamespace, selector.icon, module.event.icon.click)
|
7369
7423
|
;
|
7370
7424
|
}
|
7371
7425
|
else {
|
@@ -7377,7 +7431,7 @@ $.fn.dropdown = function(parameters) {
|
|
7377
7431
|
.on('mousedown' + eventNamespace, module.event.mousedown)
|
7378
7432
|
.on('mouseup' + eventNamespace, module.event.mouseup)
|
7379
7433
|
.on('focus' + eventNamespace, module.event.focus)
|
7380
|
-
.on(
|
7434
|
+
.on('click' + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
|
7381
7435
|
;
|
7382
7436
|
if(module.has.menuSearch() ) {
|
7383
7437
|
$module
|
@@ -7391,21 +7445,16 @@ $.fn.dropdown = function(parameters) {
|
|
7391
7445
|
}
|
7392
7446
|
}
|
7393
7447
|
$menu
|
7394
|
-
.on(
|
7448
|
+
.on('mouseenter' + eventNamespace, selector.item, module.event.item.mouseenter)
|
7449
|
+
.on('touchstart' + eventNamespace, selector.item, module.event.item.mouseenter)
|
7395
7450
|
.on('mouseleave' + eventNamespace, selector.item, module.event.item.mouseleave)
|
7396
7451
|
.on('click' + eventNamespace, selector.item, module.event.item.click)
|
7397
7452
|
;
|
7398
7453
|
},
|
7399
7454
|
intent: function() {
|
7400
7455
|
module.verbose('Binding hide intent event to document');
|
7401
|
-
if(hasTouch) {
|
7402
|
-
$document
|
7403
|
-
.on('touchstart' + elementNamespace, module.event.test.touch)
|
7404
|
-
.on('touchmove' + elementNamespace, module.event.test.touch)
|
7405
|
-
;
|
7406
|
-
}
|
7407
7456
|
$document
|
7408
|
-
.on(
|
7457
|
+
.on('click' + elementNamespace, module.event.test.hide)
|
7409
7458
|
;
|
7410
7459
|
}
|
7411
7460
|
},
|
@@ -7413,14 +7462,8 @@ $.fn.dropdown = function(parameters) {
|
|
7413
7462
|
unbind: {
|
7414
7463
|
intent: function() {
|
7415
7464
|
module.verbose('Removing hide intent event from document');
|
7416
|
-
if(hasTouch) {
|
7417
|
-
$document
|
7418
|
-
.off('touchstart' + elementNamespace)
|
7419
|
-
.off('touchmove' + elementNamespace)
|
7420
|
-
;
|
7421
|
-
}
|
7422
7465
|
$document
|
7423
|
-
.off(
|
7466
|
+
.off('click' + elementNamespace)
|
7424
7467
|
;
|
7425
7468
|
}
|
7426
7469
|
},
|
@@ -7513,20 +7556,28 @@ $.fn.dropdown = function(parameters) {
|
|
7513
7556
|
throttle : settings.throttle,
|
7514
7557
|
urlData : {
|
7515
7558
|
query: query
|
7516
|
-
}
|
7517
|
-
|
7559
|
+
}
|
7560
|
+
},
|
7561
|
+
apiCallbacks = {
|
7562
|
+
onError: function(errorMessage, $module, xhr) {
|
7518
7563
|
module.add.message(message.serverError);
|
7519
7564
|
iconClicked = false;
|
7520
7565
|
focused = false;
|
7521
7566
|
callback.apply(null, callbackParameters);
|
7567
|
+
if(typeof settings.apiSettings.onError === 'function') {
|
7568
|
+
settings.apiSettings.onError.call(this, errorMessage, $module, xhr);
|
7569
|
+
}
|
7522
7570
|
},
|
7523
|
-
onFailure: function() {
|
7571
|
+
onFailure: function(response, $module, xhr) {
|
7524
7572
|
module.add.message(message.serverError);
|
7525
7573
|
iconClicked = false;
|
7526
7574
|
focused = false;
|
7527
7575
|
callback.apply(null, callbackParameters);
|
7576
|
+
if(typeof settings.apiSettings.onFailure === 'function') {
|
7577
|
+
settings.apiSettings.onFailure.call(this, response, $module, xhr);
|
7578
|
+
}
|
7528
7579
|
},
|
7529
|
-
onSuccess : function(response) {
|
7580
|
+
onSuccess : function(response, $module, xhr) {
|
7530
7581
|
var
|
7531
7582
|
values = response[fields.remoteValues]
|
7532
7583
|
;
|
@@ -7545,19 +7596,22 @@ $.fn.dropdown = function(parameters) {
|
|
7545
7596
|
var value = module.is.multiple() ? module.get.values() : module.get.value();
|
7546
7597
|
if (value !== '') {
|
7547
7598
|
module.verbose('Value(s) present after click icon, select value(s) in items');
|
7548
|
-
module.set.selected(value, null,
|
7599
|
+
module.set.selected(value, null, true, true);
|
7549
7600
|
}
|
7550
7601
|
}
|
7551
7602
|
iconClicked = false;
|
7552
7603
|
focused = false;
|
7553
7604
|
callback.apply(null, callbackParameters);
|
7605
|
+
if(typeof settings.apiSettings.onSuccess === 'function') {
|
7606
|
+
settings.apiSettings.onSuccess.call(this, response, $module, xhr);
|
7607
|
+
}
|
7554
7608
|
}
|
7555
7609
|
}
|
7556
7610
|
;
|
7557
7611
|
if( !$module.api('get request') ) {
|
7558
7612
|
module.setup.api();
|
7559
7613
|
}
|
7560
|
-
apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings);
|
7614
|
+
apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks);
|
7561
7615
|
$module
|
7562
7616
|
.api('setting', apiSettings)
|
7563
7617
|
.api('query')
|
@@ -7745,7 +7799,7 @@ $.fn.dropdown = function(parameters) {
|
|
7745
7799
|
menuConfig[fields.values] = values;
|
7746
7800
|
module.setup.menu(menuConfig);
|
7747
7801
|
$.each(values, function(index, item) {
|
7748
|
-
if(item.selected
|
7802
|
+
if(item.selected === true) {
|
7749
7803
|
module.debug('Setting initial selection to', item[fields.value]);
|
7750
7804
|
module.set.selected(item[fields.value]);
|
7751
7805
|
if(!module.is.multiple()) {
|
@@ -7766,7 +7820,7 @@ $.fn.dropdown = function(parameters) {
|
|
7766
7820
|
settings.preserveHTML
|
7767
7821
|
)
|
7768
7822
|
;
|
7769
|
-
$input.append('<option value="' + value + '">' + name + '</option>');
|
7823
|
+
$input.append('<option value="' + value + '"' + (item.selected === true ? ' selected' : '') + '>' + name + '</option>');
|
7770
7824
|
});
|
7771
7825
|
module.observe.select();
|
7772
7826
|
}
|
@@ -7774,6 +7828,15 @@ $.fn.dropdown = function(parameters) {
|
|
7774
7828
|
},
|
7775
7829
|
|
7776
7830
|
event: {
|
7831
|
+
paste: function(event) {
|
7832
|
+
var pasteValue = (event.originalEvent.clipboardData || window.clipboardData).getData('text'),
|
7833
|
+
tokens = pasteValue.split(settings.delimiter)
|
7834
|
+
;
|
7835
|
+
tokens.forEach(function(value){
|
7836
|
+
module.set.selected(module.escape.htmlEntities(value.trim()), null, true, true);
|
7837
|
+
});
|
7838
|
+
event.preventDefault();
|
7839
|
+
},
|
7777
7840
|
change: function() {
|
7778
7841
|
if(!internalChange) {
|
7779
7842
|
module.debug('Input changed, updating selection');
|
@@ -7832,7 +7895,7 @@ $.fn.dropdown = function(parameters) {
|
|
7832
7895
|
if(module.is.multiple()) {
|
7833
7896
|
module.remove.activeLabel();
|
7834
7897
|
}
|
7835
|
-
if(!focused && !module.is.active() && (settings.showOnFocus || (event.type !== 'focus' && event.type !== 'focusin'))) {
|
7898
|
+
if(!focused && !module.is.active() && (settings.showOnFocus || (event.type !== 'focus' && event.type !== 'focusin')) && event.type !== 'touchstart') {
|
7836
7899
|
focused = true;
|
7837
7900
|
module.search();
|
7838
7901
|
}
|
@@ -7950,23 +8013,12 @@ $.fn.dropdown = function(parameters) {
|
|
7950
8013
|
if (!module.is.multiple() || (module.is.multiple() && !module.is.active())) {
|
7951
8014
|
focused = true;
|
7952
8015
|
}
|
7953
|
-
if( module.determine.eventOnElement(event, toggleBehavior) ) {
|
8016
|
+
if( module.determine.eventOnElement(event, toggleBehavior) && event.type !== 'touchstart') {
|
8017
|
+
// do not preventDefault of touchstart; so emulated mouseenter is triggered on first touch and not later
|
8018
|
+
// (when selecting an item). The double-showing of the dropdown through both events does not hurt.
|
7954
8019
|
event.preventDefault();
|
7955
8020
|
}
|
7956
8021
|
},
|
7957
|
-
touch: function(event) {
|
7958
|
-
module.determine.eventOnElement(event, function() {
|
7959
|
-
if(event.type == 'touchstart') {
|
7960
|
-
module.timer = setTimeout(function() {
|
7961
|
-
module.hide();
|
7962
|
-
}, settings.delay.touch);
|
7963
|
-
}
|
7964
|
-
else if(event.type == 'touchmove') {
|
7965
|
-
clearTimeout(module.timer);
|
7966
|
-
}
|
7967
|
-
});
|
7968
|
-
event.stopPropagation();
|
7969
|
-
},
|
7970
8022
|
hide: function(event) {
|
7971
8023
|
if(module.determine.eventInModule(event, module.hide)){
|
7972
8024
|
if(element.id && $(event.target).attr('for') === element.id){
|
@@ -7986,8 +8038,8 @@ $.fn.dropdown = function(parameters) {
|
|
7986
8038
|
},
|
7987
8039
|
select: {
|
7988
8040
|
mutation: function(mutations) {
|
7989
|
-
module.debug('<select> modified, recreating menu');
|
7990
8041
|
if(module.is.selectMutation(mutations)) {
|
8042
|
+
module.debug('<select> modified, recreating menu');
|
7991
8043
|
module.disconnect.selectObserver();
|
7992
8044
|
module.refresh();
|
7993
8045
|
module.setup.select();
|
@@ -8050,13 +8102,15 @@ $.fn.dropdown = function(parameters) {
|
|
8050
8102
|
},
|
8051
8103
|
mouseleave: function(event) {
|
8052
8104
|
var
|
8053
|
-
$subMenu = $(this).
|
8105
|
+
$subMenu = $(this).find(selector.menu)
|
8054
8106
|
;
|
8055
8107
|
if($subMenu.length > 0) {
|
8056
8108
|
clearTimeout(module.itemTimer);
|
8057
8109
|
module.itemTimer = setTimeout(function() {
|
8058
8110
|
module.verbose('Hiding sub-menu', $subMenu);
|
8059
|
-
|
8111
|
+
$subMenu.each(function() {
|
8112
|
+
module.animate.hide(false, $(this));
|
8113
|
+
});
|
8060
8114
|
}, settings.delay.hide);
|
8061
8115
|
}
|
8062
8116
|
},
|
@@ -8082,7 +8136,7 @@ $.fn.dropdown = function(parameters) {
|
|
8082
8136
|
module.remove.userAddition();
|
8083
8137
|
}
|
8084
8138
|
module.remove.searchTerm();
|
8085
|
-
if(!module.is.focusedOnSearch() &&
|
8139
|
+
if(!module.is.focusedOnSearch() && skipRefocus !== true) {
|
8086
8140
|
module.focusSearch(true);
|
8087
8141
|
}
|
8088
8142
|
}
|
@@ -8214,7 +8268,7 @@ $.fn.dropdown = function(parameters) {
|
|
8214
8268
|
keydown: function(event) {
|
8215
8269
|
var
|
8216
8270
|
pressedKey = event.which,
|
8217
|
-
isShortcutKey = module.is.inObject(pressedKey, keys)
|
8271
|
+
isShortcutKey = module.is.inObject(pressedKey, keys) || event.key === settings.delimiter
|
8218
8272
|
;
|
8219
8273
|
if(isShortcutKey) {
|
8220
8274
|
var
|
@@ -8232,7 +8286,7 @@ $.fn.dropdown = function(parameters) {
|
|
8232
8286
|
hasSubMenu = ($subMenu.length> 0),
|
8233
8287
|
hasSelectedItem = ($selectedItem.length > 0),
|
8234
8288
|
selectedIsSelectable = ($selectedItem.not(selector.unselectable).length > 0),
|
8235
|
-
delimiterPressed = (
|
8289
|
+
delimiterPressed = (event.key === settings.delimiter && module.is.multiple()),
|
8236
8290
|
isAdditionWithoutMenu = (settings.allowAdditions && settings.hideAdditions && (pressedKey == keys.enter || delimiterPressed) && selectedIsSelectable),
|
8237
8291
|
$nextItem,
|
8238
8292
|
isSubMenuItem,
|
@@ -8330,7 +8384,7 @@ $.fn.dropdown = function(parameters) {
|
|
8330
8384
|
.addClass(className.selected)
|
8331
8385
|
;
|
8332
8386
|
module.set.scrollPosition($nextItem);
|
8333
|
-
if(settings.selectOnKeydown && module.is.single()) {
|
8387
|
+
if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
8334
8388
|
module.set.selectedItem($nextItem);
|
8335
8389
|
}
|
8336
8390
|
}
|
@@ -8357,7 +8411,7 @@ $.fn.dropdown = function(parameters) {
|
|
8357
8411
|
.addClass(className.selected)
|
8358
8412
|
;
|
8359
8413
|
module.set.scrollPosition($nextItem);
|
8360
|
-
if(settings.selectOnKeydown && module.is.single()) {
|
8414
|
+
if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
8361
8415
|
module.set.selectedItem($nextItem);
|
8362
8416
|
}
|
8363
8417
|
}
|
@@ -8488,7 +8542,7 @@ $.fn.dropdown = function(parameters) {
|
|
8488
8542
|
;
|
8489
8543
|
if( module.can.activate( $(element) ) ) {
|
8490
8544
|
module.set.selected(value, $(element));
|
8491
|
-
if(!module.is.multiple()) {
|
8545
|
+
if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
|
8492
8546
|
module.hideAndClear();
|
8493
8547
|
}
|
8494
8548
|
}
|
@@ -8501,7 +8555,7 @@ $.fn.dropdown = function(parameters) {
|
|
8501
8555
|
;
|
8502
8556
|
if( module.can.activate( $(element) ) ) {
|
8503
8557
|
module.set.value(value, text, $(element));
|
8504
|
-
if(!module.is.multiple()) {
|
8558
|
+
if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
|
8505
8559
|
module.hideAndClear();
|
8506
8560
|
}
|
8507
8561
|
}
|
@@ -8552,7 +8606,7 @@ $.fn.dropdown = function(parameters) {
|
|
8552
8606
|
;
|
8553
8607
|
$sizer.text(value);
|
8554
8608
|
// prevent rounding issues
|
8555
|
-
return Math.ceil( $sizer.width() + 1);
|
8609
|
+
return Math.ceil( $sizer.width() + (module.is.edge() ? 3 : 1));
|
8556
8610
|
},
|
8557
8611
|
selectionCount: function() {
|
8558
8612
|
var
|
@@ -9021,7 +9075,7 @@ $.fn.dropdown = function(parameters) {
|
|
9021
9075
|
module.error(error.noStorage);
|
9022
9076
|
return;
|
9023
9077
|
}
|
9024
|
-
name = sessionStorage.getItem(value);
|
9078
|
+
name = sessionStorage.getItem(value + elementNamespace);
|
9025
9079
|
return (name !== undefined)
|
9026
9080
|
? name
|
9027
9081
|
: false
|
@@ -9065,7 +9119,7 @@ $.fn.dropdown = function(parameters) {
|
|
9065
9119
|
return;
|
9066
9120
|
}
|
9067
9121
|
module.verbose('Saving remote data to session storage', value, name);
|
9068
|
-
sessionStorage.setItem(value, name);
|
9122
|
+
sessionStorage.setItem(value + elementNamespace, name);
|
9069
9123
|
}
|
9070
9124
|
},
|
9071
9125
|
|
@@ -9125,7 +9179,7 @@ $.fn.dropdown = function(parameters) {
|
|
9125
9179
|
$nextSelectedItem
|
9126
9180
|
.addClass(className.selected)
|
9127
9181
|
;
|
9128
|
-
if(settings.selectOnKeydown && module.is.single()) {
|
9182
|
+
if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
9129
9183
|
module.set.selectedItem($nextSelectedItem);
|
9130
9184
|
}
|
9131
9185
|
$menu
|
@@ -9211,7 +9265,7 @@ $.fn.dropdown = function(parameters) {
|
|
9211
9265
|
var
|
9212
9266
|
length = module.get.query().length
|
9213
9267
|
;
|
9214
|
-
$search.val( text.
|
9268
|
+
$search.val( text.slice(0, length));
|
9215
9269
|
},
|
9216
9270
|
scrollPosition: function($item, forceScroll) {
|
9217
9271
|
var
|
@@ -9328,13 +9382,13 @@ $.fn.dropdown = function(parameters) {
|
|
9328
9382
|
module.set.scrollPosition($nextValue);
|
9329
9383
|
$selectedItem.removeClass(className.selected);
|
9330
9384
|
$nextValue.addClass(className.selected);
|
9331
|
-
if(settings.selectOnKeydown && module.is.single()) {
|
9385
|
+
if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
9332
9386
|
module.set.selectedItem($nextValue);
|
9333
9387
|
}
|
9334
9388
|
}
|
9335
9389
|
},
|
9336
9390
|
direction: function($menu) {
|
9337
|
-
if(settings.direction
|
9391
|
+
if(settings.direction === 'auto') {
|
9338
9392
|
// reset position, remove upward if it's base menu
|
9339
9393
|
if (!$menu) {
|
9340
9394
|
module.remove.upward();
|
@@ -9353,7 +9407,7 @@ $.fn.dropdown = function(parameters) {
|
|
9353
9407
|
module.set.leftward($menu);
|
9354
9408
|
}
|
9355
9409
|
}
|
9356
|
-
else if(settings.direction
|
9410
|
+
else if(settings.direction === 'upward') {
|
9357
9411
|
module.set.upward($menu);
|
9358
9412
|
}
|
9359
9413
|
},
|
@@ -9366,6 +9420,11 @@ $.fn.dropdown = function(parameters) {
|
|
9366
9420
|
$element.addClass(className.leftward);
|
9367
9421
|
},
|
9368
9422
|
value: function(value, text, $selected, preventChangeTrigger) {
|
9423
|
+
if(typeof text === 'boolean') {
|
9424
|
+
preventChangeTrigger = text;
|
9425
|
+
$selected = undefined;
|
9426
|
+
text = undefined;
|
9427
|
+
}
|
9369
9428
|
if(value !== undefined && value !== '' && !(Array.isArray(value) && value.length === 0)) {
|
9370
9429
|
$input.removeClass(className.noselection);
|
9371
9430
|
} else {
|
@@ -9429,12 +9488,21 @@ $.fn.dropdown = function(parameters) {
|
|
9429
9488
|
visible: function() {
|
9430
9489
|
$module.addClass(className.visible);
|
9431
9490
|
},
|
9432
|
-
exactly: function(value, $selectedItem) {
|
9491
|
+
exactly: function(value, $selectedItem, preventChangeTrigger) {
|
9492
|
+
if(typeof $selectedItem === 'boolean') {
|
9493
|
+
preventChangeTrigger = $selectedItem;
|
9494
|
+
$selectedItem = undefined;
|
9495
|
+
}
|
9433
9496
|
module.debug('Setting selected to exact values');
|
9434
9497
|
module.clear();
|
9435
|
-
module.set.selected(value, $selectedItem);
|
9498
|
+
module.set.selected(value, $selectedItem, preventChangeTrigger);
|
9436
9499
|
},
|
9437
9500
|
selected: function(value, $selectedItem, preventChangeTrigger, keepSearchTerm) {
|
9501
|
+
if(typeof $selectedItem === 'boolean') {
|
9502
|
+
keepSearchTerm = preventChangeTrigger;
|
9503
|
+
preventChangeTrigger = $selectedItem;
|
9504
|
+
$selectedItem = undefined;
|
9505
|
+
}
|
9438
9506
|
var
|
9439
9507
|
isMultiple = module.is.multiple()
|
9440
9508
|
;
|
@@ -9466,23 +9534,30 @@ $.fn.dropdown = function(parameters) {
|
|
9466
9534
|
|
9467
9535
|
isFiltered = $selected.hasClass(className.filtered),
|
9468
9536
|
isActive = $selected.hasClass(className.active),
|
9537
|
+
isActionable = $selected.hasClass(className.actionable),
|
9469
9538
|
isUserValue = $selected.hasClass(className.addition),
|
9470
|
-
shouldAnimate = (isMultiple && $selectedItem.length
|
9539
|
+
shouldAnimate = (isMultiple && $selectedItem && $selectedItem.length === 1)
|
9471
9540
|
;
|
9472
|
-
if(
|
9541
|
+
if(isActionable){
|
9542
|
+
if((!isMultiple || (!isActive || isUserValue)) && settings.apiSettings && settings.saveRemoteData) {
|
9543
|
+
module.save.remoteData(selectedText, selectedValue);
|
9544
|
+
}
|
9545
|
+
settings.onActionable.call(element, selectedValue, selectedText, $selected);
|
9546
|
+
}
|
9547
|
+
else if(isMultiple) {
|
9473
9548
|
if(!isActive || isUserValue) {
|
9474
9549
|
if(settings.apiSettings && settings.saveRemoteData) {
|
9475
9550
|
module.save.remoteData(selectedText, selectedValue);
|
9476
9551
|
}
|
9477
9552
|
if(settings.useLabels) {
|
9553
|
+
module.add.value(selectedValue, selectedText, $selected, preventChangeTrigger);
|
9478
9554
|
module.add.label(selectedValue, selectedText, shouldAnimate);
|
9479
|
-
module.add.value(selectedValue, selectedText, $selected);
|
9480
9555
|
module.set.activeItem($selected);
|
9481
9556
|
module.filterActive();
|
9482
9557
|
module.select.nextAvailable($selectedItem);
|
9483
9558
|
}
|
9484
9559
|
else {
|
9485
|
-
module.add.value(selectedValue, selectedText, $selected);
|
9560
|
+
module.add.value(selectedValue, selectedText, $selected, preventChangeTrigger);
|
9486
9561
|
module.set.text(module.add.variables(message.count));
|
9487
9562
|
module.set.activeItem($selected);
|
9488
9563
|
}
|
@@ -9496,7 +9571,7 @@ $.fn.dropdown = function(parameters) {
|
|
9496
9571
|
if(settings.apiSettings && settings.saveRemoteData) {
|
9497
9572
|
module.save.remoteData(selectedText, selectedValue);
|
9498
9573
|
}
|
9499
|
-
if (!keepSearchTerm) {
|
9574
|
+
if (!keepSearchTerm && !$selected.hasClass(className.actionable)) {
|
9500
9575
|
module.set.text(selectedText);
|
9501
9576
|
}
|
9502
9577
|
module.set.value(selectedValue, selectedText, $selected, preventChangeTrigger);
|
@@ -9595,7 +9670,7 @@ $.fn.dropdown = function(parameters) {
|
|
9595
9670
|
$('<option/>')
|
9596
9671
|
.prop('value', escapedValue)
|
9597
9672
|
.addClass(className.addition)
|
9598
|
-
.
|
9673
|
+
.text(value)
|
9599
9674
|
.appendTo($input)
|
9600
9675
|
;
|
9601
9676
|
module.verbose('Adding user addition as an <option>', value);
|
@@ -9671,7 +9746,12 @@ $.fn.dropdown = function(parameters) {
|
|
9671
9746
|
}
|
9672
9747
|
return message;
|
9673
9748
|
},
|
9674
|
-
value: function(addedValue, addedText, $selectedItem) {
|
9749
|
+
value: function(addedValue, addedText, $selectedItem, preventChangeTrigger) {
|
9750
|
+
if(typeof addedText === 'boolean') {
|
9751
|
+
preventChangeTrigger = addedText;
|
9752
|
+
$selectedItem = undefined;
|
9753
|
+
addedText = undefined;
|
9754
|
+
}
|
9675
9755
|
var
|
9676
9756
|
currentValue = module.get.values(true),
|
9677
9757
|
newValue
|
@@ -9686,7 +9766,7 @@ $.fn.dropdown = function(parameters) {
|
|
9686
9766
|
}
|
9687
9767
|
// extend current array
|
9688
9768
|
if(Array.isArray(currentValue)) {
|
9689
|
-
newValue = currentValue.concat([addedValue]);
|
9769
|
+
newValue = $selectedItem && $selectedItem.hasClass(className.actionable) ? currentValue : currentValue.concat([addedValue]);
|
9690
9770
|
newValue = module.get.uniqueArray(newValue);
|
9691
9771
|
}
|
9692
9772
|
else {
|
@@ -9710,7 +9790,7 @@ $.fn.dropdown = function(parameters) {
|
|
9710
9790
|
else {
|
9711
9791
|
settings.onAdd.call(element, addedValue, addedText, $selectedItem);
|
9712
9792
|
}
|
9713
|
-
module.set.value(newValue, addedText, $selectedItem);
|
9793
|
+
module.set.value(newValue, addedText, $selectedItem, preventChangeTrigger);
|
9714
9794
|
module.check.maxSelections();
|
9715
9795
|
},
|
9716
9796
|
},
|
@@ -9770,18 +9850,10 @@ $.fn.dropdown = function(parameters) {
|
|
9770
9850
|
return;
|
9771
9851
|
}
|
9772
9852
|
// temporarily disconnect observer
|
9773
|
-
|
9774
|
-
selectObserver.disconnect();
|
9775
|
-
module.verbose('Temporarily disconnecting mutation observer');
|
9776
|
-
}
|
9853
|
+
module.disconnect.selectObserver();
|
9777
9854
|
$option.remove();
|
9778
9855
|
module.verbose('Removing user addition as an <option>', escapedValue);
|
9779
|
-
|
9780
|
-
selectObserver.observe($input[0], {
|
9781
|
-
childList : true,
|
9782
|
-
subtree : true
|
9783
|
-
});
|
9784
|
-
}
|
9856
|
+
module.observe.select();
|
9785
9857
|
},
|
9786
9858
|
message: function() {
|
9787
9859
|
$menu.children(selector.message).remove();
|
@@ -10080,8 +10152,11 @@ $.fn.dropdown = function(parameters) {
|
|
10080
10152
|
bubbledIconClick: function(event) {
|
10081
10153
|
return $(event.target).closest($icon).length > 0;
|
10082
10154
|
},
|
10155
|
+
edge: function() {
|
10156
|
+
return !!window.chrome && !!window.StyleMedia;
|
10157
|
+
},
|
10083
10158
|
chrome: function() {
|
10084
|
-
return !!window.chrome &&
|
10159
|
+
return !!window.chrome && !window.StyleMedia;
|
10085
10160
|
},
|
10086
10161
|
alreadySetup: function() {
|
10087
10162
|
return ($module.is('select') && $module.parent(selector.dropdown).data(moduleNamespace) !== undefined && $module.prev().length === 0);
|
@@ -10146,7 +10221,7 @@ $.fn.dropdown = function(parameters) {
|
|
10146
10221
|
selectChanged = false
|
10147
10222
|
;
|
10148
10223
|
$.each(mutations, function(index, mutation) {
|
10149
|
-
if($(mutation.target).is('select') || $(mutation.addedNodes).is('select')) {
|
10224
|
+
if($(mutation.target).is('select, option, optgroup') || $(mutation.addedNodes).is('select')) {
|
10150
10225
|
selectChanged = true;
|
10151
10226
|
return false;
|
10152
10227
|
}
|
@@ -10288,9 +10363,6 @@ $.fn.dropdown = function(parameters) {
|
|
10288
10363
|
$currentMenu.removeClass(className.loading);
|
10289
10364
|
return canOpenRightward;
|
10290
10365
|
},
|
10291
|
-
click: function() {
|
10292
|
-
return (hasTouch || settings.on == 'click');
|
10293
|
-
},
|
10294
10366
|
extendSelect: function() {
|
10295
10367
|
return settings.allowAdditions || settings.apiSettings;
|
10296
10368
|
},
|
@@ -10360,9 +10432,7 @@ $.fn.dropdown = function(parameters) {
|
|
10360
10432
|
start = ($subMenu)
|
10361
10433
|
? function() {}
|
10362
10434
|
: function() {
|
10363
|
-
|
10364
|
-
module.unbind.intent();
|
10365
|
-
}
|
10435
|
+
module.unbind.intent();
|
10366
10436
|
module.remove.active();
|
10367
10437
|
},
|
10368
10438
|
transition = settings.transition.hideMethod || module.get.transition($subMenu)
|
@@ -10691,7 +10761,7 @@ $.fn.dropdown.settings = {
|
|
10691
10761
|
keepOnScreen : true, // Whether dropdown should check whether it is on screen before showing
|
10692
10762
|
|
10693
10763
|
match : 'both', // what to match against with search selection (both, text, or label)
|
10694
|
-
fullTextSearch :
|
10764
|
+
fullTextSearch : 'exact', // search anywhere in value (set to 'exact' to require exact matches)
|
10695
10765
|
ignoreDiacritics : false, // match results also if they contain diacritics of the same base character (for example searching for "a" will also match "á" or "â" or "à", etc...)
|
10696
10766
|
hideDividers : false, // Whether to hide any divider elements (specified in selector.divider) that are sibling to any items when searched (set to true will hide all dividers, set to 'empty' will hide them when they are not followed by a visible item)
|
10697
10767
|
|
@@ -10699,7 +10769,7 @@ $.fn.dropdown.settings = {
|
|
10699
10769
|
preserveHTML : true, // preserve html when selecting value
|
10700
10770
|
sortSelect : false, // sort selection on init
|
10701
10771
|
|
10702
|
-
forceSelection :
|
10772
|
+
forceSelection : false, // force a choice on blur with search selection
|
10703
10773
|
|
10704
10774
|
allowAdditions : false, // whether multiple select should allow user added values
|
10705
10775
|
ignoreCase : false, // whether to consider case sensitivity when creating labels
|
@@ -10710,7 +10780,7 @@ $.fn.dropdown.settings = {
|
|
10710
10780
|
useLabels : true, // whether multiple select should filter currently active selections from choices
|
10711
10781
|
delimiter : ',', // when multiselect uses normal <input> the values will be delimited with this character
|
10712
10782
|
|
10713
|
-
showOnFocus :
|
10783
|
+
showOnFocus : false, // show menu on focus
|
10714
10784
|
allowReselection : false, // whether current value should trigger callbacks when reselected
|
10715
10785
|
allowTab : true, // add tabindex to element
|
10716
10786
|
allowCategorySelection : false, // allow elements with sub-menus to be selected
|
@@ -10725,6 +10795,8 @@ $.fn.dropdown.settings = {
|
|
10725
10795
|
|
10726
10796
|
headerDivider : true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
|
10727
10797
|
|
10798
|
+
collapseOnActionable : true, // whether the dropdown should collapse upon selection of an actionable item
|
10799
|
+
|
10728
10800
|
// label settings on multi-select
|
10729
10801
|
label: {
|
10730
10802
|
transition : 'scale',
|
@@ -10737,13 +10809,13 @@ $.fn.dropdown.settings = {
|
|
10737
10809
|
hide : 300,
|
10738
10810
|
show : 200,
|
10739
10811
|
search : 20,
|
10740
|
-
touch : 50
|
10741
10812
|
},
|
10742
10813
|
|
10743
10814
|
/* Callbacks */
|
10744
10815
|
onChange : function(value, text, $selected){},
|
10745
10816
|
onAdd : function(value, text, $selected){},
|
10746
10817
|
onRemove : function(value, text, $selected){},
|
10818
|
+
onActionable : function(value, text, $selected){},
|
10747
10819
|
onSearch : function(searchTerm){},
|
10748
10820
|
|
10749
10821
|
onLabelSelect : function($selectedLabels){},
|
@@ -10806,12 +10878,12 @@ $.fn.dropdown.settings = {
|
|
10806
10878
|
icon : 'icon', // optional icon name
|
10807
10879
|
iconClass : 'iconClass', // optional individual class for icon (for example to use flag instead)
|
10808
10880
|
class : 'class', // optional individual class for item/header
|
10809
|
-
divider : 'divider' // optional divider append for group headers
|
10881
|
+
divider : 'divider', // optional divider append for group headers
|
10882
|
+
actionable : 'actionable' // optional actionable item
|
10810
10883
|
},
|
10811
10884
|
|
10812
10885
|
keys : {
|
10813
10886
|
backspace : 8,
|
10814
|
-
delimiter : 188, // comma
|
10815
10887
|
deleteKey : 46,
|
10816
10888
|
enter : 13,
|
10817
10889
|
escape : 27,
|
@@ -10878,7 +10950,8 @@ $.fn.dropdown.settings = {
|
|
10878
10950
|
header : 'header',
|
10879
10951
|
divider : 'divider',
|
10880
10952
|
groupIcon : '',
|
10881
|
-
unfilterable : 'unfilterable'
|
10953
|
+
unfilterable : 'unfilterable',
|
10954
|
+
actionable : 'actionable'
|
10882
10955
|
}
|
10883
10956
|
|
10884
10957
|
};
|
@@ -10953,6 +11026,9 @@ $.fn.dropdown.settings.templates = {
|
|
10953
11026
|
maybeText = (option[fields.text])
|
10954
11027
|
? ' data-text="' + deQuote(option[fields.text],true) + '"'
|
10955
11028
|
: '',
|
11029
|
+
maybeActionable = (option[fields.actionable])
|
11030
|
+
? className.actionable+' '
|
11031
|
+
: '',
|
10956
11032
|
maybeDisabled = (option[fields.disabled])
|
10957
11033
|
? className.disabled+' '
|
10958
11034
|
: '',
|
@@ -10961,7 +11037,7 @@ $.fn.dropdown.settings.templates = {
|
|
10961
11037
|
: '',
|
10962
11038
|
hasDescription = (escape(option[fields.description] || '', preserveHTML) != '')
|
10963
11039
|
;
|
10964
|
-
html += '<div class="'+ maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
|
11040
|
+
html += '<div class="'+ maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
|
10965
11041
|
if (isMenu) {
|
10966
11042
|
html += '<i class="'+ (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
|
10967
11043
|
}
|
@@ -11031,7 +11107,7 @@ $.fn.dropdown.settings.templates = {
|
|
11031
11107
|
})( jQuery, window, document );
|
11032
11108
|
|
11033
11109
|
/*!
|
11034
|
-
* # Fomantic-UI 2.9.0-beta.
|
11110
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Embed
|
11035
11111
|
* http://github.com/fomantic/Fomantic-UI/
|
11036
11112
|
*
|
11037
11113
|
*
|
@@ -11741,7 +11817,7 @@ $.fn.embed.settings = {
|
|
11741
11817
|
})( jQuery, window, document );
|
11742
11818
|
|
11743
11819
|
/*!
|
11744
|
-
* # Fomantic-UI 2.9.0-beta.
|
11820
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Modal
|
11745
11821
|
* http://github.com/fomantic/Fomantic-UI/
|
11746
11822
|
*
|
11747
11823
|
*
|
@@ -11807,8 +11883,9 @@ $.fn.modal = function(parameters) {
|
|
11807
11883
|
moduleNamespace = 'module-' + namespace,
|
11808
11884
|
|
11809
11885
|
$module = $(this),
|
11810
|
-
$context = $(settings.context),
|
11811
|
-
$
|
11886
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context),
|
11887
|
+
$closeIcon = $module.find(selector.closeIcon),
|
11888
|
+
$inputs,
|
11812
11889
|
|
11813
11890
|
$allModals,
|
11814
11891
|
$otherModals,
|
@@ -11834,6 +11911,7 @@ $.fn.modal = function(parameters) {
|
|
11834
11911
|
module = {
|
11835
11912
|
|
11836
11913
|
initialize: function() {
|
11914
|
+
module.create.id();
|
11837
11915
|
if(!$module.hasClass('modal')) {
|
11838
11916
|
module.create.modal();
|
11839
11917
|
if(!$.isFunction(settings.onHidden)) {
|
@@ -11858,15 +11936,17 @@ $.fn.modal = function(parameters) {
|
|
11858
11936
|
$actions.empty();
|
11859
11937
|
}
|
11860
11938
|
settings.actions.forEach(function (el) {
|
11861
|
-
var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
11939
|
+
var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
11862
11940
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
11863
11941
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
11864
11942
|
click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
|
11865
11943
|
$actions.append($('<button/>', {
|
11866
11944
|
html: icon + text,
|
11945
|
+
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
|
11867
11946
|
class: className.button + ' ' + cls,
|
11868
11947
|
click: function () {
|
11869
|
-
|
11948
|
+
var button = $(this);
|
11949
|
+
if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
|
11870
11950
|
return;
|
11871
11951
|
}
|
11872
11952
|
module.hide();
|
@@ -11877,7 +11957,6 @@ $.fn.modal = function(parameters) {
|
|
11877
11957
|
module.cache = {};
|
11878
11958
|
module.verbose('Initializing dimmer', $context);
|
11879
11959
|
|
11880
|
-
module.create.id();
|
11881
11960
|
module.create.dimmer();
|
11882
11961
|
|
11883
11962
|
if ( settings.allowMultiple ) {
|
@@ -11887,11 +11966,9 @@ $.fn.modal = function(parameters) {
|
|
11887
11966
|
$module.addClass('top aligned');
|
11888
11967
|
}
|
11889
11968
|
module.refreshModals();
|
11890
|
-
|
11969
|
+
module.refreshInputs();
|
11891
11970
|
module.bind.events();
|
11892
|
-
|
11893
|
-
module.observeChanges();
|
11894
|
-
}
|
11971
|
+
module.observeChanges();
|
11895
11972
|
module.instantiate();
|
11896
11973
|
if(settings.autoShow){
|
11897
11974
|
module.show();
|
@@ -11908,16 +11985,20 @@ $.fn.modal = function(parameters) {
|
|
11908
11985
|
|
11909
11986
|
create: {
|
11910
11987
|
modal: function() {
|
11911
|
-
$module = $('<div/>', {class: className.modal});
|
11988
|
+
$module = $('<div/>', {class: className.modal, role: 'dialog', 'aria-modal': true});
|
11912
11989
|
if (settings.closeIcon) {
|
11913
|
-
$
|
11914
|
-
$module.append($
|
11990
|
+
$closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
|
11991
|
+
$module.append($closeIcon);
|
11915
11992
|
}
|
11916
11993
|
if (settings.title !== '') {
|
11917
|
-
|
11994
|
+
var titleId = '_' + module.get.id() + 'title';
|
11995
|
+
$module.attr('aria-labelledby', titleId);
|
11996
|
+
$('<div/>', {class: className.title, id: titleId}).appendTo($module);
|
11918
11997
|
}
|
11919
11998
|
if (settings.content !== '') {
|
11920
|
-
|
11999
|
+
var descId = '_' + module.get.id() + 'desc';
|
12000
|
+
$module.attr('aria-describedby', descId);
|
12001
|
+
$('<div/>', {class: className.content, id: descId}).appendTo($module);
|
11921
12002
|
}
|
11922
12003
|
if (module.has.configActions()) {
|
11923
12004
|
$('<div/>', {class: className.actions}).appendTo($module);
|
@@ -11948,13 +12029,13 @@ $.fn.modal = function(parameters) {
|
|
11948
12029
|
$dimmer = $dimmable.dimmer('get dimmer');
|
11949
12030
|
},
|
11950
12031
|
id: function() {
|
11951
|
-
id = (Math.random().toString(16) + '000000000').
|
12032
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
11952
12033
|
elementEventNamespace = '.' + id;
|
11953
12034
|
module.verbose('Creating unique id for element', id);
|
11954
12035
|
},
|
11955
12036
|
innerDimmer: function() {
|
11956
|
-
if ( $module.find(selector.dimmer).length
|
11957
|
-
$
|
12037
|
+
if ( $module.find(selector.dimmer).length === 0 ) {
|
12038
|
+
$('<div/>', {class: className.innerDimmer}).prependTo($module);
|
11958
12039
|
}
|
11959
12040
|
}
|
11960
12041
|
},
|
@@ -11970,15 +12051,21 @@ $.fn.modal = function(parameters) {
|
|
11970
12051
|
;
|
11971
12052
|
$window.off(elementEventNamespace);
|
11972
12053
|
$dimmer.off(elementEventNamespace);
|
11973
|
-
$
|
12054
|
+
$closeIcon.off(elementEventNamespace);
|
12055
|
+
if($inputs) {
|
12056
|
+
$inputs.off(elementEventNamespace);
|
12057
|
+
}
|
11974
12058
|
$context.dimmer('destroy');
|
11975
12059
|
},
|
11976
12060
|
|
11977
12061
|
observeChanges: function() {
|
11978
12062
|
if('MutationObserver' in window) {
|
11979
12063
|
observer = new MutationObserver(function(mutations) {
|
11980
|
-
|
11981
|
-
|
12064
|
+
if(settings.observeChanges) {
|
12065
|
+
module.debug('DOM tree modified, refreshing');
|
12066
|
+
module.refresh();
|
12067
|
+
}
|
12068
|
+
module.refreshInputs();
|
11982
12069
|
});
|
11983
12070
|
observer.observe(element, {
|
11984
12071
|
childList : true,
|
@@ -12003,6 +12090,23 @@ $.fn.modal = function(parameters) {
|
|
12003
12090
|
$allModals = $otherModals.add($module);
|
12004
12091
|
},
|
12005
12092
|
|
12093
|
+
refreshInputs: function(){
|
12094
|
+
if($inputs){
|
12095
|
+
$inputs
|
12096
|
+
.off('keydown' + elementEventNamespace)
|
12097
|
+
;
|
12098
|
+
}
|
12099
|
+
$inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
|
12100
|
+
return $(this).closest('.disabled').length === 0;
|
12101
|
+
});
|
12102
|
+
$inputs.first()
|
12103
|
+
.on('keydown' + elementEventNamespace, module.event.inputKeyDown.first)
|
12104
|
+
;
|
12105
|
+
$inputs.last()
|
12106
|
+
.on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
|
12107
|
+
;
|
12108
|
+
},
|
12109
|
+
|
12006
12110
|
attachEvents: function(selector, event) {
|
12007
12111
|
var
|
12008
12112
|
$toggle = $(selector)
|
@@ -12031,6 +12135,9 @@ $.fn.modal = function(parameters) {
|
|
12031
12135
|
.on('click' + eventNamespace, selector.approve, module.event.approve)
|
12032
12136
|
.on('click' + eventNamespace, selector.deny, module.event.deny)
|
12033
12137
|
;
|
12138
|
+
$closeIcon
|
12139
|
+
.on('keyup' + elementEventNamespace, module.event.closeKeyUp)
|
12140
|
+
;
|
12034
12141
|
$window
|
12035
12142
|
.on('resize' + elementEventNamespace, module.event.resize)
|
12036
12143
|
;
|
@@ -12049,7 +12156,7 @@ $.fn.modal = function(parameters) {
|
|
12049
12156
|
|
12050
12157
|
get: {
|
12051
12158
|
id: function() {
|
12052
|
-
return
|
12159
|
+
return id;
|
12053
12160
|
},
|
12054
12161
|
element: function() {
|
12055
12162
|
return $module;
|
@@ -12088,10 +12195,38 @@ $.fn.modal = function(parameters) {
|
|
12088
12195
|
close: function() {
|
12089
12196
|
module.hide();
|
12090
12197
|
},
|
12198
|
+
closeKeyUp: function(event){
|
12199
|
+
var
|
12200
|
+
keyCode = event.which
|
12201
|
+
;
|
12202
|
+
if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
|
12203
|
+
module.hide();
|
12204
|
+
}
|
12205
|
+
},
|
12206
|
+
inputKeyDown: {
|
12207
|
+
first: function(event) {
|
12208
|
+
var
|
12209
|
+
keyCode = event.which
|
12210
|
+
;
|
12211
|
+
if (keyCode === settings.keys.tab && event.shiftKey) {
|
12212
|
+
$inputs.last().focus();
|
12213
|
+
event.preventDefault();
|
12214
|
+
}
|
12215
|
+
},
|
12216
|
+
last: function(event) {
|
12217
|
+
var
|
12218
|
+
keyCode = event.which
|
12219
|
+
;
|
12220
|
+
if (keyCode === settings.keys.tab && !event.shiftKey) {
|
12221
|
+
$inputs.first().focus();
|
12222
|
+
event.preventDefault();
|
12223
|
+
}
|
12224
|
+
}
|
12225
|
+
},
|
12091
12226
|
mousedown: function(event) {
|
12092
12227
|
var
|
12093
12228
|
$target = $(event.target),
|
12094
|
-
isRtl = module.is.rtl()
|
12229
|
+
isRtl = module.is.rtl()
|
12095
12230
|
;
|
12096
12231
|
initialMouseDownInModal = ($target.closest(selector.modal).length > 0);
|
12097
12232
|
if(initialMouseDownInModal) {
|
@@ -12139,10 +12274,9 @@ $.fn.modal = function(parameters) {
|
|
12139
12274
|
},
|
12140
12275
|
keyboard: function(event) {
|
12141
12276
|
var
|
12142
|
-
keyCode = event.which
|
12143
|
-
escapeKey = 27
|
12277
|
+
keyCode = event.which
|
12144
12278
|
;
|
12145
|
-
if(keyCode
|
12279
|
+
if(keyCode === settings.keys.escape) {
|
12146
12280
|
if(settings.closable) {
|
12147
12281
|
module.debug('Escape key pressed hiding modal');
|
12148
12282
|
if ( $module.hasClass(className.front) ) {
|
@@ -12198,6 +12332,10 @@ $.fn.modal = function(parameters) {
|
|
12198
12332
|
: function(){}
|
12199
12333
|
;
|
12200
12334
|
if( module.is.animating() || !module.is.active() ) {
|
12335
|
+
if(settings.onShow.call(element) === false) {
|
12336
|
+
module.verbose('Show callback returned false cancelling show');
|
12337
|
+
return;
|
12338
|
+
}
|
12201
12339
|
module.showDimmer();
|
12202
12340
|
module.cacheSizes();
|
12203
12341
|
module.set.bodyMargin();
|
@@ -12227,7 +12365,6 @@ $.fn.modal = function(parameters) {
|
|
12227
12365
|
$module.detach().appendTo($dimmer);
|
12228
12366
|
}
|
12229
12367
|
}
|
12230
|
-
settings.onShow.call(element);
|
12231
12368
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
12232
12369
|
module.debug('Showing modal with css animations');
|
12233
12370
|
$module
|
@@ -12270,7 +12407,6 @@ $.fn.modal = function(parameters) {
|
|
12270
12407
|
? callback
|
12271
12408
|
: function(){}
|
12272
12409
|
;
|
12273
|
-
module.debug('Hiding modal');
|
12274
12410
|
if(settings.onHide.call(element, $(this)) === false) {
|
12275
12411
|
module.verbose('Hide callback returned false cancelling hide');
|
12276
12412
|
ignoreRepeatedEvents = false;
|
@@ -12278,6 +12414,7 @@ $.fn.modal = function(parameters) {
|
|
12278
12414
|
}
|
12279
12415
|
|
12280
12416
|
if( module.is.animating() || module.is.active() ) {
|
12417
|
+
module.debug('Hiding modal');
|
12281
12418
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
12282
12419
|
module.remove.active();
|
12283
12420
|
$module
|
@@ -12457,7 +12594,7 @@ $.fn.modal = function(parameters) {
|
|
12457
12594
|
$module
|
12458
12595
|
.off('mousedown' + elementEventNamespace)
|
12459
12596
|
;
|
12460
|
-
}
|
12597
|
+
}
|
12461
12598
|
$dimmer
|
12462
12599
|
.off('mousedown' + elementEventNamespace)
|
12463
12600
|
;
|
@@ -12642,13 +12779,10 @@ $.fn.modal = function(parameters) {
|
|
12642
12779
|
set: {
|
12643
12780
|
autofocus: function() {
|
12644
12781
|
var
|
12645
|
-
$inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
|
12646
|
-
return $(this).closest('.disabled').length === 0;
|
12647
|
-
}),
|
12648
12782
|
$autofocus = $inputs.filter('[autofocus]'),
|
12649
12783
|
$input = ($autofocus.length > 0)
|
12650
12784
|
? $autofocus.first()
|
12651
|
-
: $inputs.first()
|
12785
|
+
: ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
|
12652
12786
|
;
|
12653
12787
|
if($input.length > 0) {
|
12654
12788
|
$input.focus();
|
@@ -12730,7 +12864,7 @@ $.fn.modal = function(parameters) {
|
|
12730
12864
|
? $(document).scrollTop() + settings.padding
|
12731
12865
|
: $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
|
12732
12866
|
marginLeft: -(module.cache.width / 2)
|
12733
|
-
})
|
12867
|
+
})
|
12734
12868
|
;
|
12735
12869
|
} else {
|
12736
12870
|
$module
|
@@ -12739,7 +12873,7 @@ $.fn.modal = function(parameters) {
|
|
12739
12873
|
? -(module.cache.height / 2)
|
12740
12874
|
: settings.padding / 2,
|
12741
12875
|
marginLeft: -(module.cache.width / 2)
|
12742
|
-
})
|
12876
|
+
})
|
12743
12877
|
;
|
12744
12878
|
}
|
12745
12879
|
module.verbose('Setting modal offset for legacy mode');
|
@@ -13065,11 +13199,19 @@ $.fn.modal.settings = {
|
|
13065
13199
|
// called after deny selector match
|
13066
13200
|
onDeny : function(){ return true; },
|
13067
13201
|
|
13202
|
+
keys : {
|
13203
|
+
space : 32,
|
13204
|
+
enter : 13,
|
13205
|
+
escape : 27,
|
13206
|
+
tab : 9,
|
13207
|
+
},
|
13208
|
+
|
13068
13209
|
selector : {
|
13069
13210
|
title : '> .header',
|
13070
13211
|
content : '> .content',
|
13071
13212
|
actions : '> .actions',
|
13072
13213
|
close : '> .close',
|
13214
|
+
closeIcon: '> .close',
|
13073
13215
|
approve : '.actions .positive, .actions .approve, .actions .ok',
|
13074
13216
|
deny : '.actions .negative, .actions .deny, .actions .cancel',
|
13075
13217
|
modal : '.ui.modal',
|
@@ -13101,11 +13243,13 @@ $.fn.modal.settings = {
|
|
13101
13243
|
template : 'ui tiny modal',
|
13102
13244
|
ok : 'positive',
|
13103
13245
|
cancel : 'negative',
|
13104
|
-
prompt : 'ui fluid input'
|
13246
|
+
prompt : 'ui fluid input',
|
13247
|
+
innerDimmer: 'ui inverted dimmer'
|
13105
13248
|
},
|
13106
13249
|
text: {
|
13107
13250
|
ok : 'Ok',
|
13108
|
-
cancel: 'Cancel'
|
13251
|
+
cancel: 'Cancel',
|
13252
|
+
close : 'Close'
|
13109
13253
|
}
|
13110
13254
|
};
|
13111
13255
|
|
@@ -13131,33 +13275,39 @@ $.fn.modal.settings.templates = {
|
|
13131
13275
|
},
|
13132
13276
|
alert: function () {
|
13133
13277
|
var settings = this.get.settings(),
|
13134
|
-
args = settings.templates.getArguments(arguments)
|
13278
|
+
args = settings.templates.getArguments(arguments),
|
13279
|
+
approveFn = args.handler
|
13135
13280
|
;
|
13136
13281
|
return {
|
13137
13282
|
title : args.title,
|
13138
13283
|
content: args.content,
|
13284
|
+
onApprove: approveFn,
|
13139
13285
|
actions: [{
|
13140
13286
|
text : settings.text.ok,
|
13141
13287
|
class: settings.className.ok,
|
13142
|
-
click:
|
13288
|
+
click: approveFn
|
13143
13289
|
}]
|
13144
13290
|
}
|
13145
13291
|
},
|
13146
13292
|
confirm: function () {
|
13147
13293
|
var settings = this.get.settings(),
|
13148
|
-
args = settings.templates.getArguments(arguments)
|
13294
|
+
args = settings.templates.getArguments(arguments),
|
13295
|
+
approveFn = function(){args.handler(true)},
|
13296
|
+
denyFn = function(){args.handler(false)}
|
13149
13297
|
;
|
13150
13298
|
return {
|
13151
13299
|
title : args.title,
|
13152
13300
|
content: args.content,
|
13301
|
+
onApprove: approveFn,
|
13302
|
+
onDeny: denyFn,
|
13153
13303
|
actions: [{
|
13154
13304
|
text : settings.text.ok,
|
13155
13305
|
class: settings.className.ok,
|
13156
|
-
click:
|
13306
|
+
click: approveFn
|
13157
13307
|
},{
|
13158
13308
|
text: settings.text.cancel,
|
13159
13309
|
class: settings.className.cancel,
|
13160
|
-
click:
|
13310
|
+
click: denyFn
|
13161
13311
|
}]
|
13162
13312
|
}
|
13163
13313
|
},
|
@@ -13165,7 +13315,14 @@ $.fn.modal.settings.templates = {
|
|
13165
13315
|
var $this = this,
|
13166
13316
|
settings = this.get.settings(),
|
13167
13317
|
args = settings.templates.getArguments(arguments),
|
13168
|
-
input = $($.parseHTML(args.content)).filter('.ui.input')
|
13318
|
+
input = $($.parseHTML(args.content)).filter('.ui.input'),
|
13319
|
+
approveFn = function(){
|
13320
|
+
var settings = $this.get.settings(),
|
13321
|
+
inputField = $this.get.element().find(settings.selector.prompt)[0]
|
13322
|
+
;
|
13323
|
+
args.handler($(inputField).val());
|
13324
|
+
},
|
13325
|
+
denyFn = function(){args.handler(null)}
|
13169
13326
|
;
|
13170
13327
|
if (input.length === 0) {
|
13171
13328
|
args.content += '<p><div class="'+settings.className.prompt+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
|
@@ -13173,19 +13330,16 @@ $.fn.modal.settings.templates = {
|
|
13173
13330
|
return {
|
13174
13331
|
title : args.title,
|
13175
13332
|
content: args.content,
|
13333
|
+
onApprove: approveFn,
|
13334
|
+
onDeny: denyFn,
|
13176
13335
|
actions: [{
|
13177
13336
|
text: settings.text.ok,
|
13178
13337
|
class: settings.className.ok,
|
13179
|
-
click:
|
13180
|
-
var settings = $this.get.settings(),
|
13181
|
-
inputField = $this.get.element().find(settings.selector.prompt)[0]
|
13182
|
-
;
|
13183
|
-
args.handler($(inputField).val());
|
13184
|
-
}
|
13338
|
+
click: approveFn
|
13185
13339
|
},{
|
13186
13340
|
text: settings.text.cancel,
|
13187
13341
|
class: settings.className.cancel,
|
13188
|
-
click:
|
13342
|
+
click: denyFn
|
13189
13343
|
}]
|
13190
13344
|
}
|
13191
13345
|
}
|
@@ -13194,7 +13348,7 @@ $.fn.modal.settings.templates = {
|
|
13194
13348
|
})( jQuery, window, document );
|
13195
13349
|
|
13196
13350
|
/*!
|
13197
|
-
* # Fomantic-UI 2.9.0-beta.
|
13351
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Nag
|
13198
13352
|
* http://github.com/fomantic/Fomantic-UI/
|
13199
13353
|
*
|
13200
13354
|
*
|
@@ -13248,7 +13402,7 @@ $.fn.nag = function(parameters) {
|
|
13248
13402
|
$module = $(this),
|
13249
13403
|
|
13250
13404
|
$context = (settings.context)
|
13251
|
-
? $(settings.context)
|
13405
|
+
? ([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
13252
13406
|
: $('body'),
|
13253
13407
|
|
13254
13408
|
element = this,
|
@@ -13753,7 +13907,7 @@ $.extend( $.easing, {
|
|
13753
13907
|
})( jQuery, window, document );
|
13754
13908
|
|
13755
13909
|
/*!
|
13756
|
-
* # Fomantic-UI 2.9.0-beta.
|
13910
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Popup
|
13757
13911
|
* http://github.com/fomantic/Fomantic-UI/
|
13758
13912
|
*
|
13759
13913
|
*
|
@@ -13816,11 +13970,11 @@ $.fn.popup = function(parameters) {
|
|
13816
13970
|
moduleNamespace = 'module-' + namespace,
|
13817
13971
|
|
13818
13972
|
$module = $(this),
|
13819
|
-
$context = $(settings.context),
|
13820
|
-
$scrollContext = $(settings.scrollContext),
|
13821
|
-
$boundary = $(settings.boundary),
|
13973
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context),
|
13974
|
+
$scrollContext = [window,document].indexOf(settings.scrollContext) < 0 ? $(document).find(settings.scrollContext) : $(settings.scrollContext),
|
13975
|
+
$boundary = [window,document].indexOf(settings.boundary) < 0 ? $(document).find(settings.boundary) : $(settings.boundary),
|
13822
13976
|
$target = (settings.target)
|
13823
|
-
? $(settings.target)
|
13977
|
+
? ([window,document].indexOf(settings.target) < 0 ? $(document).find(settings.target) : $(settings.target))
|
13824
13978
|
: $module,
|
13825
13979
|
|
13826
13980
|
$popup,
|
@@ -13875,8 +14029,8 @@ $.fn.popup = function(parameters) {
|
|
13875
14029
|
},
|
13876
14030
|
|
13877
14031
|
refresh: function() {
|
13878
|
-
if(settings.popup) {
|
13879
|
-
$popup = $(settings.popup).eq(0);
|
14032
|
+
if(settings.popup && typeof settings.popup === 'string') {
|
14033
|
+
$popup = $(document).find(settings.popup).eq(0);
|
13880
14034
|
}
|
13881
14035
|
else {
|
13882
14036
|
if(settings.inline) {
|
@@ -14040,8 +14194,8 @@ $.fn.popup = function(parameters) {
|
|
14040
14194
|
}
|
14041
14195
|
settings.onCreate.call($popup, element);
|
14042
14196
|
}
|
14043
|
-
else if(settings.popup) {
|
14044
|
-
$(settings.popup).data(metadata.activator, $module);
|
14197
|
+
else if(settings.popup && typeof settings.popup === 'string') {
|
14198
|
+
$(document).find(settings.popup).data(metadata.activator, $module);
|
14045
14199
|
module.verbose('Used popup specified in settings');
|
14046
14200
|
module.refresh();
|
14047
14201
|
if(settings.hoverable) {
|
@@ -14063,7 +14217,7 @@ $.fn.popup = function(parameters) {
|
|
14063
14217
|
},
|
14064
14218
|
|
14065
14219
|
createID: function() {
|
14066
|
-
id = (Math.random().toString(16) + '000000000').
|
14220
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
14067
14221
|
elementNamespace = '.' + id;
|
14068
14222
|
module.verbose('Creating unique id for element', id);
|
14069
14223
|
},
|
@@ -14122,7 +14276,7 @@ $.fn.popup = function(parameters) {
|
|
14122
14276
|
},
|
14123
14277
|
|
14124
14278
|
hideAll: function() {
|
14125
|
-
$(selector.popup)
|
14279
|
+
$(document).find(selector.popup)
|
14126
14280
|
.filter('.' + className.popupVisible)
|
14127
14281
|
.each(function() {
|
14128
14282
|
$(this)
|
@@ -15295,7 +15449,7 @@ $.fn.popup.settings = {
|
|
15295
15449
|
})( jQuery, window, document );
|
15296
15450
|
|
15297
15451
|
/*!
|
15298
|
-
* # Fomantic-UI 2.9.0-beta.
|
15452
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Progress
|
15299
15453
|
* http://github.com/fomantic/Fomantic-UI/
|
15300
15454
|
*
|
15301
15455
|
*
|
@@ -15903,6 +16057,9 @@ $.fn.progress = function(parameters) {
|
|
15903
16057
|
}
|
15904
16058
|
else {
|
15905
16059
|
module.remove.active();
|
16060
|
+
module.remove.warning();
|
16061
|
+
module.remove.error();
|
16062
|
+
module.remove.success();
|
15906
16063
|
module.set.label(settings.text.active);
|
15907
16064
|
}
|
15908
16065
|
},
|
@@ -16329,7 +16486,7 @@ $.fn.progress.settings = {
|
|
16329
16486
|
})( jQuery, window, document );
|
16330
16487
|
|
16331
16488
|
/*!
|
16332
|
-
* # Fomantic-UI 2.9.0-beta.
|
16489
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Slider
|
16333
16490
|
* http://github.com/fomantic/Fomantic-UI/
|
16334
16491
|
*
|
16335
16492
|
*
|
@@ -16400,6 +16557,7 @@ $.fn.slider = function(parameters) {
|
|
16400
16557
|
|
16401
16558
|
$module = $(this),
|
16402
16559
|
$currThumb,
|
16560
|
+
touchIdentifier,
|
16403
16561
|
$thumb,
|
16404
16562
|
$secondThumb,
|
16405
16563
|
$track,
|
@@ -16416,7 +16574,6 @@ $.fn.slider = function(parameters) {
|
|
16416
16574
|
secondPos,
|
16417
16575
|
offset,
|
16418
16576
|
precision,
|
16419
|
-
isTouch,
|
16420
16577
|
gapRatio = 1,
|
16421
16578
|
previousValue,
|
16422
16579
|
|
@@ -16434,7 +16591,6 @@ $.fn.slider = function(parameters) {
|
|
16434
16591
|
currentRange += 1;
|
16435
16592
|
documentEventID = currentRange;
|
16436
16593
|
|
16437
|
-
isTouch = module.setup.testOutTouch();
|
16438
16594
|
module.setup.layout();
|
16439
16595
|
module.setup.labels();
|
16440
16596
|
|
@@ -16505,14 +16661,6 @@ $.fn.slider = function(parameters) {
|
|
16505
16661
|
}
|
16506
16662
|
}
|
16507
16663
|
},
|
16508
|
-
testOutTouch: function() {
|
16509
|
-
try {
|
16510
|
-
document.createEvent('TouchEvent');
|
16511
|
-
return true;
|
16512
|
-
} catch (e) {
|
16513
|
-
return false;
|
16514
|
-
}
|
16515
|
-
},
|
16516
16664
|
customLabel: function() {
|
16517
16665
|
var
|
16518
16666
|
$children = $labels.find('.label'),
|
@@ -16566,9 +16714,6 @@ $.fn.slider = function(parameters) {
|
|
16566
16714
|
module.bind.globalKeyboardEvents();
|
16567
16715
|
module.bind.keyboardEvents();
|
16568
16716
|
module.bind.mouseEvents();
|
16569
|
-
if(module.is.touch()) {
|
16570
|
-
module.bind.touchEvents();
|
16571
|
-
}
|
16572
16717
|
if (settings.autoAdjustLabels) {
|
16573
16718
|
module.bind.windowEvents();
|
16574
16719
|
}
|
@@ -16581,7 +16726,7 @@ $.fn.slider = function(parameters) {
|
|
16581
16726
|
$(document).on('keydown' + eventNamespace + documentEventID, module.event.activateFocus);
|
16582
16727
|
},
|
16583
16728
|
mouseEvents: function() {
|
16584
|
-
module.verbose('Binding mouse events');
|
16729
|
+
module.verbose('Binding mouse and touch events');
|
16585
16730
|
$module.find('.track, .thumb, .inner').on('mousedown' + eventNamespace, function(event) {
|
16586
16731
|
event.stopImmediatePropagation();
|
16587
16732
|
event.preventDefault();
|
@@ -16594,27 +16739,20 @@ $.fn.slider = function(parameters) {
|
|
16594
16739
|
$module.on('mouseleave' + eventNamespace, function(event) {
|
16595
16740
|
isHover = false;
|
16596
16741
|
});
|
16597
|
-
|
16598
|
-
|
16599
|
-
|
16600
|
-
$module.find('.
|
16601
|
-
event.
|
16602
|
-
event.
|
16603
|
-
module.event.
|
16604
|
-
|
16605
|
-
$module.on('touchstart' + eventNamespace, module.event.down);
|
16742
|
+
// All touch events are invoked on the element where the touch *started*. Thus, we can bind them all
|
16743
|
+
// on the thumb(s) and don't need to worry about interference with other components, i.e. no dynamic binding
|
16744
|
+
// and unbinding required.
|
16745
|
+
$module.find('.thumb')
|
16746
|
+
.on('touchstart' + eventNamespace, module.event.touchDown)
|
16747
|
+
.on('touchmove' + eventNamespace, module.event.move)
|
16748
|
+
.on('touchend' + eventNamespace, module.event.up)
|
16749
|
+
.on('touchcancel' + eventNamespace, module.event.touchCancel);
|
16606
16750
|
},
|
16607
16751
|
slidingEvents: function() {
|
16608
16752
|
// these don't need the identifier because we only ever want one of them to be registered with document
|
16609
16753
|
module.verbose('Binding page wide events while handle is being draged');
|
16610
|
-
|
16611
|
-
|
16612
|
-
$(document).on('touchend' + eventNamespace, module.event.up);
|
16613
|
-
}
|
16614
|
-
else {
|
16615
|
-
$(document).on('mousemove' + eventNamespace, module.event.move);
|
16616
|
-
$(document).on('mouseup' + eventNamespace, module.event.up);
|
16617
|
-
}
|
16754
|
+
$(document).on('mousemove' + eventNamespace, module.event.move);
|
16755
|
+
$(document).on('mouseup' + eventNamespace, module.event.up);
|
16618
16756
|
},
|
16619
16757
|
windowEvents: function() {
|
16620
16758
|
$window.on('resize' + eventNamespace, module.event.resize);
|
@@ -16624,24 +16762,22 @@ $.fn.slider = function(parameters) {
|
|
16624
16762
|
unbind: {
|
16625
16763
|
events: function() {
|
16626
16764
|
$module.find('.track, .thumb, .inner').off('mousedown' + eventNamespace);
|
16627
|
-
$module.find('.track, .thumb, .inner').off('touchstart' + eventNamespace);
|
16628
16765
|
$module.off('mousedown' + eventNamespace);
|
16629
16766
|
$module.off('mouseenter' + eventNamespace);
|
16630
16767
|
$module.off('mouseleave' + eventNamespace);
|
16631
|
-
$module.
|
16768
|
+
$module.find('.thumb')
|
16769
|
+
.off('touchstart' + eventNamespace)
|
16770
|
+
.off('touchmove' + eventNamespace)
|
16771
|
+
.off('touchend' + eventNamespace)
|
16772
|
+
.off('touchcancel' + eventNamespace);
|
16632
16773
|
$module.off('keydown' + eventNamespace);
|
16633
16774
|
$module.off('focusout' + eventNamespace);
|
16634
16775
|
$(document).off('keydown' + eventNamespace + documentEventID, module.event.activateFocus);
|
16635
16776
|
$window.off('resize' + eventNamespace);
|
16636
16777
|
},
|
16637
16778
|
slidingEvents: function() {
|
16638
|
-
|
16639
|
-
|
16640
|
-
$(document).off('touchend' + eventNamespace);
|
16641
|
-
} else {
|
16642
|
-
$(document).off('mousemove' + eventNamespace);
|
16643
|
-
$(document).off('mouseup' + eventNamespace);
|
16644
|
-
}
|
16779
|
+
$(document).off('mousemove' + eventNamespace);
|
16780
|
+
$(document).off('mouseup' + eventNamespace);
|
16645
16781
|
},
|
16646
16782
|
},
|
16647
16783
|
|
@@ -16671,10 +16807,31 @@ $.fn.slider = function(parameters) {
|
|
16671
16807
|
module.bind.slidingEvents();
|
16672
16808
|
}
|
16673
16809
|
},
|
16810
|
+
touchDown: function(event) {
|
16811
|
+
event.preventDefault(); // disable mouse emulation and touch-scrolling
|
16812
|
+
event.stopImmediatePropagation();
|
16813
|
+
if(touchIdentifier !== undefined) {
|
16814
|
+
// ignore multiple touches on the same slider --
|
16815
|
+
// we cannot handle changing both thumbs at once due to shared state
|
16816
|
+
return;
|
16817
|
+
}
|
16818
|
+
$currThumb = $(event.target);
|
16819
|
+
var touchEvent = event.touches ? event : event.originalEvent;
|
16820
|
+
touchIdentifier = touchEvent.targetTouches[0].identifier;
|
16821
|
+
if(previousValue === undefined) {
|
16822
|
+
previousValue = module.get.currentThumbValue();
|
16823
|
+
}
|
16824
|
+
},
|
16674
16825
|
move: function(event) {
|
16675
|
-
event.
|
16826
|
+
if(event.type == 'mousemove') {
|
16827
|
+
event.preventDefault(); // prevent text selection etc.
|
16828
|
+
}
|
16829
|
+
if(module.is.disabled()) {
|
16830
|
+
// touch events are always bound, so we need to prevent touch-sliding on disabled sliders here
|
16831
|
+
return;
|
16832
|
+
}
|
16676
16833
|
var value = module.determine.valueFromEvent(event);
|
16677
|
-
if($currThumb === undefined) {
|
16834
|
+
if(event.type == 'mousemove' && $currThumb === undefined) {
|
16678
16835
|
var
|
16679
16836
|
eventPos = module.determine.eventPos(event),
|
16680
16837
|
newPos = module.determine.pos(eventPos)
|
@@ -16711,13 +16868,26 @@ $.fn.slider = function(parameters) {
|
|
16711
16868
|
},
|
16712
16869
|
up: function(event) {
|
16713
16870
|
event.preventDefault();
|
16871
|
+
if(module.is.disabled()) {
|
16872
|
+
// touch events are always bound, so we need to prevent touch-sliding on disabled sliders here
|
16873
|
+
return;
|
16874
|
+
}
|
16714
16875
|
var value = module.determine.valueFromEvent(event);
|
16715
16876
|
module.set.value(value);
|
16716
16877
|
module.unbind.slidingEvents();
|
16878
|
+
touchIdentifier = undefined;
|
16717
16879
|
if (previousValue !== undefined) {
|
16718
16880
|
previousValue = undefined;
|
16719
16881
|
}
|
16720
16882
|
},
|
16883
|
+
touchCancel: function(event) {
|
16884
|
+
event.preventDefault();
|
16885
|
+
touchIdentifier = undefined;
|
16886
|
+
if (previousValue !== undefined) {
|
16887
|
+
module.update.value(previousValue);
|
16888
|
+
previousValue = undefined;
|
16889
|
+
}
|
16890
|
+
},
|
16721
16891
|
keydown: function(event, first) {
|
16722
16892
|
if(settings.preventCrossover && module.is.range() && module.thumbVal === module.secondThumbVal) {
|
16723
16893
|
$currThumb = undefined;
|
@@ -16830,9 +17000,6 @@ $.fn.slider = function(parameters) {
|
|
16830
17000
|
},
|
16831
17001
|
smooth: function() {
|
16832
17002
|
return settings.smooth || $module.hasClass(settings.className.smooth);
|
16833
|
-
},
|
16834
|
-
touch: function() {
|
16835
|
-
return isTouch;
|
16836
17003
|
}
|
16837
17004
|
},
|
16838
17005
|
|
@@ -17096,12 +17263,19 @@ $.fn.slider = function(parameters) {
|
|
17096
17263
|
return value;
|
17097
17264
|
},
|
17098
17265
|
eventPos: function(event) {
|
17099
|
-
if(
|
17266
|
+
if(event.type === "touchmove" || event.type === "touchend") {
|
17267
|
+
var
|
17268
|
+
touchEvent = event.touches ? event : event.originalEvent,
|
17269
|
+
touch = touchEvent.changedTouches[0]; // fall back to first touch if correct touch not found
|
17270
|
+
for(var i=0; i < touchEvent.touches.length; i++) {
|
17271
|
+
if(touchEvent.touches[i].identifier === touchIdentifier) {
|
17272
|
+
touch = touchEvent.touches[i];
|
17273
|
+
break;
|
17274
|
+
}
|
17275
|
+
}
|
17100
17276
|
var
|
17101
|
-
|
17102
|
-
|
17103
|
-
touchY = touches[0].pageY,
|
17104
|
-
touchX = touches[0].pageX
|
17277
|
+
touchY = touch.pageY,
|
17278
|
+
touchX = touch.pageX
|
17105
17279
|
;
|
17106
17280
|
return module.is.vertical() ? touchY : touchX;
|
17107
17281
|
}
|
@@ -17668,7 +17842,7 @@ $.fn.slider.settings = {
|
|
17668
17842
|
})( jQuery, window, document );
|
17669
17843
|
|
17670
17844
|
/*!
|
17671
|
-
* # Fomantic-UI 2.9.0-beta.
|
17845
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Rating
|
17672
17846
|
* http://github.com/fomantic/Fomantic-UI/
|
17673
17847
|
*
|
17674
17848
|
*
|
@@ -18223,7 +18397,7 @@ $.fn.rating.settings = {
|
|
18223
18397
|
})( jQuery, window, document );
|
18224
18398
|
|
18225
18399
|
/*!
|
18226
|
-
* # Fomantic-UI 2.9.0-beta.
|
18400
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Search
|
18227
18401
|
* http://github.com/fomantic/Fomantic-UI/
|
18228
18402
|
*
|
18229
18403
|
*
|
@@ -18591,20 +18765,36 @@ $.fn.search = function(parameters) {
|
|
18591
18765
|
urlData : {
|
18592
18766
|
query : searchTerm
|
18593
18767
|
},
|
18594
|
-
|
18768
|
+
},
|
18769
|
+
apiCallbacks = {
|
18770
|
+
onSuccess : function(response, $module, xhr) {
|
18595
18771
|
module.parse.response.call(element, response, searchTerm);
|
18596
18772
|
callback();
|
18773
|
+
if(settings.apiSettings && typeof settings.apiSettings.onSuccess === 'function') {
|
18774
|
+
settings.apiSettings.onSuccess.call(this, response, $module, xhr);
|
18775
|
+
}
|
18597
18776
|
},
|
18598
|
-
onFailure : function() {
|
18777
|
+
onFailure : function(response, $module, xhr) {
|
18599
18778
|
module.displayMessage(error.serverError);
|
18600
18779
|
callback();
|
18780
|
+
if(settings.apiSettings && typeof settings.apiSettings.onFailure === 'function') {
|
18781
|
+
settings.apiSettings.onFailure.call(this, response, $module, xhr);
|
18782
|
+
}
|
18601
18783
|
},
|
18602
|
-
onAbort : function(
|
18784
|
+
onAbort : function(status, $module, xhr) {
|
18785
|
+
if(settings.apiSettings && typeof settings.apiSettings.onAbort === 'function') {
|
18786
|
+
settings.apiSettings.onAbort.call(this, status, $module, xhr);
|
18787
|
+
}
|
18603
18788
|
},
|
18604
|
-
onError : module
|
18789
|
+
onError : function(errorMessage, $module, xhr){
|
18790
|
+
module.error();
|
18791
|
+
if(settings.apiSettings && typeof settings.apiSettings.onError === 'function') {
|
18792
|
+
settings.apiSettings.onError.call(this, errorMessage, $module, xhr);
|
18793
|
+
}
|
18794
|
+
}
|
18605
18795
|
}
|
18606
18796
|
;
|
18607
|
-
$.extend(true, apiSettings, settings.apiSettings);
|
18797
|
+
$.extend(true, apiSettings, settings.apiSettings, apiCallbacks);
|
18608
18798
|
module.verbose('Setting up API request', apiSettings);
|
18609
18799
|
$module.api(apiSettings);
|
18610
18800
|
}
|
@@ -18627,7 +18817,7 @@ $.fn.search = function(parameters) {
|
|
18627
18817
|
return $results.hasClass(className.animating);
|
18628
18818
|
},
|
18629
18819
|
chrome: function() {
|
18630
|
-
return !!window.chrome &&
|
18820
|
+
return !!window.chrome && !window.StyleMedia;
|
18631
18821
|
},
|
18632
18822
|
hidden: function() {
|
18633
18823
|
return $results.hasClass(className.hidden);
|
@@ -19791,7 +19981,7 @@ $.fn.search.settings = {
|
|
19791
19981
|
})( jQuery, window, document );
|
19792
19982
|
|
19793
19983
|
/*!
|
19794
|
-
* # Fomantic-UI 2.9.0-beta.
|
19984
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Shape
|
19795
19985
|
* http://github.com/fomantic/Fomantic-UI/
|
19796
19986
|
*
|
19797
19987
|
*
|
@@ -19918,7 +20108,7 @@ $.fn.shape = function(parameters) {
|
|
19918
20108
|
module.reset();
|
19919
20109
|
module.set.active();
|
19920
20110
|
};
|
19921
|
-
settings.
|
20111
|
+
settings.onBeforeChange.call($nextSide[0]);
|
19922
20112
|
if(module.get.transitionEvent()) {
|
19923
20113
|
module.verbose('Starting CSS animation');
|
19924
20114
|
$module
|
@@ -20605,7 +20795,7 @@ $.fn.shape.settings = {
|
|
20605
20795
|
height: 'initial',
|
20606
20796
|
|
20607
20797
|
// callback occurs on side change
|
20608
|
-
|
20798
|
+
onBeforeChange : function() {},
|
20609
20799
|
onChange : function() {},
|
20610
20800
|
|
20611
20801
|
// allow animation to same side
|
@@ -20640,7 +20830,7 @@ $.fn.shape.settings = {
|
|
20640
20830
|
})( jQuery, window, document );
|
20641
20831
|
|
20642
20832
|
/*!
|
20643
|
-
* # Fomantic-UI 2.9.0-beta.
|
20833
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Sidebar
|
20644
20834
|
* http://github.com/fomantic/Fomantic-UI/
|
20645
20835
|
*
|
20646
20836
|
*
|
@@ -20707,7 +20897,7 @@ $.fn.sidebar = function(parameters) {
|
|
20707
20897
|
moduleNamespace = 'module-' + namespace,
|
20708
20898
|
|
20709
20899
|
$module = $(this),
|
20710
|
-
$context = $(settings.context),
|
20900
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context),
|
20711
20901
|
|
20712
20902
|
$sidebars = $module.children(selector.sidebar),
|
20713
20903
|
$fixed = $context.children(selector.fixed),
|
@@ -20759,7 +20949,7 @@ $.fn.sidebar = function(parameters) {
|
|
20759
20949
|
|
20760
20950
|
create: {
|
20761
20951
|
id: function() {
|
20762
|
-
id = (Math.random().toString(16) + '000000000').
|
20952
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
20763
20953
|
elementNamespace = '.' + id;
|
20764
20954
|
module.verbose('Creating unique id for element', id);
|
20765
20955
|
}
|
@@ -20902,7 +21092,7 @@ $.fn.sidebar = function(parameters) {
|
|
20902
21092
|
if(direction === 'left' || direction === 'right') {
|
20903
21093
|
module.debug('Adding CSS rules for animation distance', width);
|
20904
21094
|
style += ''
|
20905
|
-
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher
|
21095
|
+
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher::after {'
|
20906
21096
|
+ ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
20907
21097
|
+ ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
20908
21098
|
+ ' }'
|
@@ -20910,7 +21100,7 @@ $.fn.sidebar = function(parameters) {
|
|
20910
21100
|
}
|
20911
21101
|
else if(direction === 'top' || direction == 'bottom') {
|
20912
21102
|
style += ''
|
20913
|
-
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher
|
21103
|
+
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher::after {'
|
20914
21104
|
+ ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
20915
21105
|
+ ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
20916
21106
|
+ ' }'
|
@@ -20918,8 +21108,8 @@ $.fn.sidebar = function(parameters) {
|
|
20918
21108
|
}
|
20919
21109
|
/* opposite sides visible forces content overlay */
|
20920
21110
|
style += ''
|
20921
|
-
+ ' body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher
|
20922
|
-
+ ' body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher
|
21111
|
+
+ ' body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher::after,'
|
21112
|
+
+ ' body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher::after {'
|
20923
21113
|
+ ' -webkit-transform: translate3d(0, 0, 0);'
|
20924
21114
|
+ ' transform: translate3d(0, 0, 0);'
|
20925
21115
|
+ ' }'
|
@@ -20935,7 +21125,7 @@ $.fn.sidebar = function(parameters) {
|
|
20935
21125
|
|
20936
21126
|
refresh: function() {
|
20937
21127
|
module.verbose('Refreshing selector cache');
|
20938
|
-
$context = $(settings.context);
|
21128
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
|
20939
21129
|
$sidebars = $context.children(selector.sidebar);
|
20940
21130
|
$pusher = $context.children(selector.pusher);
|
20941
21131
|
$fixed = $context.children(selector.fixed);
|
@@ -21012,6 +21202,10 @@ $.fn.sidebar = function(parameters) {
|
|
21012
21202
|
: function(){}
|
21013
21203
|
;
|
21014
21204
|
if(module.is.hidden()) {
|
21205
|
+
if(settings.onShow.call(element) === false) {
|
21206
|
+
module.verbose('Show callback returned false cancelling show');
|
21207
|
+
return;
|
21208
|
+
}
|
21015
21209
|
module.refreshSidebars();
|
21016
21210
|
if(settings.overlay) {
|
21017
21211
|
module.error(error.overlay);
|
@@ -21036,10 +21230,9 @@ $.fn.sidebar = function(parameters) {
|
|
21036
21230
|
}
|
21037
21231
|
module.pushPage(function() {
|
21038
21232
|
callback.call(element);
|
21039
|
-
settings.
|
21233
|
+
settings.onVisible.call(element);
|
21040
21234
|
});
|
21041
21235
|
settings.onChange.call(element);
|
21042
|
-
settings.onVisible.call(element);
|
21043
21236
|
}
|
21044
21237
|
else {
|
21045
21238
|
module.debug('Sidebar is already visible');
|
@@ -21051,7 +21244,7 @@ $.fn.sidebar = function(parameters) {
|
|
21051
21244
|
? callback
|
21052
21245
|
: function(){}
|
21053
21246
|
;
|
21054
|
-
if(module.is.visible() || module.is.animating()) {
|
21247
|
+
if((module.is.visible() || module.is.animating()) && settings.onHide.call(element) !== false) {
|
21055
21248
|
module.debug('Hiding sidebar', callback);
|
21056
21249
|
module.refreshSidebars();
|
21057
21250
|
module.pullPage(function() {
|
@@ -21059,7 +21252,6 @@ $.fn.sidebar = function(parameters) {
|
|
21059
21252
|
settings.onHidden.call(element);
|
21060
21253
|
});
|
21061
21254
|
settings.onChange.call(element);
|
21062
|
-
settings.onHide.call(element);
|
21063
21255
|
}
|
21064
21256
|
},
|
21065
21257
|
|
@@ -21677,7 +21869,7 @@ $.fn.sidebar.settings = {
|
|
21677
21869
|
})( jQuery, window, document );
|
21678
21870
|
|
21679
21871
|
/*!
|
21680
|
-
* # Fomantic-UI 2.9.0-beta.
|
21872
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Sticky
|
21681
21873
|
* http://github.com/fomantic/Fomantic-UI/
|
21682
21874
|
*
|
21683
21875
|
*
|
@@ -21731,7 +21923,7 @@ $.fn.sticky = function(parameters) {
|
|
21731
21923
|
|
21732
21924
|
$module = $(this),
|
21733
21925
|
$window = $(window),
|
21734
|
-
$scroll = $(settings.scrollContext),
|
21926
|
+
$scroll = [window,document].indexOf(settings.scrollContext) < 0 ? $(document).find(settings.scrollContext) : $(settings.scrollContext),
|
21735
21927
|
$container,
|
21736
21928
|
$context,
|
21737
21929
|
|
@@ -21817,7 +22009,7 @@ $.fn.sticky = function(parameters) {
|
|
21817
22009
|
|
21818
22010
|
determineContainer: function() {
|
21819
22011
|
if(settings.container) {
|
21820
|
-
$container = $(settings.container);
|
22012
|
+
$container = [window,document].indexOf(settings.container) < 0 ? $(document).find(settings.container) : $(settings.container);
|
21821
22013
|
}
|
21822
22014
|
else {
|
21823
22015
|
$container = $module.offsetParent();
|
@@ -21826,7 +22018,7 @@ $.fn.sticky = function(parameters) {
|
|
21826
22018
|
|
21827
22019
|
determineContext: function() {
|
21828
22020
|
if(settings.context) {
|
21829
|
-
$context = $(settings.context);
|
22021
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
|
21830
22022
|
}
|
21831
22023
|
else {
|
21832
22024
|
$context = $container;
|
@@ -22635,7 +22827,7 @@ $.fn.sticky.settings = {
|
|
22635
22827
|
})( jQuery, window, document );
|
22636
22828
|
|
22637
22829
|
/*!
|
22638
|
-
* # Fomantic-UI 2.9.0-beta.
|
22830
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Tab
|
22639
22831
|
* http://github.com/fomantic/Fomantic-UI/
|
22640
22832
|
*
|
22641
22833
|
*
|
@@ -22736,10 +22928,18 @@ $.fn.tab = function(parameters) {
|
|
22736
22928
|
initializedHistory = true;
|
22737
22929
|
}
|
22738
22930
|
|
22739
|
-
|
22740
|
-
|
22741
|
-
|
22742
|
-
|
22931
|
+
var activeTab = module.determine.activeTab();
|
22932
|
+
if(settings.autoTabActivation && instance === undefined && activeTab == null) {
|
22933
|
+
activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
|
22934
|
+
module.debug('No active tab detected, setting tab active', activeTab);
|
22935
|
+
module.changeTab(activeTab);
|
22936
|
+
}
|
22937
|
+
if(activeTab != null && settings.history) {
|
22938
|
+
var autoUpdate = $.address.autoUpdate();
|
22939
|
+
$.address.autoUpdate(false);
|
22940
|
+
$.address.value(activeTab);
|
22941
|
+
$.address.autoUpdate(autoUpdate);
|
22942
|
+
}
|
22743
22943
|
|
22744
22944
|
module.instantiate();
|
22745
22945
|
},
|
@@ -22790,7 +22990,7 @@ $.fn.tab = function(parameters) {
|
|
22790
22990
|
module.verbose('Determined parent element for creating context', $context);
|
22791
22991
|
}
|
22792
22992
|
else if(settings.context) {
|
22793
|
-
$context = $(settings.context);
|
22993
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
|
22794
22994
|
module.verbose('Using selector for tab context', settings.context, $context);
|
22795
22995
|
}
|
22796
22996
|
else {
|
@@ -22839,6 +23039,7 @@ $.fn.tab = function(parameters) {
|
|
22839
23039
|
.history(true)
|
22840
23040
|
.state(settings.path)
|
22841
23041
|
;
|
23042
|
+
$(window).trigger('popstate');
|
22842
23043
|
}
|
22843
23044
|
else {
|
22844
23045
|
module.error(error.path);
|
@@ -23006,6 +23207,10 @@ $.fn.tab = function(parameters) {
|
|
23006
23207
|
module.verbose('Tab parameters found', nextPathArray);
|
23007
23208
|
}
|
23008
23209
|
}
|
23210
|
+
if (settings.onBeforeChange.call(element, currentPath) === false) {
|
23211
|
+
module.debug('onBeforeChange returned false, cancelling tab change', $tab);
|
23212
|
+
return false;
|
23213
|
+
}
|
23009
23214
|
if(isLastTab && remoteContent) {
|
23010
23215
|
if(!shouldIgnoreLoad) {
|
23011
23216
|
module.activate.navigation(currentPath);
|
@@ -23042,6 +23247,10 @@ $.fn.tab = function(parameters) {
|
|
23042
23247
|
// if anchor exists use parent tab
|
23043
23248
|
if($anchor && $anchor.length > 0 && currentPath) {
|
23044
23249
|
module.debug('Anchor link used, opening parent tab', $tab, $anchor);
|
23250
|
+
if (settings.onBeforeChange.call(element, currentPath) === false) {
|
23251
|
+
module.debug('onBeforeChange returned false, cancelling tab change', $tab);
|
23252
|
+
return false;
|
23253
|
+
}
|
23045
23254
|
if( !$tab.hasClass(className.active) ) {
|
23046
23255
|
setTimeout(function() {
|
23047
23256
|
module.scrollTo($anchor);
|
@@ -23595,6 +23804,7 @@ $.fn.tab.settings = {
|
|
23595
23804
|
onLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
|
23596
23805
|
onVisible : function(tabPath, parameterArray, historyEvent) {}, // called every time tab visible
|
23597
23806
|
onRequest : function(tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content
|
23807
|
+
onBeforeChange: function(tabPath) {}, // called before a tab is about to be changed. Returning false will cancel the tab change
|
23598
23808
|
|
23599
23809
|
templates : {
|
23600
23810
|
determineTitle: function(tabArray) {} // returns page title for path
|
@@ -23637,7 +23847,7 @@ $.fn.tab.settings = {
|
|
23637
23847
|
})( jQuery, window, document );
|
23638
23848
|
|
23639
23849
|
/*!
|
23640
|
-
* # Fomantic-UI 2.9.0-beta.
|
23850
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Toast
|
23641
23851
|
* http://github.com/fomantic/Fomantic-UI/
|
23642
23852
|
*
|
23643
23853
|
*
|
@@ -23699,7 +23909,7 @@ $.fn.toast = function(parameters) {
|
|
23699
23909
|
$animationObject,
|
23700
23910
|
$close,
|
23701
23911
|
$context = (settings.context)
|
23702
|
-
? $(settings.context)
|
23912
|
+
? ([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
23703
23913
|
: $('body'),
|
23704
23914
|
|
23705
23915
|
isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card'),
|
@@ -23707,12 +23917,14 @@ $.fn.toast = function(parameters) {
|
|
23707
23917
|
element = this,
|
23708
23918
|
instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
|
23709
23919
|
|
23920
|
+
id,
|
23710
23921
|
module
|
23711
23922
|
;
|
23712
23923
|
module = {
|
23713
23924
|
|
23714
23925
|
initialize: function() {
|
23715
23926
|
module.verbose('Initializing element');
|
23927
|
+
module.create.id();
|
23716
23928
|
if (!module.has.container()) {
|
23717
23929
|
module.create.container();
|
23718
23930
|
}
|
@@ -23762,17 +23974,22 @@ $.fn.toast = function(parameters) {
|
|
23762
23974
|
},
|
23763
23975
|
|
23764
23976
|
show: function(callback) {
|
23765
|
-
callback = callback || function(){};
|
23766
|
-
module.debug('Showing toast');
|
23767
23977
|
if(settings.onShow.call($toastBox, element) === false) {
|
23768
23978
|
module.debug('onShow callback returned false, cancelling toast animation');
|
23769
23979
|
return;
|
23770
23980
|
}
|
23981
|
+
callback = callback || function(){};
|
23982
|
+
module.debug('Showing toast');
|
23771
23983
|
module.animate.show(callback);
|
23772
23984
|
},
|
23773
23985
|
|
23774
23986
|
close: function(callback) {
|
23987
|
+
if(settings.onHide.call($toastBox, element) === false) {
|
23988
|
+
module.debug('onHide callback returned false, cancelling toast animation');
|
23989
|
+
return;
|
23990
|
+
}
|
23775
23991
|
callback = callback || function(){};
|
23992
|
+
module.debug('Closing toast');
|
23776
23993
|
module.remove.visible();
|
23777
23994
|
module.unbind.events();
|
23778
23995
|
module.animate.close(callback);
|
@@ -23782,14 +23999,18 @@ $.fn.toast = function(parameters) {
|
|
23782
23999
|
create: {
|
23783
24000
|
container: function() {
|
23784
24001
|
module.verbose('Creating container');
|
23785
|
-
$context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '')}));
|
24002
|
+
$context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '') + ' ' + (settings.context && settings.context !== 'body' ? className.absolute : '')}));
|
24003
|
+
},
|
24004
|
+
id: function() {
|
24005
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
24006
|
+
module.verbose('Creating unique id for element', id);
|
23786
24007
|
},
|
23787
24008
|
toast: function() {
|
23788
24009
|
$toastBox = $('<div/>', {class: className.box});
|
23789
24010
|
var iconClass = module.get.iconClass();
|
23790
24011
|
if (!isToastComponent) {
|
23791
24012
|
module.verbose('Creating toast');
|
23792
|
-
$toast = $('<div/>');
|
24013
|
+
$toast = $('<div/>', {role: 'alert'});
|
23793
24014
|
var $content = $('<div/>', {class: className.content});
|
23794
24015
|
if (iconClass !== '') {
|
23795
24016
|
$toast.append($('<i/>', {class: iconClass + ' ' + className.icon}));
|
@@ -23802,13 +24023,21 @@ $.fn.toast = function(parameters) {
|
|
23802
24023
|
}));
|
23803
24024
|
}
|
23804
24025
|
if (settings.title !== '') {
|
24026
|
+
var titleId = '_' + module.get.id() + 'title';
|
24027
|
+
$toast.attr('aria-labelledby', titleId);
|
23805
24028
|
$content.append($('<div/>', {
|
23806
24029
|
class: className.title,
|
23807
|
-
|
24030
|
+
id: titleId,
|
24031
|
+
html: module.helpers.escape(settings.title, settings.preserveHTML)
|
23808
24032
|
}));
|
23809
24033
|
}
|
23810
|
-
|
23811
|
-
$
|
24034
|
+
var descId = '_' + module.get.id() + 'desc';
|
24035
|
+
$toast.attr('aria-describedby', descId);
|
24036
|
+
$content.append($('<div/>', {
|
24037
|
+
class: className.message,
|
24038
|
+
id: descId,
|
24039
|
+
html: module.helpers.escape(settings.message, settings.preserveHTML)
|
24040
|
+
}));
|
23812
24041
|
|
23813
24042
|
$toast
|
23814
24043
|
.addClass(settings.class + ' ' + className.toast)
|
@@ -23816,7 +24045,7 @@ $.fn.toast = function(parameters) {
|
|
23816
24045
|
;
|
23817
24046
|
$toast.css('opacity', settings.opacity);
|
23818
24047
|
if (settings.closeIcon) {
|
23819
|
-
$close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : '')});
|
24048
|
+
$close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''), role: 'button', tabindex: 0, 'aria-label': settings.text.close});
|
23820
24049
|
if($close.hasClass(className.left)) {
|
23821
24050
|
$toast.prepend($close);
|
23822
24051
|
} else {
|
@@ -23859,15 +24088,17 @@ $.fn.toast = function(parameters) {
|
|
23859
24088
|
}
|
23860
24089
|
}
|
23861
24090
|
settings.actions.forEach(function (el) {
|
23862
|
-
var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
24091
|
+
var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
23863
24092
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
23864
24093
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
23865
24094
|
click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
|
23866
24095
|
$actions.append($('<button/>', {
|
23867
24096
|
html: icon + text,
|
24097
|
+
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
|
23868
24098
|
class: className.button + ' ' + cls,
|
23869
24099
|
click: function () {
|
23870
|
-
|
24100
|
+
var button = $(this);
|
24101
|
+
if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
|
23871
24102
|
return;
|
23872
24103
|
}
|
23873
24104
|
module.close();
|
@@ -23967,13 +24198,12 @@ $.fn.toast = function(parameters) {
|
|
23967
24198
|
bind: {
|
23968
24199
|
events: function() {
|
23969
24200
|
module.debug('Binding events to toast');
|
23970
|
-
if(settings.
|
23971
|
-
(
|
23972
|
-
.on('click' + eventNamespace, module.event.click)
|
23973
|
-
;
|
24201
|
+
if(settings.closeIcon) {
|
24202
|
+
$close.on('click' + eventNamespace, module.event.close);
|
23974
24203
|
}
|
24204
|
+
$toast.on('click' + eventNamespace, module.event.click);
|
23975
24205
|
if($animationObject) {
|
23976
|
-
$animationObject.on('animationend' + eventNamespace, module.close);
|
24206
|
+
$animationObject.on('animationend' + eventNamespace, module.event.close);
|
23977
24207
|
}
|
23978
24208
|
$toastBox
|
23979
24209
|
.on('click' + eventNamespace, selector.approve, module.event.approve)
|
@@ -23985,11 +24215,10 @@ $.fn.toast = function(parameters) {
|
|
23985
24215
|
unbind: {
|
23986
24216
|
events: function() {
|
23987
24217
|
module.debug('Unbinding events to toast');
|
23988
|
-
if(settings.
|
23989
|
-
|
23990
|
-
.off('click' + eventNamespace)
|
23991
|
-
;
|
24218
|
+
if(settings.closeIcon) {
|
24219
|
+
$close.off('click' + eventNamespace);
|
23992
24220
|
}
|
24221
|
+
$toast.off('click' + eventNamespace);
|
23993
24222
|
if($animationObject) {
|
23994
24223
|
$animationObject.off('animationend' + eventNamespace);
|
23995
24224
|
}
|
@@ -24021,11 +24250,6 @@ $.fn.toast = function(parameters) {
|
|
24021
24250
|
},
|
24022
24251
|
close: function(callback) {
|
24023
24252
|
callback = $.isFunction(callback) ? callback : function(){};
|
24024
|
-
module.debug('Closing toast');
|
24025
|
-
if(settings.onHide.call($toastBox, element) === false) {
|
24026
|
-
module.debug('onHide callback returned false, cancelling toast animation');
|
24027
|
-
return;
|
24028
|
-
}
|
24029
24253
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
24030
24254
|
$toastBox
|
24031
24255
|
.transition({
|
@@ -24081,7 +24305,7 @@ $.fn.toast = function(parameters) {
|
|
24081
24305
|
has: {
|
24082
24306
|
container: function() {
|
24083
24307
|
module.verbose('Determining if there is already a container');
|
24084
|
-
return
|
24308
|
+
return module.get.containers().length > 0;
|
24085
24309
|
},
|
24086
24310
|
toast: function(){
|
24087
24311
|
return !!module.get.toast();
|
@@ -24095,8 +24319,14 @@ $.fn.toast = function(parameters) {
|
|
24095
24319
|
},
|
24096
24320
|
|
24097
24321
|
get: {
|
24322
|
+
id: function() {
|
24323
|
+
return id;
|
24324
|
+
},
|
24325
|
+
containers: function() {
|
24326
|
+
return $context.children(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')') + (settings.context && settings.context !== 'body' ? module.helpers.toClass(className.absolute) : ':not('+module.helpers.toClass(className.absolute)+')'));
|
24327
|
+
},
|
24098
24328
|
container: function() {
|
24099
|
-
return
|
24329
|
+
return module.get.containers()[0];
|
24100
24330
|
},
|
24101
24331
|
toastBox: function() {
|
24102
24332
|
return $toastBox || null;
|
@@ -24128,9 +24358,15 @@ $.fn.toast = function(parameters) {
|
|
24128
24358
|
},
|
24129
24359
|
|
24130
24360
|
event: {
|
24361
|
+
close: function(){
|
24362
|
+
module.close();
|
24363
|
+
},
|
24131
24364
|
click: function(event) {
|
24132
|
-
if($(event.target).closest(
|
24133
|
-
settings.onClick.call($toastBox, element)
|
24365
|
+
if($(event.target).closest(selector.clickable).length === 0) {
|
24366
|
+
if(settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
|
24367
|
+
module.verbose('Click callback returned false or close denied by setting cancelling close');
|
24368
|
+
return;
|
24369
|
+
}
|
24134
24370
|
module.close();
|
24135
24371
|
}
|
24136
24372
|
},
|
@@ -24153,7 +24389,7 @@ $.fn.toast = function(parameters) {
|
|
24153
24389
|
helpers: {
|
24154
24390
|
toClass: function(selector) {
|
24155
24391
|
var
|
24156
|
-
classes = selector.split(
|
24392
|
+
classes = selector.trim().split(/\s+/),
|
24157
24393
|
result = ''
|
24158
24394
|
;
|
24159
24395
|
|
@@ -24443,6 +24679,7 @@ $.fn.toast.settings = {
|
|
24443
24679
|
|
24444
24680
|
className : {
|
24445
24681
|
container : 'ui toast-container',
|
24682
|
+
absolute : 'absolute',
|
24446
24683
|
box : 'floating toast-box',
|
24447
24684
|
progress : 'ui attached active progress',
|
24448
24685
|
toast : 'ui toast',
|
@@ -24471,6 +24708,10 @@ $.fn.toast.settings = {
|
|
24471
24708
|
unclickable : 'unclickable'
|
24472
24709
|
},
|
24473
24710
|
|
24711
|
+
text: {
|
24712
|
+
close : 'Close'
|
24713
|
+
},
|
24714
|
+
|
24474
24715
|
icons : {
|
24475
24716
|
info : 'info',
|
24476
24717
|
success : 'checkmark',
|
@@ -24487,6 +24728,7 @@ $.fn.toast.settings = {
|
|
24487
24728
|
image : '> img.image, > .image > img',
|
24488
24729
|
icon : '> i.icon',
|
24489
24730
|
input : 'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',
|
24731
|
+
clickable : 'a, details, .ui.accordion',
|
24490
24732
|
approve : '.actions .positive, .actions .approve, .actions .ok',
|
24491
24733
|
deny : '.actions .negative, .actions .deny, .actions .cancel'
|
24492
24734
|
},
|
@@ -24530,7 +24772,7 @@ $.extend( $.easing, {
|
|
24530
24772
|
})( jQuery, window, document );
|
24531
24773
|
|
24532
24774
|
/*!
|
24533
|
-
* # Fomantic-UI 2.9.0-beta.
|
24775
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Transition
|
24534
24776
|
* http://github.com/fomantic/Fomantic-UI/
|
24535
24777
|
*
|
24536
24778
|
*
|
@@ -25302,6 +25544,10 @@ $.fn.transition = function() {
|
|
25302
25544
|
},
|
25303
25545
|
|
25304
25546
|
hide: function() {
|
25547
|
+
if(settings.onHide.call(element) === false) {
|
25548
|
+
module.verbose('Hide callback returned false cancelling hide');
|
25549
|
+
return false;
|
25550
|
+
}
|
25305
25551
|
module.verbose('Hiding element');
|
25306
25552
|
if( module.is.animating() ) {
|
25307
25553
|
module.reset();
|
@@ -25309,35 +25555,32 @@ $.fn.transition = function() {
|
|
25309
25555
|
element.blur(); // IE will trigger focus change if element is not blurred before hiding
|
25310
25556
|
module.remove.display();
|
25311
25557
|
module.remove.visible();
|
25312
|
-
|
25313
|
-
settings.onBeforeHide.call(element,function(){
|
25314
|
-
module.hideNow();
|
25315
|
-
});
|
25316
|
-
} else {
|
25317
|
-
module.hideNow();
|
25318
|
-
}
|
25319
|
-
|
25558
|
+
settings.onBeforeHide.call(element, module.hideNow);
|
25320
25559
|
},
|
25321
25560
|
|
25322
25561
|
hideNow: function() {
|
25323
25562
|
module.set.hidden();
|
25324
25563
|
module.force.hidden();
|
25325
|
-
settings.
|
25564
|
+
settings.onHidden.call(element);
|
25326
25565
|
settings.onComplete.call(element);
|
25327
25566
|
// module.repaint();
|
25328
25567
|
},
|
25329
25568
|
|
25330
25569
|
show: function(display) {
|
25331
|
-
module.
|
25332
|
-
|
25570
|
+
if(module.force.visible() && settings.onShow.call(element) !== false) {
|
25571
|
+
module.verbose('Showing element', display);
|
25333
25572
|
module.remove.hidden();
|
25334
|
-
|
25335
|
-
settings.onShow.call(element);
|
25336
|
-
settings.onComplete.call(element);
|
25337
|
-
// module.repaint();
|
25573
|
+
settings.onBeforeShow.call(element, module.showNow);
|
25338
25574
|
}
|
25339
25575
|
},
|
25340
25576
|
|
25577
|
+
showNow: function(){
|
25578
|
+
module.set.visible();
|
25579
|
+
settings.onVisible.call(element);
|
25580
|
+
settings.onComplete.call(element);
|
25581
|
+
// module.repaint();
|
25582
|
+
},
|
25583
|
+
|
25341
25584
|
toggle: function() {
|
25342
25585
|
if( module.is.visible() ) {
|
25343
25586
|
module.hide();
|
@@ -25586,7 +25829,11 @@ $.fn.transition.settings = {
|
|
25586
25829
|
onStart : function() {},
|
25587
25830
|
onComplete : function() {},
|
25588
25831
|
onShow : function() {},
|
25832
|
+
onBeforeShow : function(callback) {callback.call(this)},
|
25833
|
+
onVisible : function() {},
|
25589
25834
|
onHide : function() {},
|
25835
|
+
onHidden : function() {},
|
25836
|
+
onBeforeHide : function(callback) {callback.call(this)},
|
25590
25837
|
|
25591
25838
|
// whether timeout should be used to ensure callback fires in cases animationend does not
|
25592
25839
|
useFailSafe : true,
|
@@ -25640,7 +25887,7 @@ $.fn.transition.settings = {
|
|
25640
25887
|
})( jQuery, window, document );
|
25641
25888
|
|
25642
25889
|
/*!
|
25643
|
-
* # Fomantic-UI 2.9.0-beta.
|
25890
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - API
|
25644
25891
|
* http://github.com/fomantic/Fomantic-UI/
|
25645
25892
|
*
|
25646
25893
|
*
|
@@ -25706,7 +25953,7 @@ $.api = $.fn.api = function(parameters) {
|
|
25706
25953
|
|
25707
25954
|
// context used for state
|
25708
25955
|
$context = (settings.stateContext)
|
25709
|
-
? $(settings.stateContext)
|
25956
|
+
? ([window,document].indexOf(settings.stateContext) < 0 ? $(document).find(settings.stateContext) : $(settings.stateContext))
|
25710
25957
|
: $module,
|
25711
25958
|
|
25712
25959
|
// request details
|
@@ -25715,6 +25962,7 @@ $.api = $.fn.api = function(parameters) {
|
|
25715
25962
|
url,
|
25716
25963
|
data,
|
25717
25964
|
requestStartTime,
|
25965
|
+
originalData,
|
25718
25966
|
|
25719
25967
|
// standard module
|
25720
25968
|
element = this,
|
@@ -25727,6 +25975,7 @@ $.api = $.fn.api = function(parameters) {
|
|
25727
25975
|
|
25728
25976
|
initialize: function() {
|
25729
25977
|
if(!methodInvoked) {
|
25978
|
+
originalData = settings.data;
|
25730
25979
|
module.bind.events();
|
25731
25980
|
}
|
25732
25981
|
module.instantiate();
|
@@ -25789,8 +26038,8 @@ $.api = $.fn.api = function(parameters) {
|
|
25789
26038
|
module.error(error.noStorage);
|
25790
26039
|
return;
|
25791
26040
|
}
|
25792
|
-
response = sessionStorage.getItem(url);
|
25793
|
-
module.debug('Using cached response', url, response);
|
26041
|
+
response = sessionStorage.getItem(url + module.get.normalizedData());
|
26042
|
+
module.debug('Using cached response', url, settings.data, response);
|
25794
26043
|
response = module.decode.json(response);
|
25795
26044
|
return response;
|
25796
26045
|
}
|
@@ -25808,8 +26057,8 @@ $.api = $.fn.api = function(parameters) {
|
|
25808
26057
|
if( $.isPlainObject(response) ) {
|
25809
26058
|
response = JSON.stringify(response);
|
25810
26059
|
}
|
25811
|
-
sessionStorage.setItem(url, response);
|
25812
|
-
module.verbose('Storing cached response for url', url, response);
|
26060
|
+
sessionStorage.setItem(url + module.get.normalizedData(), response);
|
26061
|
+
module.verbose('Storing cached response for url', url, settings.data, response);
|
25813
26062
|
}
|
25814
26063
|
},
|
25815
26064
|
|
@@ -25838,7 +26087,7 @@ $.api = $.fn.api = function(parameters) {
|
|
25838
26087
|
|
25839
26088
|
// Add form content
|
25840
26089
|
if(settings.serializeForm) {
|
25841
|
-
settings.data = module.add.formData(settings.data);
|
26090
|
+
settings.data = module.add.formData(originalData || settings.data);
|
25842
26091
|
}
|
25843
26092
|
|
25844
26093
|
// call beforesend and get any settings changes
|
@@ -25975,10 +26224,6 @@ $.api = $.fn.api = function(parameters) {
|
|
25975
26224
|
cancelled: function() {
|
25976
26225
|
return (module.cancelled || false);
|
25977
26226
|
},
|
25978
|
-
succesful: function() {
|
25979
|
-
module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
|
25980
|
-
return module.was.successful();
|
25981
|
-
},
|
25982
26227
|
successful: function() {
|
25983
26228
|
return (module.request && module.request.state() == 'resolved');
|
25984
26229
|
},
|
@@ -26006,8 +26251,8 @@ $.api = $.fn.api = function(parameters) {
|
|
26006
26251
|
var
|
26007
26252
|
// allow legacy {$var} style
|
26008
26253
|
variable = (templatedString.indexOf('$') !== -1)
|
26009
|
-
? templatedString.
|
26010
|
-
: templatedString.
|
26254
|
+
? templatedString.slice(2, -1)
|
26255
|
+
: templatedString.slice(1, -1),
|
26011
26256
|
value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
|
26012
26257
|
? urlData[variable]
|
26013
26258
|
: ($module.data(variable) !== undefined)
|
@@ -26038,8 +26283,8 @@ $.api = $.fn.api = function(parameters) {
|
|
26038
26283
|
var
|
26039
26284
|
// allow legacy {/$var} style
|
26040
26285
|
variable = (templatedString.indexOf('$') !== -1)
|
26041
|
-
? templatedString.
|
26042
|
-
: templatedString.
|
26286
|
+
? templatedString.slice(3, -1)
|
26287
|
+
: templatedString.slice(2, -1),
|
26043
26288
|
value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
|
26044
26289
|
? urlData[variable]
|
26045
26290
|
: ($module.data(variable) !== undefined)
|
@@ -26070,24 +26315,76 @@ $.api = $.fn.api = function(parameters) {
|
|
26070
26315
|
},
|
26071
26316
|
formData: function(data) {
|
26072
26317
|
var
|
26073
|
-
|
26074
|
-
|
26075
|
-
|
26076
|
-
: $form.serialize(),
|
26077
|
-
hasOtherData
|
26318
|
+
formData = {},
|
26319
|
+
hasOtherData,
|
26320
|
+
useFormDataApi = settings.serializeForm === 'formdata'
|
26078
26321
|
;
|
26079
|
-
data = data || settings.data;
|
26322
|
+
data = data || originalData || settings.data;
|
26080
26323
|
hasOtherData = $.isPlainObject(data);
|
26081
26324
|
|
26325
|
+
if (useFormDataApi) {
|
26326
|
+
formData = new FormData($form[0]);
|
26327
|
+
settings.processData = typeof settings.processData !== 'undefined' ? settings.processData : false;
|
26328
|
+
settings.contentType = typeof settings.contentType !== 'undefined' ? settings.contentType : false;
|
26329
|
+
} else {
|
26330
|
+
var formArray = $form.serializeArray(),
|
26331
|
+
pushes = {},
|
26332
|
+
pushValues= {},
|
26333
|
+
build = function(base, key, value) {
|
26334
|
+
base[key] = value;
|
26335
|
+
return base;
|
26336
|
+
}
|
26337
|
+
;
|
26338
|
+
// add files
|
26339
|
+
$.each($('input[type="file"]',$form), function(i, tag) {
|
26340
|
+
$.each($(tag)[0].files, function(j, file) {
|
26341
|
+
formArray.push({name:tag.name, value: file});
|
26342
|
+
});
|
26343
|
+
});
|
26344
|
+
$.each(formArray, function(i, el) {
|
26345
|
+
if (!settings.regExp.validate.test(el.name)) return;
|
26346
|
+
var isCheckbox = $('[name="' + el.name + '"]', $form).attr('type') === 'checkbox',
|
26347
|
+
floatValue = parseFloat(el.value),
|
26348
|
+
value = (isCheckbox && el.value === 'on') || el.value === 'true' || (String(floatValue) === el.value ? floatValue : (el.value === 'false' ? false : el.value)),
|
26349
|
+
nameKeys = el.name.match(settings.regExp.key) || [], k, pushKey= el.name.replace(/\[\]$/,'')
|
26350
|
+
;
|
26351
|
+
if(!(pushKey in pushes)) {
|
26352
|
+
pushes[pushKey] = 0;
|
26353
|
+
pushValues[pushKey] = value;
|
26354
|
+
} else if (Array.isArray(pushValues[pushKey])) {
|
26355
|
+
pushValues[pushKey].push(value);
|
26356
|
+
} else {
|
26357
|
+
pushValues[pushKey] = [pushValues[pushKey] , value];
|
26358
|
+
}
|
26359
|
+
value = pushValues[pushKey];
|
26360
|
+
|
26361
|
+
while ((k = nameKeys.pop()) !== undefined) {
|
26362
|
+
// foo[]
|
26363
|
+
if (k == '' && !Array.isArray(value)){
|
26364
|
+
value = build([], pushes[pushKey]++, value);
|
26365
|
+
}
|
26366
|
+
// foo[n]
|
26367
|
+
else if (settings.regExp.fixed.test(k)) {
|
26368
|
+
value = build([], k, value);
|
26369
|
+
}
|
26370
|
+
// foo; foo[bar]
|
26371
|
+
else if (settings.regExp.named.test(k)) {
|
26372
|
+
value = build({}, k, value);
|
26373
|
+
}
|
26374
|
+
}
|
26375
|
+
formData = $.extend(true, formData, value);
|
26376
|
+
});
|
26377
|
+
}
|
26378
|
+
|
26082
26379
|
if(hasOtherData) {
|
26083
|
-
|
26084
|
-
|
26085
|
-
|
26086
|
-
|
26087
|
-
|
26088
|
-
module.error(error.missingSerialize);
|
26089
|
-
module.debug('Cant extend data. Replacing data with form data', data, formData);
|
26380
|
+
module.debug('Extending existing data with form data', data, formData);
|
26381
|
+
if(useFormDataApi) {
|
26382
|
+
$.each(Object.keys(data),function(i, el){
|
26383
|
+
formData.append(el, data[el]);
|
26384
|
+
});
|
26090
26385
|
data = formData;
|
26386
|
+
} else {
|
26387
|
+
data = $.extend(true, {}, data, formData);
|
26091
26388
|
}
|
26092
26389
|
}
|
26093
26390
|
else {
|
@@ -26339,6 +26636,9 @@ $.api = $.fn.api = function(parameters) {
|
|
26339
26636
|
},
|
26340
26637
|
|
26341
26638
|
get: {
|
26639
|
+
normalizedData: function(){
|
26640
|
+
return typeof settings.data === "string" ? settings.data : JSON.stringify(settings.data, Object.keys(settings.data).sort());
|
26641
|
+
},
|
26342
26642
|
responseFromXHR: function(xhr) {
|
26343
26643
|
return $.isPlainObject(xhr)
|
26344
26644
|
? (module.is.expectingJSON())
|
@@ -26724,6 +27024,8 @@ $.api.settings = {
|
|
26724
27024
|
defaultData : true,
|
26725
27025
|
|
26726
27026
|
// whether to serialize closest form
|
27027
|
+
// use true to convert complex named keys like a[b][1][c][] into a nested object
|
27028
|
+
// use 'formdata' for formdata web api
|
26727
27029
|
serializeForm : false,
|
26728
27030
|
|
26729
27031
|
// how long to wait before request should occur
|
@@ -26746,7 +27048,7 @@ $.api.settings = {
|
|
26746
27048
|
responseAsync : false,
|
26747
27049
|
|
26748
27050
|
// whether onResponse should work with response value without force converting into an object
|
26749
|
-
rawResponse :
|
27051
|
+
rawResponse : true,
|
26750
27052
|
|
26751
27053
|
// callbacks before request
|
26752
27054
|
beforeSend : function(settings) { return settings; },
|
@@ -26782,7 +27084,6 @@ $.api.settings = {
|
|
26782
27084
|
legacyParameters : 'You are using legacy API success callback names',
|
26783
27085
|
method : 'The method you called is not defined',
|
26784
27086
|
missingAction : 'API action used but no url was defined',
|
26785
|
-
missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
|
26786
27087
|
missingURL : 'No URL specified for api event',
|
26787
27088
|
noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
|
26788
27089
|
noStorage : 'Caching responses locally requires session storage',
|
@@ -26795,6 +27096,11 @@ $.api.settings = {
|
|
26795
27096
|
regExp : {
|
26796
27097
|
required : /\{\$*[A-z0-9]+\}/g,
|
26797
27098
|
optional : /\{\/\$*[A-z0-9]+\}/g,
|
27099
|
+
validate: /^[a-z_][a-z0-9_-]*(?:\[[a-z0-9_-]*\])*$/i,
|
27100
|
+
key: /[a-z0-9_-]+|(?=\[\])/gi,
|
27101
|
+
push: /^$/,
|
27102
|
+
fixed: /^\d+$/,
|
27103
|
+
named: /^[a-z0-9_-]+$/i
|
26798
27104
|
},
|
26799
27105
|
|
26800
27106
|
className: {
|
@@ -26818,7 +27124,7 @@ $.api.settings = {
|
|
26818
27124
|
})( jQuery, window, document );
|
26819
27125
|
|
26820
27126
|
/*!
|
26821
|
-
* # Fomantic-UI 2.9.0-beta.
|
27127
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - State
|
26822
27128
|
* http://github.com/fomantic/Fomantic-UI/
|
26823
27129
|
*
|
26824
27130
|
*
|
@@ -26893,7 +27199,7 @@ $.fn.state = function(parameters) {
|
|
26893
27199
|
|
26894
27200
|
// bind events with delegated events
|
26895
27201
|
if(settings.context && moduleSelector !== '') {
|
26896
|
-
$(settings.context)
|
27202
|
+
([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
26897
27203
|
.on(moduleSelector, 'mouseenter' + eventNamespace, module.change.text)
|
26898
27204
|
.on(moduleSelector, 'mouseleave' + eventNamespace, module.reset.text)
|
26899
27205
|
.on(moduleSelector, 'click' + eventNamespace, module.toggle.state)
|
@@ -27530,7 +27836,7 @@ $.fn.state.settings = {
|
|
27530
27836
|
})( jQuery, window, document );
|
27531
27837
|
|
27532
27838
|
/*!
|
27533
|
-
* # Fomantic-UI 2.9.0-beta.
|
27839
|
+
* # Fomantic-UI 2.9.0-beta.302+091bcb0 - Visibility
|
27534
27840
|
* http://github.com/fomantic/Fomantic-UI/
|
27535
27841
|
*
|
27536
27842
|
*
|
@@ -27589,7 +27895,7 @@ $.fn.visibility = function(parameters) {
|
|
27589
27895
|
$window = $(window),
|
27590
27896
|
|
27591
27897
|
$module = $(this),
|
27592
|
-
$context = $(settings.context),
|
27898
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context),
|
27593
27899
|
|
27594
27900
|
$placeholder,
|
27595
27901
|
|