fomantic-ui 2.9.0-beta.31 → 2.9.0-beta.312
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 +274 -4
- 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 +86 -37
- package/FAQ.md +38 -38
- package/README.md +8 -8
- package/dist/components/accordion.css +176 -36
- package/dist/components/accordion.js +9 -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 +91 -71
- 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 +20 -13
- 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 +17 -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 +100 -50
- package/dist/components/dropdown.js +189 -138
- 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 +12 -6
- 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 +140 -56
- 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 +13 -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 +7 -3
- 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 +44 -14
- 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 +13 -7
- package/dist/components/sidebar.js +116 -37
- 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 +6 -6
- 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 +66 -32
- 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 +23 -16
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +3 -3
- package/dist/components/visibility.js +4 -4
- package/dist/components/visibility.min.js +3 -3
- package/dist/semantic.css +20201 -13378
- package/dist/semantic.js +990 -542
- 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 +3 -3
- package/src/definitions/collections/form.less +229 -166
- 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 +8 -2
- package/src/definitions/modules/accordion.less +371 -219
- package/src/definitions/modules/calendar.js +90 -70
- package/src/definitions/modules/calendar.less +20 -0
- package/src/definitions/modules/checkbox.js +19 -12
- package/src/definitions/modules/checkbox.less +83 -227
- package/src/definitions/modules/dimmer.js +16 -4
- package/src/definitions/modules/dimmer.less +22 -8
- package/src/definitions/modules/dropdown.js +188 -137
- package/src/definitions/modules/dropdown.less +201 -136
- package/src/definitions/modules/embed.js +11 -5
- package/src/definitions/modules/embed.less +4 -4
- package/src/definitions/modules/modal.js +139 -55
- 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 +12 -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.js +6 -2
- package/src/definitions/modules/rating.less +35 -34
- package/src/definitions/modules/search.js +43 -13
- package/src/definitions/modules/search.less +35 -19
- package/src/definitions/modules/shape.js +2 -2
- package/src/definitions/modules/sidebar.js +115 -36
- package/src/definitions/modules/sidebar.less +42 -24
- package/src/definitions/modules/slider.js +67 -50
- package/src/definitions/modules/slider.less +48 -47
- package/src/definitions/modules/sticky.js +5 -5
- 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 +65 -31
- package/src/definitions/modules/toast.less +51 -16
- package/src/definitions/modules/transition.js +22 -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 +7 -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.312+86121ef
|
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.312+86121ef - 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.312+86121ef - 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.312+86121ef - 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
|
|
@@ -2764,6 +2775,7 @@ $.fn.accordion = function(parameters) {
|
|
2764
2775
|
useFailSafe : true,
|
2765
2776
|
debug : settings.debug,
|
2766
2777
|
verbose : settings.verbose,
|
2778
|
+
silent : settings.silent,
|
2767
2779
|
duration : settings.duration,
|
2768
2780
|
skipInlineHidden : true,
|
2769
2781
|
onComplete: function() {
|
@@ -2829,6 +2841,7 @@ $.fn.accordion = function(parameters) {
|
|
2829
2841
|
useFailSafe : true,
|
2830
2842
|
debug : settings.debug,
|
2831
2843
|
verbose : settings.verbose,
|
2844
|
+
silent : settings.silent,
|
2832
2845
|
duration : settings.duration,
|
2833
2846
|
skipInlineHidden : true
|
2834
2847
|
})
|
@@ -2899,6 +2912,7 @@ $.fn.accordion = function(parameters) {
|
|
2899
2912
|
useFailSafe : true,
|
2900
2913
|
debug : settings.debug,
|
2901
2914
|
verbose : settings.verbose,
|
2915
|
+
silent : settings.silent,
|
2902
2916
|
duration : settings.duration,
|
2903
2917
|
skipInlineHidden : true
|
2904
2918
|
})
|
@@ -3178,6 +3192,7 @@ $.fn.accordion.settings = {
|
|
3178
3192
|
accordion : '.accordion',
|
3179
3193
|
title : '.title',
|
3180
3194
|
trigger : '.title',
|
3195
|
+
ignore : '.ui.dropdown',
|
3181
3196
|
content : '.content'
|
3182
3197
|
}
|
3183
3198
|
|
@@ -3194,7 +3209,7 @@ $.extend( $.easing, {
|
|
3194
3209
|
|
3195
3210
|
|
3196
3211
|
/*!
|
3197
|
-
* # Fomantic-UI 2.9.0-beta.
|
3212
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Calendar
|
3198
3213
|
* http://github.com/fomantic/Fomantic-UI/
|
3199
3214
|
*
|
3200
3215
|
*
|
@@ -3317,7 +3332,7 @@ $.fn.calendar = function(parameters) {
|
|
3317
3332
|
module.set.maxDate($module.data(metadata.maxDate));
|
3318
3333
|
}
|
3319
3334
|
module.setting('type', module.get.type());
|
3320
|
-
module.setting('on', settings.on ||
|
3335
|
+
module.setting('on', settings.on || 'click');
|
3321
3336
|
},
|
3322
3337
|
popup: function () {
|
3323
3338
|
if (settings.inline) {
|
@@ -3517,7 +3532,7 @@ $.fn.calendar = function(parameters) {
|
|
3517
3532
|
var headerDate = isYear || isMonth ? new Date(year, 0, 1) :
|
3518
3533
|
isDay ? new Date(year, month, 1) : new Date(year, month, day, hour, minute);
|
3519
3534
|
var headerText = $('<span/>').addClass(className.link).appendTo(cell);
|
3520
|
-
headerText.text(
|
3535
|
+
headerText.text(module.helper.dateFormat(formatter[mode+'Header'], headerDate));
|
3521
3536
|
var newMode = isMonth ? (settings.disableYear ? 'day' : 'year') :
|
3522
3537
|
isDay ? (settings.disableMonth ? 'year' : 'month') : 'day';
|
3523
3538
|
headerText.data(metadata.mode, newMode);
|
@@ -3565,7 +3580,7 @@ $.fn.calendar = function(parameters) {
|
|
3565
3580
|
isHour ? new Date(year, month, day, i) : new Date(year, month, day, hour, i * settings.minTimeGap);
|
3566
3581
|
var cellText = isYear ? i :
|
3567
3582
|
isMonth ? settings.text.monthsShort[i] : isDay ? cellDate.getDate() :
|
3568
|
-
|
3583
|
+
module.helper.dateFormat(formatter.cellTime,cellDate);
|
3569
3584
|
cell = $('<td/>').addClass(className.cell).appendTo(row);
|
3570
3585
|
cell.text(cellText);
|
3571
3586
|
cell.data(metadata.date, cellDate);
|
@@ -3697,7 +3712,7 @@ $.fn.calendar = function(parameters) {
|
|
3697
3712
|
var winWidth = $(window).width();
|
3698
3713
|
$container.find('td[data-position]').each(function () {
|
3699
3714
|
var cell = $(this);
|
3700
|
-
var tooltipWidth = window.getComputedStyle(cell[0], '
|
3715
|
+
var tooltipWidth = window.getComputedStyle(cell[0], '::after').width.replace(/[^0-9\.]/g,'');
|
3701
3716
|
var tooltipPosition = cell.attr('data-position');
|
3702
3717
|
// use a fallback width of 250 (calendar width) for IE/Edge (which return "auto")
|
3703
3718
|
var calcPosition = (winWidth - cell.width() - (parseInt(tooltipWidth,10) || 250)) > cell.offset().left ? 'right' : 'left';
|
@@ -3788,8 +3803,8 @@ $.fn.calendar = function(parameters) {
|
|
3788
3803
|
},
|
3789
3804
|
keydown: function (event) {
|
3790
3805
|
var keyCode = event.which;
|
3791
|
-
if (keyCode ===
|
3792
|
-
//
|
3806
|
+
if (keyCode === 9) {
|
3807
|
+
//tab
|
3793
3808
|
module.popup('hide');
|
3794
3809
|
}
|
3795
3810
|
|
@@ -3825,6 +3840,9 @@ $.fn.calendar = function(parameters) {
|
|
3825
3840
|
//disable form submission:
|
3826
3841
|
event.preventDefault();
|
3827
3842
|
event.stopPropagation();
|
3843
|
+
} else if (keyCode === 27) {
|
3844
|
+
module.popup('hide');
|
3845
|
+
event.stopPropagation();
|
3828
3846
|
}
|
3829
3847
|
}
|
3830
3848
|
|
@@ -3846,7 +3864,7 @@ $.fn.calendar = function(parameters) {
|
|
3846
3864
|
$container.removeClass(className.active);
|
3847
3865
|
if (settings.formatInput) {
|
3848
3866
|
var date = module.get.date();
|
3849
|
-
var text = formatter.
|
3867
|
+
var text = module.helper.dateFormat(formatter[settings.type], date);
|
3850
3868
|
$input.val(text);
|
3851
3869
|
}
|
3852
3870
|
if(selectionComplete){
|
@@ -3917,6 +3935,9 @@ $.fn.calendar = function(parameters) {
|
|
3917
3935
|
return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1;
|
3918
3936
|
}();
|
3919
3937
|
},
|
3938
|
+
formattedDate: function(format, date) {
|
3939
|
+
return module.helper.dateFormat(format || formatter[settings.type], date || module.get.date());
|
3940
|
+
},
|
3920
3941
|
date: function () {
|
3921
3942
|
return module.helper.sanitiseDate($module.data(metadata.date)) || null;
|
3922
3943
|
},
|
@@ -3941,7 +3962,7 @@ $.fn.calendar = function(parameters) {
|
|
3941
3962
|
return $module.data(metadata.maxDate) || null;
|
3942
3963
|
},
|
3943
3964
|
monthOffset: function () {
|
3944
|
-
return $module.data(metadata.monthOffset) || 0;
|
3965
|
+
return $module.data(metadata.monthOffset) || settings.monthOffset || 0;
|
3945
3966
|
},
|
3946
3967
|
mode: function () {
|
3947
3968
|
//only returns valid modes for the current settings
|
@@ -3995,7 +4016,7 @@ $.fn.calendar = function(parameters) {
|
|
3995
4016
|
return null;
|
3996
4017
|
}
|
3997
4018
|
if (!(selector instanceof $)) {
|
3998
|
-
selector = $(selector).first();
|
4019
|
+
selector = $(document).find(selector).first();
|
3999
4020
|
}
|
4000
4021
|
//assume range related calendars are using the same namespace
|
4001
4022
|
return selector.data(moduleNamespace);
|
@@ -4010,7 +4031,7 @@ $.fn.calendar = function(parameters) {
|
|
4010
4031
|
date = module.helper.dateInRange(date);
|
4011
4032
|
|
4012
4033
|
var mode = module.get.mode();
|
4013
|
-
var text = formatter.
|
4034
|
+
var text = module.helper.dateFormat(formatter[settings.type],date);
|
4014
4035
|
|
4015
4036
|
if (fireChange && settings.onBeforeChange.call(element, date, text, mode) === false) {
|
4016
4037
|
return false;
|
@@ -4181,6 +4202,60 @@ $.fn.calendar = function(parameters) {
|
|
4181
4202
|
},
|
4182
4203
|
|
4183
4204
|
helper: {
|
4205
|
+
dateFormat: function(format,date) {
|
4206
|
+
if (!(date instanceof Date)) {
|
4207
|
+
return '';
|
4208
|
+
}
|
4209
|
+
if(typeof format === 'function') {
|
4210
|
+
return format.call(module, date, settings);
|
4211
|
+
}
|
4212
|
+
|
4213
|
+
var D = date.getDate(),
|
4214
|
+
M = date.getMonth(),
|
4215
|
+
Y = date.getFullYear(),
|
4216
|
+
d = date.getDay(),
|
4217
|
+
H = date.getHours(),
|
4218
|
+
m = date.getMinutes(),
|
4219
|
+
s = date.getSeconds(),
|
4220
|
+
w = module.get.weekOfYear(Y,M,D+1-settings.firstDayOfWeek),
|
4221
|
+
h = H % 12 || 12,
|
4222
|
+
a = H < 12 ? settings.text.am.toLowerCase() : settings.text.pm.toLowerCase(),
|
4223
|
+
tokens = {
|
4224
|
+
D: D,
|
4225
|
+
DD: ('0'+D).slice(-2),
|
4226
|
+
M: M + 1,
|
4227
|
+
MM: ('0'+(M+1)).slice(-2),
|
4228
|
+
MMM: settings.text.monthsShort[M],
|
4229
|
+
MMMM: settings.text.months[M],
|
4230
|
+
Y: Y,
|
4231
|
+
YY: String(Y).slice(2),
|
4232
|
+
YYYY: Y,
|
4233
|
+
d: d,
|
4234
|
+
dd: settings.text.dayNamesShort[d].slice(0,2),
|
4235
|
+
ddd: settings.text.dayNamesShort[d],
|
4236
|
+
dddd: settings.text.dayNames[d],
|
4237
|
+
h: h,
|
4238
|
+
hh: ('0'+h).slice(-2),
|
4239
|
+
H: H,
|
4240
|
+
HH: ('0'+H).slice(-2),
|
4241
|
+
m: m,
|
4242
|
+
mm: ('0'+m).slice(-2),
|
4243
|
+
s: s,
|
4244
|
+
ss: ('0'+s).slice(-2),
|
4245
|
+
a: a,
|
4246
|
+
A: a.toUpperCase(),
|
4247
|
+
S: ['th', 'st', 'nd', 'rd'][D % 10 > 3 ? 0 : (D % 100 - D % 10 !== 10) * D % 10],
|
4248
|
+
w: w,
|
4249
|
+
ww: ('0'+w).slice(-2)
|
4250
|
+
}
|
4251
|
+
;
|
4252
|
+
return format.replace(settings.regExp.token, function (match) {
|
4253
|
+
if (match in tokens) {
|
4254
|
+
return tokens[match];
|
4255
|
+
}
|
4256
|
+
return match.slice(1, match.length - 1);
|
4257
|
+
});
|
4258
|
+
},
|
4184
4259
|
isDisabled: function(date, mode) {
|
4185
4260
|
return (mode === 'day' || mode === 'month' || mode === 'year' || mode === 'hour') && (((mode === 'day' && settings.disabledDaysOfWeek.indexOf(date.getDay()) !== -1) || settings.disabledDates.some(function(d){
|
4186
4261
|
if(typeof d === 'string') {
|
@@ -4624,14 +4699,14 @@ $.fn.calendar.settings = {
|
|
4624
4699
|
silent: false,
|
4625
4700
|
debug: false,
|
4626
4701
|
verbose: false,
|
4627
|
-
performance:
|
4702
|
+
performance: true,
|
4628
4703
|
|
4629
4704
|
type : 'datetime', // picker type, can be 'datetime', 'date', 'time', 'month', or 'year'
|
4630
4705
|
firstDayOfWeek : 0, // day for first day column (0 = Sunday)
|
4631
4706
|
constantHeight : true, // add rows to shorter months to keep day calendar height consistent (6 rows)
|
4632
4707
|
today : false, // show a 'today/now' button at the bottom of the calendar
|
4633
4708
|
closable : true, // close the popup after selecting a date/time
|
4634
|
-
monthFirst : true, // month before day when parsing
|
4709
|
+
monthFirst : true, // month before day when parsing date from text
|
4635
4710
|
touchReadonly : true, // set input to readonly on touch devices
|
4636
4711
|
inline : false, // create the calendar inline instead of inside a popup
|
4637
4712
|
on : null, // when to show the popup (defaults to 'focus' for input, 'click' for others)
|
@@ -4639,7 +4714,6 @@ $.fn.calendar.settings = {
|
|
4639
4714
|
startMode : false, // display mode to start in, can be 'year', 'month', 'day', 'hour', 'minute' (false = 'day')
|
4640
4715
|
minDate : null, // minimum date/time that can be selected, dates/times before are disabled
|
4641
4716
|
maxDate : null, // maximum date/time that can be selected, dates/times after are disabled
|
4642
|
-
ampm : true, // show am/pm in time mode
|
4643
4717
|
disableYear : false, // disable year selection mode
|
4644
4718
|
disableMonth : false, // disable month selection mode
|
4645
4719
|
disableMinute : false, // disable minute selection mode
|
@@ -4647,8 +4721,9 @@ $.fn.calendar.settings = {
|
|
4647
4721
|
startCalendar : null, // jquery object or selector for another calendar that represents the start date of a date range
|
4648
4722
|
endCalendar : null, // jquery object or selector for another calendar that represents the end date of a date range
|
4649
4723
|
multiMonth : 1, // show multiple months when in 'day' mode
|
4724
|
+
monthOffset : 0, // position current month by offset when multimonth > 1
|
4650
4725
|
minTimeGap : 5,
|
4651
|
-
showWeekNumbers :
|
4726
|
+
showWeekNumbers : false, // show Number of Week at the very first column of a dayView
|
4652
4727
|
disabledHours : [], // specific hour(s) which won't be selectable and contain additional information.
|
4653
4728
|
disabledDates : [], // specific day(s) which won't be selectable and contain additional information.
|
4654
4729
|
disabledDaysOfWeek : [], // day(s) which won't be selectable(s) (0 = Sunday)
|
@@ -4662,11 +4737,14 @@ $.fn.calendar.settings = {
|
|
4662
4737
|
position: 'bottom left',
|
4663
4738
|
lastResort: 'bottom left',
|
4664
4739
|
prefer: 'opposite',
|
4740
|
+
observeChanges: false,
|
4665
4741
|
hideOnScroll: false
|
4666
4742
|
},
|
4667
4743
|
|
4668
4744
|
text: {
|
4669
4745
|
days: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
4746
|
+
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
4747
|
+
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
4670
4748
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
4671
4749
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
4672
4750
|
today: 'Today',
|
@@ -4677,67 +4755,23 @@ $.fn.calendar.settings = {
|
|
4677
4755
|
},
|
4678
4756
|
|
4679
4757
|
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
4758
|
yearHeader: function (date, settings) {
|
4688
4759
|
var decadeYear = Math.ceil(date.getFullYear() / 10) * 10;
|
4689
4760
|
return (decadeYear - 9) + ' - ' + (decadeYear + 2);
|
4690
4761
|
},
|
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
|
-
},
|
4762
|
+
monthHeader: 'YYYY',
|
4763
|
+
dayHeader: 'MMMM YYYY',
|
4764
|
+
hourHeader: 'MMMM D, YYYY',
|
4765
|
+
minuteHeader: 'MMMM D, YYYY',
|
4705
4766
|
dayColumnHeader: function (day, settings) {
|
4706
4767
|
return settings.text.days[day];
|
4707
4768
|
},
|
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
|
-
},
|
4769
|
+
datetime: 'MMMM D, YYYY h:mm A',
|
4770
|
+
date: 'MMMM D, YYYY',
|
4771
|
+
time: 'h:mm A',
|
4772
|
+
cellTime: 'h:mm A',
|
4773
|
+
month: 'MMMM YYYY',
|
4774
|
+
year: 'YYYY',
|
4741
4775
|
today: function (settings) {
|
4742
4776
|
return settings.type === 'date' ? settings.text.today : settings.text.now;
|
4743
4777
|
},
|
@@ -4753,7 +4787,7 @@ $.fn.calendar.settings = {
|
|
4753
4787
|
if (!text) {
|
4754
4788
|
return null;
|
4755
4789
|
}
|
4756
|
-
text = String(text).trim();
|
4790
|
+
text = String(text).trim().replace(/([.:\/\-])\s+/g,'$1').replace(/\s+([.:\/-])/g,'$1').replace(/\s+/g,' ');
|
4757
4791
|
if (text.length === 0) {
|
4758
4792
|
return null;
|
4759
4793
|
}
|
@@ -5006,7 +5040,8 @@ $.fn.calendar.settings = {
|
|
5006
5040
|
|
5007
5041
|
regExp: {
|
5008
5042
|
dateWords: /[^A-Za-z\u00C0-\u024F]+/g,
|
5009
|
-
dateNumbers: /[^\d:]+/g
|
5043
|
+
dateNumbers: /[^\d:]+/g,
|
5044
|
+
token: /d{1,4}|D{1,2}|M{1,4}|YY(?:YY)?|([Hhmsw])\1?|[SAaY]|"[^"]*"|'[^']*'/g
|
5010
5045
|
},
|
5011
5046
|
|
5012
5047
|
error: {
|
@@ -5066,7 +5101,7 @@ $.fn.calendar.settings = {
|
|
5066
5101
|
})(jQuery, window, document);
|
5067
5102
|
|
5068
5103
|
/*!
|
5069
|
-
* # Fomantic-UI 2.9.0-beta.
|
5104
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Checkbox
|
5070
5105
|
* http://github.com/fomantic/Fomantic-UI/
|
5071
5106
|
*
|
5072
5107
|
*
|
@@ -5306,18 +5341,27 @@ $.fn.checkbox = function(parameters) {
|
|
5306
5341
|
}
|
5307
5342
|
}
|
5308
5343
|
|
5344
|
+
shortcutPressed = false;
|
5309
5345
|
if(key == keyCode.escape) {
|
5310
5346
|
module.verbose('Escape key pressed blurring field');
|
5311
5347
|
$input.blur();
|
5312
5348
|
shortcutPressed = true;
|
5349
|
+
event.stopPropagation();
|
5313
5350
|
}
|
5314
|
-
else if(!event.ctrlKey &&
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5351
|
+
else if(!event.ctrlKey && module.can.change()) {
|
5352
|
+
if( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey) ) {
|
5353
|
+
module.verbose('Enter/space key pressed, toggling checkbox');
|
5354
|
+
module.toggle();
|
5355
|
+
shortcutPressed = true;
|
5356
|
+
} else if($module.is('.toggle, .slider') && !module.is.radio()) {
|
5357
|
+
if(key == keyCode.left && module.is.checked()) {
|
5358
|
+
module.uncheck();
|
5359
|
+
shortcutPressed = true;
|
5360
|
+
} else if(key == keyCode.right && module.is.unchecked()) {
|
5361
|
+
module.check();
|
5362
|
+
shortcutPressed = true;
|
5363
|
+
}
|
5364
|
+
}
|
5321
5365
|
}
|
5322
5366
|
},
|
5323
5367
|
keyup: function(event) {
|
@@ -5390,7 +5434,6 @@ $.fn.checkbox = function(parameters) {
|
|
5390
5434
|
settings.onEnable.call(input);
|
5391
5435
|
// preserve legacy callbacks
|
5392
5436
|
settings.onEnabled.call(input);
|
5393
|
-
module.trigger.change();
|
5394
5437
|
}
|
5395
5438
|
},
|
5396
5439
|
|
@@ -5405,7 +5448,6 @@ $.fn.checkbox = function(parameters) {
|
|
5405
5448
|
settings.onDisable.call(input);
|
5406
5449
|
// preserve legacy callbacks
|
5407
5450
|
settings.onDisabled.call(input);
|
5408
|
-
module.trigger.change();
|
5409
5451
|
}
|
5410
5452
|
},
|
5411
5453
|
|
@@ -5890,7 +5932,7 @@ $.fn.checkbox.settings = {
|
|
5890
5932
|
|
5891
5933
|
silent : false,
|
5892
5934
|
debug : false,
|
5893
|
-
verbose :
|
5935
|
+
verbose : false,
|
5894
5936
|
performance : true,
|
5895
5937
|
|
5896
5938
|
// delegated event context
|
@@ -5933,7 +5975,7 @@ $.fn.checkbox.settings = {
|
|
5933
5975
|
|
5934
5976
|
selector : {
|
5935
5977
|
checkbox : '.ui.checkbox',
|
5936
|
-
label : 'label
|
5978
|
+
label : 'label',
|
5937
5979
|
input : 'input[type="checkbox"], input[type="radio"]',
|
5938
5980
|
link : 'a[href]'
|
5939
5981
|
}
|
@@ -5943,7 +5985,7 @@ $.fn.checkbox.settings = {
|
|
5943
5985
|
})( jQuery, window, document );
|
5944
5986
|
|
5945
5987
|
/*!
|
5946
|
-
* # Fomantic-UI 2.9.0-beta.
|
5988
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Dimmer
|
5947
5989
|
* http://github.com/fomantic/Fomantic-UI/
|
5948
5990
|
*
|
5949
5991
|
*
|
@@ -6136,11 +6178,14 @@ $.fn.dimmer = function(parameters) {
|
|
6136
6178
|
? callback
|
6137
6179
|
: function(){}
|
6138
6180
|
;
|
6139
|
-
module.debug('Showing dimmer', $dimmer, settings);
|
6140
|
-
module.set.variation();
|
6141
6181
|
if( (!module.is.dimmed() || module.is.animating()) && module.is.enabled() ) {
|
6182
|
+
if(settings.onShow.call(element) === false) {
|
6183
|
+
module.verbose('Show callback returned false cancelling dimmer show');
|
6184
|
+
return;
|
6185
|
+
}
|
6186
|
+
module.debug('Showing dimmer', $dimmer, settings);
|
6187
|
+
module.set.variation();
|
6142
6188
|
module.animate.show(callback);
|
6143
|
-
settings.onShow.call(element);
|
6144
6189
|
settings.onChange.call(element);
|
6145
6190
|
}
|
6146
6191
|
else {
|
@@ -6154,9 +6199,12 @@ $.fn.dimmer = function(parameters) {
|
|
6154
6199
|
: function(){}
|
6155
6200
|
;
|
6156
6201
|
if( module.is.dimmed() || module.is.animating() ) {
|
6202
|
+
if(settings.onHide.call(element) === false) {
|
6203
|
+
module.verbose('Hide callback returned false cancelling dimmer hide');
|
6204
|
+
return;
|
6205
|
+
}
|
6157
6206
|
module.debug('Hiding dimmer', $dimmer);
|
6158
6207
|
module.animate.hide(callback);
|
6159
|
-
settings.onHide.call(element);
|
6160
6208
|
settings.onChange.call(element);
|
6161
6209
|
}
|
6162
6210
|
else {
|
@@ -6196,6 +6244,9 @@ $.fn.dimmer = function(parameters) {
|
|
6196
6244
|
}
|
6197
6245
|
$dimmer
|
6198
6246
|
.transition({
|
6247
|
+
debug : settings.debug,
|
6248
|
+
verbose : settings.verbose,
|
6249
|
+
silent : settings.silent,
|
6199
6250
|
displayType : settings.useFlex
|
6200
6251
|
? 'flex'
|
6201
6252
|
: 'block',
|
@@ -6245,6 +6296,9 @@ $.fn.dimmer = function(parameters) {
|
|
6245
6296
|
module.verbose('Hiding dimmer with css');
|
6246
6297
|
$dimmer
|
6247
6298
|
.transition({
|
6299
|
+
debug : settings.debug,
|
6300
|
+
verbose : settings.verbose,
|
6301
|
+
silent : settings.silent,
|
6248
6302
|
displayType : settings.useFlex
|
6249
6303
|
? 'flex'
|
6250
6304
|
: 'block',
|
@@ -6700,7 +6754,7 @@ $.fn.dimmer.settings = {
|
|
6700
6754
|
})( jQuery, window, document );
|
6701
6755
|
|
6702
6756
|
/*!
|
6703
|
-
* # Fomantic-UI 2.9.0-beta.
|
6757
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Dropdown
|
6704
6758
|
* http://github.com/fomantic/Fomantic-UI/
|
6705
6759
|
*
|
6706
6760
|
*
|
@@ -6731,11 +6785,6 @@ $.fn.dropdown = function(parameters) {
|
|
6731
6785
|
|
6732
6786
|
moduleSelector = $allModules.selector || '',
|
6733
6787
|
|
6734
|
-
hasTouch = ('ontouchstart' in document.documentElement),
|
6735
|
-
clickEvent = hasTouch
|
6736
|
-
? 'touchstart'
|
6737
|
-
: 'click',
|
6738
|
-
|
6739
6788
|
time = new Date().getTime(),
|
6740
6789
|
performance = [],
|
6741
6790
|
|
@@ -6767,7 +6816,7 @@ $.fn.dropdown = function(parameters) {
|
|
6767
6816
|
moduleNamespace = 'module-' + namespace,
|
6768
6817
|
|
6769
6818
|
$module = $(this),
|
6770
|
-
$context = $(settings.context),
|
6819
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $(settings.context),
|
6771
6820
|
$text = $module.find(selector.text),
|
6772
6821
|
$search = $module.find(selector.search),
|
6773
6822
|
$sizer = $module.find(selector.sizer),
|
@@ -6817,6 +6866,7 @@ $.fn.dropdown = function(parameters) {
|
|
6817
6866
|
module.error(error.noNormalize, element);
|
6818
6867
|
}
|
6819
6868
|
|
6869
|
+
module.create.id();
|
6820
6870
|
module.setup.layout();
|
6821
6871
|
|
6822
6872
|
if(settings.values) {
|
@@ -6830,7 +6880,6 @@ $.fn.dropdown = function(parameters) {
|
|
6830
6880
|
module.save.defaults();
|
6831
6881
|
module.restore.selected();
|
6832
6882
|
|
6833
|
-
module.create.id();
|
6834
6883
|
module.bind.events();
|
6835
6884
|
|
6836
6885
|
module.observeChanges();
|
@@ -6901,6 +6950,7 @@ $.fn.dropdown = function(parameters) {
|
|
6901
6950
|
select: function() {
|
6902
6951
|
if(module.has.input() && selectObserver) {
|
6903
6952
|
selectObserver.observe($module[0], {
|
6953
|
+
attributes: true,
|
6904
6954
|
childList : true,
|
6905
6955
|
subtree : true
|
6906
6956
|
});
|
@@ -6925,7 +6975,7 @@ $.fn.dropdown = function(parameters) {
|
|
6925
6975
|
|
6926
6976
|
create: {
|
6927
6977
|
id: function() {
|
6928
|
-
id = (Math.random().toString(16) + '000000000').
|
6978
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
6929
6979
|
elementNamespace = '.' + id;
|
6930
6980
|
module.verbose('Creating unique id for element', id);
|
6931
6981
|
},
|
@@ -7071,11 +7121,20 @@ $.fn.dropdown = function(parameters) {
|
|
7071
7121
|
}
|
7072
7122
|
if( module.is.search() && !module.has.search() ) {
|
7073
7123
|
module.verbose('Adding search input');
|
7124
|
+
var
|
7125
|
+
labelNode = $module.prev('label')
|
7126
|
+
;
|
7074
7127
|
$search = $('<input />')
|
7075
7128
|
.addClass(className.search)
|
7076
7129
|
.prop('autocomplete', module.is.chrome() ? 'fomantic-search' : 'off')
|
7077
|
-
.insertBefore($text)
|
7078
7130
|
;
|
7131
|
+
if (labelNode.length) {
|
7132
|
+
if (!labelNode.attr('id')) {
|
7133
|
+
labelNode.attr('id', module.get.id() + '_formLabel');
|
7134
|
+
}
|
7135
|
+
$search.attr('aria-labelledby', labelNode.attr('id'));
|
7136
|
+
}
|
7137
|
+
$search.insertBefore($text);
|
7079
7138
|
}
|
7080
7139
|
if( module.is.multiple() && module.is.searchSelection() && !module.has.sizer()) {
|
7081
7140
|
module.create.sizer();
|
@@ -7122,6 +7181,9 @@ $.fn.dropdown = function(parameters) {
|
|
7122
7181
|
module.debug('Disabling dropdown');
|
7123
7182
|
$module.addClass(className.disabled);
|
7124
7183
|
}
|
7184
|
+
if($input.is('[required]')) {
|
7185
|
+
settings.forceSelection = true;
|
7186
|
+
}
|
7125
7187
|
$input
|
7126
7188
|
.removeAttr('required')
|
7127
7189
|
.removeAttr('class')
|
@@ -7141,7 +7203,7 @@ $.fn.dropdown = function(parameters) {
|
|
7141
7203
|
// replace module reference
|
7142
7204
|
$module = $module.parent(selector.dropdown);
|
7143
7205
|
instance = $module.data(moduleNamespace);
|
7144
|
-
element = $module
|
7206
|
+
element = $module[0];
|
7145
7207
|
module.refresh();
|
7146
7208
|
module.setup.returnedObject();
|
7147
7209
|
},
|
@@ -7238,9 +7300,7 @@ $.fn.dropdown = function(parameters) {
|
|
7238
7300
|
}
|
7239
7301
|
if(settings.onShow.call(element) !== false) {
|
7240
7302
|
module.animate.show(function() {
|
7241
|
-
|
7242
|
-
module.bind.intent();
|
7243
|
-
}
|
7303
|
+
module.bind.intent();
|
7244
7304
|
if(module.has.search() && !preventFocus) {
|
7245
7305
|
module.focusSearch();
|
7246
7306
|
}
|
@@ -7267,8 +7327,17 @@ $.fn.dropdown = function(parameters) {
|
|
7267
7327
|
}
|
7268
7328
|
callback.call(element);
|
7269
7329
|
});
|
7330
|
+
// Hide submenus explicitly. On some browsers (esp. mobile), they will not automatically receive a
|
7331
|
+
// mouseleave event
|
7332
|
+
var $subMenu = $module.find(selector.menu);
|
7333
|
+
if($subMenu.length > 0) {
|
7334
|
+
module.verbose('Hiding sub-menu', $subMenu);
|
7335
|
+
$subMenu.each(function() {
|
7336
|
+
module.animate.hide(false, $(this));
|
7337
|
+
});
|
7338
|
+
}
|
7270
7339
|
}
|
7271
|
-
} else
|
7340
|
+
} else {
|
7272
7341
|
module.unbind.intent();
|
7273
7342
|
}
|
7274
7343
|
iconClicked = false;
|
@@ -7326,13 +7395,18 @@ $.fn.dropdown = function(parameters) {
|
|
7326
7395
|
$module
|
7327
7396
|
.on('change' + eventNamespace, selector.input, module.event.change)
|
7328
7397
|
;
|
7398
|
+
if(module.is.multiple() && module.is.searchSelection()) {
|
7399
|
+
$module
|
7400
|
+
.on('paste' + eventNamespace, selector.search, module.event.paste)
|
7401
|
+
;
|
7402
|
+
}
|
7329
7403
|
},
|
7330
7404
|
mouseEvents: function() {
|
7331
7405
|
module.verbose('Binding mouse events');
|
7332
7406
|
if(module.is.multiple()) {
|
7333
7407
|
$module
|
7334
|
-
.on(
|
7335
|
-
.on(
|
7408
|
+
.on('click' + eventNamespace, selector.label, module.event.label.click)
|
7409
|
+
.on('click' + eventNamespace, selector.remove, module.event.remove.click)
|
7336
7410
|
;
|
7337
7411
|
}
|
7338
7412
|
if( module.is.searchSelection() ) {
|
@@ -7341,31 +7415,33 @@ $.fn.dropdown = function(parameters) {
|
|
7341
7415
|
.on('mouseup' + eventNamespace, module.event.mouseup)
|
7342
7416
|
.on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown)
|
7343
7417
|
.on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup)
|
7344
|
-
.on(
|
7345
|
-
.on(
|
7418
|
+
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
|
7419
|
+
.on('click' + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
|
7346
7420
|
.on('focus' + eventNamespace, selector.search, module.event.search.focus)
|
7347
|
-
.on(
|
7421
|
+
.on('click' + eventNamespace, selector.search, module.event.search.focus)
|
7348
7422
|
.on('blur' + eventNamespace, selector.search, module.event.search.blur)
|
7349
|
-
.on(
|
7423
|
+
.on('click' + eventNamespace, selector.text, module.event.text.focus)
|
7350
7424
|
;
|
7351
7425
|
if(module.is.multiple()) {
|
7352
7426
|
$module
|
7353
|
-
.on(
|
7354
|
-
.on(
|
7427
|
+
.on('click' + eventNamespace, module.event.click)
|
7428
|
+
.on('click' + eventNamespace, module.event.search.focus)
|
7355
7429
|
;
|
7356
7430
|
}
|
7357
7431
|
}
|
7358
7432
|
else {
|
7359
7433
|
if(settings.on == 'click') {
|
7360
7434
|
$module
|
7361
|
-
.on(
|
7362
|
-
.on(
|
7435
|
+
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
|
7436
|
+
.on('click' + eventNamespace, module.event.test.toggle)
|
7363
7437
|
;
|
7364
7438
|
}
|
7365
7439
|
else if(settings.on == 'hover') {
|
7366
7440
|
$module
|
7367
7441
|
.on('mouseenter' + eventNamespace, module.delay.show)
|
7368
7442
|
.on('mouseleave' + eventNamespace, module.delay.hide)
|
7443
|
+
.on('touchstart' + eventNamespace, module.event.test.toggle)
|
7444
|
+
.on('touchstart' + eventNamespace, selector.icon, module.event.icon.click)
|
7369
7445
|
;
|
7370
7446
|
}
|
7371
7447
|
else {
|
@@ -7377,7 +7453,7 @@ $.fn.dropdown = function(parameters) {
|
|
7377
7453
|
.on('mousedown' + eventNamespace, module.event.mousedown)
|
7378
7454
|
.on('mouseup' + eventNamespace, module.event.mouseup)
|
7379
7455
|
.on('focus' + eventNamespace, module.event.focus)
|
7380
|
-
.on(
|
7456
|
+
.on('click' + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
|
7381
7457
|
;
|
7382
7458
|
if(module.has.menuSearch() ) {
|
7383
7459
|
$module
|
@@ -7391,21 +7467,16 @@ $.fn.dropdown = function(parameters) {
|
|
7391
7467
|
}
|
7392
7468
|
}
|
7393
7469
|
$menu
|
7394
|
-
.on(
|
7470
|
+
.on('mouseenter' + eventNamespace, selector.item, module.event.item.mouseenter)
|
7471
|
+
.on('touchstart' + eventNamespace, selector.item, module.event.item.mouseenter)
|
7395
7472
|
.on('mouseleave' + eventNamespace, selector.item, module.event.item.mouseleave)
|
7396
7473
|
.on('click' + eventNamespace, selector.item, module.event.item.click)
|
7397
7474
|
;
|
7398
7475
|
},
|
7399
7476
|
intent: function() {
|
7400
7477
|
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
7478
|
$document
|
7408
|
-
.on(
|
7479
|
+
.on('click' + elementNamespace, module.event.test.hide)
|
7409
7480
|
;
|
7410
7481
|
}
|
7411
7482
|
},
|
@@ -7413,14 +7484,8 @@ $.fn.dropdown = function(parameters) {
|
|
7413
7484
|
unbind: {
|
7414
7485
|
intent: function() {
|
7415
7486
|
module.verbose('Removing hide intent event from document');
|
7416
|
-
if(hasTouch) {
|
7417
|
-
$document
|
7418
|
-
.off('touchstart' + elementNamespace)
|
7419
|
-
.off('touchmove' + elementNamespace)
|
7420
|
-
;
|
7421
|
-
}
|
7422
7487
|
$document
|
7423
|
-
.off(
|
7488
|
+
.off('click' + elementNamespace)
|
7424
7489
|
;
|
7425
7490
|
}
|
7426
7491
|
},
|
@@ -7513,20 +7578,28 @@ $.fn.dropdown = function(parameters) {
|
|
7513
7578
|
throttle : settings.throttle,
|
7514
7579
|
urlData : {
|
7515
7580
|
query: query
|
7516
|
-
}
|
7517
|
-
|
7581
|
+
}
|
7582
|
+
},
|
7583
|
+
apiCallbacks = {
|
7584
|
+
onError: function(errorMessage, $module, xhr) {
|
7518
7585
|
module.add.message(message.serverError);
|
7519
7586
|
iconClicked = false;
|
7520
7587
|
focused = false;
|
7521
7588
|
callback.apply(null, callbackParameters);
|
7589
|
+
if(typeof settings.apiSettings.onError === 'function') {
|
7590
|
+
settings.apiSettings.onError.call(this, errorMessage, $module, xhr);
|
7591
|
+
}
|
7522
7592
|
},
|
7523
|
-
onFailure: function() {
|
7593
|
+
onFailure: function(response, $module, xhr) {
|
7524
7594
|
module.add.message(message.serverError);
|
7525
7595
|
iconClicked = false;
|
7526
7596
|
focused = false;
|
7527
7597
|
callback.apply(null, callbackParameters);
|
7598
|
+
if(typeof settings.apiSettings.onFailure === 'function') {
|
7599
|
+
settings.apiSettings.onFailure.call(this, response, $module, xhr);
|
7600
|
+
}
|
7528
7601
|
},
|
7529
|
-
onSuccess : function(response) {
|
7602
|
+
onSuccess : function(response, $module, xhr) {
|
7530
7603
|
var
|
7531
7604
|
values = response[fields.remoteValues]
|
7532
7605
|
;
|
@@ -7545,19 +7618,22 @@ $.fn.dropdown = function(parameters) {
|
|
7545
7618
|
var value = module.is.multiple() ? module.get.values() : module.get.value();
|
7546
7619
|
if (value !== '') {
|
7547
7620
|
module.verbose('Value(s) present after click icon, select value(s) in items');
|
7548
|
-
module.set.selected(value, null,
|
7621
|
+
module.set.selected(value, null, true, true);
|
7549
7622
|
}
|
7550
7623
|
}
|
7551
7624
|
iconClicked = false;
|
7552
7625
|
focused = false;
|
7553
7626
|
callback.apply(null, callbackParameters);
|
7627
|
+
if(typeof settings.apiSettings.onSuccess === 'function') {
|
7628
|
+
settings.apiSettings.onSuccess.call(this, response, $module, xhr);
|
7629
|
+
}
|
7554
7630
|
}
|
7555
7631
|
}
|
7556
7632
|
;
|
7557
7633
|
if( !$module.api('get request') ) {
|
7558
7634
|
module.setup.api();
|
7559
7635
|
}
|
7560
|
-
apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings);
|
7636
|
+
apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks);
|
7561
7637
|
$module
|
7562
7638
|
.api('setting', apiSettings)
|
7563
7639
|
.api('query')
|
@@ -7745,7 +7821,7 @@ $.fn.dropdown = function(parameters) {
|
|
7745
7821
|
menuConfig[fields.values] = values;
|
7746
7822
|
module.setup.menu(menuConfig);
|
7747
7823
|
$.each(values, function(index, item) {
|
7748
|
-
if(item.selected
|
7824
|
+
if(item.selected === true) {
|
7749
7825
|
module.debug('Setting initial selection to', item[fields.value]);
|
7750
7826
|
module.set.selected(item[fields.value]);
|
7751
7827
|
if(!module.is.multiple()) {
|
@@ -7766,7 +7842,7 @@ $.fn.dropdown = function(parameters) {
|
|
7766
7842
|
settings.preserveHTML
|
7767
7843
|
)
|
7768
7844
|
;
|
7769
|
-
$input.append('<option value="' + value + '">' + name + '</option>');
|
7845
|
+
$input.append('<option value="' + value + '"' + (item.selected === true ? ' selected' : '') + '>' + name + '</option>');
|
7770
7846
|
});
|
7771
7847
|
module.observe.select();
|
7772
7848
|
}
|
@@ -7774,6 +7850,15 @@ $.fn.dropdown = function(parameters) {
|
|
7774
7850
|
},
|
7775
7851
|
|
7776
7852
|
event: {
|
7853
|
+
paste: function(event) {
|
7854
|
+
var pasteValue = (event.originalEvent.clipboardData || window.clipboardData).getData('text'),
|
7855
|
+
tokens = pasteValue.split(settings.delimiter)
|
7856
|
+
;
|
7857
|
+
tokens.forEach(function(value){
|
7858
|
+
module.set.selected(module.escape.htmlEntities(value.trim()), null, true, true);
|
7859
|
+
});
|
7860
|
+
event.preventDefault();
|
7861
|
+
},
|
7777
7862
|
change: function() {
|
7778
7863
|
if(!internalChange) {
|
7779
7864
|
module.debug('Input changed, updating selection');
|
@@ -7832,7 +7917,7 @@ $.fn.dropdown = function(parameters) {
|
|
7832
7917
|
if(module.is.multiple()) {
|
7833
7918
|
module.remove.activeLabel();
|
7834
7919
|
}
|
7835
|
-
if(!focused && !module.is.active() && (settings.showOnFocus || (event.type !== 'focus' && event.type !== 'focusin'))) {
|
7920
|
+
if(!focused && !module.is.active() && (settings.showOnFocus || (event.type !== 'focus' && event.type !== 'focusin')) && event.type !== 'touchstart') {
|
7836
7921
|
focused = true;
|
7837
7922
|
module.search();
|
7838
7923
|
}
|
@@ -7950,23 +8035,12 @@ $.fn.dropdown = function(parameters) {
|
|
7950
8035
|
if (!module.is.multiple() || (module.is.multiple() && !module.is.active())) {
|
7951
8036
|
focused = true;
|
7952
8037
|
}
|
7953
|
-
if( module.determine.eventOnElement(event, toggleBehavior) ) {
|
8038
|
+
if( module.determine.eventOnElement(event, toggleBehavior) && event.type !== 'touchstart') {
|
8039
|
+
// do not preventDefault of touchstart; so emulated mouseenter is triggered on first touch and not later
|
8040
|
+
// (when selecting an item). The double-showing of the dropdown through both events does not hurt.
|
7954
8041
|
event.preventDefault();
|
7955
8042
|
}
|
7956
8043
|
},
|
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
8044
|
hide: function(event) {
|
7971
8045
|
if(module.determine.eventInModule(event, module.hide)){
|
7972
8046
|
if(element.id && $(event.target).attr('for') === element.id){
|
@@ -7986,8 +8060,8 @@ $.fn.dropdown = function(parameters) {
|
|
7986
8060
|
},
|
7987
8061
|
select: {
|
7988
8062
|
mutation: function(mutations) {
|
7989
|
-
module.debug('<select> modified, recreating menu');
|
7990
8063
|
if(module.is.selectMutation(mutations)) {
|
8064
|
+
module.debug('<select> modified, recreating menu');
|
7991
8065
|
module.disconnect.selectObserver();
|
7992
8066
|
module.refresh();
|
7993
8067
|
module.setup.select();
|
@@ -8050,13 +8124,15 @@ $.fn.dropdown = function(parameters) {
|
|
8050
8124
|
},
|
8051
8125
|
mouseleave: function(event) {
|
8052
8126
|
var
|
8053
|
-
$subMenu = $(this).
|
8127
|
+
$subMenu = $(this).find(selector.menu)
|
8054
8128
|
;
|
8055
8129
|
if($subMenu.length > 0) {
|
8056
8130
|
clearTimeout(module.itemTimer);
|
8057
8131
|
module.itemTimer = setTimeout(function() {
|
8058
8132
|
module.verbose('Hiding sub-menu', $subMenu);
|
8059
|
-
|
8133
|
+
$subMenu.each(function() {
|
8134
|
+
module.animate.hide(false, $(this));
|
8135
|
+
});
|
8060
8136
|
}, settings.delay.hide);
|
8061
8137
|
}
|
8062
8138
|
},
|
@@ -8082,7 +8158,7 @@ $.fn.dropdown = function(parameters) {
|
|
8082
8158
|
module.remove.userAddition();
|
8083
8159
|
}
|
8084
8160
|
module.remove.searchTerm();
|
8085
|
-
if(!module.is.focusedOnSearch() &&
|
8161
|
+
if(!module.is.focusedOnSearch() && skipRefocus !== true) {
|
8086
8162
|
module.focusSearch(true);
|
8087
8163
|
}
|
8088
8164
|
}
|
@@ -8214,7 +8290,7 @@ $.fn.dropdown = function(parameters) {
|
|
8214
8290
|
keydown: function(event) {
|
8215
8291
|
var
|
8216
8292
|
pressedKey = event.which,
|
8217
|
-
isShortcutKey = module.is.inObject(pressedKey, keys)
|
8293
|
+
isShortcutKey = module.is.inObject(pressedKey, keys) || event.key === settings.delimiter
|
8218
8294
|
;
|
8219
8295
|
if(isShortcutKey) {
|
8220
8296
|
var
|
@@ -8232,7 +8308,7 @@ $.fn.dropdown = function(parameters) {
|
|
8232
8308
|
hasSubMenu = ($subMenu.length> 0),
|
8233
8309
|
hasSelectedItem = ($selectedItem.length > 0),
|
8234
8310
|
selectedIsSelectable = ($selectedItem.not(selector.unselectable).length > 0),
|
8235
|
-
delimiterPressed = (
|
8311
|
+
delimiterPressed = (event.key === settings.delimiter && module.is.multiple()),
|
8236
8312
|
isAdditionWithoutMenu = (settings.allowAdditions && settings.hideAdditions && (pressedKey == keys.enter || delimiterPressed) && selectedIsSelectable),
|
8237
8313
|
$nextItem,
|
8238
8314
|
isSubMenuItem,
|
@@ -8330,7 +8406,7 @@ $.fn.dropdown = function(parameters) {
|
|
8330
8406
|
.addClass(className.selected)
|
8331
8407
|
;
|
8332
8408
|
module.set.scrollPosition($nextItem);
|
8333
|
-
if(settings.selectOnKeydown && module.is.single()) {
|
8409
|
+
if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
8334
8410
|
module.set.selectedItem($nextItem);
|
8335
8411
|
}
|
8336
8412
|
}
|
@@ -8357,7 +8433,7 @@ $.fn.dropdown = function(parameters) {
|
|
8357
8433
|
.addClass(className.selected)
|
8358
8434
|
;
|
8359
8435
|
module.set.scrollPosition($nextItem);
|
8360
|
-
if(settings.selectOnKeydown && module.is.single()) {
|
8436
|
+
if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
8361
8437
|
module.set.selectedItem($nextItem);
|
8362
8438
|
}
|
8363
8439
|
}
|
@@ -8378,6 +8454,7 @@ $.fn.dropdown = function(parameters) {
|
|
8378
8454
|
if(pressedKey == keys.escape) {
|
8379
8455
|
module.verbose('Escape key pressed, closing dropdown');
|
8380
8456
|
module.hide();
|
8457
|
+
event.stopPropagation();
|
8381
8458
|
}
|
8382
8459
|
|
8383
8460
|
}
|
@@ -8488,7 +8565,7 @@ $.fn.dropdown = function(parameters) {
|
|
8488
8565
|
;
|
8489
8566
|
if( module.can.activate( $(element) ) ) {
|
8490
8567
|
module.set.selected(value, $(element));
|
8491
|
-
if(!module.is.multiple()) {
|
8568
|
+
if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
|
8492
8569
|
module.hideAndClear();
|
8493
8570
|
}
|
8494
8571
|
}
|
@@ -8501,7 +8578,7 @@ $.fn.dropdown = function(parameters) {
|
|
8501
8578
|
;
|
8502
8579
|
if( module.can.activate( $(element) ) ) {
|
8503
8580
|
module.set.value(value, text, $(element));
|
8504
|
-
if(!module.is.multiple()) {
|
8581
|
+
if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
|
8505
8582
|
module.hideAndClear();
|
8506
8583
|
}
|
8507
8584
|
}
|
@@ -8552,7 +8629,7 @@ $.fn.dropdown = function(parameters) {
|
|
8552
8629
|
;
|
8553
8630
|
$sizer.text(value);
|
8554
8631
|
// prevent rounding issues
|
8555
|
-
return Math.ceil( $sizer.width() + 1);
|
8632
|
+
return Math.ceil( $sizer.width() + (module.is.edge() ? 3 : 1));
|
8556
8633
|
},
|
8557
8634
|
selectionCount: function() {
|
8558
8635
|
var
|
@@ -8599,7 +8676,7 @@ $.fn.dropdown = function(parameters) {
|
|
8599
8676
|
},
|
8600
8677
|
caretPosition: function(returnEndPos) {
|
8601
8678
|
var
|
8602
|
-
input = $search
|
8679
|
+
input = $search[0],
|
8603
8680
|
range,
|
8604
8681
|
rangeLength
|
8605
8682
|
;
|
@@ -9021,7 +9098,7 @@ $.fn.dropdown = function(parameters) {
|
|
9021
9098
|
module.error(error.noStorage);
|
9022
9099
|
return;
|
9023
9100
|
}
|
9024
|
-
name = sessionStorage.getItem(value);
|
9101
|
+
name = sessionStorage.getItem(value + elementNamespace);
|
9025
9102
|
return (name !== undefined)
|
9026
9103
|
? name
|
9027
9104
|
: false
|
@@ -9065,7 +9142,7 @@ $.fn.dropdown = function(parameters) {
|
|
9065
9142
|
return;
|
9066
9143
|
}
|
9067
9144
|
module.verbose('Saving remote data to session storage', value, name);
|
9068
|
-
sessionStorage.setItem(value, name);
|
9145
|
+
sessionStorage.setItem(value + elementNamespace, name);
|
9069
9146
|
}
|
9070
9147
|
},
|
9071
9148
|
|
@@ -9125,7 +9202,7 @@ $.fn.dropdown = function(parameters) {
|
|
9125
9202
|
$nextSelectedItem
|
9126
9203
|
.addClass(className.selected)
|
9127
9204
|
;
|
9128
|
-
if(settings.selectOnKeydown && module.is.single()) {
|
9205
|
+
if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
9129
9206
|
module.set.selectedItem($nextSelectedItem);
|
9130
9207
|
}
|
9131
9208
|
$menu
|
@@ -9211,7 +9288,7 @@ $.fn.dropdown = function(parameters) {
|
|
9211
9288
|
var
|
9212
9289
|
length = module.get.query().length
|
9213
9290
|
;
|
9214
|
-
$search.val( text.
|
9291
|
+
$search.val( text.slice(0, length));
|
9215
9292
|
},
|
9216
9293
|
scrollPosition: function($item, forceScroll) {
|
9217
9294
|
var
|
@@ -9328,13 +9405,13 @@ $.fn.dropdown = function(parameters) {
|
|
9328
9405
|
module.set.scrollPosition($nextValue);
|
9329
9406
|
$selectedItem.removeClass(className.selected);
|
9330
9407
|
$nextValue.addClass(className.selected);
|
9331
|
-
if(settings.selectOnKeydown && module.is.single()) {
|
9408
|
+
if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
9332
9409
|
module.set.selectedItem($nextValue);
|
9333
9410
|
}
|
9334
9411
|
}
|
9335
9412
|
},
|
9336
9413
|
direction: function($menu) {
|
9337
|
-
if(settings.direction
|
9414
|
+
if(settings.direction === 'auto') {
|
9338
9415
|
// reset position, remove upward if it's base menu
|
9339
9416
|
if (!$menu) {
|
9340
9417
|
module.remove.upward();
|
@@ -9353,7 +9430,7 @@ $.fn.dropdown = function(parameters) {
|
|
9353
9430
|
module.set.leftward($menu);
|
9354
9431
|
}
|
9355
9432
|
}
|
9356
|
-
else if(settings.direction
|
9433
|
+
else if(settings.direction === 'upward') {
|
9357
9434
|
module.set.upward($menu);
|
9358
9435
|
}
|
9359
9436
|
},
|
@@ -9366,6 +9443,11 @@ $.fn.dropdown = function(parameters) {
|
|
9366
9443
|
$element.addClass(className.leftward);
|
9367
9444
|
},
|
9368
9445
|
value: function(value, text, $selected, preventChangeTrigger) {
|
9446
|
+
if(typeof text === 'boolean') {
|
9447
|
+
preventChangeTrigger = text;
|
9448
|
+
$selected = undefined;
|
9449
|
+
text = undefined;
|
9450
|
+
}
|
9369
9451
|
if(value !== undefined && value !== '' && !(Array.isArray(value) && value.length === 0)) {
|
9370
9452
|
$input.removeClass(className.noselection);
|
9371
9453
|
} else {
|
@@ -9429,12 +9511,21 @@ $.fn.dropdown = function(parameters) {
|
|
9429
9511
|
visible: function() {
|
9430
9512
|
$module.addClass(className.visible);
|
9431
9513
|
},
|
9432
|
-
exactly: function(value, $selectedItem) {
|
9514
|
+
exactly: function(value, $selectedItem, preventChangeTrigger) {
|
9515
|
+
if(typeof $selectedItem === 'boolean') {
|
9516
|
+
preventChangeTrigger = $selectedItem;
|
9517
|
+
$selectedItem = undefined;
|
9518
|
+
}
|
9433
9519
|
module.debug('Setting selected to exact values');
|
9434
9520
|
module.clear();
|
9435
|
-
module.set.selected(value, $selectedItem);
|
9521
|
+
module.set.selected(value, $selectedItem, preventChangeTrigger);
|
9436
9522
|
},
|
9437
9523
|
selected: function(value, $selectedItem, preventChangeTrigger, keepSearchTerm) {
|
9524
|
+
if(typeof $selectedItem === 'boolean') {
|
9525
|
+
keepSearchTerm = preventChangeTrigger;
|
9526
|
+
preventChangeTrigger = $selectedItem;
|
9527
|
+
$selectedItem = undefined;
|
9528
|
+
}
|
9438
9529
|
var
|
9439
9530
|
isMultiple = module.is.multiple()
|
9440
9531
|
;
|
@@ -9466,23 +9557,30 @@ $.fn.dropdown = function(parameters) {
|
|
9466
9557
|
|
9467
9558
|
isFiltered = $selected.hasClass(className.filtered),
|
9468
9559
|
isActive = $selected.hasClass(className.active),
|
9560
|
+
isActionable = $selected.hasClass(className.actionable),
|
9469
9561
|
isUserValue = $selected.hasClass(className.addition),
|
9470
|
-
shouldAnimate = (isMultiple && $selectedItem.length
|
9562
|
+
shouldAnimate = (isMultiple && $selectedItem && $selectedItem.length === 1)
|
9471
9563
|
;
|
9472
|
-
if(
|
9564
|
+
if(isActionable){
|
9565
|
+
if((!isMultiple || (!isActive || isUserValue)) && settings.apiSettings && settings.saveRemoteData) {
|
9566
|
+
module.save.remoteData(selectedText, selectedValue);
|
9567
|
+
}
|
9568
|
+
settings.onActionable.call(element, selectedValue, selectedText, $selected);
|
9569
|
+
}
|
9570
|
+
else if(isMultiple) {
|
9473
9571
|
if(!isActive || isUserValue) {
|
9474
9572
|
if(settings.apiSettings && settings.saveRemoteData) {
|
9475
9573
|
module.save.remoteData(selectedText, selectedValue);
|
9476
9574
|
}
|
9477
9575
|
if(settings.useLabels) {
|
9576
|
+
module.add.value(selectedValue, selectedText, $selected, preventChangeTrigger);
|
9478
9577
|
module.add.label(selectedValue, selectedText, shouldAnimate);
|
9479
|
-
module.add.value(selectedValue, selectedText, $selected);
|
9480
9578
|
module.set.activeItem($selected);
|
9481
9579
|
module.filterActive();
|
9482
9580
|
module.select.nextAvailable($selectedItem);
|
9483
9581
|
}
|
9484
9582
|
else {
|
9485
|
-
module.add.value(selectedValue, selectedText, $selected);
|
9583
|
+
module.add.value(selectedValue, selectedText, $selected, preventChangeTrigger);
|
9486
9584
|
module.set.text(module.add.variables(message.count));
|
9487
9585
|
module.set.activeItem($selected);
|
9488
9586
|
}
|
@@ -9496,7 +9594,7 @@ $.fn.dropdown = function(parameters) {
|
|
9496
9594
|
if(settings.apiSettings && settings.saveRemoteData) {
|
9497
9595
|
module.save.remoteData(selectedText, selectedValue);
|
9498
9596
|
}
|
9499
|
-
if (!keepSearchTerm) {
|
9597
|
+
if (!keepSearchTerm && !$selected.hasClass(className.actionable)) {
|
9500
9598
|
module.set.text(selectedText);
|
9501
9599
|
}
|
9502
9600
|
module.set.value(selectedValue, selectedText, $selected, preventChangeTrigger);
|
@@ -9548,6 +9646,7 @@ $.fn.dropdown = function(parameters) {
|
|
9548
9646
|
animation : settings.label.transition,
|
9549
9647
|
debug : settings.debug,
|
9550
9648
|
verbose : settings.verbose,
|
9649
|
+
silent : settings.silent,
|
9551
9650
|
duration : settings.label.duration
|
9552
9651
|
})
|
9553
9652
|
;
|
@@ -9595,7 +9694,7 @@ $.fn.dropdown = function(parameters) {
|
|
9595
9694
|
$('<option/>')
|
9596
9695
|
.prop('value', escapedValue)
|
9597
9696
|
.addClass(className.addition)
|
9598
|
-
.
|
9697
|
+
.text(value)
|
9599
9698
|
.appendTo($input)
|
9600
9699
|
;
|
9601
9700
|
module.verbose('Adding user addition as an <option>', value);
|
@@ -9671,7 +9770,12 @@ $.fn.dropdown = function(parameters) {
|
|
9671
9770
|
}
|
9672
9771
|
return message;
|
9673
9772
|
},
|
9674
|
-
value: function(addedValue, addedText, $selectedItem) {
|
9773
|
+
value: function(addedValue, addedText, $selectedItem, preventChangeTrigger) {
|
9774
|
+
if(typeof addedText === 'boolean') {
|
9775
|
+
preventChangeTrigger = addedText;
|
9776
|
+
$selectedItem = undefined;
|
9777
|
+
addedText = undefined;
|
9778
|
+
}
|
9675
9779
|
var
|
9676
9780
|
currentValue = module.get.values(true),
|
9677
9781
|
newValue
|
@@ -9686,7 +9790,7 @@ $.fn.dropdown = function(parameters) {
|
|
9686
9790
|
}
|
9687
9791
|
// extend current array
|
9688
9792
|
if(Array.isArray(currentValue)) {
|
9689
|
-
newValue = currentValue.concat([addedValue]);
|
9793
|
+
newValue = $selectedItem && $selectedItem.hasClass(className.actionable) ? currentValue : currentValue.concat([addedValue]);
|
9690
9794
|
newValue = module.get.uniqueArray(newValue);
|
9691
9795
|
}
|
9692
9796
|
else {
|
@@ -9710,7 +9814,7 @@ $.fn.dropdown = function(parameters) {
|
|
9710
9814
|
else {
|
9711
9815
|
settings.onAdd.call(element, addedValue, addedText, $selectedItem);
|
9712
9816
|
}
|
9713
|
-
module.set.value(newValue, addedText, $selectedItem);
|
9817
|
+
module.set.value(newValue, addedText, $selectedItem, preventChangeTrigger);
|
9714
9818
|
module.check.maxSelections();
|
9715
9819
|
},
|
9716
9820
|
},
|
@@ -9770,18 +9874,10 @@ $.fn.dropdown = function(parameters) {
|
|
9770
9874
|
return;
|
9771
9875
|
}
|
9772
9876
|
// temporarily disconnect observer
|
9773
|
-
|
9774
|
-
selectObserver.disconnect();
|
9775
|
-
module.verbose('Temporarily disconnecting mutation observer');
|
9776
|
-
}
|
9877
|
+
module.disconnect.selectObserver();
|
9777
9878
|
$option.remove();
|
9778
9879
|
module.verbose('Removing user addition as an <option>', escapedValue);
|
9779
|
-
|
9780
|
-
selectObserver.observe($input[0], {
|
9781
|
-
childList : true,
|
9782
|
-
subtree : true
|
9783
|
-
});
|
9784
|
-
}
|
9880
|
+
module.observe.select();
|
9785
9881
|
},
|
9786
9882
|
message: function() {
|
9787
9883
|
$menu.children(selector.message).remove();
|
@@ -10080,8 +10176,11 @@ $.fn.dropdown = function(parameters) {
|
|
10080
10176
|
bubbledIconClick: function(event) {
|
10081
10177
|
return $(event.target).closest($icon).length > 0;
|
10082
10178
|
},
|
10179
|
+
edge: function() {
|
10180
|
+
return !!window.chrome && !!window.StyleMedia;
|
10181
|
+
},
|
10083
10182
|
chrome: function() {
|
10084
|
-
return !!window.chrome &&
|
10183
|
+
return !!window.chrome && !window.StyleMedia;
|
10085
10184
|
},
|
10086
10185
|
alreadySetup: function() {
|
10087
10186
|
return ($module.is('select') && $module.parent(selector.dropdown).data(moduleNamespace) !== undefined && $module.prev().length === 0);
|
@@ -10146,7 +10245,7 @@ $.fn.dropdown = function(parameters) {
|
|
10146
10245
|
selectChanged = false
|
10147
10246
|
;
|
10148
10247
|
$.each(mutations, function(index, mutation) {
|
10149
|
-
if($(mutation.target).is('select') || $(mutation.addedNodes).is('select')) {
|
10248
|
+
if($(mutation.target).is('select, option, optgroup') || $(mutation.addedNodes).is('select')) {
|
10150
10249
|
selectChanged = true;
|
10151
10250
|
return false;
|
10152
10251
|
}
|
@@ -10177,7 +10276,7 @@ $.fn.dropdown = function(parameters) {
|
|
10177
10276
|
},
|
10178
10277
|
verticallyScrollableContext: function() {
|
10179
10278
|
var
|
10180
|
-
overflowY = ($context
|
10279
|
+
overflowY = ($context[0] !== window)
|
10181
10280
|
? $context.css('overflow-y')
|
10182
10281
|
: false
|
10183
10282
|
;
|
@@ -10185,7 +10284,7 @@ $.fn.dropdown = function(parameters) {
|
|
10185
10284
|
},
|
10186
10285
|
horizontallyScrollableContext: function() {
|
10187
10286
|
var
|
10188
|
-
overflowX = ($context
|
10287
|
+
overflowX = ($context[0] !== window)
|
10189
10288
|
? $context.css('overflow-X')
|
10190
10289
|
: false
|
10191
10290
|
;
|
@@ -10218,7 +10317,7 @@ $.fn.dropdown = function(parameters) {
|
|
10218
10317
|
;
|
10219
10318
|
calculations = {
|
10220
10319
|
context: {
|
10221
|
-
offset : ($context
|
10320
|
+
offset : ($context[0] === window)
|
10222
10321
|
? { top: 0, left: 0}
|
10223
10322
|
: $context.offset(),
|
10224
10323
|
scrollTop : $context.scrollTop(),
|
@@ -10266,7 +10365,7 @@ $.fn.dropdown = function(parameters) {
|
|
10266
10365
|
;
|
10267
10366
|
calculations = {
|
10268
10367
|
context: {
|
10269
|
-
offset : ($context
|
10368
|
+
offset : ($context[0] === window)
|
10270
10369
|
? { top: 0, left: 0}
|
10271
10370
|
: $context.offset(),
|
10272
10371
|
scrollLeft : $context.scrollLeft(),
|
@@ -10288,9 +10387,6 @@ $.fn.dropdown = function(parameters) {
|
|
10288
10387
|
$currentMenu.removeClass(className.loading);
|
10289
10388
|
return canOpenRightward;
|
10290
10389
|
},
|
10291
|
-
click: function() {
|
10292
|
-
return (hasTouch || settings.on == 'click');
|
10293
|
-
},
|
10294
10390
|
extendSelect: function() {
|
10295
10391
|
return settings.allowAdditions || settings.apiSettings;
|
10296
10392
|
},
|
@@ -10339,6 +10435,7 @@ $.fn.dropdown = function(parameters) {
|
|
10339
10435
|
animation : transition + ' in',
|
10340
10436
|
debug : settings.debug,
|
10341
10437
|
verbose : settings.verbose,
|
10438
|
+
silent : settings.silent,
|
10342
10439
|
duration : settings.transition.showDuration || settings.duration,
|
10343
10440
|
queue : true,
|
10344
10441
|
onStart : start,
|
@@ -10360,9 +10457,7 @@ $.fn.dropdown = function(parameters) {
|
|
10360
10457
|
start = ($subMenu)
|
10361
10458
|
? function() {}
|
10362
10459
|
: function() {
|
10363
|
-
|
10364
|
-
module.unbind.intent();
|
10365
|
-
}
|
10460
|
+
module.unbind.intent();
|
10366
10461
|
module.remove.active();
|
10367
10462
|
},
|
10368
10463
|
transition = settings.transition.hideMethod || module.get.transition($subMenu)
|
@@ -10388,6 +10483,7 @@ $.fn.dropdown = function(parameters) {
|
|
10388
10483
|
duration : settings.transition.hideDuration || settings.duration,
|
10389
10484
|
debug : settings.debug,
|
10390
10485
|
verbose : settings.verbose,
|
10486
|
+
silent : settings.silent,
|
10391
10487
|
queue : false,
|
10392
10488
|
onStart : start,
|
10393
10489
|
displayType: module.get.displayType(),
|
@@ -10691,7 +10787,7 @@ $.fn.dropdown.settings = {
|
|
10691
10787
|
keepOnScreen : true, // Whether dropdown should check whether it is on screen before showing
|
10692
10788
|
|
10693
10789
|
match : 'both', // what to match against with search selection (both, text, or label)
|
10694
|
-
fullTextSearch :
|
10790
|
+
fullTextSearch : 'exact', // search anywhere in value (set to 'exact' to require exact matches)
|
10695
10791
|
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
10792
|
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
10793
|
|
@@ -10699,7 +10795,7 @@ $.fn.dropdown.settings = {
|
|
10699
10795
|
preserveHTML : true, // preserve html when selecting value
|
10700
10796
|
sortSelect : false, // sort selection on init
|
10701
10797
|
|
10702
|
-
forceSelection :
|
10798
|
+
forceSelection : false, // force a choice on blur with search selection
|
10703
10799
|
|
10704
10800
|
allowAdditions : false, // whether multiple select should allow user added values
|
10705
10801
|
ignoreCase : false, // whether to consider case sensitivity when creating labels
|
@@ -10710,7 +10806,7 @@ $.fn.dropdown.settings = {
|
|
10710
10806
|
useLabels : true, // whether multiple select should filter currently active selections from choices
|
10711
10807
|
delimiter : ',', // when multiselect uses normal <input> the values will be delimited with this character
|
10712
10808
|
|
10713
|
-
showOnFocus :
|
10809
|
+
showOnFocus : false, // show menu on focus
|
10714
10810
|
allowReselection : false, // whether current value should trigger callbacks when reselected
|
10715
10811
|
allowTab : true, // add tabindex to element
|
10716
10812
|
allowCategorySelection : false, // allow elements with sub-menus to be selected
|
@@ -10725,6 +10821,8 @@ $.fn.dropdown.settings = {
|
|
10725
10821
|
|
10726
10822
|
headerDivider : true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
|
10727
10823
|
|
10824
|
+
collapseOnActionable : true, // whether the dropdown should collapse upon selection of an actionable item
|
10825
|
+
|
10728
10826
|
// label settings on multi-select
|
10729
10827
|
label: {
|
10730
10828
|
transition : 'scale',
|
@@ -10737,13 +10835,13 @@ $.fn.dropdown.settings = {
|
|
10737
10835
|
hide : 300,
|
10738
10836
|
show : 200,
|
10739
10837
|
search : 20,
|
10740
|
-
touch : 50
|
10741
10838
|
},
|
10742
10839
|
|
10743
10840
|
/* Callbacks */
|
10744
10841
|
onChange : function(value, text, $selected){},
|
10745
10842
|
onAdd : function(value, text, $selected){},
|
10746
10843
|
onRemove : function(value, text, $selected){},
|
10844
|
+
onActionable : function(value, text, $selected){},
|
10747
10845
|
onSearch : function(searchTerm){},
|
10748
10846
|
|
10749
10847
|
onLabelSelect : function($selectedLabels){},
|
@@ -10806,12 +10904,12 @@ $.fn.dropdown.settings = {
|
|
10806
10904
|
icon : 'icon', // optional icon name
|
10807
10905
|
iconClass : 'iconClass', // optional individual class for icon (for example to use flag instead)
|
10808
10906
|
class : 'class', // optional individual class for item/header
|
10809
|
-
divider : 'divider' // optional divider append for group headers
|
10907
|
+
divider : 'divider', // optional divider append for group headers
|
10908
|
+
actionable : 'actionable' // optional actionable item
|
10810
10909
|
},
|
10811
10910
|
|
10812
10911
|
keys : {
|
10813
10912
|
backspace : 8,
|
10814
|
-
delimiter : 188, // comma
|
10815
10913
|
deleteKey : 46,
|
10816
10914
|
enter : 13,
|
10817
10915
|
escape : 27,
|
@@ -10878,7 +10976,8 @@ $.fn.dropdown.settings = {
|
|
10878
10976
|
header : 'header',
|
10879
10977
|
divider : 'divider',
|
10880
10978
|
groupIcon : '',
|
10881
|
-
unfilterable : 'unfilterable'
|
10979
|
+
unfilterable : 'unfilterable',
|
10980
|
+
actionable : 'actionable'
|
10882
10981
|
}
|
10883
10982
|
|
10884
10983
|
};
|
@@ -10917,7 +11016,8 @@ $.fn.dropdown.settings.templates = {
|
|
10917
11016
|
var
|
10918
11017
|
placeholder = select.placeholder || false,
|
10919
11018
|
html = '',
|
10920
|
-
escape = $.fn.dropdown.settings.templates.escape
|
11019
|
+
escape = $.fn.dropdown.settings.templates.escape,
|
11020
|
+
deQuote = $.fn.dropdown.settings.templates.deQuote
|
10921
11021
|
;
|
10922
11022
|
html += '<i class="dropdown icon"></i>';
|
10923
11023
|
if(placeholder) {
|
@@ -10926,7 +11026,7 @@ $.fn.dropdown.settings.templates = {
|
|
10926
11026
|
else {
|
10927
11027
|
html += '<div class="text"></div>';
|
10928
11028
|
}
|
10929
|
-
html += '<div class="'+className.menu+'">';
|
11029
|
+
html += '<div class="'+deQuote(className.menu)+'">';
|
10930
11030
|
html += $.fn.dropdown.settings.templates.menu(select, fields, preserveHTML,className);
|
10931
11031
|
html += '</div>';
|
10932
11032
|
return html;
|
@@ -10953,6 +11053,9 @@ $.fn.dropdown.settings.templates = {
|
|
10953
11053
|
maybeText = (option[fields.text])
|
10954
11054
|
? ' data-text="' + deQuote(option[fields.text],true) + '"'
|
10955
11055
|
: '',
|
11056
|
+
maybeActionable = (option[fields.actionable])
|
11057
|
+
? className.actionable+' '
|
11058
|
+
: '',
|
10956
11059
|
maybeDisabled = (option[fields.disabled])
|
10957
11060
|
? className.disabled+' '
|
10958
11061
|
: '',
|
@@ -10961,27 +11064,27 @@ $.fn.dropdown.settings.templates = {
|
|
10961
11064
|
: '',
|
10962
11065
|
hasDescription = (escape(option[fields.description] || '', preserveHTML) != '')
|
10963
11066
|
;
|
10964
|
-
html += '<div class="'+ maybeDisabled + maybeDescriptionVertical + (option[fields.class] ?
|
11067
|
+
html += '<div class="'+ deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? option[fields.class] : className.item))+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
|
10965
11068
|
if (isMenu) {
|
10966
11069
|
html += '<i class="'+ (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
|
10967
11070
|
}
|
10968
11071
|
if(option[fields.image]) {
|
10969
|
-
html += '<img class="'+(option[fields.imageClass] ?
|
11072
|
+
html += '<img class="'+deQuote(option[fields.imageClass] ? option[fields.imageClass] : className.image)+'" src="' + deQuote(option[fields.image]) + '">';
|
10970
11073
|
}
|
10971
11074
|
if(option[fields.icon]) {
|
10972
|
-
html += '<i class="'+deQuote(option[fields.icon]
|
11075
|
+
html += '<i class="'+deQuote(option[fields.icon]+' '+(option[fields.iconClass] ? option[fields.iconClass] : className.icon))+'"></i>';
|
10973
11076
|
}
|
10974
11077
|
if(hasDescription){
|
10975
|
-
html += '<span class="'+ className.description +'">'+ escape(option[fields.description] || '', preserveHTML) + '</span>';
|
10976
|
-
html += (!isMenu) ? '<span class="'+ className.text + '">' : '';
|
11078
|
+
html += '<span class="'+ deQuote(className.description) +'">'+ escape(option[fields.description] || '', preserveHTML) + '</span>';
|
11079
|
+
html += (!isMenu) ? '<span class="'+ deQuote(className.text) + '">' : '';
|
10977
11080
|
}
|
10978
11081
|
if (isMenu) {
|
10979
|
-
html += '<span class="' + className.text + '">';
|
11082
|
+
html += '<span class="' + deQuote(className.text) + '">';
|
10980
11083
|
}
|
10981
11084
|
html += escape(option[fields.name] || '', preserveHTML);
|
10982
11085
|
if (isMenu) {
|
10983
11086
|
html += '</span>';
|
10984
|
-
html += '<div class="' + itemType + '">';
|
11087
|
+
html += '<div class="' + deQuote(itemType) + '">';
|
10985
11088
|
html += $.fn.dropdown.settings.templates.menu(option, fields, preserveHTML, className);
|
10986
11089
|
html += '</div>';
|
10987
11090
|
} else if(hasDescription){
|
@@ -10990,18 +11093,18 @@ $.fn.dropdown.settings.templates = {
|
|
10990
11093
|
html += '</div>';
|
10991
11094
|
} else if (itemType === 'header') {
|
10992
11095
|
var groupName = escape(option[fields.name] || '', preserveHTML),
|
10993
|
-
groupIcon = option[fields.icon] ?
|
11096
|
+
groupIcon = deQuote(option[fields.icon] ? option[fields.icon] : className.groupIcon)
|
10994
11097
|
;
|
10995
11098
|
if(groupName !== '' || groupIcon !== '') {
|
10996
|
-
html += '<div class="' + (option[fields.class] ?
|
11099
|
+
html += '<div class="' + deQuote(option[fields.class] ? option[fields.class] : className.header) + '">';
|
10997
11100
|
if (groupIcon !== '') {
|
10998
|
-
html += '<i class="' + groupIcon + ' ' + (option[fields.iconClass] ?
|
11101
|
+
html += '<i class="' + deQuote(groupIcon + ' ' + (option[fields.iconClass] ? option[fields.iconClass] : className.icon)) + '"></i>';
|
10999
11102
|
}
|
11000
11103
|
html += groupName;
|
11001
11104
|
html += '</div>';
|
11002
11105
|
}
|
11003
11106
|
if(option[fields.divider]){
|
11004
|
-
html += '<div class="'+className.divider+'"></div>';
|
11107
|
+
html += '<div class="'+deQuote(className.divider)+'"></div>';
|
11005
11108
|
}
|
11006
11109
|
}
|
11007
11110
|
});
|
@@ -11011,8 +11114,10 @@ $.fn.dropdown.settings.templates = {
|
|
11011
11114
|
// generates label for multiselect
|
11012
11115
|
label: function(value, text, preserveHTML, className) {
|
11013
11116
|
var
|
11014
|
-
escape = $.fn.dropdown.settings.templates.escape
|
11015
|
-
|
11117
|
+
escape = $.fn.dropdown.settings.templates.escape,
|
11118
|
+
deQuote = $.fn.dropdown.settings.templates.deQuote
|
11119
|
+
;
|
11120
|
+
return escape(text,preserveHTML) + '<i class="'+deQuote(className.delete)+' icon"></i>';
|
11016
11121
|
},
|
11017
11122
|
|
11018
11123
|
|
@@ -11031,7 +11136,7 @@ $.fn.dropdown.settings.templates = {
|
|
11031
11136
|
})( jQuery, window, document );
|
11032
11137
|
|
11033
11138
|
/*!
|
11034
|
-
* # Fomantic-UI 2.9.0-beta.
|
11139
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Embed
|
11035
11140
|
* http://github.com/fomantic/Fomantic-UI/
|
11036
11141
|
*
|
11037
11142
|
*
|
@@ -11703,26 +11808,32 @@ $.fn.embed.settings = {
|
|
11703
11808
|
},
|
11704
11809
|
|
11705
11810
|
templates: {
|
11811
|
+
deQuote: function(string, encode) {
|
11812
|
+
return String(string).replace(/"/g,encode ? """ : "");
|
11813
|
+
},
|
11706
11814
|
iframe : function(url, parameters) {
|
11707
|
-
var src = url
|
11815
|
+
var src = url,
|
11816
|
+
deQuote = $.fn.embed.settings.templates.deQuote
|
11817
|
+
;
|
11708
11818
|
if (parameters) {
|
11709
11819
|
src += '?' + parameters;
|
11710
11820
|
}
|
11711
11821
|
return ''
|
11712
|
-
+ '<iframe src="' + src + '"'
|
11822
|
+
+ '<iframe src="' + deQuote(src) + '"'
|
11713
11823
|
+ ' width="100%" height="100%"'
|
11714
11824
|
+ ' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'
|
11715
11825
|
;
|
11716
11826
|
},
|
11717
11827
|
placeholder : function(image, icon) {
|
11718
11828
|
var
|
11719
|
-
html = ''
|
11829
|
+
html = '',
|
11830
|
+
deQuote = $.fn.embed.settings.templates.deQuote
|
11720
11831
|
;
|
11721
11832
|
if(icon) {
|
11722
|
-
html += '<i class="' + icon + ' icon"></i>';
|
11833
|
+
html += '<i class="' + deQuote(icon) + ' icon"></i>';
|
11723
11834
|
}
|
11724
11835
|
if(image) {
|
11725
|
-
html += '<img class="placeholder" src="' + image + '">';
|
11836
|
+
html += '<img class="placeholder" src="' + deQuote(image) + '">';
|
11726
11837
|
}
|
11727
11838
|
return html;
|
11728
11839
|
}
|
@@ -11741,7 +11852,7 @@ $.fn.embed.settings = {
|
|
11741
11852
|
})( jQuery, window, document );
|
11742
11853
|
|
11743
11854
|
/*!
|
11744
|
-
* # Fomantic-UI 2.9.0-beta.
|
11855
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Modal
|
11745
11856
|
* http://github.com/fomantic/Fomantic-UI/
|
11746
11857
|
*
|
11747
11858
|
*
|
@@ -11765,7 +11876,7 @@ window = (typeof window != 'undefined' && window.Math == Math)
|
|
11765
11876
|
: Function('return this')()
|
11766
11877
|
;
|
11767
11878
|
|
11768
|
-
$.fn.modal = function(parameters) {
|
11879
|
+
$.modal = $.fn.modal = function(parameters) {
|
11769
11880
|
var
|
11770
11881
|
$allModules = $(this),
|
11771
11882
|
$window = $(window),
|
@@ -11807,8 +11918,9 @@ $.fn.modal = function(parameters) {
|
|
11807
11918
|
moduleNamespace = 'module-' + namespace,
|
11808
11919
|
|
11809
11920
|
$module = $(this),
|
11810
|
-
$context = $(settings.context),
|
11811
|
-
$
|
11921
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context),
|
11922
|
+
$closeIcon = $module.find(selector.closeIcon),
|
11923
|
+
$inputs,
|
11812
11924
|
|
11813
11925
|
$allModals,
|
11814
11926
|
$otherModals,
|
@@ -11816,8 +11928,10 @@ $.fn.modal = function(parameters) {
|
|
11816
11928
|
$dimmable,
|
11817
11929
|
$dimmer,
|
11818
11930
|
|
11931
|
+
isModalComponent = $module.hasClass('modal'),
|
11932
|
+
|
11819
11933
|
element = this,
|
11820
|
-
instance =
|
11934
|
+
instance = isModalComponent ? $module.data(moduleNamespace) : undefined,
|
11821
11935
|
|
11822
11936
|
ignoreRepeatedEvents = false,
|
11823
11937
|
|
@@ -11834,7 +11948,8 @@ $.fn.modal = function(parameters) {
|
|
11834
11948
|
module = {
|
11835
11949
|
|
11836
11950
|
initialize: function() {
|
11837
|
-
|
11951
|
+
module.create.id();
|
11952
|
+
if(!isModalComponent) {
|
11838
11953
|
module.create.modal();
|
11839
11954
|
if(!$.isFunction(settings.onHidden)) {
|
11840
11955
|
settings.onHidden = function () {
|
@@ -11858,15 +11973,17 @@ $.fn.modal = function(parameters) {
|
|
11858
11973
|
$actions.empty();
|
11859
11974
|
}
|
11860
11975
|
settings.actions.forEach(function (el) {
|
11861
|
-
var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
11976
|
+
var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
11862
11977
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
11863
11978
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
11864
11979
|
click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
|
11865
11980
|
$actions.append($('<button/>', {
|
11866
11981
|
html: icon + text,
|
11982
|
+
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
|
11867
11983
|
class: className.button + ' ' + cls,
|
11868
11984
|
click: function () {
|
11869
|
-
|
11985
|
+
var button = $(this);
|
11986
|
+
if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
|
11870
11987
|
return;
|
11871
11988
|
}
|
11872
11989
|
module.hide();
|
@@ -11877,7 +11994,6 @@ $.fn.modal = function(parameters) {
|
|
11877
11994
|
module.cache = {};
|
11878
11995
|
module.verbose('Initializing dimmer', $context);
|
11879
11996
|
|
11880
|
-
module.create.id();
|
11881
11997
|
module.create.dimmer();
|
11882
11998
|
|
11883
11999
|
if ( settings.allowMultiple ) {
|
@@ -11887,11 +12003,9 @@ $.fn.modal = function(parameters) {
|
|
11887
12003
|
$module.addClass('top aligned');
|
11888
12004
|
}
|
11889
12005
|
module.refreshModals();
|
11890
|
-
|
12006
|
+
module.refreshInputs();
|
11891
12007
|
module.bind.events();
|
11892
|
-
|
11893
|
-
module.observeChanges();
|
11894
|
-
}
|
12008
|
+
module.observeChanges();
|
11895
12009
|
module.instantiate();
|
11896
12010
|
if(settings.autoShow){
|
11897
12011
|
module.show();
|
@@ -11908,16 +12022,20 @@ $.fn.modal = function(parameters) {
|
|
11908
12022
|
|
11909
12023
|
create: {
|
11910
12024
|
modal: function() {
|
11911
|
-
$module = $('<div/>', {class: className.modal});
|
12025
|
+
$module = $('<div/>', {class: className.modal, role: 'dialog', 'aria-modal': true});
|
11912
12026
|
if (settings.closeIcon) {
|
11913
|
-
$
|
11914
|
-
$module.append($
|
12027
|
+
$closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
|
12028
|
+
$module.append($closeIcon);
|
11915
12029
|
}
|
11916
12030
|
if (settings.title !== '') {
|
11917
|
-
|
12031
|
+
var titleId = '_' + module.get.id() + 'title';
|
12032
|
+
$module.attr('aria-labelledby', titleId);
|
12033
|
+
$('<div/>', {class: className.title, id: titleId}).appendTo($module);
|
11918
12034
|
}
|
11919
12035
|
if (settings.content !== '') {
|
11920
|
-
|
12036
|
+
var descId = '_' + module.get.id() + 'desc';
|
12037
|
+
$module.attr('aria-describedby', descId);
|
12038
|
+
$('<div/>', {class: className.content, id: descId}).appendTo($module);
|
11921
12039
|
}
|
11922
12040
|
if (module.has.configActions()) {
|
11923
12041
|
$('<div/>', {class: className.actions}).appendTo($module);
|
@@ -11948,13 +12066,13 @@ $.fn.modal = function(parameters) {
|
|
11948
12066
|
$dimmer = $dimmable.dimmer('get dimmer');
|
11949
12067
|
},
|
11950
12068
|
id: function() {
|
11951
|
-
id = (Math.random().toString(16) + '000000000').
|
12069
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
11952
12070
|
elementEventNamespace = '.' + id;
|
11953
12071
|
module.verbose('Creating unique id for element', id);
|
11954
12072
|
},
|
11955
12073
|
innerDimmer: function() {
|
11956
|
-
if ( $module.find(selector.dimmer).length
|
11957
|
-
$
|
12074
|
+
if ( $module.find(selector.dimmer).length === 0 ) {
|
12075
|
+
$('<div/>', {class: className.innerDimmer}).prependTo($module);
|
11958
12076
|
}
|
11959
12077
|
}
|
11960
12078
|
},
|
@@ -11970,15 +12088,21 @@ $.fn.modal = function(parameters) {
|
|
11970
12088
|
;
|
11971
12089
|
$window.off(elementEventNamespace);
|
11972
12090
|
$dimmer.off(elementEventNamespace);
|
11973
|
-
$
|
12091
|
+
$closeIcon.off(elementEventNamespace);
|
12092
|
+
if($inputs) {
|
12093
|
+
$inputs.off(elementEventNamespace);
|
12094
|
+
}
|
11974
12095
|
$context.dimmer('destroy');
|
11975
12096
|
},
|
11976
12097
|
|
11977
12098
|
observeChanges: function() {
|
11978
12099
|
if('MutationObserver' in window) {
|
11979
12100
|
observer = new MutationObserver(function(mutations) {
|
11980
|
-
|
11981
|
-
|
12101
|
+
if(settings.observeChanges) {
|
12102
|
+
module.debug('DOM tree modified, refreshing');
|
12103
|
+
module.refresh();
|
12104
|
+
}
|
12105
|
+
module.refreshInputs();
|
11982
12106
|
});
|
11983
12107
|
observer.observe(element, {
|
11984
12108
|
childList : true,
|
@@ -12003,6 +12127,23 @@ $.fn.modal = function(parameters) {
|
|
12003
12127
|
$allModals = $otherModals.add($module);
|
12004
12128
|
},
|
12005
12129
|
|
12130
|
+
refreshInputs: function(){
|
12131
|
+
if($inputs){
|
12132
|
+
$inputs
|
12133
|
+
.off('keydown' + elementEventNamespace)
|
12134
|
+
;
|
12135
|
+
}
|
12136
|
+
$inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
|
12137
|
+
return $(this).closest('.disabled').length === 0;
|
12138
|
+
});
|
12139
|
+
$inputs.first()
|
12140
|
+
.on('keydown' + elementEventNamespace, module.event.inputKeyDown.first)
|
12141
|
+
;
|
12142
|
+
$inputs.last()
|
12143
|
+
.on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
|
12144
|
+
;
|
12145
|
+
},
|
12146
|
+
|
12006
12147
|
attachEvents: function(selector, event) {
|
12007
12148
|
var
|
12008
12149
|
$toggle = $(selector)
|
@@ -12031,6 +12172,9 @@ $.fn.modal = function(parameters) {
|
|
12031
12172
|
.on('click' + eventNamespace, selector.approve, module.event.approve)
|
12032
12173
|
.on('click' + eventNamespace, selector.deny, module.event.deny)
|
12033
12174
|
;
|
12175
|
+
$closeIcon
|
12176
|
+
.on('keyup' + elementEventNamespace, module.event.closeKeyUp)
|
12177
|
+
;
|
12034
12178
|
$window
|
12035
12179
|
.on('resize' + elementEventNamespace, module.event.resize)
|
12036
12180
|
;
|
@@ -12049,7 +12193,7 @@ $.fn.modal = function(parameters) {
|
|
12049
12193
|
|
12050
12194
|
get: {
|
12051
12195
|
id: function() {
|
12052
|
-
return
|
12196
|
+
return id;
|
12053
12197
|
},
|
12054
12198
|
element: function() {
|
12055
12199
|
return $module;
|
@@ -12088,10 +12232,38 @@ $.fn.modal = function(parameters) {
|
|
12088
12232
|
close: function() {
|
12089
12233
|
module.hide();
|
12090
12234
|
},
|
12235
|
+
closeKeyUp: function(event){
|
12236
|
+
var
|
12237
|
+
keyCode = event.which
|
12238
|
+
;
|
12239
|
+
if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
|
12240
|
+
module.hide();
|
12241
|
+
}
|
12242
|
+
},
|
12243
|
+
inputKeyDown: {
|
12244
|
+
first: function(event) {
|
12245
|
+
var
|
12246
|
+
keyCode = event.which
|
12247
|
+
;
|
12248
|
+
if (keyCode === settings.keys.tab && event.shiftKey) {
|
12249
|
+
$inputs.last().focus();
|
12250
|
+
event.preventDefault();
|
12251
|
+
}
|
12252
|
+
},
|
12253
|
+
last: function(event) {
|
12254
|
+
var
|
12255
|
+
keyCode = event.which
|
12256
|
+
;
|
12257
|
+
if (keyCode === settings.keys.tab && !event.shiftKey) {
|
12258
|
+
$inputs.first().focus();
|
12259
|
+
event.preventDefault();
|
12260
|
+
}
|
12261
|
+
}
|
12262
|
+
},
|
12091
12263
|
mousedown: function(event) {
|
12092
12264
|
var
|
12093
12265
|
$target = $(event.target),
|
12094
|
-
isRtl = module.is.rtl()
|
12266
|
+
isRtl = module.is.rtl()
|
12095
12267
|
;
|
12096
12268
|
initialMouseDownInModal = ($target.closest(selector.modal).length > 0);
|
12097
12269
|
if(initialMouseDownInModal) {
|
@@ -12139,10 +12311,9 @@ $.fn.modal = function(parameters) {
|
|
12139
12311
|
},
|
12140
12312
|
keyboard: function(event) {
|
12141
12313
|
var
|
12142
|
-
keyCode = event.which
|
12143
|
-
escapeKey = 27
|
12314
|
+
keyCode = event.which
|
12144
12315
|
;
|
12145
|
-
if(keyCode
|
12316
|
+
if(keyCode === settings.keys.escape) {
|
12146
12317
|
if(settings.closable) {
|
12147
12318
|
module.debug('Escape key pressed hiding modal');
|
12148
12319
|
if ( $module.hasClass(className.front) ) {
|
@@ -12198,6 +12369,10 @@ $.fn.modal = function(parameters) {
|
|
12198
12369
|
: function(){}
|
12199
12370
|
;
|
12200
12371
|
if( module.is.animating() || !module.is.active() ) {
|
12372
|
+
if(settings.onShow.call(element) === false) {
|
12373
|
+
module.verbose('Show callback returned false cancelling show');
|
12374
|
+
return;
|
12375
|
+
}
|
12201
12376
|
module.showDimmer();
|
12202
12377
|
module.cacheSizes();
|
12203
12378
|
module.set.bodyMargin();
|
@@ -12227,12 +12402,13 @@ $.fn.modal = function(parameters) {
|
|
12227
12402
|
$module.detach().appendTo($dimmer);
|
12228
12403
|
}
|
12229
12404
|
}
|
12230
|
-
settings.onShow.call(element);
|
12231
12405
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
12232
12406
|
module.debug('Showing modal with css animations');
|
12233
12407
|
$module
|
12234
12408
|
.transition({
|
12235
12409
|
debug : settings.debug,
|
12410
|
+
verbose : settings.verbose,
|
12411
|
+
silent : settings.silent,
|
12236
12412
|
animation : (settings.transition.showMethod || settings.transition) + ' in',
|
12237
12413
|
queue : settings.queue,
|
12238
12414
|
duration : settings.transition.showDuration || settings.duration,
|
@@ -12270,7 +12446,6 @@ $.fn.modal = function(parameters) {
|
|
12270
12446
|
? callback
|
12271
12447
|
: function(){}
|
12272
12448
|
;
|
12273
|
-
module.debug('Hiding modal');
|
12274
12449
|
if(settings.onHide.call(element, $(this)) === false) {
|
12275
12450
|
module.verbose('Hide callback returned false cancelling hide');
|
12276
12451
|
ignoreRepeatedEvents = false;
|
@@ -12278,11 +12453,14 @@ $.fn.modal = function(parameters) {
|
|
12278
12453
|
}
|
12279
12454
|
|
12280
12455
|
if( module.is.animating() || module.is.active() ) {
|
12456
|
+
module.debug('Hiding modal');
|
12281
12457
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
12282
12458
|
module.remove.active();
|
12283
12459
|
$module
|
12284
12460
|
.transition({
|
12285
12461
|
debug : settings.debug,
|
12462
|
+
verbose : settings.verbose,
|
12463
|
+
silent : settings.silent,
|
12286
12464
|
animation : (settings.transition.hideMethod || settings.transition) + ' out',
|
12287
12465
|
queue : settings.queue,
|
12288
12466
|
duration : settings.transition.hideDuration || settings.duration,
|
@@ -12404,7 +12582,7 @@ $.fn.modal = function(parameters) {
|
|
12404
12582
|
keyboardShortcuts: function() {
|
12405
12583
|
module.verbose('Adding keyboard shortcuts');
|
12406
12584
|
$document
|
12407
|
-
.on('
|
12585
|
+
.on('keydown' + eventNamespace, module.event.keyboard)
|
12408
12586
|
;
|
12409
12587
|
}
|
12410
12588
|
},
|
@@ -12457,7 +12635,7 @@ $.fn.modal = function(parameters) {
|
|
12457
12635
|
$module
|
12458
12636
|
.off('mousedown' + elementEventNamespace)
|
12459
12637
|
;
|
12460
|
-
}
|
12638
|
+
}
|
12461
12639
|
$dimmer
|
12462
12640
|
.off('mousedown' + elementEventNamespace)
|
12463
12641
|
;
|
@@ -12484,7 +12662,7 @@ $.fn.modal = function(parameters) {
|
|
12484
12662
|
keyboardShortcuts: function() {
|
12485
12663
|
module.verbose('Removing keyboard shortcuts');
|
12486
12664
|
$document
|
12487
|
-
.off('
|
12665
|
+
.off('keydown' + eventNamespace)
|
12488
12666
|
;
|
12489
12667
|
},
|
12490
12668
|
scrolling: function() {
|
@@ -12642,13 +12820,10 @@ $.fn.modal = function(parameters) {
|
|
12642
12820
|
set: {
|
12643
12821
|
autofocus: function() {
|
12644
12822
|
var
|
12645
|
-
$inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
|
12646
|
-
return $(this).closest('.disabled').length === 0;
|
12647
|
-
}),
|
12648
12823
|
$autofocus = $inputs.filter('[autofocus]'),
|
12649
12824
|
$input = ($autofocus.length > 0)
|
12650
12825
|
? $autofocus.first()
|
12651
|
-
: $inputs.first()
|
12826
|
+
: ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
|
12652
12827
|
;
|
12653
12828
|
if($input.length > 0) {
|
12654
12829
|
$input.focus();
|
@@ -12730,7 +12905,7 @@ $.fn.modal = function(parameters) {
|
|
12730
12905
|
? $(document).scrollTop() + settings.padding
|
12731
12906
|
: $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
|
12732
12907
|
marginLeft: -(module.cache.width / 2)
|
12733
|
-
})
|
12908
|
+
})
|
12734
12909
|
;
|
12735
12910
|
} else {
|
12736
12911
|
$module
|
@@ -12739,7 +12914,7 @@ $.fn.modal = function(parameters) {
|
|
12739
12914
|
? -(module.cache.height / 2)
|
12740
12915
|
: settings.padding / 2,
|
12741
12916
|
marginLeft: -(module.cache.width / 2)
|
12742
|
-
})
|
12917
|
+
})
|
12743
12918
|
;
|
12744
12919
|
}
|
12745
12920
|
module.verbose('Setting modal offset for legacy mode');
|
@@ -13065,11 +13240,19 @@ $.fn.modal.settings = {
|
|
13065
13240
|
// called after deny selector match
|
13066
13241
|
onDeny : function(){ return true; },
|
13067
13242
|
|
13243
|
+
keys : {
|
13244
|
+
space : 32,
|
13245
|
+
enter : 13,
|
13246
|
+
escape : 27,
|
13247
|
+
tab : 9,
|
13248
|
+
},
|
13249
|
+
|
13068
13250
|
selector : {
|
13069
13251
|
title : '> .header',
|
13070
13252
|
content : '> .content',
|
13071
13253
|
actions : '> .actions',
|
13072
13254
|
close : '> .close',
|
13255
|
+
closeIcon: '> .close',
|
13073
13256
|
approve : '.actions .positive, .actions .approve, .actions .ok',
|
13074
13257
|
deny : '.actions .negative, .actions .deny, .actions .cancel',
|
13075
13258
|
modal : '.ui.modal',
|
@@ -13101,11 +13284,13 @@ $.fn.modal.settings = {
|
|
13101
13284
|
template : 'ui tiny modal',
|
13102
13285
|
ok : 'positive',
|
13103
13286
|
cancel : 'negative',
|
13104
|
-
prompt : 'ui fluid input'
|
13287
|
+
prompt : 'ui fluid input',
|
13288
|
+
innerDimmer: 'ui inverted dimmer'
|
13105
13289
|
},
|
13106
13290
|
text: {
|
13107
13291
|
ok : 'Ok',
|
13108
|
-
cancel: 'Cancel'
|
13292
|
+
cancel: 'Cancel',
|
13293
|
+
close : 'Close'
|
13109
13294
|
}
|
13110
13295
|
};
|
13111
13296
|
|
@@ -13131,33 +13316,39 @@ $.fn.modal.settings.templates = {
|
|
13131
13316
|
},
|
13132
13317
|
alert: function () {
|
13133
13318
|
var settings = this.get.settings(),
|
13134
|
-
args = settings.templates.getArguments(arguments)
|
13319
|
+
args = settings.templates.getArguments(arguments),
|
13320
|
+
approveFn = args.handler
|
13135
13321
|
;
|
13136
13322
|
return {
|
13137
13323
|
title : args.title,
|
13138
13324
|
content: args.content,
|
13325
|
+
onApprove: approveFn,
|
13139
13326
|
actions: [{
|
13140
13327
|
text : settings.text.ok,
|
13141
13328
|
class: settings.className.ok,
|
13142
|
-
click:
|
13329
|
+
click: approveFn
|
13143
13330
|
}]
|
13144
13331
|
}
|
13145
13332
|
},
|
13146
13333
|
confirm: function () {
|
13147
13334
|
var settings = this.get.settings(),
|
13148
|
-
args = settings.templates.getArguments(arguments)
|
13335
|
+
args = settings.templates.getArguments(arguments),
|
13336
|
+
approveFn = function(){args.handler(true)},
|
13337
|
+
denyFn = function(){args.handler(false)}
|
13149
13338
|
;
|
13150
13339
|
return {
|
13151
13340
|
title : args.title,
|
13152
13341
|
content: args.content,
|
13342
|
+
onApprove: approveFn,
|
13343
|
+
onDeny: denyFn,
|
13153
13344
|
actions: [{
|
13154
13345
|
text : settings.text.ok,
|
13155
13346
|
class: settings.className.ok,
|
13156
|
-
click:
|
13347
|
+
click: approveFn
|
13157
13348
|
},{
|
13158
13349
|
text: settings.text.cancel,
|
13159
13350
|
class: settings.className.cancel,
|
13160
|
-
click:
|
13351
|
+
click: denyFn
|
13161
13352
|
}]
|
13162
13353
|
}
|
13163
13354
|
},
|
@@ -13165,27 +13356,31 @@ $.fn.modal.settings.templates = {
|
|
13165
13356
|
var $this = this,
|
13166
13357
|
settings = this.get.settings(),
|
13167
13358
|
args = settings.templates.getArguments(arguments),
|
13168
|
-
input = $($.parseHTML(args.content)).filter('.ui.input')
|
13359
|
+
input = $($.parseHTML(args.content)).filter('.ui.input'),
|
13360
|
+
approveFn = function(){
|
13361
|
+
var settings = $this.get.settings(),
|
13362
|
+
inputField = $this.get.element().find(settings.selector.prompt)[0]
|
13363
|
+
;
|
13364
|
+
args.handler($(inputField).val());
|
13365
|
+
},
|
13366
|
+
denyFn = function(){args.handler(null)}
|
13169
13367
|
;
|
13170
13368
|
if (input.length === 0) {
|
13171
|
-
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>';
|
13369
|
+
args.content += '<p><div class="'+this.helpers.deQuote(settings.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
|
13172
13370
|
}
|
13173
13371
|
return {
|
13174
13372
|
title : args.title,
|
13175
13373
|
content: args.content,
|
13374
|
+
onApprove: approveFn,
|
13375
|
+
onDeny: denyFn,
|
13176
13376
|
actions: [{
|
13177
13377
|
text: settings.text.ok,
|
13178
13378
|
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
|
-
}
|
13379
|
+
click: approveFn
|
13185
13380
|
},{
|
13186
13381
|
text: settings.text.cancel,
|
13187
13382
|
class: settings.className.cancel,
|
13188
|
-
click:
|
13383
|
+
click: denyFn
|
13189
13384
|
}]
|
13190
13385
|
}
|
13191
13386
|
}
|
@@ -13194,7 +13389,7 @@ $.fn.modal.settings.templates = {
|
|
13194
13389
|
})( jQuery, window, document );
|
13195
13390
|
|
13196
13391
|
/*!
|
13197
|
-
* # Fomantic-UI 2.9.0-beta.
|
13392
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Nag
|
13198
13393
|
* http://github.com/fomantic/Fomantic-UI/
|
13199
13394
|
*
|
13200
13395
|
*
|
@@ -13248,7 +13443,7 @@ $.fn.nag = function(parameters) {
|
|
13248
13443
|
$module = $(this),
|
13249
13444
|
|
13250
13445
|
$context = (settings.context)
|
13251
|
-
? $(settings.context)
|
13446
|
+
? ([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
13252
13447
|
: $('body'),
|
13253
13448
|
|
13254
13449
|
element = this,
|
@@ -13753,7 +13948,7 @@ $.extend( $.easing, {
|
|
13753
13948
|
})( jQuery, window, document );
|
13754
13949
|
|
13755
13950
|
/*!
|
13756
|
-
* # Fomantic-UI 2.9.0-beta.
|
13951
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Popup
|
13757
13952
|
* http://github.com/fomantic/Fomantic-UI/
|
13758
13953
|
*
|
13759
13954
|
*
|
@@ -13816,11 +14011,11 @@ $.fn.popup = function(parameters) {
|
|
13816
14011
|
moduleNamespace = 'module-' + namespace,
|
13817
14012
|
|
13818
14013
|
$module = $(this),
|
13819
|
-
$context = $(settings.context),
|
13820
|
-
$scrollContext = $(settings.scrollContext),
|
13821
|
-
$boundary = $(settings.boundary),
|
14014
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $(settings.context),
|
14015
|
+
$scrollContext = [window,document].indexOf(settings.scrollContext) < 0 ? $document.find(settings.scrollContext) : $(settings.scrollContext),
|
14016
|
+
$boundary = [window,document].indexOf(settings.boundary) < 0 ? $document.find(settings.boundary) : $(settings.boundary),
|
13822
14017
|
$target = (settings.target)
|
13823
|
-
? $(settings.target)
|
14018
|
+
? ([window,document].indexOf(settings.target) < 0 ? $document.find(settings.target) : $(settings.target))
|
13824
14019
|
: $module,
|
13825
14020
|
|
13826
14021
|
$popup,
|
@@ -13876,7 +14071,7 @@ $.fn.popup = function(parameters) {
|
|
13876
14071
|
|
13877
14072
|
refresh: function() {
|
13878
14073
|
if(settings.popup) {
|
13879
|
-
$popup = $(settings.popup).eq(0);
|
14074
|
+
$popup = $document.find(settings.popup).eq(0);
|
13880
14075
|
}
|
13881
14076
|
else {
|
13882
14077
|
if(settings.inline) {
|
@@ -14041,7 +14236,7 @@ $.fn.popup = function(parameters) {
|
|
14041
14236
|
settings.onCreate.call($popup, element);
|
14042
14237
|
}
|
14043
14238
|
else if(settings.popup) {
|
14044
|
-
$(settings.popup).data(metadata.activator, $module);
|
14239
|
+
$document.find(settings.popup).data(metadata.activator, $module);
|
14045
14240
|
module.verbose('Used popup specified in settings');
|
14046
14241
|
module.refresh();
|
14047
14242
|
if(settings.hoverable) {
|
@@ -14063,7 +14258,7 @@ $.fn.popup = function(parameters) {
|
|
14063
14258
|
},
|
14064
14259
|
|
14065
14260
|
createID: function() {
|
14066
|
-
id = (Math.random().toString(16) + '000000000').
|
14261
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
14067
14262
|
elementNamespace = '.' + id;
|
14068
14263
|
module.verbose('Creating unique id for element', id);
|
14069
14264
|
},
|
@@ -14122,7 +14317,7 @@ $.fn.popup = function(parameters) {
|
|
14122
14317
|
},
|
14123
14318
|
|
14124
14319
|
hideAll: function() {
|
14125
|
-
$(selector.popup)
|
14320
|
+
$document.find(selector.popup)
|
14126
14321
|
.filter('.' + className.popupVisible)
|
14127
14322
|
.each(function() {
|
14128
14323
|
$(this)
|
@@ -14192,6 +14387,7 @@ $.fn.popup = function(parameters) {
|
|
14192
14387
|
queue : false,
|
14193
14388
|
debug : settings.debug,
|
14194
14389
|
verbose : settings.verbose,
|
14390
|
+
silent : settings.silent,
|
14195
14391
|
duration : settings.transition.showDuration || settings.duration,
|
14196
14392
|
onComplete : function() {
|
14197
14393
|
module.bind.close();
|
@@ -14216,6 +14412,7 @@ $.fn.popup = function(parameters) {
|
|
14216
14412
|
duration : settings.transition.hideDuration || settings.duration,
|
14217
14413
|
debug : settings.debug,
|
14218
14414
|
verbose : settings.verbose,
|
14415
|
+
silent : settings.silent,
|
14219
14416
|
onComplete : function() {
|
14220
14417
|
module.reset();
|
14221
14418
|
callback.call($popup, element);
|
@@ -14311,7 +14508,7 @@ $.fn.popup = function(parameters) {
|
|
14311
14508
|
};
|
14312
14509
|
|
14313
14510
|
// if popup offset context is not same as target, then adjust calculations
|
14314
|
-
if($popupOffsetParent
|
14511
|
+
if($popupOffsetParent[0] !== $offsetParent[0]) {
|
14315
14512
|
var
|
14316
14513
|
popupOffset = $popupOffsetParent.offset()
|
14317
14514
|
;
|
@@ -14889,7 +15086,7 @@ $.fn.popup = function(parameters) {
|
|
14889
15086
|
return !module.is.visible();
|
14890
15087
|
},
|
14891
15088
|
rtl: function () {
|
14892
|
-
return $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl';
|
15089
|
+
return $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl' || $body.attr('dir') === 'rtl' || $body.css('direction') === 'rtl' || $context.attr('dir') === 'rtl' || $context.css('direction') === 'rtl';
|
14893
15090
|
}
|
14894
15091
|
},
|
14895
15092
|
|
@@ -15295,7 +15492,7 @@ $.fn.popup.settings = {
|
|
15295
15492
|
})( jQuery, window, document );
|
15296
15493
|
|
15297
15494
|
/*!
|
15298
|
-
* # Fomantic-UI 2.9.0-beta.
|
15495
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Progress
|
15299
15496
|
* http://github.com/fomantic/Fomantic-UI/
|
15300
15497
|
*
|
15301
15498
|
*
|
@@ -15903,6 +16100,9 @@ $.fn.progress = function(parameters) {
|
|
15903
16100
|
}
|
15904
16101
|
else {
|
15905
16102
|
module.remove.active();
|
16103
|
+
module.remove.warning();
|
16104
|
+
module.remove.error();
|
16105
|
+
module.remove.success();
|
15906
16106
|
module.set.label(settings.text.active);
|
15907
16107
|
}
|
15908
16108
|
},
|
@@ -16329,7 +16529,7 @@ $.fn.progress.settings = {
|
|
16329
16529
|
})( jQuery, window, document );
|
16330
16530
|
|
16331
16531
|
/*!
|
16332
|
-
* # Fomantic-UI 2.9.0-beta.
|
16532
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Slider
|
16333
16533
|
* http://github.com/fomantic/Fomantic-UI/
|
16334
16534
|
*
|
16335
16535
|
*
|
@@ -16400,6 +16600,7 @@ $.fn.slider = function(parameters) {
|
|
16400
16600
|
|
16401
16601
|
$module = $(this),
|
16402
16602
|
$currThumb,
|
16603
|
+
touchIdentifier,
|
16403
16604
|
$thumb,
|
16404
16605
|
$secondThumb,
|
16405
16606
|
$track,
|
@@ -16416,7 +16617,6 @@ $.fn.slider = function(parameters) {
|
|
16416
16617
|
secondPos,
|
16417
16618
|
offset,
|
16418
16619
|
precision,
|
16419
|
-
isTouch,
|
16420
16620
|
gapRatio = 1,
|
16421
16621
|
previousValue,
|
16422
16622
|
|
@@ -16434,7 +16634,6 @@ $.fn.slider = function(parameters) {
|
|
16434
16634
|
currentRange += 1;
|
16435
16635
|
documentEventID = currentRange;
|
16436
16636
|
|
16437
|
-
isTouch = module.setup.testOutTouch();
|
16438
16637
|
module.setup.layout();
|
16439
16638
|
module.setup.labels();
|
16440
16639
|
|
@@ -16505,14 +16704,6 @@ $.fn.slider = function(parameters) {
|
|
16505
16704
|
}
|
16506
16705
|
}
|
16507
16706
|
},
|
16508
|
-
testOutTouch: function() {
|
16509
|
-
try {
|
16510
|
-
document.createEvent('TouchEvent');
|
16511
|
-
return true;
|
16512
|
-
} catch (e) {
|
16513
|
-
return false;
|
16514
|
-
}
|
16515
|
-
},
|
16516
16707
|
customLabel: function() {
|
16517
16708
|
var
|
16518
16709
|
$children = $labels.find('.label'),
|
@@ -16566,9 +16757,6 @@ $.fn.slider = function(parameters) {
|
|
16566
16757
|
module.bind.globalKeyboardEvents();
|
16567
16758
|
module.bind.keyboardEvents();
|
16568
16759
|
module.bind.mouseEvents();
|
16569
|
-
if(module.is.touch()) {
|
16570
|
-
module.bind.touchEvents();
|
16571
|
-
}
|
16572
16760
|
if (settings.autoAdjustLabels) {
|
16573
16761
|
module.bind.windowEvents();
|
16574
16762
|
}
|
@@ -16581,7 +16769,7 @@ $.fn.slider = function(parameters) {
|
|
16581
16769
|
$(document).on('keydown' + eventNamespace + documentEventID, module.event.activateFocus);
|
16582
16770
|
},
|
16583
16771
|
mouseEvents: function() {
|
16584
|
-
module.verbose('Binding mouse events');
|
16772
|
+
module.verbose('Binding mouse and touch events');
|
16585
16773
|
$module.find('.track, .thumb, .inner').on('mousedown' + eventNamespace, function(event) {
|
16586
16774
|
event.stopImmediatePropagation();
|
16587
16775
|
event.preventDefault();
|
@@ -16594,27 +16782,20 @@ $.fn.slider = function(parameters) {
|
|
16594
16782
|
$module.on('mouseleave' + eventNamespace, function(event) {
|
16595
16783
|
isHover = false;
|
16596
16784
|
});
|
16597
|
-
|
16598
|
-
|
16599
|
-
|
16600
|
-
$module.find('.
|
16601
|
-
event.
|
16602
|
-
event.
|
16603
|
-
module.event.
|
16604
|
-
|
16605
|
-
$module.on('touchstart' + eventNamespace, module.event.down);
|
16785
|
+
// All touch events are invoked on the element where the touch *started*. Thus, we can bind them all
|
16786
|
+
// on the thumb(s) and don't need to worry about interference with other components, i.e. no dynamic binding
|
16787
|
+
// and unbinding required.
|
16788
|
+
$module.find('.thumb')
|
16789
|
+
.on('touchstart' + eventNamespace, module.event.touchDown)
|
16790
|
+
.on('touchmove' + eventNamespace, module.event.move)
|
16791
|
+
.on('touchend' + eventNamespace, module.event.up)
|
16792
|
+
.on('touchcancel' + eventNamespace, module.event.touchCancel);
|
16606
16793
|
},
|
16607
16794
|
slidingEvents: function() {
|
16608
16795
|
// these don't need the identifier because we only ever want one of them to be registered with document
|
16609
16796
|
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
|
-
}
|
16797
|
+
$(document).on('mousemove' + eventNamespace, module.event.move);
|
16798
|
+
$(document).on('mouseup' + eventNamespace, module.event.up);
|
16618
16799
|
},
|
16619
16800
|
windowEvents: function() {
|
16620
16801
|
$window.on('resize' + eventNamespace, module.event.resize);
|
@@ -16624,24 +16805,22 @@ $.fn.slider = function(parameters) {
|
|
16624
16805
|
unbind: {
|
16625
16806
|
events: function() {
|
16626
16807
|
$module.find('.track, .thumb, .inner').off('mousedown' + eventNamespace);
|
16627
|
-
$module.find('.track, .thumb, .inner').off('touchstart' + eventNamespace);
|
16628
16808
|
$module.off('mousedown' + eventNamespace);
|
16629
16809
|
$module.off('mouseenter' + eventNamespace);
|
16630
16810
|
$module.off('mouseleave' + eventNamespace);
|
16631
|
-
$module.
|
16811
|
+
$module.find('.thumb')
|
16812
|
+
.off('touchstart' + eventNamespace)
|
16813
|
+
.off('touchmove' + eventNamespace)
|
16814
|
+
.off('touchend' + eventNamespace)
|
16815
|
+
.off('touchcancel' + eventNamespace);
|
16632
16816
|
$module.off('keydown' + eventNamespace);
|
16633
16817
|
$module.off('focusout' + eventNamespace);
|
16634
16818
|
$(document).off('keydown' + eventNamespace + documentEventID, module.event.activateFocus);
|
16635
16819
|
$window.off('resize' + eventNamespace);
|
16636
16820
|
},
|
16637
16821
|
slidingEvents: function() {
|
16638
|
-
|
16639
|
-
|
16640
|
-
$(document).off('touchend' + eventNamespace);
|
16641
|
-
} else {
|
16642
|
-
$(document).off('mousemove' + eventNamespace);
|
16643
|
-
$(document).off('mouseup' + eventNamespace);
|
16644
|
-
}
|
16822
|
+
$(document).off('mousemove' + eventNamespace);
|
16823
|
+
$(document).off('mouseup' + eventNamespace);
|
16645
16824
|
},
|
16646
16825
|
},
|
16647
16826
|
|
@@ -16671,10 +16850,31 @@ $.fn.slider = function(parameters) {
|
|
16671
16850
|
module.bind.slidingEvents();
|
16672
16851
|
}
|
16673
16852
|
},
|
16853
|
+
touchDown: function(event) {
|
16854
|
+
event.preventDefault(); // disable mouse emulation and touch-scrolling
|
16855
|
+
event.stopImmediatePropagation();
|
16856
|
+
if(touchIdentifier !== undefined) {
|
16857
|
+
// ignore multiple touches on the same slider --
|
16858
|
+
// we cannot handle changing both thumbs at once due to shared state
|
16859
|
+
return;
|
16860
|
+
}
|
16861
|
+
$currThumb = $(event.target);
|
16862
|
+
var touchEvent = event.touches ? event : event.originalEvent;
|
16863
|
+
touchIdentifier = touchEvent.targetTouches[0].identifier;
|
16864
|
+
if(previousValue === undefined) {
|
16865
|
+
previousValue = module.get.currentThumbValue();
|
16866
|
+
}
|
16867
|
+
},
|
16674
16868
|
move: function(event) {
|
16675
|
-
event.
|
16869
|
+
if(event.type == 'mousemove') {
|
16870
|
+
event.preventDefault(); // prevent text selection etc.
|
16871
|
+
}
|
16872
|
+
if(module.is.disabled()) {
|
16873
|
+
// touch events are always bound, so we need to prevent touch-sliding on disabled sliders here
|
16874
|
+
return;
|
16875
|
+
}
|
16676
16876
|
var value = module.determine.valueFromEvent(event);
|
16677
|
-
if($currThumb === undefined) {
|
16877
|
+
if(event.type == 'mousemove' && $currThumb === undefined) {
|
16678
16878
|
var
|
16679
16879
|
eventPos = module.determine.eventPos(event),
|
16680
16880
|
newPos = module.determine.pos(eventPos)
|
@@ -16711,13 +16911,26 @@ $.fn.slider = function(parameters) {
|
|
16711
16911
|
},
|
16712
16912
|
up: function(event) {
|
16713
16913
|
event.preventDefault();
|
16914
|
+
if(module.is.disabled()) {
|
16915
|
+
// touch events are always bound, so we need to prevent touch-sliding on disabled sliders here
|
16916
|
+
return;
|
16917
|
+
}
|
16714
16918
|
var value = module.determine.valueFromEvent(event);
|
16715
16919
|
module.set.value(value);
|
16716
16920
|
module.unbind.slidingEvents();
|
16921
|
+
touchIdentifier = undefined;
|
16717
16922
|
if (previousValue !== undefined) {
|
16718
16923
|
previousValue = undefined;
|
16719
16924
|
}
|
16720
16925
|
},
|
16926
|
+
touchCancel: function(event) {
|
16927
|
+
event.preventDefault();
|
16928
|
+
touchIdentifier = undefined;
|
16929
|
+
if (previousValue !== undefined) {
|
16930
|
+
module.update.value(previousValue);
|
16931
|
+
previousValue = undefined;
|
16932
|
+
}
|
16933
|
+
},
|
16721
16934
|
keydown: function(event, first) {
|
16722
16935
|
if(settings.preventCrossover && module.is.range() && module.thumbVal === module.secondThumbVal) {
|
16723
16936
|
$currThumb = undefined;
|
@@ -16830,9 +17043,6 @@ $.fn.slider = function(parameters) {
|
|
16830
17043
|
},
|
16831
17044
|
smooth: function() {
|
16832
17045
|
return settings.smooth || $module.hasClass(settings.className.smooth);
|
16833
|
-
},
|
16834
|
-
touch: function() {
|
16835
|
-
return isTouch;
|
16836
17046
|
}
|
16837
17047
|
},
|
16838
17048
|
|
@@ -17096,12 +17306,19 @@ $.fn.slider = function(parameters) {
|
|
17096
17306
|
return value;
|
17097
17307
|
},
|
17098
17308
|
eventPos: function(event) {
|
17099
|
-
if(
|
17309
|
+
if(event.type === "touchmove" || event.type === "touchend") {
|
17310
|
+
var
|
17311
|
+
touchEvent = event.touches ? event : event.originalEvent,
|
17312
|
+
touch = touchEvent.changedTouches[0]; // fall back to first touch if correct touch not found
|
17313
|
+
for(var i=0; i < touchEvent.touches.length; i++) {
|
17314
|
+
if(touchEvent.touches[i].identifier === touchIdentifier) {
|
17315
|
+
touch = touchEvent.touches[i];
|
17316
|
+
break;
|
17317
|
+
}
|
17318
|
+
}
|
17100
17319
|
var
|
17101
|
-
|
17102
|
-
|
17103
|
-
touchY = touches[0].pageY,
|
17104
|
-
touchX = touches[0].pageX
|
17320
|
+
touchY = touch.pageY,
|
17321
|
+
touchX = touch.pageX
|
17105
17322
|
;
|
17106
17323
|
return module.is.vertical() ? touchY : touchX;
|
17107
17324
|
}
|
@@ -17668,7 +17885,7 @@ $.fn.slider.settings = {
|
|
17668
17885
|
})( jQuery, window, document );
|
17669
17886
|
|
17670
17887
|
/*!
|
17671
|
-
* # Fomantic-UI 2.9.0-beta.
|
17888
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Rating
|
17672
17889
|
* http://github.com/fomantic/Fomantic-UI/
|
17673
17890
|
*
|
17674
17891
|
*
|
@@ -18205,13 +18422,17 @@ $.fn.rating.settings = {
|
|
18205
18422
|
},
|
18206
18423
|
|
18207
18424
|
templates: {
|
18425
|
+
deQuote: function(string, encode) {
|
18426
|
+
return String(string).replace(/"/g,encode ? """ : "");
|
18427
|
+
},
|
18208
18428
|
icon: function(maxRating, iconClass) {
|
18209
18429
|
var
|
18210
18430
|
icon = 1,
|
18211
|
-
html = ''
|
18431
|
+
html = '',
|
18432
|
+
deQuote = $.fn.rating.settings.templates.deQuote
|
18212
18433
|
;
|
18213
18434
|
while(icon <= maxRating) {
|
18214
|
-
html += '<i class="'+iconClass+' icon"></i>';
|
18435
|
+
html += '<i class="'+deQuote(iconClass)+' icon"></i>';
|
18215
18436
|
icon++;
|
18216
18437
|
}
|
18217
18438
|
return html;
|
@@ -18223,7 +18444,7 @@ $.fn.rating.settings = {
|
|
18223
18444
|
})( jQuery, window, document );
|
18224
18445
|
|
18225
18446
|
/*!
|
18226
|
-
* # Fomantic-UI 2.9.0-beta.
|
18447
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Search
|
18227
18448
|
* http://github.com/fomantic/Fomantic-UI/
|
18228
18449
|
*
|
18229
18450
|
*
|
@@ -18486,7 +18707,7 @@ $.fn.search = function(parameters) {
|
|
18486
18707
|
|
18487
18708
|
resultsScrollTop = $results.scrollTop();
|
18488
18709
|
resultsHeight = $results.height();
|
18489
|
-
|
18710
|
+
|
18490
18711
|
if (elTop < 0) {
|
18491
18712
|
$results.scrollTop(resultsScrollTop + elTop);
|
18492
18713
|
}
|
@@ -18517,8 +18738,13 @@ $.fn.search = function(parameters) {
|
|
18517
18738
|
;
|
18518
18739
|
// search shortcuts
|
18519
18740
|
if(keyCode == keys.escape) {
|
18520
|
-
module.
|
18521
|
-
|
18741
|
+
if(!module.is.visible()) {
|
18742
|
+
module.verbose('Escape key pressed, blurring search field');
|
18743
|
+
$prompt.blur();
|
18744
|
+
} else {
|
18745
|
+
module.hideResults();
|
18746
|
+
}
|
18747
|
+
event.stopPropagation();
|
18522
18748
|
resultsDismissed = true;
|
18523
18749
|
}
|
18524
18750
|
if( module.is.visible() ) {
|
@@ -18591,20 +18817,36 @@ $.fn.search = function(parameters) {
|
|
18591
18817
|
urlData : {
|
18592
18818
|
query : searchTerm
|
18593
18819
|
},
|
18594
|
-
|
18820
|
+
},
|
18821
|
+
apiCallbacks = {
|
18822
|
+
onSuccess : function(response, $module, xhr) {
|
18595
18823
|
module.parse.response.call(element, response, searchTerm);
|
18596
18824
|
callback();
|
18825
|
+
if(settings.apiSettings && typeof settings.apiSettings.onSuccess === 'function') {
|
18826
|
+
settings.apiSettings.onSuccess.call(this, response, $module, xhr);
|
18827
|
+
}
|
18597
18828
|
},
|
18598
|
-
onFailure : function() {
|
18829
|
+
onFailure : function(response, $module, xhr) {
|
18599
18830
|
module.displayMessage(error.serverError);
|
18600
18831
|
callback();
|
18832
|
+
if(settings.apiSettings && typeof settings.apiSettings.onFailure === 'function') {
|
18833
|
+
settings.apiSettings.onFailure.call(this, response, $module, xhr);
|
18834
|
+
}
|
18601
18835
|
},
|
18602
|
-
onAbort : function(
|
18836
|
+
onAbort : function(status, $module, xhr) {
|
18837
|
+
if(settings.apiSettings && typeof settings.apiSettings.onAbort === 'function') {
|
18838
|
+
settings.apiSettings.onAbort.call(this, status, $module, xhr);
|
18839
|
+
}
|
18603
18840
|
},
|
18604
|
-
onError : module
|
18841
|
+
onError : function(errorMessage, $module, xhr){
|
18842
|
+
module.error();
|
18843
|
+
if(settings.apiSettings && typeof settings.apiSettings.onError === 'function') {
|
18844
|
+
settings.apiSettings.onError.call(this, errorMessage, $module, xhr);
|
18845
|
+
}
|
18846
|
+
}
|
18605
18847
|
}
|
18606
18848
|
;
|
18607
|
-
$.extend(true, apiSettings, settings.apiSettings);
|
18849
|
+
$.extend(true, apiSettings, settings.apiSettings, apiCallbacks);
|
18608
18850
|
module.verbose('Setting up API request', apiSettings);
|
18609
18851
|
$module.api(apiSettings);
|
18610
18852
|
}
|
@@ -18627,7 +18869,7 @@ $.fn.search = function(parameters) {
|
|
18627
18869
|
return $results.hasClass(className.animating);
|
18628
18870
|
},
|
18629
18871
|
chrome: function() {
|
18630
|
-
return !!window.chrome &&
|
18872
|
+
return !!window.chrome && !window.StyleMedia;
|
18631
18873
|
},
|
18632
18874
|
hidden: function() {
|
18633
18875
|
return $results.hasClass(className.hidden);
|
@@ -18738,8 +18980,8 @@ $.fn.search = function(parameters) {
|
|
18738
18980
|
},
|
18739
18981
|
type: function(type) {
|
18740
18982
|
type = type || settings.type;
|
18741
|
-
if(
|
18742
|
-
$module.addClass(
|
18983
|
+
if(className[type]) {
|
18984
|
+
$module.addClass(className[type]);
|
18743
18985
|
}
|
18744
18986
|
},
|
18745
18987
|
buttonPressed: function() {
|
@@ -18886,10 +19128,10 @@ $.fn.search = function(parameters) {
|
|
18886
19128
|
;
|
18887
19129
|
if(fieldExists) {
|
18888
19130
|
var text;
|
18889
|
-
if (typeof content[field] === 'string'){
|
19131
|
+
if (typeof content[field] === 'string'){
|
18890
19132
|
text = module.remove.diacritics(content[field]);
|
18891
19133
|
} else {
|
18892
|
-
text = content[field].toString();
|
19134
|
+
text = content[field].toString();
|
18893
19135
|
}
|
18894
19136
|
if( text.search(matchRegExp) !== -1) {
|
18895
19137
|
// content starts with value (first in results)
|
@@ -19201,6 +19443,7 @@ $.fn.search = function(parameters) {
|
|
19201
19443
|
animation : settings.transition + ' in',
|
19202
19444
|
debug : settings.debug,
|
19203
19445
|
verbose : settings.verbose,
|
19446
|
+
silent : settings.silent,
|
19204
19447
|
duration : settings.duration,
|
19205
19448
|
onShow : function() {
|
19206
19449
|
var $firstResult = $module.find(selector.result).eq(0);
|
@@ -19236,6 +19479,7 @@ $.fn.search = function(parameters) {
|
|
19236
19479
|
animation : settings.transition + ' out',
|
19237
19480
|
debug : settings.debug,
|
19238
19481
|
verbose : settings.verbose,
|
19482
|
+
silent : settings.silent,
|
19239
19483
|
duration : settings.duration,
|
19240
19484
|
onComplete : function() {
|
19241
19485
|
callback();
|
@@ -19558,6 +19802,7 @@ $.fn.search.settings = {
|
|
19558
19802
|
className: {
|
19559
19803
|
animating : 'animating',
|
19560
19804
|
active : 'active',
|
19805
|
+
category : 'category',
|
19561
19806
|
empty : 'empty',
|
19562
19807
|
focus : 'focus',
|
19563
19808
|
hidden : 'hidden',
|
@@ -19788,10 +20033,16 @@ $.fn.search.settings = {
|
|
19788
20033
|
}
|
19789
20034
|
};
|
19790
20035
|
|
20036
|
+
$.extend($.easing, {
|
20037
|
+
easeOutExpo: function(x) {
|
20038
|
+
return x === 1 ? 1 : 1 - Math.pow(2, -10 * x);
|
20039
|
+
}
|
20040
|
+
});
|
20041
|
+
|
19791
20042
|
})( jQuery, window, document );
|
19792
20043
|
|
19793
20044
|
/*!
|
19794
|
-
* # Fomantic-UI 2.9.0-beta.
|
20045
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Shape
|
19795
20046
|
* http://github.com/fomantic/Fomantic-UI/
|
19796
20047
|
*
|
19797
20048
|
*
|
@@ -19918,7 +20169,7 @@ $.fn.shape = function(parameters) {
|
|
19918
20169
|
module.reset();
|
19919
20170
|
module.set.active();
|
19920
20171
|
};
|
19921
|
-
settings.
|
20172
|
+
settings.onBeforeChange.call($nextSide[0]);
|
19922
20173
|
if(module.get.transitionEvent()) {
|
19923
20174
|
module.verbose('Starting CSS animation');
|
19924
20175
|
$module
|
@@ -20605,7 +20856,7 @@ $.fn.shape.settings = {
|
|
20605
20856
|
height: 'initial',
|
20606
20857
|
|
20607
20858
|
// callback occurs on side change
|
20608
|
-
|
20859
|
+
onBeforeChange : function() {},
|
20609
20860
|
onChange : function() {},
|
20610
20861
|
|
20611
20862
|
// allow animation to same side
|
@@ -20640,7 +20891,7 @@ $.fn.shape.settings = {
|
|
20640
20891
|
})( jQuery, window, document );
|
20641
20892
|
|
20642
20893
|
/*!
|
20643
|
-
* # Fomantic-UI 2.9.0-beta.
|
20894
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Sidebar
|
20644
20895
|
* http://github.com/fomantic/Fomantic-UI/
|
20645
20896
|
*
|
20646
20897
|
*
|
@@ -20669,6 +20920,7 @@ $.fn.sidebar = function(parameters) {
|
|
20669
20920
|
$allModules = $(this),
|
20670
20921
|
$window = $(window),
|
20671
20922
|
$document = $(document),
|
20923
|
+
$body = $('body'),
|
20672
20924
|
$html = $('html'),
|
20673
20925
|
$head = $('head'),
|
20674
20926
|
|
@@ -20707,7 +20959,8 @@ $.fn.sidebar = function(parameters) {
|
|
20707
20959
|
moduleNamespace = 'module-' + namespace,
|
20708
20960
|
|
20709
20961
|
$module = $(this),
|
20710
|
-
$context = $(settings.context),
|
20962
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $body,
|
20963
|
+
isBody = $context[0] === $body[0],
|
20711
20964
|
|
20712
20965
|
$sidebars = $module.children(selector.sidebar),
|
20713
20966
|
$fixed = $context.children(selector.fixed),
|
@@ -20721,6 +20974,9 @@ $.fn.sidebar = function(parameters) {
|
|
20721
20974
|
id,
|
20722
20975
|
currentScroll,
|
20723
20976
|
transitionEvent,
|
20977
|
+
initialBodyMargin = '',
|
20978
|
+
tempBodyMargin = '',
|
20979
|
+
hadScrollbar = false,
|
20724
20980
|
|
20725
20981
|
module
|
20726
20982
|
;
|
@@ -20759,7 +21015,7 @@ $.fn.sidebar = function(parameters) {
|
|
20759
21015
|
|
20760
21016
|
create: {
|
20761
21017
|
id: function() {
|
20762
|
-
id = (Math.random().toString(16) + '000000000').
|
21018
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
20763
21019
|
elementNamespace = '.' + id;
|
20764
21020
|
module.verbose('Creating unique id for element', id);
|
20765
21021
|
}
|
@@ -20826,9 +21082,12 @@ $.fn.sidebar = function(parameters) {
|
|
20826
21082
|
scrollLock: function() {
|
20827
21083
|
if(settings.scrollLock) {
|
20828
21084
|
module.debug('Disabling page scroll');
|
20829
|
-
|
20830
|
-
|
20831
|
-
|
21085
|
+
hadScrollbar = module.has.scrollbar();
|
21086
|
+
if(hadScrollbar) {
|
21087
|
+
module.save.bodyMargin();
|
21088
|
+
module.set.bodyMargin();
|
21089
|
+
}
|
21090
|
+
$context.addClass(className.locked);
|
20832
21091
|
}
|
20833
21092
|
module.verbose('Adding events to contain sidebar scroll');
|
20834
21093
|
$document
|
@@ -20846,8 +21105,11 @@ $.fn.sidebar = function(parameters) {
|
|
20846
21105
|
},
|
20847
21106
|
scrollLock: function() {
|
20848
21107
|
module.verbose('Removing scroll lock from page');
|
21108
|
+
if(hadScrollbar) {
|
21109
|
+
module.restore.bodyMargin();
|
21110
|
+
}
|
21111
|
+
$context.removeClass(className.locked);
|
20849
21112
|
$document.off(elementNamespace);
|
20850
|
-
$window.off(elementNamespace);
|
20851
21113
|
$module.off('scroll' + eventNamespace);
|
20852
21114
|
}
|
20853
21115
|
},
|
@@ -20902,7 +21164,7 @@ $.fn.sidebar = function(parameters) {
|
|
20902
21164
|
if(direction === 'left' || direction === 'right') {
|
20903
21165
|
module.debug('Adding CSS rules for animation distance', width);
|
20904
21166
|
style += ''
|
20905
|
-
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher
|
21167
|
+
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher::after {'
|
20906
21168
|
+ ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
20907
21169
|
+ ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
20908
21170
|
+ ' }'
|
@@ -20910,7 +21172,7 @@ $.fn.sidebar = function(parameters) {
|
|
20910
21172
|
}
|
20911
21173
|
else if(direction === 'top' || direction == 'bottom') {
|
20912
21174
|
style += ''
|
20913
|
-
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher
|
21175
|
+
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher::after {'
|
20914
21176
|
+ ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
20915
21177
|
+ ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
20916
21178
|
+ ' }'
|
@@ -20918,8 +21180,8 @@ $.fn.sidebar = function(parameters) {
|
|
20918
21180
|
}
|
20919
21181
|
/* opposite sides visible forces content overlay */
|
20920
21182
|
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
|
21183
|
+
+ ' body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher::after,'
|
21184
|
+
+ ' body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher::after {'
|
20923
21185
|
+ ' -webkit-transform: translate3d(0, 0, 0);'
|
20924
21186
|
+ ' transform: translate3d(0, 0, 0);'
|
20925
21187
|
+ ' }'
|
@@ -20935,7 +21197,7 @@ $.fn.sidebar = function(parameters) {
|
|
20935
21197
|
|
20936
21198
|
refresh: function() {
|
20937
21199
|
module.verbose('Refreshing selector cache');
|
20938
|
-
$context = $(settings.context);
|
21200
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
|
20939
21201
|
$sidebars = $context.children(selector.sidebar);
|
20940
21202
|
$pusher = $context.children(selector.pusher);
|
20941
21203
|
$fixed = $context.children(selector.fixed);
|
@@ -21005,13 +21267,32 @@ $.fn.sidebar = function(parameters) {
|
|
21005
21267
|
module.error(error.notFound, selector);
|
21006
21268
|
}
|
21007
21269
|
},
|
21008
|
-
|
21270
|
+
can: {
|
21271
|
+
leftBodyScrollbar: function () {
|
21272
|
+
if (module.cache.leftBodyScrollbar === undefined) {
|
21273
|
+
module.cache.leftBodyScrollbar = module.is.rtl() && ((module.is.iframe && !module.is.firefox()) || module.is.safari() || module.is.edge() || module.is.ie());
|
21274
|
+
}
|
21275
|
+
return module.cache.leftBodyScrollbar;
|
21276
|
+
}
|
21277
|
+
},
|
21278
|
+
save: {
|
21279
|
+
bodyMargin: function() {
|
21280
|
+
initialBodyMargin = $context.css((isBody ? 'margin-':'padding-')+(module.can.leftBodyScrollbar() ? 'left':'right'));
|
21281
|
+
var bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, '')),
|
21282
|
+
bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
|
21283
|
+
tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
|
21284
|
+
}
|
21285
|
+
},
|
21009
21286
|
show: function(callback) {
|
21010
21287
|
callback = $.isFunction(callback)
|
21011
21288
|
? callback
|
21012
21289
|
: function(){}
|
21013
21290
|
;
|
21014
21291
|
if(module.is.hidden()) {
|
21292
|
+
if(settings.onShow.call(element) === false) {
|
21293
|
+
module.verbose('Show callback returned false cancelling show');
|
21294
|
+
return;
|
21295
|
+
}
|
21015
21296
|
module.refreshSidebars();
|
21016
21297
|
if(settings.overlay) {
|
21017
21298
|
module.error(error.overlay);
|
@@ -21036,10 +21317,9 @@ $.fn.sidebar = function(parameters) {
|
|
21036
21317
|
}
|
21037
21318
|
module.pushPage(function() {
|
21038
21319
|
callback.call(element);
|
21039
|
-
settings.
|
21320
|
+
settings.onVisible.call(element);
|
21040
21321
|
});
|
21041
21322
|
settings.onChange.call(element);
|
21042
|
-
settings.onVisible.call(element);
|
21043
21323
|
}
|
21044
21324
|
else {
|
21045
21325
|
module.debug('Sidebar is already visible');
|
@@ -21051,7 +21331,7 @@ $.fn.sidebar = function(parameters) {
|
|
21051
21331
|
? callback
|
21052
21332
|
: function(){}
|
21053
21333
|
;
|
21054
|
-
if(module.is.visible() || module.is.animating()) {
|
21334
|
+
if((module.is.visible() || module.is.animating()) && settings.onHide.call(element) !== false) {
|
21055
21335
|
module.debug('Hiding sidebar', callback);
|
21056
21336
|
module.refreshSidebars();
|
21057
21337
|
module.pullPage(function() {
|
@@ -21059,7 +21339,6 @@ $.fn.sidebar = function(parameters) {
|
|
21059
21339
|
settings.onHidden.call(element);
|
21060
21340
|
});
|
21061
21341
|
settings.onChange.call(element);
|
21062
|
-
settings.onHide.call(element);
|
21063
21342
|
}
|
21064
21343
|
},
|
21065
21344
|
|
@@ -21114,9 +21393,13 @@ $.fn.sidebar = function(parameters) {
|
|
21114
21393
|
? callback
|
21115
21394
|
: function(){}
|
21116
21395
|
;
|
21117
|
-
if(settings.
|
21396
|
+
if(settings.returnScroll) {
|
21397
|
+
currentScroll = (isBody ? $window : $context).scrollTop();
|
21398
|
+
}
|
21399
|
+
if(settings.transition === 'scale down') {
|
21118
21400
|
module.scrollToTop();
|
21119
21401
|
}
|
21402
|
+
module.bind.scrollLock();
|
21120
21403
|
module.set.transition(transition);
|
21121
21404
|
module.repaint();
|
21122
21405
|
animate = function() {
|
@@ -21132,7 +21415,6 @@ $.fn.sidebar = function(parameters) {
|
|
21132
21415
|
if( event.target == $transition[0] ) {
|
21133
21416
|
$transition.off(transitionEvent + elementNamespace, transitionEnd);
|
21134
21417
|
module.remove.animating();
|
21135
|
-
module.bind.scrollLock();
|
21136
21418
|
callback.call(element);
|
21137
21419
|
}
|
21138
21420
|
};
|
@@ -21176,7 +21458,7 @@ $.fn.sidebar = function(parameters) {
|
|
21176
21458
|
module.remove.animating();
|
21177
21459
|
module.remove.transition();
|
21178
21460
|
module.remove.inlineCSS();
|
21179
|
-
if(transition
|
21461
|
+
if(transition === 'scale down' || settings.returnScroll) {
|
21180
21462
|
module.scrollBack();
|
21181
21463
|
}
|
21182
21464
|
callback.call(element);
|
@@ -21189,14 +21471,13 @@ $.fn.sidebar = function(parameters) {
|
|
21189
21471
|
|
21190
21472
|
scrollToTop: function() {
|
21191
21473
|
module.verbose('Scrolling to top of page to avoid animation issues');
|
21192
|
-
currentScroll = $(window).scrollTop();
|
21193
21474
|
$module.scrollTop(0);
|
21194
|
-
window.scrollTo(0, 0);
|
21475
|
+
(isBody ? $window : $context)[0].scrollTo(0, 0);
|
21195
21476
|
},
|
21196
21477
|
|
21197
21478
|
scrollBack: function() {
|
21198
21479
|
module.verbose('Scrolling back to original page position');
|
21199
|
-
window.scrollTo(0, currentScroll);
|
21480
|
+
(isBody ? $window : $context)[0].scrollTo(0, currentScroll);
|
21200
21481
|
},
|
21201
21482
|
|
21202
21483
|
clear: {
|
@@ -21207,7 +21488,16 @@ $.fn.sidebar = function(parameters) {
|
|
21207
21488
|
},
|
21208
21489
|
|
21209
21490
|
set: {
|
21210
|
-
|
21491
|
+
bodyMargin: function() {
|
21492
|
+
var position = module.can.leftBodyScrollbar() ? 'left':'right';
|
21493
|
+
$context.css((isBody ? 'margin-':'padding-')+position, tempBodyMargin + 'px');
|
21494
|
+
$context.find(selector.bodyFixed.replace('right',position)).each(function(){
|
21495
|
+
var el = $(this),
|
21496
|
+
attribute = el.css('position') === 'fixed' ? 'padding-'+position : position
|
21497
|
+
;
|
21498
|
+
el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
|
21499
|
+
});
|
21500
|
+
},
|
21211
21501
|
// ios only (scroll on html not document). This prevent auto-resize canvas/scroll in ios
|
21212
21502
|
// (This is no longer necessary in latest iOS)
|
21213
21503
|
ios: function() {
|
@@ -21293,7 +21583,18 @@ $.fn.sidebar = function(parameters) {
|
|
21293
21583
|
$module.removeClass(className.overlay);
|
21294
21584
|
}
|
21295
21585
|
},
|
21296
|
-
|
21586
|
+
restore: {
|
21587
|
+
bodyMargin: function() {
|
21588
|
+
var position = module.can.leftBodyScrollbar() ? 'left':'right';
|
21589
|
+
$context.css((isBody ? 'margin-':'padding-')+position, initialBodyMargin);
|
21590
|
+
$context.find(selector.bodyFixed.replace('right',position)).each(function(){
|
21591
|
+
var el = $(this),
|
21592
|
+
attribute = el.css('position') === 'fixed' ? 'padding-'+position : position
|
21593
|
+
;
|
21594
|
+
el.css(attribute, '');
|
21595
|
+
});
|
21596
|
+
}
|
21597
|
+
},
|
21297
21598
|
get: {
|
21298
21599
|
direction: function() {
|
21299
21600
|
if($module.hasClass(className.top)) {
|
@@ -21341,15 +21642,42 @@ $.fn.sidebar = function(parameters) {
|
|
21341
21642
|
}
|
21342
21643
|
}
|
21343
21644
|
},
|
21344
|
-
|
21645
|
+
has: {
|
21646
|
+
scrollbar: function() {
|
21647
|
+
return isBody || $context.css('overflow-y') !== 'hidden';
|
21648
|
+
}
|
21649
|
+
},
|
21345
21650
|
is: {
|
21346
|
-
|
21651
|
+
safari: function() {
|
21652
|
+
if(module.cache.isSafari === undefined) {
|
21653
|
+
module.cache.isSafari = /constructor/i.test(window.HTMLElement) || !!window.ApplePaySession;
|
21654
|
+
}
|
21655
|
+
return module.cache.isSafari;
|
21656
|
+
},
|
21657
|
+
edge: function(){
|
21658
|
+
if(module.cache.isEdge === undefined) {
|
21659
|
+
module.cache.isEdge = !!window.setImmediate && !module.is.ie();
|
21660
|
+
}
|
21661
|
+
return module.cache.isEdge;
|
21662
|
+
},
|
21663
|
+
firefox: function(){
|
21664
|
+
if(module.cache.isFirefox === undefined) {
|
21665
|
+
module.cache.isFirefox = !!window.InstallTrigger;
|
21666
|
+
}
|
21667
|
+
return module.cache.isFirefox;
|
21668
|
+
},
|
21669
|
+
iframe: function() {
|
21670
|
+
return !(self === top);
|
21671
|
+
},
|
21347
21672
|
ie: function() {
|
21348
|
-
|
21349
|
-
|
21350
|
-
|
21351
|
-
|
21352
|
-
|
21673
|
+
if(module.cache.isIE === undefined) {
|
21674
|
+
var
|
21675
|
+
isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window),
|
21676
|
+
isIE = ('ActiveXObject' in window)
|
21677
|
+
;
|
21678
|
+
module.cache.isIE = (isIE11 || isIE);
|
21679
|
+
}
|
21680
|
+
return module.cache.isIE;
|
21353
21681
|
},
|
21354
21682
|
|
21355
21683
|
ios: function() {
|
@@ -21399,12 +21727,12 @@ $.fn.sidebar = function(parameters) {
|
|
21399
21727
|
animating: function() {
|
21400
21728
|
return $context.hasClass(className.animating);
|
21401
21729
|
},
|
21402
|
-
rtl: function
|
21403
|
-
if(module.cache.
|
21404
|
-
module.cache.
|
21730
|
+
rtl: function() {
|
21731
|
+
if(module.cache.isRTL === undefined) {
|
21732
|
+
module.cache.isRTL = $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl' || $body.attr('dir') === 'rtl' || $body.css('direction') === 'rtl' || $context.attr('dir') === 'rtl' || $context.css('direction') === 'rtl';
|
21405
21733
|
}
|
21406
|
-
return module.cache.
|
21407
|
-
}
|
21734
|
+
return module.cache.isRTL;
|
21735
|
+
},
|
21408
21736
|
},
|
21409
21737
|
|
21410
21738
|
setting: function(name, value) {
|
@@ -21641,6 +21969,7 @@ $.fn.sidebar.settings = {
|
|
21641
21969
|
animating : 'animating',
|
21642
21970
|
dimmed : 'dimmed',
|
21643
21971
|
ios : 'ios',
|
21972
|
+
locked : 'locked',
|
21644
21973
|
pushable : 'pushable',
|
21645
21974
|
pushed : 'pushed',
|
21646
21975
|
right : 'right',
|
@@ -21651,6 +21980,7 @@ $.fn.sidebar.settings = {
|
|
21651
21980
|
},
|
21652
21981
|
|
21653
21982
|
selector: {
|
21983
|
+
bodyFixed: '> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close',
|
21654
21984
|
fixed : '.fixed',
|
21655
21985
|
omitted : 'script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed',
|
21656
21986
|
pusher : '.pusher',
|
@@ -21677,7 +22007,7 @@ $.fn.sidebar.settings = {
|
|
21677
22007
|
})( jQuery, window, document );
|
21678
22008
|
|
21679
22009
|
/*!
|
21680
|
-
* # Fomantic-UI 2.9.0-beta.
|
22010
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Sticky
|
21681
22011
|
* http://github.com/fomantic/Fomantic-UI/
|
21682
22012
|
*
|
21683
22013
|
*
|
@@ -21731,7 +22061,7 @@ $.fn.sticky = function(parameters) {
|
|
21731
22061
|
|
21732
22062
|
$module = $(this),
|
21733
22063
|
$window = $(window),
|
21734
|
-
$scroll = $(settings.scrollContext),
|
22064
|
+
$scroll = [window,document].indexOf(settings.scrollContext) < 0 ? $(document).find(settings.scrollContext) : $(settings.scrollContext),
|
21735
22065
|
$container,
|
21736
22066
|
$context,
|
21737
22067
|
|
@@ -21817,7 +22147,7 @@ $.fn.sticky = function(parameters) {
|
|
21817
22147
|
|
21818
22148
|
determineContainer: function() {
|
21819
22149
|
if(settings.container) {
|
21820
|
-
$container = $(settings.container);
|
22150
|
+
$container = [window,document].indexOf(settings.container) < 0 ? $(document).find(settings.container) : $(settings.container);
|
21821
22151
|
}
|
21822
22152
|
else {
|
21823
22153
|
$container = $module.offsetParent();
|
@@ -21826,7 +22156,7 @@ $.fn.sticky = function(parameters) {
|
|
21826
22156
|
|
21827
22157
|
determineContext: function() {
|
21828
22158
|
if(settings.context) {
|
21829
|
-
$context = $(settings.context);
|
22159
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
|
21830
22160
|
}
|
21831
22161
|
else {
|
21832
22162
|
$context = $container;
|
@@ -22071,9 +22401,9 @@ $.fn.sticky = function(parameters) {
|
|
22071
22401
|
},
|
22072
22402
|
containerSize: function() {
|
22073
22403
|
var
|
22074
|
-
tagName = $container
|
22404
|
+
tagName = $container[0].tagName
|
22075
22405
|
;
|
22076
|
-
if(tagName === 'HTML' || tagName
|
22406
|
+
if(tagName === 'HTML' || tagName === 'body') {
|
22077
22407
|
// this can trigger for too many reasons
|
22078
22408
|
//module.error(error.container, tagName, $module);
|
22079
22409
|
module.determineContainer();
|
@@ -22635,7 +22965,7 @@ $.fn.sticky.settings = {
|
|
22635
22965
|
})( jQuery, window, document );
|
22636
22966
|
|
22637
22967
|
/*!
|
22638
|
-
* # Fomantic-UI 2.9.0-beta.
|
22968
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Tab
|
22639
22969
|
* http://github.com/fomantic/Fomantic-UI/
|
22640
22970
|
*
|
22641
22971
|
*
|
@@ -22736,10 +23066,18 @@ $.fn.tab = function(parameters) {
|
|
22736
23066
|
initializedHistory = true;
|
22737
23067
|
}
|
22738
23068
|
|
22739
|
-
|
22740
|
-
|
22741
|
-
|
22742
|
-
|
23069
|
+
var activeTab = module.determine.activeTab();
|
23070
|
+
if(settings.autoTabActivation && instance === undefined && activeTab == null) {
|
23071
|
+
activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
|
23072
|
+
module.debug('No active tab detected, setting tab active', activeTab);
|
23073
|
+
module.changeTab(activeTab);
|
23074
|
+
}
|
23075
|
+
if(activeTab != null && settings.history) {
|
23076
|
+
var autoUpdate = $.address.autoUpdate();
|
23077
|
+
$.address.autoUpdate(false);
|
23078
|
+
$.address.value(activeTab);
|
23079
|
+
$.address.autoUpdate(autoUpdate);
|
23080
|
+
}
|
22743
23081
|
|
22744
23082
|
module.instantiate();
|
22745
23083
|
},
|
@@ -22790,7 +23128,7 @@ $.fn.tab = function(parameters) {
|
|
22790
23128
|
module.verbose('Determined parent element for creating context', $context);
|
22791
23129
|
}
|
22792
23130
|
else if(settings.context) {
|
22793
|
-
$context = $(settings.context);
|
23131
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
|
22794
23132
|
module.verbose('Using selector for tab context', settings.context, $context);
|
22795
23133
|
}
|
22796
23134
|
else {
|
@@ -22839,6 +23177,7 @@ $.fn.tab = function(parameters) {
|
|
22839
23177
|
.history(true)
|
22840
23178
|
.state(settings.path)
|
22841
23179
|
;
|
23180
|
+
$(window).trigger('popstate');
|
22842
23181
|
}
|
22843
23182
|
else {
|
22844
23183
|
module.error(error.path);
|
@@ -23006,6 +23345,10 @@ $.fn.tab = function(parameters) {
|
|
23006
23345
|
module.verbose('Tab parameters found', nextPathArray);
|
23007
23346
|
}
|
23008
23347
|
}
|
23348
|
+
if (settings.onBeforeChange.call(element, currentPath) === false) {
|
23349
|
+
module.debug('onBeforeChange returned false, cancelling tab change', $tab);
|
23350
|
+
return false;
|
23351
|
+
}
|
23009
23352
|
if(isLastTab && remoteContent) {
|
23010
23353
|
if(!shouldIgnoreLoad) {
|
23011
23354
|
module.activate.navigation(currentPath);
|
@@ -23042,6 +23385,10 @@ $.fn.tab = function(parameters) {
|
|
23042
23385
|
// if anchor exists use parent tab
|
23043
23386
|
if($anchor && $anchor.length > 0 && currentPath) {
|
23044
23387
|
module.debug('Anchor link used, opening parent tab', $tab, $anchor);
|
23388
|
+
if (settings.onBeforeChange.call(element, currentPath) === false) {
|
23389
|
+
module.debug('onBeforeChange returned false, cancelling tab change', $tab);
|
23390
|
+
return false;
|
23391
|
+
}
|
23045
23392
|
if( !$tab.hasClass(className.active) ) {
|
23046
23393
|
setTimeout(function() {
|
23047
23394
|
module.scrollTo($anchor);
|
@@ -23595,6 +23942,7 @@ $.fn.tab.settings = {
|
|
23595
23942
|
onLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
|
23596
23943
|
onVisible : function(tabPath, parameterArray, historyEvent) {}, // called every time tab visible
|
23597
23944
|
onRequest : function(tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content
|
23945
|
+
onBeforeChange: function(tabPath) {}, // called before a tab is about to be changed. Returning false will cancel the tab change
|
23598
23946
|
|
23599
23947
|
templates : {
|
23600
23948
|
determineTitle: function(tabArray) {} // returns page title for path
|
@@ -23637,7 +23985,7 @@ $.fn.tab.settings = {
|
|
23637
23985
|
})( jQuery, window, document );
|
23638
23986
|
|
23639
23987
|
/*!
|
23640
|
-
* # Fomantic-UI 2.9.0-beta.
|
23988
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Toast
|
23641
23989
|
* http://github.com/fomantic/Fomantic-UI/
|
23642
23990
|
*
|
23643
23991
|
*
|
@@ -23661,7 +24009,7 @@ window = (typeof window != 'undefined' && window.Math == Math)
|
|
23661
24009
|
: Function('return this')()
|
23662
24010
|
;
|
23663
24011
|
|
23664
|
-
$.fn.toast = function(parameters) {
|
24012
|
+
$.toast = $.fn.toast = function(parameters) {
|
23665
24013
|
var
|
23666
24014
|
$allModules = $(this),
|
23667
24015
|
moduleSelector = $allModules.selector || '',
|
@@ -23699,7 +24047,7 @@ $.fn.toast = function(parameters) {
|
|
23699
24047
|
$animationObject,
|
23700
24048
|
$close,
|
23701
24049
|
$context = (settings.context)
|
23702
|
-
? $(settings.context)
|
24050
|
+
? ([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
23703
24051
|
: $('body'),
|
23704
24052
|
|
23705
24053
|
isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card'),
|
@@ -23707,12 +24055,14 @@ $.fn.toast = function(parameters) {
|
|
23707
24055
|
element = this,
|
23708
24056
|
instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
|
23709
24057
|
|
24058
|
+
id,
|
23710
24059
|
module
|
23711
24060
|
;
|
23712
24061
|
module = {
|
23713
24062
|
|
23714
24063
|
initialize: function() {
|
23715
24064
|
module.verbose('Initializing element');
|
24065
|
+
module.create.id();
|
23716
24066
|
if (!module.has.container()) {
|
23717
24067
|
module.create.container();
|
23718
24068
|
}
|
@@ -23762,17 +24112,22 @@ $.fn.toast = function(parameters) {
|
|
23762
24112
|
},
|
23763
24113
|
|
23764
24114
|
show: function(callback) {
|
23765
|
-
callback = callback || function(){};
|
23766
|
-
module.debug('Showing toast');
|
23767
24115
|
if(settings.onShow.call($toastBox, element) === false) {
|
23768
24116
|
module.debug('onShow callback returned false, cancelling toast animation');
|
23769
24117
|
return;
|
23770
24118
|
}
|
24119
|
+
callback = callback || function(){};
|
24120
|
+
module.debug('Showing toast');
|
23771
24121
|
module.animate.show(callback);
|
23772
24122
|
},
|
23773
24123
|
|
23774
24124
|
close: function(callback) {
|
24125
|
+
if(settings.onHide.call($toastBox, element) === false) {
|
24126
|
+
module.debug('onHide callback returned false, cancelling toast animation');
|
24127
|
+
return;
|
24128
|
+
}
|
23775
24129
|
callback = callback || function(){};
|
24130
|
+
module.debug('Closing toast');
|
23776
24131
|
module.remove.visible();
|
23777
24132
|
module.unbind.events();
|
23778
24133
|
module.animate.close(callback);
|
@@ -23782,14 +24137,18 @@ $.fn.toast = function(parameters) {
|
|
23782
24137
|
create: {
|
23783
24138
|
container: function() {
|
23784
24139
|
module.verbose('Creating container');
|
23785
|
-
$context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '')}));
|
24140
|
+
$context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '') + ' ' + (settings.context && settings.context !== 'body' ? className.absolute : '')}));
|
24141
|
+
},
|
24142
|
+
id: function() {
|
24143
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
24144
|
+
module.verbose('Creating unique id for element', id);
|
23786
24145
|
},
|
23787
24146
|
toast: function() {
|
23788
24147
|
$toastBox = $('<div/>', {class: className.box});
|
23789
24148
|
var iconClass = module.get.iconClass();
|
23790
24149
|
if (!isToastComponent) {
|
23791
24150
|
module.verbose('Creating toast');
|
23792
|
-
$toast = $('<div/>');
|
24151
|
+
$toast = $('<div/>', {role: 'alert'});
|
23793
24152
|
var $content = $('<div/>', {class: className.content});
|
23794
24153
|
if (iconClass !== '') {
|
23795
24154
|
$toast.append($('<i/>', {class: iconClass + ' ' + className.icon}));
|
@@ -23802,13 +24161,21 @@ $.fn.toast = function(parameters) {
|
|
23802
24161
|
}));
|
23803
24162
|
}
|
23804
24163
|
if (settings.title !== '') {
|
24164
|
+
var titleId = '_' + module.get.id() + 'title';
|
24165
|
+
$toast.attr('aria-labelledby', titleId);
|
23805
24166
|
$content.append($('<div/>', {
|
23806
24167
|
class: className.title,
|
23807
|
-
|
24168
|
+
id: titleId,
|
24169
|
+
html: module.helpers.escape(settings.title, settings.preserveHTML)
|
23808
24170
|
}));
|
23809
24171
|
}
|
23810
|
-
|
23811
|
-
$
|
24172
|
+
var descId = '_' + module.get.id() + 'desc';
|
24173
|
+
$toast.attr('aria-describedby', descId);
|
24174
|
+
$content.append($('<div/>', {
|
24175
|
+
class: className.message,
|
24176
|
+
id: descId,
|
24177
|
+
html: module.helpers.escape(settings.message, settings.preserveHTML)
|
24178
|
+
}));
|
23812
24179
|
|
23813
24180
|
$toast
|
23814
24181
|
.addClass(settings.class + ' ' + className.toast)
|
@@ -23816,7 +24183,7 @@ $.fn.toast = function(parameters) {
|
|
23816
24183
|
;
|
23817
24184
|
$toast.css('opacity', settings.opacity);
|
23818
24185
|
if (settings.closeIcon) {
|
23819
|
-
$close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : '')});
|
24186
|
+
$close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''), role: 'button', tabindex: 0, 'aria-label': settings.text.close});
|
23820
24187
|
if($close.hasClass(className.left)) {
|
23821
24188
|
$toast.prepend($close);
|
23822
24189
|
} else {
|
@@ -23859,15 +24226,17 @@ $.fn.toast = function(parameters) {
|
|
23859
24226
|
}
|
23860
24227
|
}
|
23861
24228
|
settings.actions.forEach(function (el) {
|
23862
|
-
var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
24229
|
+
var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
23863
24230
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
23864
24231
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
23865
24232
|
click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
|
23866
24233
|
$actions.append($('<button/>', {
|
23867
24234
|
html: icon + text,
|
24235
|
+
'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
|
23868
24236
|
class: className.button + ' ' + cls,
|
23869
24237
|
click: function () {
|
23870
|
-
|
24238
|
+
var button = $(this);
|
24239
|
+
if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
|
23871
24240
|
return;
|
23872
24241
|
}
|
23873
24242
|
module.close();
|
@@ -23967,13 +24336,12 @@ $.fn.toast = function(parameters) {
|
|
23967
24336
|
bind: {
|
23968
24337
|
events: function() {
|
23969
24338
|
module.debug('Binding events to toast');
|
23970
|
-
if(settings.
|
23971
|
-
(
|
23972
|
-
.on('click' + eventNamespace, module.event.click)
|
23973
|
-
;
|
24339
|
+
if(settings.closeIcon) {
|
24340
|
+
$close.on('click' + eventNamespace, module.event.close);
|
23974
24341
|
}
|
24342
|
+
$toast.on('click' + eventNamespace, module.event.click);
|
23975
24343
|
if($animationObject) {
|
23976
|
-
$animationObject.on('animationend' + eventNamespace, module.close);
|
24344
|
+
$animationObject.on('animationend' + eventNamespace, module.event.close);
|
23977
24345
|
}
|
23978
24346
|
$toastBox
|
23979
24347
|
.on('click' + eventNamespace, selector.approve, module.event.approve)
|
@@ -23985,11 +24353,10 @@ $.fn.toast = function(parameters) {
|
|
23985
24353
|
unbind: {
|
23986
24354
|
events: function() {
|
23987
24355
|
module.debug('Unbinding events to toast');
|
23988
|
-
if(settings.
|
23989
|
-
|
23990
|
-
.off('click' + eventNamespace)
|
23991
|
-
;
|
24356
|
+
if(settings.closeIcon) {
|
24357
|
+
$close.off('click' + eventNamespace);
|
23992
24358
|
}
|
24359
|
+
$toast.off('click' + eventNamespace);
|
23993
24360
|
if($animationObject) {
|
23994
24361
|
$animationObject.off('animationend' + eventNamespace);
|
23995
24362
|
}
|
@@ -24010,6 +24377,7 @@ $.fn.toast = function(parameters) {
|
|
24010
24377
|
queue : false,
|
24011
24378
|
debug : settings.debug,
|
24012
24379
|
verbose : settings.verbose,
|
24380
|
+
silent : settings.silent,
|
24013
24381
|
duration : settings.transition.showDuration,
|
24014
24382
|
onComplete : function() {
|
24015
24383
|
callback.call($toastBox, element);
|
@@ -24021,11 +24389,6 @@ $.fn.toast = function(parameters) {
|
|
24021
24389
|
},
|
24022
24390
|
close: function(callback) {
|
24023
24391
|
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
24392
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
24030
24393
|
$toastBox
|
24031
24394
|
.transition({
|
@@ -24034,6 +24397,7 @@ $.fn.toast = function(parameters) {
|
|
24034
24397
|
duration : settings.transition.hideDuration,
|
24035
24398
|
debug : settings.debug,
|
24036
24399
|
verbose : settings.verbose,
|
24400
|
+
silent : settings.silent,
|
24037
24401
|
interval : 50,
|
24038
24402
|
|
24039
24403
|
onBeforeHide: function(callback){
|
@@ -24081,7 +24445,7 @@ $.fn.toast = function(parameters) {
|
|
24081
24445
|
has: {
|
24082
24446
|
container: function() {
|
24083
24447
|
module.verbose('Determining if there is already a container');
|
24084
|
-
return
|
24448
|
+
return module.get.containers().length > 0;
|
24085
24449
|
},
|
24086
24450
|
toast: function(){
|
24087
24451
|
return !!module.get.toast();
|
@@ -24095,8 +24459,14 @@ $.fn.toast = function(parameters) {
|
|
24095
24459
|
},
|
24096
24460
|
|
24097
24461
|
get: {
|
24462
|
+
id: function() {
|
24463
|
+
return id;
|
24464
|
+
},
|
24465
|
+
containers: function() {
|
24466
|
+
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)+')'));
|
24467
|
+
},
|
24098
24468
|
container: function() {
|
24099
|
-
return
|
24469
|
+
return module.get.containers()[0];
|
24100
24470
|
},
|
24101
24471
|
toastBox: function() {
|
24102
24472
|
return $toastBox || null;
|
@@ -24128,9 +24498,15 @@ $.fn.toast = function(parameters) {
|
|
24128
24498
|
},
|
24129
24499
|
|
24130
24500
|
event: {
|
24501
|
+
close: function(){
|
24502
|
+
module.close();
|
24503
|
+
},
|
24131
24504
|
click: function(event) {
|
24132
|
-
if($(event.target).closest(
|
24133
|
-
settings.onClick.call($toastBox, element)
|
24505
|
+
if($(event.target).closest(selector.clickable).length === 0) {
|
24506
|
+
if(settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
|
24507
|
+
module.verbose('Click callback returned false or close denied by setting cancelling close');
|
24508
|
+
return;
|
24509
|
+
}
|
24134
24510
|
module.close();
|
24135
24511
|
}
|
24136
24512
|
},
|
@@ -24153,7 +24529,7 @@ $.fn.toast = function(parameters) {
|
|
24153
24529
|
helpers: {
|
24154
24530
|
toClass: function(selector) {
|
24155
24531
|
var
|
24156
|
-
classes = selector.split(
|
24532
|
+
classes = selector.trim().split(/\s+/),
|
24157
24533
|
result = ''
|
24158
24534
|
;
|
24159
24535
|
|
@@ -24443,6 +24819,7 @@ $.fn.toast.settings = {
|
|
24443
24819
|
|
24444
24820
|
className : {
|
24445
24821
|
container : 'ui toast-container',
|
24822
|
+
absolute : 'absolute',
|
24446
24823
|
box : 'floating toast-box',
|
24447
24824
|
progress : 'ui attached active progress',
|
24448
24825
|
toast : 'ui toast',
|
@@ -24471,6 +24848,10 @@ $.fn.toast.settings = {
|
|
24471
24848
|
unclickable : 'unclickable'
|
24472
24849
|
},
|
24473
24850
|
|
24851
|
+
text: {
|
24852
|
+
close : 'Close'
|
24853
|
+
},
|
24854
|
+
|
24474
24855
|
icons : {
|
24475
24856
|
info : 'info',
|
24476
24857
|
success : 'checkmark',
|
@@ -24487,6 +24868,7 @@ $.fn.toast.settings = {
|
|
24487
24868
|
image : '> img.image, > .image > img',
|
24488
24869
|
icon : '> i.icon',
|
24489
24870
|
input : 'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',
|
24871
|
+
clickable : 'a, details, .ui.accordion',
|
24490
24872
|
approve : '.actions .positive, .actions .approve, .actions .ok',
|
24491
24873
|
deny : '.actions .negative, .actions .deny, .actions .cancel'
|
24492
24874
|
},
|
@@ -24530,7 +24912,7 @@ $.extend( $.easing, {
|
|
24530
24912
|
})( jQuery, window, document );
|
24531
24913
|
|
24532
24914
|
/*!
|
24533
|
-
* # Fomantic-UI 2.9.0-beta.
|
24915
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Transition
|
24534
24916
|
* http://github.com/fomantic/Fomantic-UI/
|
24535
24917
|
*
|
24536
24918
|
*
|
@@ -25229,11 +25611,13 @@ $.fn.transition = function() {
|
|
25229
25611
|
.addClass(className.transition)
|
25230
25612
|
.css('animationName')
|
25231
25613
|
;
|
25614
|
+
$clone.detach().insertAfter($module);
|
25232
25615
|
inAnimation = $clone
|
25233
25616
|
.addClass(className.inward)
|
25234
25617
|
.css('animationName')
|
25235
25618
|
;
|
25236
25619
|
if(!displayType) {
|
25620
|
+
$clone.detach().insertAfter($module);
|
25237
25621
|
displayType = $clone
|
25238
25622
|
.attr('class', elementClass)
|
25239
25623
|
.removeAttr('style')
|
@@ -25302,6 +25686,10 @@ $.fn.transition = function() {
|
|
25302
25686
|
},
|
25303
25687
|
|
25304
25688
|
hide: function() {
|
25689
|
+
if(settings.onHide.call(element) === false) {
|
25690
|
+
module.verbose('Hide callback returned false cancelling hide');
|
25691
|
+
return false;
|
25692
|
+
}
|
25305
25693
|
module.verbose('Hiding element');
|
25306
25694
|
if( module.is.animating() ) {
|
25307
25695
|
module.reset();
|
@@ -25309,35 +25697,32 @@ $.fn.transition = function() {
|
|
25309
25697
|
element.blur(); // IE will trigger focus change if element is not blurred before hiding
|
25310
25698
|
module.remove.display();
|
25311
25699
|
module.remove.visible();
|
25312
|
-
|
25313
|
-
settings.onBeforeHide.call(element,function(){
|
25314
|
-
module.hideNow();
|
25315
|
-
});
|
25316
|
-
} else {
|
25317
|
-
module.hideNow();
|
25318
|
-
}
|
25319
|
-
|
25700
|
+
settings.onBeforeHide.call(element, module.hideNow);
|
25320
25701
|
},
|
25321
25702
|
|
25322
25703
|
hideNow: function() {
|
25323
25704
|
module.set.hidden();
|
25324
25705
|
module.force.hidden();
|
25325
|
-
settings.
|
25706
|
+
settings.onHidden.call(element);
|
25326
25707
|
settings.onComplete.call(element);
|
25327
25708
|
// module.repaint();
|
25328
25709
|
},
|
25329
25710
|
|
25330
25711
|
show: function(display) {
|
25331
|
-
module.
|
25332
|
-
|
25712
|
+
if(module.force.visible() && settings.onShow.call(element) !== false) {
|
25713
|
+
module.verbose('Showing element', display);
|
25333
25714
|
module.remove.hidden();
|
25334
|
-
|
25335
|
-
settings.onShow.call(element);
|
25336
|
-
settings.onComplete.call(element);
|
25337
|
-
// module.repaint();
|
25715
|
+
settings.onBeforeShow.call(element, module.showNow);
|
25338
25716
|
}
|
25339
25717
|
},
|
25340
25718
|
|
25719
|
+
showNow: function(){
|
25720
|
+
module.set.visible();
|
25721
|
+
settings.onVisible.call(element);
|
25722
|
+
settings.onComplete.call(element);
|
25723
|
+
// module.repaint();
|
25724
|
+
},
|
25725
|
+
|
25341
25726
|
toggle: function() {
|
25342
25727
|
if( module.is.visible() ) {
|
25343
25728
|
module.hide();
|
@@ -25586,7 +25971,11 @@ $.fn.transition.settings = {
|
|
25586
25971
|
onStart : function() {},
|
25587
25972
|
onComplete : function() {},
|
25588
25973
|
onShow : function() {},
|
25974
|
+
onBeforeShow : function(callback) {callback.call(this)},
|
25975
|
+
onVisible : function() {},
|
25589
25976
|
onHide : function() {},
|
25977
|
+
onHidden : function() {},
|
25978
|
+
onBeforeHide : function(callback) {callback.call(this)},
|
25590
25979
|
|
25591
25980
|
// whether timeout should be used to ensure callback fires in cases animationend does not
|
25592
25981
|
useFailSafe : true,
|
@@ -25640,7 +26029,7 @@ $.fn.transition.settings = {
|
|
25640
26029
|
})( jQuery, window, document );
|
25641
26030
|
|
25642
26031
|
/*!
|
25643
|
-
* # Fomantic-UI 2.9.0-beta.
|
26032
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - API
|
25644
26033
|
* http://github.com/fomantic/Fomantic-UI/
|
25645
26034
|
*
|
25646
26035
|
*
|
@@ -25706,7 +26095,7 @@ $.api = $.fn.api = function(parameters) {
|
|
25706
26095
|
|
25707
26096
|
// context used for state
|
25708
26097
|
$context = (settings.stateContext)
|
25709
|
-
? $(settings.stateContext)
|
26098
|
+
? ([window,document].indexOf(settings.stateContext) < 0 ? $(document).find(settings.stateContext) : $(settings.stateContext))
|
25710
26099
|
: $module,
|
25711
26100
|
|
25712
26101
|
// request details
|
@@ -25715,6 +26104,7 @@ $.api = $.fn.api = function(parameters) {
|
|
25715
26104
|
url,
|
25716
26105
|
data,
|
25717
26106
|
requestStartTime,
|
26107
|
+
originalData,
|
25718
26108
|
|
25719
26109
|
// standard module
|
25720
26110
|
element = this,
|
@@ -25727,6 +26117,7 @@ $.api = $.fn.api = function(parameters) {
|
|
25727
26117
|
|
25728
26118
|
initialize: function() {
|
25729
26119
|
if(!methodInvoked) {
|
26120
|
+
originalData = settings.data;
|
25730
26121
|
module.bind.events();
|
25731
26122
|
}
|
25732
26123
|
module.instantiate();
|
@@ -25789,8 +26180,8 @@ $.api = $.fn.api = function(parameters) {
|
|
25789
26180
|
module.error(error.noStorage);
|
25790
26181
|
return;
|
25791
26182
|
}
|
25792
|
-
response = sessionStorage.getItem(url);
|
25793
|
-
module.debug('Using cached response', url, response);
|
26183
|
+
response = sessionStorage.getItem(url + module.get.normalizedData());
|
26184
|
+
module.debug('Using cached response', url, settings.data, response);
|
25794
26185
|
response = module.decode.json(response);
|
25795
26186
|
return response;
|
25796
26187
|
}
|
@@ -25808,8 +26199,8 @@ $.api = $.fn.api = function(parameters) {
|
|
25808
26199
|
if( $.isPlainObject(response) ) {
|
25809
26200
|
response = JSON.stringify(response);
|
25810
26201
|
}
|
25811
|
-
sessionStorage.setItem(url, response);
|
25812
|
-
module.verbose('Storing cached response for url', url, response);
|
26202
|
+
sessionStorage.setItem(url + module.get.normalizedData(), response);
|
26203
|
+
module.verbose('Storing cached response for url', url, settings.data, response);
|
25813
26204
|
}
|
25814
26205
|
},
|
25815
26206
|
|
@@ -25838,7 +26229,7 @@ $.api = $.fn.api = function(parameters) {
|
|
25838
26229
|
|
25839
26230
|
// Add form content
|
25840
26231
|
if(settings.serializeForm) {
|
25841
|
-
settings.data = module.add.formData(settings.data);
|
26232
|
+
settings.data = module.add.formData(originalData || settings.data);
|
25842
26233
|
}
|
25843
26234
|
|
25844
26235
|
// call beforesend and get any settings changes
|
@@ -25975,10 +26366,6 @@ $.api = $.fn.api = function(parameters) {
|
|
25975
26366
|
cancelled: function() {
|
25976
26367
|
return (module.cancelled || false);
|
25977
26368
|
},
|
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
26369
|
successful: function() {
|
25983
26370
|
return (module.request && module.request.state() == 'resolved');
|
25984
26371
|
},
|
@@ -26006,8 +26393,8 @@ $.api = $.fn.api = function(parameters) {
|
|
26006
26393
|
var
|
26007
26394
|
// allow legacy {$var} style
|
26008
26395
|
variable = (templatedString.indexOf('$') !== -1)
|
26009
|
-
? templatedString.
|
26010
|
-
: templatedString.
|
26396
|
+
? templatedString.slice(2, -1)
|
26397
|
+
: templatedString.slice(1, -1),
|
26011
26398
|
value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
|
26012
26399
|
? urlData[variable]
|
26013
26400
|
: ($module.data(variable) !== undefined)
|
@@ -26038,8 +26425,8 @@ $.api = $.fn.api = function(parameters) {
|
|
26038
26425
|
var
|
26039
26426
|
// allow legacy {/$var} style
|
26040
26427
|
variable = (templatedString.indexOf('$') !== -1)
|
26041
|
-
? templatedString.
|
26042
|
-
: templatedString.
|
26428
|
+
? templatedString.slice(3, -1)
|
26429
|
+
: templatedString.slice(2, -1),
|
26043
26430
|
value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
|
26044
26431
|
? urlData[variable]
|
26045
26432
|
: ($module.data(variable) !== undefined)
|
@@ -26070,24 +26457,76 @@ $.api = $.fn.api = function(parameters) {
|
|
26070
26457
|
},
|
26071
26458
|
formData: function(data) {
|
26072
26459
|
var
|
26073
|
-
|
26074
|
-
|
26075
|
-
|
26076
|
-
: $form.serialize(),
|
26077
|
-
hasOtherData
|
26460
|
+
formData = {},
|
26461
|
+
hasOtherData,
|
26462
|
+
useFormDataApi = settings.serializeForm === 'formdata'
|
26078
26463
|
;
|
26079
|
-
data = data || settings.data;
|
26464
|
+
data = data || originalData || settings.data;
|
26080
26465
|
hasOtherData = $.isPlainObject(data);
|
26081
26466
|
|
26467
|
+
if (useFormDataApi) {
|
26468
|
+
formData = new FormData($form[0]);
|
26469
|
+
settings.processData = typeof settings.processData !== 'undefined' ? settings.processData : false;
|
26470
|
+
settings.contentType = typeof settings.contentType !== 'undefined' ? settings.contentType : false;
|
26471
|
+
} else {
|
26472
|
+
var formArray = $form.serializeArray(),
|
26473
|
+
pushes = {},
|
26474
|
+
pushValues= {},
|
26475
|
+
build = function(base, key, value) {
|
26476
|
+
base[key] = value;
|
26477
|
+
return base;
|
26478
|
+
}
|
26479
|
+
;
|
26480
|
+
// add files
|
26481
|
+
$.each($('input[type="file"]',$form), function(i, tag) {
|
26482
|
+
$.each($(tag)[0].files, function(j, file) {
|
26483
|
+
formArray.push({name:tag.name, value: file});
|
26484
|
+
});
|
26485
|
+
});
|
26486
|
+
$.each(formArray, function(i, el) {
|
26487
|
+
if (!settings.regExp.validate.test(el.name)) return;
|
26488
|
+
var isCheckbox = $('[name="' + el.name + '"]', $form).attr('type') === 'checkbox',
|
26489
|
+
floatValue = parseFloat(el.value),
|
26490
|
+
value = (isCheckbox && el.value === 'on') || el.value === 'true' || (String(floatValue) === el.value ? floatValue : (el.value === 'false' ? false : el.value)),
|
26491
|
+
nameKeys = el.name.match(settings.regExp.key) || [], k, pushKey= el.name.replace(/\[\]$/,'')
|
26492
|
+
;
|
26493
|
+
if(!(pushKey in pushes)) {
|
26494
|
+
pushes[pushKey] = 0;
|
26495
|
+
pushValues[pushKey] = value;
|
26496
|
+
} else if (Array.isArray(pushValues[pushKey])) {
|
26497
|
+
pushValues[pushKey].push(value);
|
26498
|
+
} else {
|
26499
|
+
pushValues[pushKey] = [pushValues[pushKey] , value];
|
26500
|
+
}
|
26501
|
+
value = pushValues[pushKey];
|
26502
|
+
|
26503
|
+
while ((k = nameKeys.pop()) !== undefined) {
|
26504
|
+
// foo[]
|
26505
|
+
if (k == '' && !Array.isArray(value)){
|
26506
|
+
value = build([], pushes[pushKey]++, value);
|
26507
|
+
}
|
26508
|
+
// foo[n]
|
26509
|
+
else if (settings.regExp.fixed.test(k)) {
|
26510
|
+
value = build([], k, value);
|
26511
|
+
}
|
26512
|
+
// foo; foo[bar]
|
26513
|
+
else if (settings.regExp.named.test(k)) {
|
26514
|
+
value = build({}, k, value);
|
26515
|
+
}
|
26516
|
+
}
|
26517
|
+
formData = $.extend(true, formData, value);
|
26518
|
+
});
|
26519
|
+
}
|
26520
|
+
|
26082
26521
|
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);
|
26522
|
+
module.debug('Extending existing data with form data', data, formData);
|
26523
|
+
if(useFormDataApi) {
|
26524
|
+
$.each(Object.keys(data),function(i, el){
|
26525
|
+
formData.append(el, data[el]);
|
26526
|
+
});
|
26090
26527
|
data = formData;
|
26528
|
+
} else {
|
26529
|
+
data = $.extend(true, {}, data, formData);
|
26091
26530
|
}
|
26092
26531
|
}
|
26093
26532
|
else {
|
@@ -26339,6 +26778,9 @@ $.api = $.fn.api = function(parameters) {
|
|
26339
26778
|
},
|
26340
26779
|
|
26341
26780
|
get: {
|
26781
|
+
normalizedData: function(){
|
26782
|
+
return typeof settings.data === "string" ? settings.data : JSON.stringify(settings.data, Object.keys(settings.data).sort());
|
26783
|
+
},
|
26342
26784
|
responseFromXHR: function(xhr) {
|
26343
26785
|
return $.isPlainObject(xhr)
|
26344
26786
|
? (module.is.expectingJSON())
|
@@ -26724,6 +27166,8 @@ $.api.settings = {
|
|
26724
27166
|
defaultData : true,
|
26725
27167
|
|
26726
27168
|
// whether to serialize closest form
|
27169
|
+
// use true to convert complex named keys like a[b][1][c][] into a nested object
|
27170
|
+
// use 'formdata' for formdata web api
|
26727
27171
|
serializeForm : false,
|
26728
27172
|
|
26729
27173
|
// how long to wait before request should occur
|
@@ -26746,7 +27190,7 @@ $.api.settings = {
|
|
26746
27190
|
responseAsync : false,
|
26747
27191
|
|
26748
27192
|
// whether onResponse should work with response value without force converting into an object
|
26749
|
-
rawResponse :
|
27193
|
+
rawResponse : true,
|
26750
27194
|
|
26751
27195
|
// callbacks before request
|
26752
27196
|
beforeSend : function(settings) { return settings; },
|
@@ -26782,7 +27226,6 @@ $.api.settings = {
|
|
26782
27226
|
legacyParameters : 'You are using legacy API success callback names',
|
26783
27227
|
method : 'The method you called is not defined',
|
26784
27228
|
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
27229
|
missingURL : 'No URL specified for api event',
|
26787
27230
|
noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
|
26788
27231
|
noStorage : 'Caching responses locally requires session storage',
|
@@ -26795,6 +27238,11 @@ $.api.settings = {
|
|
26795
27238
|
regExp : {
|
26796
27239
|
required : /\{\$*[A-z0-9]+\}/g,
|
26797
27240
|
optional : /\{\/\$*[A-z0-9]+\}/g,
|
27241
|
+
validate: /^[a-z_][a-z0-9_-]*(?:\[[a-z0-9_-]*\])*$/i,
|
27242
|
+
key: /[a-z0-9_-]+|(?=\[\])/gi,
|
27243
|
+
push: /^$/,
|
27244
|
+
fixed: /^\d+$/,
|
27245
|
+
named: /^[a-z0-9_-]+$/i
|
26798
27246
|
},
|
26799
27247
|
|
26800
27248
|
className: {
|
@@ -26818,7 +27266,7 @@ $.api.settings = {
|
|
26818
27266
|
})( jQuery, window, document );
|
26819
27267
|
|
26820
27268
|
/*!
|
26821
|
-
* # Fomantic-UI 2.9.0-beta.
|
27269
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - State
|
26822
27270
|
* http://github.com/fomantic/Fomantic-UI/
|
26823
27271
|
*
|
26824
27272
|
*
|
@@ -26893,7 +27341,7 @@ $.fn.state = function(parameters) {
|
|
26893
27341
|
|
26894
27342
|
// bind events with delegated events
|
26895
27343
|
if(settings.context && moduleSelector !== '') {
|
26896
|
-
$(settings.context)
|
27344
|
+
([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
26897
27345
|
.on(moduleSelector, 'mouseenter' + eventNamespace, module.change.text)
|
26898
27346
|
.on(moduleSelector, 'mouseleave' + eventNamespace, module.reset.text)
|
26899
27347
|
.on(moduleSelector, 'click' + eventNamespace, module.toggle.state)
|
@@ -27530,7 +27978,7 @@ $.fn.state.settings = {
|
|
27530
27978
|
})( jQuery, window, document );
|
27531
27979
|
|
27532
27980
|
/*!
|
27533
|
-
* # Fomantic-UI 2.9.0-beta.
|
27981
|
+
* # Fomantic-UI 2.9.0-beta.312+86121ef - Visibility
|
27534
27982
|
* http://github.com/fomantic/Fomantic-UI/
|
27535
27983
|
*
|
27536
27984
|
*
|
@@ -27589,7 +28037,7 @@ $.fn.visibility = function(parameters) {
|
|
27589
28037
|
$window = $(window),
|
27590
28038
|
|
27591
28039
|
$module = $(this),
|
27592
|
-
$context = $(settings.context),
|
28040
|
+
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context),
|
27593
28041
|
|
27594
28042
|
$placeholder,
|
27595
28043
|
|
@@ -27959,7 +28407,7 @@ $.fn.visibility = function(parameters) {
|
|
27959
28407
|
},
|
27960
28408
|
verticallyScrollableContext: function() {
|
27961
28409
|
var
|
27962
|
-
overflowY = ($context
|
28410
|
+
overflowY = ($context[0] !== window)
|
27963
28411
|
? $context.css('overflow-y')
|
27964
28412
|
: false
|
27965
28413
|
;
|
@@ -27967,7 +28415,7 @@ $.fn.visibility = function(parameters) {
|
|
27967
28415
|
},
|
27968
28416
|
horizontallyScrollableContext: function() {
|
27969
28417
|
var
|
27970
|
-
overflowX = ($context
|
28418
|
+
overflowX = ($context[0] !== window)
|
27971
28419
|
? $context.css('overflow-x')
|
27972
28420
|
: false
|
27973
28421
|
;
|