fomantic-ui 2.9.1-beta.8 → 2.9.1
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/.eslint/eqeqeq-rule.js +18 -0
- package/.eslint/index.js +29 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +123 -0
- package/.github/auto_assign.yml +0 -1
- package/.github/workflows/ci.yml +37 -4
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/.prettierrc.js +12 -0
- package/.stylelintrc.js +48 -0
- package/CHANGELOG.md +112 -0
- package/README.md +1 -1
- package/dist/components/accordion.css +35 -53
- package/dist/components/accordion.js +568 -595
- package/dist/components/accordion.min.css +2 -2
- package/dist/components/accordion.min.js +3 -3
- package/dist/components/ad.css +34 -45
- package/dist/components/ad.min.css +2 -2
- package/dist/components/api.js +1157 -1179
- package/dist/components/api.min.js +3 -3
- package/dist/components/breadcrumb.css +5 -5
- package/dist/components/breadcrumb.min.css +2 -2
- package/dist/components/button.css +709 -1111
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +24 -27
- package/dist/components/calendar.js +1934 -1809
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +3 -3
- package/dist/components/card.css +219 -365
- package/dist/components/card.min.css +2 -2
- package/dist/components/checkbox.css +120 -191
- package/dist/components/checkbox.js +842 -841
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +3 -3
- package/dist/components/comment.css +41 -59
- package/dist/components/comment.min.css +2 -2
- package/dist/components/container.css +7 -6
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +53 -172
- package/dist/components/dimmer.js +706 -737
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +3 -3
- package/dist/components/divider.css +43 -61
- package/dist/components/divider.min.css +2 -2
- package/dist/components/dropdown.css +252 -386
- package/dist/components/dropdown.js +4195 -4236
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +3 -3
- package/dist/components/embed.css +18 -29
- package/dist/components/embed.js +645 -675
- package/dist/components/embed.min.css +2 -2
- package/dist/components/embed.min.js +3 -3
- package/dist/components/emoji.css +3556 -3556
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +35 -57
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +270 -268
- package/dist/components/flag.min.css +2 -2
- package/dist/components/flyout.css +95 -141
- package/dist/components/flyout.js +1514 -1465
- package/dist/components/flyout.min.css +2 -2
- package/dist/components/flyout.min.js +3 -3
- package/dist/components/form.css +244 -339
- package/dist/components/form.js +2022 -2004
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +3 -3
- package/dist/components/grid.css +183 -329
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +118 -142
- package/dist/components/header.min.css +2 -2
- package/dist/components/icon.css +662 -745
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +39 -63
- package/dist/components/image.min.css +2 -2
- package/dist/components/input.css +356 -274
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +84 -131
- package/dist/components/item.min.css +2 -2
- package/dist/components/label.css +359 -410
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +49 -70
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +67 -155
- package/dist/components/loader.min.css +2 -2
- package/dist/components/menu.css +270 -431
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +125 -197
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +120 -154
- package/dist/components/modal.js +1544 -1486
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +3 -3
- package/dist/components/nag.css +53 -63
- package/dist/components/nag.js +520 -526
- package/dist/components/nag.min.css +2 -2
- package/dist/components/nag.min.js +3 -3
- package/dist/components/placeholder.css +22 -42
- package/dist/components/placeholder.min.css +2 -2
- package/dist/components/popup.css +424 -202
- package/dist/components/popup.js +1456 -1456
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +3 -3
- package/dist/components/progress.css +106 -211
- package/dist/components/progress.js +969 -997
- package/dist/components/progress.min.css +2 -2
- package/dist/components/progress.min.js +3 -3
- package/dist/components/rail.css +15 -20
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +80 -121
- package/dist/components/rating.js +507 -523
- package/dist/components/rating.min.css +2 -2
- package/dist/components/rating.min.js +3 -3
- package/dist/components/reset.css +8 -13
- package/dist/components/reset.min.css +2 -2
- package/dist/components/reveal.css +44 -83
- package/dist/components/reveal.min.css +2 -2
- package/dist/components/search.css +69 -98
- package/dist/components/search.js +1520 -1534
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +3 -3
- package/dist/components/segment.css +148 -224
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +14 -30
- package/dist/components/shape.js +783 -810
- package/dist/components/shape.min.css +2 -2
- package/dist/components/shape.min.js +3 -3
- package/dist/components/sidebar.css +103 -206
- package/dist/components/sidebar.js +1061 -1099
- package/dist/components/sidebar.min.css +2 -2
- package/dist/components/sidebar.min.js +3 -3
- package/dist/components/site.css +28 -41
- package/dist/components/site.js +436 -476
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +3 -3
- package/dist/components/slider.css +93 -121
- package/dist/components/slider.js +1310 -1311
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +3 -3
- package/dist/components/state.js +638 -657
- package/dist/components/state.min.js +3 -3
- package/dist/components/statistic.css +75 -116
- package/dist/components/statistic.min.css +2 -2
- package/dist/components/step.css +77 -150
- package/dist/components/step.min.css +2 -2
- package/dist/components/sticky.css +1 -5
- package/dist/components/sticky.js +847 -901
- package/dist/components/sticky.min.css +2 -2
- package/dist/components/sticky.min.js +3 -3
- package/dist/components/tab.css +10 -14
- package/dist/components/tab.js +902 -966
- package/dist/components/tab.min.css +2 -2
- package/dist/components/tab.min.js +3 -3
- package/dist/components/table.css +547 -774
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +32 -32
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +69 -147
- package/dist/components/toast.js +910 -884
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +3 -3
- package/dist/components/transition.css +299 -1356
- package/dist/components/transition.js +1048 -1077
- package/dist/components/transition.min.css +2 -2
- package/dist/components/transition.min.js +3 -3
- package/dist/components/visibility.js +1213 -1245
- package/dist/components/visibility.min.js +3 -3
- package/dist/semantic.css +9344 -12298
- package/dist/semantic.js +29181 -29423
- package/dist/semantic.min.css +3 -3
- package/dist/semantic.min.js +3 -3
- package/dist/themes/basic/assets/fonts/icons.woff2 +0 -0
- package/dist/themes/github/assets/fonts/octicons.woff2 +0 -0
- package/examples/.eslintrc.js +6 -0
- package/examples/assets/library/jquery.min.js +2 -4
- package/examples/assets/show-examples.js +13 -13
- package/examples/attached.html +1 -1
- package/examples/bootstrap.html +1 -1
- package/examples/components/button.html +1 -1
- package/examples/components/card.html +6 -6
- package/examples/components/input.html +1 -1
- package/examples/components/menu.html +1 -1
- package/examples/components/site.html +1 -1
- package/examples/components/sticky-context.html +2 -2
- package/examples/components/table.html +1 -1
- package/examples/fixed.html +3 -3
- package/examples/grid.html +5 -5
- package/examples/homepage.html +1 -1
- package/examples/login.html +2 -2
- package/examples/responsive.html +2 -2
- package/examples/sticky.html +4 -4
- package/examples/theming.html +1 -1
- package/gulpfile.js +13 -11
- package/package.json +17 -8
- package/scripts/nightly-version.js +83 -75
- package/src/_site/collections/menu.overrides +1 -1
- package/src/_site/elements/flag.variables +2 -2
- package/src/_site/globals/site.variables +1 -1
- package/src/_site/modules/embed.variables +3 -0
- package/src/definitions/behaviors/api.js +1158 -1180
- package/src/definitions/behaviors/form.js +2021 -2003
- package/src/definitions/behaviors/state.js +644 -663
- package/src/definitions/behaviors/visibility.js +1212 -1244
- package/src/definitions/collections/breadcrumb.less +43 -47
- package/src/definitions/collections/form.less +866 -884
- package/src/definitions/collections/grid.less +1681 -1699
- package/src/definitions/collections/menu.less +1522 -1544
- package/src/definitions/collections/message.less +294 -298
- package/src/definitions/collections/table.less +1657 -1661
- package/src/definitions/elements/button.less +1716 -1750
- package/src/definitions/elements/container.less +211 -211
- package/src/definitions/elements/divider.less +198 -211
- package/src/definitions/elements/emoji.less +41 -48
- package/src/definitions/elements/flag.less +46 -48
- package/src/definitions/elements/header.less +351 -359
- package/src/definitions/elements/icon.less +541 -484
- package/src/definitions/elements/image.less +216 -227
- package/src/definitions/elements/input.less +692 -699
- package/src/definitions/elements/label.less +784 -806
- package/src/definitions/elements/list.less +810 -814
- package/src/definitions/elements/loader.less +273 -268
- package/src/definitions/elements/placeholder.less +173 -170
- package/src/definitions/elements/rail.less +93 -93
- package/src/definitions/elements/reveal.less +192 -198
- package/src/definitions/elements/segment.less +742 -749
- package/src/definitions/elements/step.less +423 -437
- package/src/definitions/elements/text.less +34 -36
- package/src/definitions/globals/reset.less +11 -8
- package/src/definitions/globals/site.js +435 -475
- package/src/definitions/globals/site.less +108 -110
- package/src/definitions/modules/accordion.js +567 -594
- package/src/definitions/modules/accordion.less +244 -248
- package/src/definitions/modules/calendar.js +1933 -1808
- package/src/definitions/modules/calendar.less +100 -97
- package/src/definitions/modules/checkbox.js +841 -840
- package/src/definitions/modules/checkbox.less +531 -552
- package/src/definitions/modules/dimmer.js +705 -736
- package/src/definitions/modules/dimmer.less +294 -305
- package/src/definitions/modules/dropdown.js +4194 -4235
- package/src/definitions/modules/dropdown.less +1568 -1598
- package/src/definitions/modules/embed.js +644 -674
- package/src/definitions/modules/embed.less +82 -84
- package/src/definitions/modules/flyout.js +1513 -1464
- package/src/definitions/modules/flyout.less +453 -455
- package/src/definitions/modules/modal.js +1543 -1485
- package/src/definitions/modules/modal.less +459 -467
- package/src/definitions/modules/nag.js +519 -525
- package/src/definitions/modules/nag.less +136 -149
- package/src/definitions/modules/popup.js +1455 -1455
- package/src/definitions/modules/popup.less +738 -693
- package/src/definitions/modules/progress.js +968 -996
- package/src/definitions/modules/progress.less +523 -499
- package/src/definitions/modules/rating.js +506 -522
- package/src/definitions/modules/rating.less +98 -103
- package/src/definitions/modules/search.js +1519 -1533
- package/src/definitions/modules/search.less +374 -394
- package/src/definitions/modules/shape.js +782 -809
- package/src/definitions/modules/shape.less +70 -79
- package/src/definitions/modules/sidebar.js +1060 -1098
- package/src/definitions/modules/sidebar.less +463 -476
- package/src/definitions/modules/slider.js +1309 -1310
- package/src/definitions/modules/slider.less +309 -310
- package/src/definitions/modules/sticky.js +863 -917
- package/src/definitions/modules/sticky.less +17 -25
- package/src/definitions/modules/tab.js +901 -965
- package/src/definitions/modules/tab.less +48 -54
- package/src/definitions/modules/toast.js +909 -883
- package/src/definitions/modules/toast.less +589 -589
- package/src/definitions/modules/transition.js +1047 -1076
- package/src/definitions/modules/transition.less +58 -59
- package/src/definitions/views/ad.less +207 -208
- package/src/definitions/views/card.less +955 -973
- package/src/definitions/views/comment.less +192 -200
- package/src/definitions/views/feed.less +222 -226
- package/src/definitions/views/item.less +437 -448
- package/src/definitions/views/statistic.less +273 -279
- package/src/semantic.less +8 -6
- package/src/theme.config.example +53 -53
- package/src/theme.less +44 -35
- package/src/themes/amazon/elements/button.overrides +23 -24
- package/src/themes/amazon/elements/button.variables +18 -23
- package/src/themes/amazon/globals/site.variables +16 -17
- package/src/themes/basic/assets/fonts/icons.woff2 +0 -0
- package/src/themes/basic/collections/table.overrides +0 -1
- package/src/themes/basic/collections/table.variables +3 -3
- package/src/themes/basic/elements/button.overrides +0 -1
- package/src/themes/basic/elements/button.variables +9 -9
- package/src/themes/basic/elements/icon.overrides +9 -169
- package/src/themes/basic/elements/icon.variables +161 -18
- package/src/themes/basic/elements/step.overrides +2 -2
- package/src/themes/basic/elements/step.variables +2 -2
- package/src/themes/basic/globals/reset.overrides +1 -1
- package/src/themes/basic/globals/reset.variables +1 -1
- package/src/themes/basic/modules/progress.variables +2 -2
- package/src/themes/basic/views/card.overrides +0 -1
- package/src/themes/basic/views/card.variables +6 -6
- package/src/themes/bookish/elements/header.overrides +4 -4
- package/src/themes/bookish/elements/header.variables +5 -5
- package/src/themes/bootstrap3/elements/button.overrides +3 -0
- package/src/themes/bootstrap3/elements/button.variables +20 -25
- package/src/themes/chubby/collections/form.overrides +9 -9
- package/src/themes/chubby/collections/form.variables +3 -3
- package/src/themes/chubby/collections/menu.overrides +3 -0
- package/src/themes/chubby/collections/menu.variables +3 -3
- package/src/themes/chubby/elements/button.overrides +8 -10
- package/src/themes/chubby/elements/button.variables +10 -10
- package/src/themes/chubby/elements/header.overrides +1 -1
- package/src/themes/chubby/elements/header.variables +4 -4
- package/src/themes/chubby/modules/accordion.overrides +2 -2
- package/src/themes/chubby/modules/accordion.variables +4 -4
- package/src/themes/chubby/views/comment.overrides +5 -5
- package/src/themes/chubby/views/comment.variables +11 -11
- package/src/themes/classic/collections/table.variables +3 -3
- package/src/themes/classic/elements/button.variables +36 -43
- package/src/themes/classic/elements/header.variables +4 -4
- package/src/themes/classic/modules/progress.variables +3 -3
- package/src/themes/classic/views/card.overrides +25 -27
- package/src/themes/classic/views/card.variables +7 -7
- package/src/themes/colored/modules/checkbox.overrides +3 -0
- package/src/themes/colored/modules/checkbox.variables +1 -3
- package/src/themes/default/collections/breadcrumb.variables +4 -4
- package/src/themes/default/collections/form.variables +15 -16
- package/src/themes/default/collections/grid.overrides +0 -1
- package/src/themes/default/collections/grid.variables +15 -16
- package/src/themes/default/collections/menu.variables +31 -45
- package/src/themes/default/collections/message.variables +84 -123
- package/src/themes/default/collections/table.overrides +3 -0
- package/src/themes/default/collections/table.variables +30 -34
- package/src/themes/default/elements/button.variables +44 -53
- package/src/themes/default/elements/container.variables +8 -16
- package/src/themes/default/elements/divider.overrides +8 -9
- package/src/themes/default/elements/divider.variables +5 -6
- package/src/themes/default/elements/emoji.overrides +0 -1
- package/src/themes/default/elements/emoji.variables +3556 -3556
- package/src/themes/default/elements/flag.variables +1595 -1595
- package/src/themes/default/elements/header.overrides +0 -1
- package/src/themes/default/elements/header.variables +21 -21
- package/src/themes/default/elements/icon.variables +2016 -2012
- package/src/themes/default/elements/image.variables +6 -7
- package/src/themes/default/elements/input.variables +11 -12
- package/src/themes/default/elements/label.variables +25 -26
- package/src/themes/default/elements/list.variables +17 -21
- package/src/themes/default/elements/loader.variables +16 -17
- package/src/themes/default/elements/placeholder.variables +12 -9
- package/src/themes/default/elements/rail.variables +4 -5
- package/src/themes/default/elements/reveal.variables +1 -1
- package/src/themes/default/elements/segment.variables +24 -36
- package/src/themes/default/elements/step.overrides +4 -4
- package/src/themes/default/elements/step.variables +19 -22
- package/src/themes/default/elements/text.variables +2 -3
- package/src/themes/default/globals/colors.less +588 -588
- package/src/themes/default/globals/reset.overrides +63 -59
- package/src/themes/default/globals/reset.variables +1 -1
- package/src/themes/default/globals/site.variables +1074 -1123
- package/src/themes/default/globals/variation.variables +6 -4
- package/src/themes/default/modules/accordion.overrides +11 -11
- package/src/themes/default/modules/accordion.variables +15 -20
- package/src/themes/default/modules/calendar.variables +2 -0
- package/src/themes/default/modules/chatroom.variables +1 -1
- package/src/themes/default/modules/checkbox.overrides +9 -13
- package/src/themes/default/modules/checkbox.variables +24 -33
- package/src/themes/default/modules/dimmer.variables +14 -17
- package/src/themes/default/modules/dropdown.overrides +17 -17
- package/src/themes/default/modules/dropdown.variables +29 -31
- package/src/themes/default/modules/embed.variables +9 -13
- package/src/themes/default/modules/flyout.variables +10 -8
- package/src/themes/default/modules/modal.variables +64 -67
- package/src/themes/default/modules/nag.variables +11 -14
- package/src/themes/default/modules/popup.variables +14 -13
- package/src/themes/default/modules/progress.variables +17 -19
- package/src/themes/default/modules/rating.variables +10 -12
- package/src/themes/default/modules/search.variables +12 -17
- package/src/themes/default/modules/shape.variables +7 -8
- package/src/themes/default/modules/sidebar.variables +4 -4
- package/src/themes/default/modules/slider.variables +55 -54
- package/src/themes/default/modules/sticky.variables +1 -1
- package/src/themes/default/modules/toast.variables +8 -8
- package/src/themes/default/modules/transition.overrides +936 -915
- package/src/themes/default/modules/transition.variables +1 -1
- package/src/themes/default/views/ad.variables +1 -1
- package/src/themes/default/views/card.variables +33 -45
- package/src/themes/default/views/comment.variables +7 -9
- package/src/themes/default/views/feed.variables +10 -10
- package/src/themes/default/views/item.variables +20 -23
- package/src/themes/default/views/statistic.variables +8 -8
- package/src/themes/duo/elements/loader.variables +1 -1
- package/src/themes/famfamfam/elements/flag.overrides +263 -268
- package/src/themes/famfamfam/elements/flag.variables +4 -4
- package/src/themes/fixed-width/collections/grid.variables +4 -4
- package/src/themes/fixed-width/modules/modal.variables +11 -13
- package/src/themes/flat/collections/form.overrides +9 -9
- package/src/themes/flat/collections/form.variables +16 -17
- package/src/themes/flat/globals/site.variables +69 -74
- package/src/themes/github/assets/fonts/octicons.woff2 +0 -0
- package/src/themes/github/collections/breadcrumb.variables +0 -1
- package/src/themes/github/collections/form.overrides +7 -8
- package/src/themes/github/collections/form.variables +16 -18
- package/src/themes/github/collections/grid.variables +1 -2
- package/src/themes/github/collections/menu.overrides +2 -2
- package/src/themes/github/collections/menu.variables +24 -26
- package/src/themes/github/collections/message.overrides +3 -3
- package/src/themes/github/collections/message.variables +12 -14
- package/src/themes/github/collections/table.variables +2 -2
- package/src/themes/github/elements/button.overrides +0 -1
- package/src/themes/github/elements/button.variables +26 -30
- package/src/themes/github/elements/header.variables +2 -2
- package/src/themes/github/elements/icon.overrides +3 -208
- package/src/themes/github/elements/icon.variables +234 -19
- package/src/themes/github/elements/image.variables +1 -1
- package/src/themes/github/elements/input.overrides +16 -16
- package/src/themes/github/elements/input.variables +4 -5
- package/src/themes/github/elements/label.overrides +3 -3
- package/src/themes/github/elements/label.variables +0 -1
- package/src/themes/github/elements/segment.variables +9 -10
- package/src/themes/github/elements/step.overrides +13 -13
- package/src/themes/github/elements/step.variables +6 -6
- package/src/themes/github/globals/site.variables +16 -16
- package/src/themes/github/modules/dropdown.overrides +18 -19
- package/src/themes/github/modules/dropdown.variables +8 -10
- package/src/themes/github/modules/popup.variables +0 -2
- package/src/themes/gmail/collections/message.overrides +3 -0
- package/src/themes/gmail/collections/message.variables +4 -4
- package/src/themes/instagram/views/card.overrides +4 -5
- package/src/themes/instagram/views/card.variables +7 -8
- package/src/themes/joypixels/elements/emoji.overrides +0 -2
- package/src/themes/joypixels/elements/emoji.variables +3554 -3554
- package/src/themes/material/collections/menu.overrides +1 -1
- package/src/themes/material/collections/menu.variables +4 -4
- package/src/themes/material/elements/button.overrides +7 -9
- package/src/themes/material/elements/button.variables +44 -46
- package/src/themes/material/elements/header.overrides +3 -3
- package/src/themes/material/elements/header.variables +8 -10
- package/src/themes/material/elements/icon.overrides +3 -934
- package/src/themes/material/elements/icon.variables +958 -18
- package/src/themes/material/globals/site.overrides +3 -0
- package/src/themes/material/globals/site.variables +83 -84
- package/src/themes/material/modules/dropdown.overrides +2 -2
- package/src/themes/material/modules/dropdown.variables +5 -5
- package/src/themes/material/modules/modal.overrides +3 -3
- package/src/themes/material/modules/modal.variables +4 -5
- package/src/themes/pulsar/elements/loader.overrides +23 -61
- package/src/themes/raised/elements/button.variables +8 -9
- package/src/themes/resetcss/globals/reset.overrides +115 -33
- package/src/themes/resetcss/globals/reset.variables +1 -1
- package/src/themes/round/elements/button.overrides +3 -0
- package/src/themes/round/elements/button.variables +33 -38
- package/src/themes/rtl/globals/site.overrides +1 -1
- package/src/themes/rtl/globals/site.variables +5 -6
- package/src/themes/striped/modules/progress.overrides +20 -16
- package/src/themes/systemfont/globals/reset.overrides +1 -1
- package/src/themes/systemfont/globals/site.variables +6 -6
- package/src/themes/timeline/views/feed.overrides +12 -12
- package/src/themes/timeline/views/feed.variables +8 -8
- package/src/themes/twitter/elements/button.overrides +4 -5
- package/src/themes/twitter/elements/button.variables +17 -18
- package/src/themes/twitter/elements/emoji.variables +3556 -3556
- package/tasks/.eslintrc.js +9 -0
- package/tasks/README.md +2 -4
- package/tasks/admin/components/create.js +268 -277
- package/tasks/admin/components/init.js +123 -129
- package/tasks/admin/components/update.js +151 -158
- package/tasks/admin/distributions/create.js +183 -189
- package/tasks/admin/distributions/init.js +125 -131
- package/tasks/admin/distributions/update.js +147 -153
- package/tasks/admin/publish.js +5 -9
- package/tasks/admin/register.js +37 -39
- package/tasks/admin/release.js +8 -12
- package/tasks/build/assets.js +43 -40
- package/tasks/build/css.js +230 -217
- package/tasks/build/javascript.js +120 -114
- package/tasks/build.js +11 -11
- package/tasks/check-install.js +15 -17
- package/tasks/clean.js +6 -6
- package/tasks/collections/README.md +3 -5
- package/tasks/collections/admin.js +34 -36
- package/tasks/collections/build.js +19 -21
- package/tasks/collections/docs.js +11 -13
- package/tasks/collections/install.js +11 -13
- package/tasks/collections/rtl.js +9 -12
- package/tasks/collections/various.js +10 -12
- package/tasks/config/admin/github.js +17 -19
- package/tasks/config/admin/oauth.example.js +4 -4
- package/tasks/config/admin/release.js +98 -98
- package/tasks/config/admin/templates/README.md +8 -8
- package/tasks/config/admin/templates/bower.json +3 -2
- package/tasks/config/admin/templates/component-package.js +9 -10
- package/tasks/config/admin/templates/css-package.js +19 -21
- package/tasks/config/admin/templates/less-package.js +12 -14
- package/tasks/config/admin/templates/package.json +6 -6
- package/tasks/config/defaults.js +116 -116
- package/tasks/config/docs.js +23 -23
- package/tasks/config/npm/gulpfile.js +15 -14
- package/tasks/config/project/config.js +124 -136
- package/tasks/config/project/install.js +722 -719
- package/tasks/config/project/release.js +34 -41
- package/tasks/config/tasks.js +168 -167
- package/tasks/config/user.js +28 -32
- package/tasks/docs/build.js +100 -96
- package/tasks/docs/metadata.js +91 -98
- package/tasks/docs/serve.js +84 -82
- package/tasks/install.js +373 -382
- package/tasks/rtl/build.js +4 -3
- package/tasks/rtl/watch.js +4 -3
- package/tasks/version.js +4 -6
- package/tasks/watch.js +29 -31
- package/test/.eslintrc.js +23 -0
- package/test/meteor/assets.js +11 -14
- package/test/meteor/fonts.js +12 -13
- package/test/modules/accordion.spec.js +6 -8
- package/test/modules/checkbox.spec.js +5 -7
- package/test/modules/dropdown.spec.js +5 -7
- package/test/modules/modal.spec.js +6 -8
- package/test/modules/module.spec.js +158 -178
- package/test/modules/popup.spec.js +5 -7
- package/test/modules/search.spec.js +5 -7
- package/test/modules/shape.spec.js +5 -7
- package/test/modules/sidebar.spec.js +5 -7
- package/test/modules/tab.spec.js +6 -8
- package/test/modules/transition.spec.js +5 -7
- package/test/modules/video.spec.js +5 -7
- package/.github/workflows/codeql.yml +0 -68
package/dist/components/shape.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1
|
2
|
+
* # Fomantic-UI 2.9.1 - Shape
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -8,841 +8,814 @@
|
|
8
8
|
*
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
'use strict';
|
14
|
-
|
15
|
-
$.isFunction = $.isFunction || function(obj) {
|
16
|
-
return typeof obj === "function" && typeof obj.nodeType !== "number";
|
17
|
-
};
|
18
|
-
|
19
|
-
window = (typeof window != 'undefined' && window.Math == Math)
|
20
|
-
? window
|
21
|
-
: (typeof self != 'undefined' && self.Math == Math)
|
22
|
-
? self
|
23
|
-
: Function('return this')()
|
24
|
-
;
|
25
|
-
|
26
|
-
$.fn.shape = function(parameters) {
|
27
|
-
var
|
28
|
-
$allModules = $(this),
|
29
|
-
|
30
|
-
time = new Date().getTime(),
|
31
|
-
performance = [],
|
32
|
-
|
33
|
-
query = arguments[0],
|
34
|
-
methodInvoked = (typeof query == 'string'),
|
35
|
-
queryArguments = [].slice.call(arguments, 1),
|
36
|
-
|
37
|
-
requestAnimationFrame = window.requestAnimationFrame
|
38
|
-
|| window.mozRequestAnimationFrame
|
39
|
-
|| window.webkitRequestAnimationFrame
|
40
|
-
|| window.msRequestAnimationFrame
|
41
|
-
|| function(callback) { setTimeout(callback, 0); },
|
42
|
-
|
43
|
-
returnedValue
|
44
|
-
;
|
45
|
-
|
46
|
-
$allModules
|
47
|
-
.each(function() {
|
48
|
-
var
|
49
|
-
moduleSelector = $allModules.selector || '',
|
50
|
-
settings = ( $.isPlainObject(parameters) )
|
51
|
-
? $.extend(true, {}, $.fn.shape.settings, parameters)
|
52
|
-
: $.extend({}, $.fn.shape.settings),
|
53
|
-
|
54
|
-
// internal aliases
|
55
|
-
namespace = settings.namespace,
|
56
|
-
selector = settings.selector,
|
57
|
-
error = settings.error,
|
58
|
-
className = settings.className,
|
59
|
-
|
60
|
-
// define namespaces for modules
|
61
|
-
eventNamespace = '.' + namespace,
|
62
|
-
moduleNamespace = 'module-' + namespace,
|
63
|
-
|
64
|
-
// selector cache
|
65
|
-
$module = $(this),
|
66
|
-
$sides = $module.find('>' + selector.sides),
|
67
|
-
$side = $sides.find('>' + selector.side),
|
68
|
-
|
69
|
-
// private variables
|
70
|
-
nextIndex = false,
|
71
|
-
$activeSide,
|
72
|
-
$nextSide,
|
73
|
-
|
74
|
-
// standard module
|
75
|
-
element = this,
|
76
|
-
instance = $module.data(moduleNamespace),
|
77
|
-
module
|
78
|
-
;
|
79
|
-
|
80
|
-
module = {
|
81
|
-
|
82
|
-
initialize: function() {
|
83
|
-
module.verbose('Initializing module for', element);
|
84
|
-
module.set.defaultSide();
|
85
|
-
module.instantiate();
|
86
|
-
},
|
11
|
+
(function ($, window, document) {
|
12
|
+
'use strict';
|
87
13
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
$module
|
92
|
-
.data(moduleNamespace, instance)
|
93
|
-
;
|
94
|
-
},
|
14
|
+
function isFunction(obj) {
|
15
|
+
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
|
+
}
|
95
17
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
.removeData(moduleNamespace)
|
100
|
-
.off(eventNamespace)
|
101
|
-
;
|
102
|
-
},
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
|
+
? window
|
20
|
+
: globalThis;
|
103
21
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
$sides = $(this).find(selector.sides);
|
108
|
-
$side = $(this).find(selector.side);
|
109
|
-
},
|
22
|
+
$.fn.shape = function (parameters) {
|
23
|
+
var
|
24
|
+
$allModules = $(this),
|
110
25
|
|
111
|
-
|
112
|
-
|
113
|
-
var
|
114
|
-
shape = $sides[0] || document.createElement('div'),
|
115
|
-
fakeAssignment = shape.offsetWidth
|
116
|
-
;
|
117
|
-
},
|
26
|
+
time = Date.now(),
|
27
|
+
performance = [],
|
118
28
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
module.verbose('Executing animation callback');
|
123
|
-
if(event !== undefined) {
|
124
|
-
event.stopPropagation();
|
125
|
-
}
|
126
|
-
module.reset();
|
127
|
-
module.set.active();
|
128
|
-
};
|
129
|
-
settings.onBeforeChange.call($nextSide[0]);
|
130
|
-
if(module.get.transitionEvent()) {
|
131
|
-
module.verbose('Starting CSS animation');
|
132
|
-
$module
|
133
|
-
.addClass(className.animating)
|
134
|
-
;
|
135
|
-
$sides
|
136
|
-
.css(propertyObject)
|
137
|
-
.one(module.get.transitionEvent(), callback)
|
138
|
-
;
|
139
|
-
module.set.duration(settings.duration);
|
140
|
-
requestAnimationFrame(function() {
|
141
|
-
$module
|
142
|
-
.addClass(className.animating)
|
143
|
-
;
|
144
|
-
$activeSide
|
145
|
-
.addClass(className.hidden)
|
146
|
-
;
|
147
|
-
});
|
148
|
-
}
|
149
|
-
else {
|
150
|
-
callback();
|
151
|
-
}
|
152
|
-
},
|
153
|
-
|
154
|
-
queue: function(method) {
|
155
|
-
module.debug('Queueing animation of', method);
|
156
|
-
$sides
|
157
|
-
.one(module.get.transitionEvent(), function() {
|
158
|
-
module.debug('Executing queued animation');
|
159
|
-
setTimeout(function(){
|
160
|
-
$module.shape(method);
|
161
|
-
}, 0);
|
162
|
-
})
|
163
|
-
;
|
164
|
-
},
|
29
|
+
query = arguments[0],
|
30
|
+
methodInvoked = typeof query === 'string',
|
31
|
+
queryArguments = [].slice.call(arguments, 1),
|
165
32
|
|
166
|
-
|
167
|
-
|
168
|
-
$module
|
169
|
-
.removeClass(className.animating)
|
170
|
-
.attr('style', '')
|
171
|
-
.removeAttr('style')
|
172
|
-
;
|
173
|
-
// removeAttr style does not consistently work in safari
|
174
|
-
$sides
|
175
|
-
.attr('style', '')
|
176
|
-
.removeAttr('style')
|
177
|
-
;
|
178
|
-
$side
|
179
|
-
.attr('style', '')
|
180
|
-
.removeAttr('style')
|
181
|
-
.removeClass(className.hidden)
|
182
|
-
;
|
183
|
-
$nextSide
|
184
|
-
.removeClass(className.animating)
|
185
|
-
.attr('style', '')
|
186
|
-
.removeAttr('style')
|
187
|
-
;
|
188
|
-
},
|
33
|
+
returnedValue
|
34
|
+
;
|
189
35
|
|
190
|
-
|
191
|
-
complete: function() {
|
192
|
-
return ($side.filter('.' + className.active)[0] == $nextSide[0]);
|
193
|
-
},
|
194
|
-
animating: function() {
|
195
|
-
return $module.hasClass(className.animating);
|
196
|
-
},
|
197
|
-
hidden: function() {
|
198
|
-
return $module.closest(':hidden').length > 0;
|
199
|
-
}
|
200
|
-
},
|
201
|
-
|
202
|
-
set: {
|
203
|
-
|
204
|
-
defaultSide: function() {
|
205
|
-
$activeSide = $side.filter('.' + settings.className.active);
|
206
|
-
$nextSide = ( $activeSide.next(selector.side).length > 0 )
|
207
|
-
? $activeSide.next(selector.side)
|
208
|
-
: $side.first()
|
209
|
-
;
|
210
|
-
nextIndex = false;
|
211
|
-
module.verbose('Active side set to', $activeSide);
|
212
|
-
module.verbose('Next side set to', $nextSide);
|
213
|
-
},
|
214
|
-
|
215
|
-
duration: function(duration) {
|
216
|
-
duration = duration || settings.duration;
|
217
|
-
duration = (typeof duration == 'number')
|
218
|
-
? duration + 'ms'
|
219
|
-
: duration
|
220
|
-
;
|
221
|
-
module.verbose('Setting animation duration', duration);
|
222
|
-
if(settings.duration || settings.duration === 0) {
|
223
|
-
$sides.add($side)
|
224
|
-
.css({
|
225
|
-
'-webkit-transition-duration': duration,
|
226
|
-
'-moz-transition-duration': duration,
|
227
|
-
'-ms-transition-duration': duration,
|
228
|
-
'-o-transition-duration': duration,
|
229
|
-
'transition-duration': duration
|
230
|
-
})
|
231
|
-
;
|
232
|
-
}
|
233
|
-
},
|
234
|
-
|
235
|
-
currentStageSize: function() {
|
36
|
+
$allModules.each(function () {
|
236
37
|
var
|
237
|
-
|
238
|
-
|
239
|
-
|
38
|
+
moduleSelector = $allModules.selector || '',
|
39
|
+
settings = $.isPlainObject(parameters)
|
40
|
+
? $.extend(true, {}, $.fn.shape.settings, parameters)
|
41
|
+
: $.extend({}, $.fn.shape.settings),
|
42
|
+
|
43
|
+
// internal aliases
|
44
|
+
namespace = settings.namespace,
|
45
|
+
selector = settings.selector,
|
46
|
+
error = settings.error,
|
47
|
+
className = settings.className,
|
48
|
+
|
49
|
+
// define namespaces for modules
|
50
|
+
eventNamespace = '.' + namespace,
|
51
|
+
moduleNamespace = 'module-' + namespace,
|
52
|
+
|
53
|
+
// selector cache
|
54
|
+
$module = $(this),
|
55
|
+
$sides = $module.find('>' + selector.sides),
|
56
|
+
$side = $sides.find('>' + selector.side),
|
57
|
+
|
58
|
+
// private variables
|
59
|
+
nextIndex = false,
|
60
|
+
$activeSide,
|
61
|
+
$nextSide,
|
62
|
+
|
63
|
+
// standard module
|
64
|
+
element = this,
|
65
|
+
instance = $module.data(moduleNamespace),
|
66
|
+
module
|
240
67
|
;
|
241
|
-
$module
|
242
|
-
.css({
|
243
|
-
width: width,
|
244
|
-
height: height
|
245
|
-
})
|
246
|
-
;
|
247
|
-
},
|
248
68
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
69
|
+
module = {
|
70
|
+
|
71
|
+
initialize: function () {
|
72
|
+
module.verbose('Initializing module for', element);
|
73
|
+
module.set.defaultSide();
|
74
|
+
module.instantiate();
|
75
|
+
},
|
76
|
+
|
77
|
+
instantiate: function () {
|
78
|
+
module.verbose('Storing instance of module', module);
|
79
|
+
instance = module;
|
80
|
+
$module
|
81
|
+
.data(moduleNamespace, instance)
|
82
|
+
;
|
83
|
+
},
|
84
|
+
|
85
|
+
destroy: function () {
|
86
|
+
module.verbose('Destroying previous module for', element);
|
87
|
+
$module
|
88
|
+
.removeData(moduleNamespace)
|
89
|
+
.off(eventNamespace)
|
90
|
+
;
|
91
|
+
},
|
92
|
+
|
93
|
+
refresh: function () {
|
94
|
+
module.verbose('Refreshing selector cache for', element);
|
95
|
+
$module = $(element);
|
96
|
+
$sides = $(this).find(selector.sides);
|
97
|
+
$side = $(this).find(selector.side);
|
98
|
+
},
|
99
|
+
|
100
|
+
repaint: function () {
|
101
|
+
module.verbose('Forcing repaint event');
|
102
|
+
var
|
103
|
+
shape = $sides[0] || document.createElement('div'),
|
104
|
+
fakeAssignment = shape.offsetWidth
|
105
|
+
;
|
106
|
+
},
|
107
|
+
|
108
|
+
animate: function (propertyObject, callback) {
|
109
|
+
module.verbose('Animating box with properties', propertyObject);
|
110
|
+
callback = callback || function (event) {
|
111
|
+
module.verbose('Executing animation callback');
|
112
|
+
if (event !== undefined) {
|
113
|
+
event.stopPropagation();
|
114
|
+
}
|
115
|
+
module.reset();
|
116
|
+
module.set.active();
|
117
|
+
};
|
118
|
+
settings.onBeforeChange.call($nextSide[0]);
|
119
|
+
if (module.get.transitionEvent()) {
|
120
|
+
module.verbose('Starting CSS animation');
|
121
|
+
$module
|
122
|
+
.addClass(className.animating)
|
123
|
+
;
|
124
|
+
$sides
|
125
|
+
.css(propertyObject)
|
126
|
+
.one(module.get.transitionEvent(), callback)
|
127
|
+
;
|
128
|
+
module.set.duration(settings.duration);
|
129
|
+
requestAnimationFrame(function () {
|
130
|
+
$module
|
131
|
+
.addClass(className.animating)
|
132
|
+
;
|
133
|
+
$activeSide
|
134
|
+
.addClass(className.hidden)
|
135
|
+
;
|
136
|
+
});
|
137
|
+
} else {
|
138
|
+
callback();
|
139
|
+
}
|
140
|
+
},
|
141
|
+
|
142
|
+
queue: function (method) {
|
143
|
+
module.debug('Queueing animation of', method);
|
144
|
+
$sides
|
145
|
+
.one(module.get.transitionEvent(), function () {
|
146
|
+
module.debug('Executing queued animation');
|
147
|
+
setTimeout(function () {
|
148
|
+
$module.shape(method);
|
149
|
+
}, 0);
|
150
|
+
})
|
151
|
+
;
|
152
|
+
},
|
153
|
+
|
154
|
+
reset: function () {
|
155
|
+
module.verbose('Animating states reset');
|
156
|
+
$module
|
157
|
+
.removeClass(className.animating)
|
158
|
+
.attr('style', '')
|
159
|
+
.removeAttr('style')
|
160
|
+
;
|
161
|
+
// removeAttr style does not consistently work in safari
|
162
|
+
$sides
|
163
|
+
.attr('style', '')
|
164
|
+
.removeAttr('style')
|
165
|
+
;
|
166
|
+
$side
|
167
|
+
.attr('style', '')
|
168
|
+
.removeAttr('style')
|
169
|
+
.removeClass(className.hidden)
|
170
|
+
;
|
171
|
+
$nextSide
|
172
|
+
.removeClass(className.animating)
|
173
|
+
.attr('style', '')
|
174
|
+
.removeAttr('style')
|
175
|
+
;
|
176
|
+
},
|
177
|
+
|
178
|
+
is: {
|
179
|
+
complete: function () {
|
180
|
+
return $side.filter('.' + className.active)[0] === $nextSide[0];
|
181
|
+
},
|
182
|
+
animating: function () {
|
183
|
+
return $module.hasClass(className.animating);
|
184
|
+
},
|
185
|
+
hidden: function () {
|
186
|
+
return $module.closest(':hidden').length > 0;
|
187
|
+
},
|
188
|
+
},
|
189
|
+
|
190
|
+
set: {
|
191
|
+
|
192
|
+
defaultSide: function () {
|
193
|
+
$activeSide = $side.filter('.' + settings.className.active);
|
194
|
+
$nextSide = $activeSide.next(selector.side).length > 0
|
195
|
+
? $activeSide.next(selector.side)
|
196
|
+
: $side.first();
|
197
|
+
nextIndex = false;
|
198
|
+
module.verbose('Active side set to', $activeSide);
|
199
|
+
module.verbose('Next side set to', $nextSide);
|
200
|
+
},
|
201
|
+
|
202
|
+
duration: function (duration) {
|
203
|
+
duration = duration || settings.duration;
|
204
|
+
duration = typeof duration === 'number'
|
205
|
+
? duration + 'ms'
|
206
|
+
: duration;
|
207
|
+
module.verbose('Setting animation duration', duration);
|
208
|
+
if (settings.duration || settings.duration === 0) {
|
209
|
+
$sides.add($side)
|
210
|
+
.css({
|
211
|
+
'transition-duration': duration,
|
212
|
+
})
|
213
|
+
;
|
214
|
+
}
|
215
|
+
},
|
216
|
+
|
217
|
+
currentStageSize: function () {
|
218
|
+
var
|
219
|
+
$activeSide = $side.filter('.' + settings.className.active),
|
220
|
+
width = $activeSide.outerWidth(true),
|
221
|
+
height = $activeSide.outerHeight(true)
|
222
|
+
;
|
223
|
+
$module
|
224
|
+
.css({
|
225
|
+
width: width,
|
226
|
+
height: height,
|
227
|
+
})
|
228
|
+
;
|
229
|
+
},
|
230
|
+
|
231
|
+
stageSize: function () {
|
232
|
+
var
|
233
|
+
$clone = $module.clone().addClass(className.loading),
|
234
|
+
$side = $clone.find('>' + selector.sides + '>' + selector.side),
|
235
|
+
$activeSide = $side.filter('.' + settings.className.active),
|
236
|
+
$nextSide = nextIndex
|
237
|
+
? $side.eq(nextIndex)
|
238
|
+
: ($activeSide.next(selector.side).length > 0
|
239
|
+
? $activeSide.next(selector.side)
|
240
|
+
: $side.first()),
|
241
|
+
newWidth = settings.width === 'next'
|
242
|
+
? $nextSide.outerWidth(true)
|
243
|
+
: (settings.width === 'initial'
|
244
|
+
? $module.width()
|
245
|
+
: settings.width),
|
246
|
+
newHeight = settings.height === 'next'
|
247
|
+
? $nextSide.outerHeight(true)
|
248
|
+
: (settings.height === 'initial'
|
249
|
+
? $module.height()
|
250
|
+
: settings.height)
|
251
|
+
;
|
252
|
+
$activeSide.removeClass(className.active);
|
253
|
+
$nextSide.addClass(className.active);
|
254
|
+
$clone.insertAfter($module);
|
255
|
+
$clone.remove();
|
256
|
+
if (settings.width !== 'auto') {
|
257
|
+
$module.css('width', newWidth + settings.jitter);
|
258
|
+
module.verbose('Specifying width during animation', newWidth);
|
259
|
+
}
|
260
|
+
if (settings.height !== 'auto') {
|
261
|
+
$module.css('height', newHeight + settings.jitter);
|
262
|
+
module.verbose('Specifying height during animation', newHeight);
|
263
|
+
}
|
264
|
+
},
|
265
|
+
|
266
|
+
nextSide: function (selector) {
|
267
|
+
nextIndex = selector;
|
268
|
+
$nextSide = $side.filter(selector);
|
269
|
+
nextIndex = $side.index($nextSide);
|
270
|
+
if ($nextSide.length === 0) {
|
271
|
+
module.set.defaultSide();
|
272
|
+
module.error(error.side);
|
273
|
+
}
|
274
|
+
module.verbose('Next side manually set to', $nextSide);
|
275
|
+
},
|
276
|
+
|
277
|
+
active: function () {
|
278
|
+
module.verbose('Setting new side to active', $nextSide);
|
279
|
+
$side
|
280
|
+
.removeClass(className.active)
|
281
|
+
;
|
282
|
+
$nextSide
|
283
|
+
.addClass(className.active)
|
284
|
+
;
|
285
|
+
settings.onChange.call($nextSide[0]);
|
286
|
+
module.set.defaultSide();
|
287
|
+
},
|
288
|
+
},
|
289
|
+
|
290
|
+
flip: {
|
291
|
+
to: function (type, stage) {
|
292
|
+
if (module.is.hidden()) {
|
293
|
+
module.debug('Module not visible', $nextSide);
|
294
|
+
|
295
|
+
return;
|
296
|
+
}
|
297
|
+
if (module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
|
298
|
+
module.debug('Side already visible', $nextSide);
|
299
|
+
|
300
|
+
return;
|
301
|
+
}
|
302
|
+
var
|
303
|
+
transform = module.get.transform[type]()
|
304
|
+
;
|
305
|
+
if (!module.is.animating()) {
|
306
|
+
module.debug('Flipping ' + type, $nextSide);
|
307
|
+
module.set.stageSize();
|
308
|
+
module.stage[stage]();
|
309
|
+
module.animate(transform);
|
310
|
+
} else {
|
311
|
+
module.queue('flip ' + type);
|
312
|
+
}
|
313
|
+
},
|
314
|
+
|
315
|
+
up: function () {
|
316
|
+
module.flip.to('up', 'above');
|
317
|
+
},
|
318
|
+
|
319
|
+
down: function () {
|
320
|
+
module.flip.to('down', 'below');
|
321
|
+
},
|
322
|
+
|
323
|
+
left: function () {
|
324
|
+
module.flip.to('left', 'left');
|
325
|
+
},
|
326
|
+
|
327
|
+
right: function () {
|
328
|
+
module.flip.to('right', 'right');
|
329
|
+
},
|
330
|
+
|
331
|
+
over: function () {
|
332
|
+
module.flip.to('over', 'behind');
|
333
|
+
},
|
334
|
+
|
335
|
+
back: function () {
|
336
|
+
module.flip.to('back', 'behind');
|
337
|
+
},
|
338
|
+
|
339
|
+
},
|
340
|
+
|
341
|
+
get: {
|
342
|
+
|
343
|
+
transform: {
|
344
|
+
up: function () {
|
345
|
+
var
|
346
|
+
translateZ = $activeSide.outerHeight(true) / 2,
|
347
|
+
translateY = $nextSide.outerHeight(true) - translateZ
|
348
|
+
;
|
349
|
+
|
350
|
+
return {
|
351
|
+
transform: 'translateY(' + translateY + 'px) translateZ(-' + translateZ + 'px) rotateX(-90deg)',
|
352
|
+
};
|
353
|
+
},
|
354
|
+
|
355
|
+
down: function () {
|
356
|
+
var
|
357
|
+
translate = {
|
358
|
+
z: $activeSide.outerHeight(true) / 2,
|
359
|
+
}
|
360
|
+
;
|
361
|
+
|
362
|
+
return {
|
363
|
+
transform: 'translateY(-' + translate.z + 'px) translateZ(-' + translate.z + 'px) rotateX(90deg)',
|
364
|
+
};
|
365
|
+
},
|
366
|
+
|
367
|
+
left: function () {
|
368
|
+
var
|
369
|
+
translateZ = $activeSide.outerWidth(true) / 2,
|
370
|
+
translateX = $nextSide.outerWidth(true) - translateZ
|
371
|
+
;
|
372
|
+
|
373
|
+
return {
|
374
|
+
transform: 'translateX(' + translateX + 'px) translateZ(-' + translateZ + 'px) rotateY(90deg)',
|
375
|
+
};
|
376
|
+
},
|
377
|
+
|
378
|
+
right: function () {
|
379
|
+
var
|
380
|
+
translate = {
|
381
|
+
z: $activeSide.outerWidth(true) / 2,
|
382
|
+
}
|
383
|
+
;
|
384
|
+
|
385
|
+
return {
|
386
|
+
transform: 'translateX(-' + translate.z + 'px) translateZ(-' + translate.z + 'px) rotateY(-90deg)',
|
387
|
+
};
|
388
|
+
},
|
389
|
+
|
390
|
+
over: function () {
|
391
|
+
var
|
392
|
+
translate = {
|
393
|
+
x: -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2),
|
394
|
+
}
|
395
|
+
;
|
396
|
+
|
397
|
+
return {
|
398
|
+
transform: 'translateX(' + translate.x + 'px) rotateY(180deg)',
|
399
|
+
};
|
400
|
+
},
|
401
|
+
|
402
|
+
back: function () {
|
403
|
+
var
|
404
|
+
translate = {
|
405
|
+
x: -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2),
|
406
|
+
}
|
407
|
+
;
|
408
|
+
|
409
|
+
return {
|
410
|
+
transform: 'translateX(' + translate.x + 'px) rotateY(-180deg)',
|
411
|
+
};
|
412
|
+
},
|
413
|
+
},
|
414
|
+
|
415
|
+
transitionEvent: function () {
|
416
|
+
var
|
417
|
+
element = document.createElement('element'),
|
418
|
+
transitions = {
|
419
|
+
transition: 'transitionend',
|
420
|
+
OTransition: 'oTransitionEnd',
|
421
|
+
MozTransition: 'transitionend',
|
422
|
+
WebkitTransition: 'webkitTransitionEnd',
|
423
|
+
},
|
424
|
+
transition
|
425
|
+
;
|
426
|
+
for (transition in transitions) {
|
427
|
+
if (element.style[transition] !== undefined) {
|
428
|
+
return transitions[transition];
|
429
|
+
}
|
430
|
+
}
|
431
|
+
},
|
432
|
+
|
433
|
+
nextSide: function () {
|
434
|
+
return $activeSide.next(selector.side).length > 0
|
435
|
+
? $activeSide.next(selector.side)
|
436
|
+
: $side.first();
|
437
|
+
},
|
438
|
+
|
439
|
+
},
|
440
|
+
|
441
|
+
stage: {
|
442
|
+
|
443
|
+
above: function () {
|
444
|
+
var
|
445
|
+
box = {
|
446
|
+
origin: ($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2,
|
447
|
+
depth: {
|
448
|
+
active: $nextSide.outerHeight(true) / 2,
|
449
|
+
next: $activeSide.outerHeight(true) / 2,
|
450
|
+
},
|
451
|
+
}
|
452
|
+
;
|
453
|
+
module.verbose('Setting the initial animation position as above', $nextSide, box);
|
454
|
+
$activeSide
|
455
|
+
.css({
|
456
|
+
transform: 'rotateX(0deg)',
|
457
|
+
})
|
458
|
+
;
|
459
|
+
$nextSide
|
460
|
+
.addClass(className.animating)
|
461
|
+
.css({
|
462
|
+
top: box.origin + 'px',
|
463
|
+
transform: 'rotateX(90deg) translateZ(' + box.depth.next + 'px) translateY(-' + box.depth.active + 'px)',
|
464
|
+
})
|
465
|
+
;
|
466
|
+
},
|
467
|
+
|
468
|
+
below: function () {
|
469
|
+
var
|
470
|
+
box = {
|
471
|
+
origin: ($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2,
|
472
|
+
depth: {
|
473
|
+
active: $nextSide.outerHeight(true) / 2,
|
474
|
+
next: $activeSide.outerHeight(true) / 2,
|
475
|
+
},
|
476
|
+
}
|
477
|
+
;
|
478
|
+
module.verbose('Setting the initial animation position as below', $nextSide, box);
|
479
|
+
$activeSide
|
480
|
+
.css({
|
481
|
+
transform: 'rotateX(0deg)',
|
482
|
+
})
|
483
|
+
;
|
484
|
+
$nextSide
|
485
|
+
.addClass(className.animating)
|
486
|
+
.css({
|
487
|
+
top: box.origin + 'px',
|
488
|
+
transform: 'rotateX(-90deg) translateZ(' + box.depth.next + 'px) translateY(' + box.depth.active + 'px)',
|
489
|
+
})
|
490
|
+
;
|
491
|
+
},
|
492
|
+
|
493
|
+
left: function () {
|
494
|
+
var
|
495
|
+
height = {
|
496
|
+
active: $activeSide.outerWidth(true),
|
497
|
+
next: $nextSide.outerWidth(true),
|
498
|
+
},
|
499
|
+
box = {
|
500
|
+
origin: (height.active - height.next) / 2,
|
501
|
+
depth: {
|
502
|
+
active: height.next / 2,
|
503
|
+
next: height.active / 2,
|
504
|
+
},
|
505
|
+
}
|
506
|
+
;
|
507
|
+
module.verbose('Setting the initial animation position as left', $nextSide, box);
|
508
|
+
$activeSide
|
509
|
+
.css({
|
510
|
+
transform: 'rotateY(0deg)',
|
511
|
+
})
|
512
|
+
;
|
513
|
+
$nextSide
|
514
|
+
.addClass(className.animating)
|
515
|
+
.css({
|
516
|
+
left: box.origin + 'px',
|
517
|
+
transform: 'rotateY(-90deg) translateZ(' + box.depth.next + 'px) translateX(-' + box.depth.active + 'px)',
|
518
|
+
})
|
519
|
+
;
|
520
|
+
},
|
521
|
+
|
522
|
+
right: function () {
|
523
|
+
var
|
524
|
+
height = {
|
525
|
+
active: $activeSide.outerWidth(true),
|
526
|
+
next: $nextSide.outerWidth(true),
|
527
|
+
},
|
528
|
+
box = {
|
529
|
+
origin: (height.active - height.next) / 2,
|
530
|
+
depth: {
|
531
|
+
active: height.next / 2,
|
532
|
+
next: height.active / 2,
|
533
|
+
},
|
534
|
+
}
|
535
|
+
;
|
536
|
+
module.verbose('Setting the initial animation position as right', $nextSide, box);
|
537
|
+
$activeSide
|
538
|
+
.css({
|
539
|
+
transform: 'rotateY(0deg)',
|
540
|
+
})
|
541
|
+
;
|
542
|
+
$nextSide
|
543
|
+
.addClass(className.animating)
|
544
|
+
.css({
|
545
|
+
left: box.origin + 'px',
|
546
|
+
transform: 'rotateY(90deg) translateZ(' + box.depth.next + 'px) translateX(' + box.depth.active + 'px)',
|
547
|
+
})
|
548
|
+
;
|
549
|
+
},
|
550
|
+
|
551
|
+
behind: function () {
|
552
|
+
var
|
553
|
+
height = {
|
554
|
+
active: $activeSide.outerWidth(true),
|
555
|
+
next: $nextSide.outerWidth(true),
|
556
|
+
},
|
557
|
+
box = {
|
558
|
+
origin: (height.active - height.next) / 2,
|
559
|
+
depth: {
|
560
|
+
active: height.next / 2,
|
561
|
+
next: height.active / 2,
|
562
|
+
},
|
563
|
+
}
|
564
|
+
;
|
565
|
+
module.verbose('Setting the initial animation position as behind', $nextSide, box);
|
566
|
+
$activeSide
|
567
|
+
.css({
|
568
|
+
transform: 'rotateY(0deg)',
|
569
|
+
})
|
570
|
+
;
|
571
|
+
$nextSide
|
572
|
+
.addClass(className.animating)
|
573
|
+
.css({
|
574
|
+
left: box.origin + 'px',
|
575
|
+
transform: 'rotateY(-180deg)',
|
576
|
+
})
|
577
|
+
;
|
578
|
+
},
|
579
|
+
},
|
580
|
+
setting: function (name, value) {
|
581
|
+
module.debug('Changing setting', name, value);
|
582
|
+
if ($.isPlainObject(name)) {
|
583
|
+
$.extend(true, settings, name);
|
584
|
+
} else if (value !== undefined) {
|
585
|
+
if ($.isPlainObject(settings[name])) {
|
586
|
+
$.extend(true, settings[name], value);
|
587
|
+
} else {
|
588
|
+
settings[name] = value;
|
589
|
+
}
|
590
|
+
} else {
|
591
|
+
return settings[name];
|
592
|
+
}
|
593
|
+
},
|
594
|
+
internal: function (name, value) {
|
595
|
+
if ($.isPlainObject(name)) {
|
596
|
+
$.extend(true, module, name);
|
597
|
+
} else if (value !== undefined) {
|
598
|
+
module[name] = value;
|
599
|
+
} else {
|
600
|
+
return module[name];
|
601
|
+
}
|
602
|
+
},
|
603
|
+
debug: function () {
|
604
|
+
if (!settings.silent && settings.debug) {
|
605
|
+
if (settings.performance) {
|
606
|
+
module.performance.log(arguments);
|
607
|
+
} else {
|
608
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
609
|
+
module.debug.apply(console, arguments);
|
610
|
+
}
|
611
|
+
}
|
612
|
+
},
|
613
|
+
verbose: function () {
|
614
|
+
if (!settings.silent && settings.verbose && settings.debug) {
|
615
|
+
if (settings.performance) {
|
616
|
+
module.performance.log(arguments);
|
617
|
+
} else {
|
618
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
619
|
+
module.verbose.apply(console, arguments);
|
620
|
+
}
|
621
|
+
}
|
622
|
+
},
|
623
|
+
error: function () {
|
624
|
+
if (!settings.silent) {
|
625
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
626
|
+
module.error.apply(console, arguments);
|
627
|
+
}
|
628
|
+
},
|
629
|
+
performance: {
|
630
|
+
log: function (message) {
|
631
|
+
var
|
632
|
+
currentTime,
|
633
|
+
executionTime,
|
634
|
+
previousTime
|
635
|
+
;
|
636
|
+
if (settings.performance) {
|
637
|
+
currentTime = Date.now();
|
638
|
+
previousTime = time || currentTime;
|
639
|
+
executionTime = currentTime - previousTime;
|
640
|
+
time = currentTime;
|
641
|
+
performance.push({
|
642
|
+
Name: message[0],
|
643
|
+
Arguments: [].slice.call(message, 1) || '',
|
644
|
+
Element: element,
|
645
|
+
'Execution Time': executionTime,
|
646
|
+
});
|
647
|
+
}
|
648
|
+
clearTimeout(module.performance.timer);
|
649
|
+
module.performance.timer = setTimeout(module.performance.display, 500);
|
650
|
+
},
|
651
|
+
display: function () {
|
652
|
+
var
|
653
|
+
title = settings.name + ':',
|
654
|
+
totalTime = 0
|
655
|
+
;
|
656
|
+
time = false;
|
657
|
+
clearTimeout(module.performance.timer);
|
658
|
+
$.each(performance, function (index, data) {
|
659
|
+
totalTime += data['Execution Time'];
|
660
|
+
});
|
661
|
+
title += ' ' + totalTime + 'ms';
|
662
|
+
if (moduleSelector) {
|
663
|
+
title += ' \'' + moduleSelector + '\'';
|
664
|
+
}
|
665
|
+
if ($allModules.length > 1) {
|
666
|
+
title += ' (' + $allModules.length + ')';
|
667
|
+
}
|
668
|
+
if (performance.length > 0) {
|
669
|
+
console.groupCollapsed(title);
|
670
|
+
if (console.table) {
|
671
|
+
console.table(performance);
|
672
|
+
} else {
|
673
|
+
$.each(performance, function (index, data) {
|
674
|
+
console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
|
675
|
+
});
|
676
|
+
}
|
677
|
+
console.groupEnd();
|
678
|
+
}
|
679
|
+
performance = [];
|
680
|
+
},
|
681
|
+
},
|
682
|
+
invoke: function (query, passedArguments, context) {
|
683
|
+
var
|
684
|
+
object = instance,
|
685
|
+
maxDepth,
|
686
|
+
found,
|
687
|
+
response
|
688
|
+
;
|
689
|
+
passedArguments = passedArguments || queryArguments;
|
690
|
+
context = context || element;
|
691
|
+
if (typeof query === 'string' && object !== undefined) {
|
692
|
+
query = query.split(/[ .]/);
|
693
|
+
maxDepth = query.length - 1;
|
694
|
+
$.each(query, function (depth, value) {
|
695
|
+
var camelCaseValue = depth !== maxDepth
|
696
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
697
|
+
: query
|
698
|
+
;
|
699
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
700
|
+
object = object[camelCaseValue];
|
701
|
+
} else if (object[camelCaseValue] !== undefined) {
|
702
|
+
found = object[camelCaseValue];
|
703
|
+
|
704
|
+
return false;
|
705
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
706
|
+
object = object[value];
|
707
|
+
} else if (object[value] !== undefined) {
|
708
|
+
found = object[value];
|
709
|
+
|
710
|
+
return false;
|
711
|
+
} else {
|
712
|
+
module.error(error.method, query);
|
713
|
+
|
714
|
+
return false;
|
715
|
+
}
|
716
|
+
});
|
717
|
+
}
|
718
|
+
if (isFunction(found)) {
|
719
|
+
response = found.apply(context, passedArguments);
|
720
|
+
} else if (found !== undefined) {
|
721
|
+
response = found;
|
722
|
+
}
|
723
|
+
if (Array.isArray(returnedValue)) {
|
724
|
+
returnedValue.push(response);
|
725
|
+
} else if (returnedValue !== undefined) {
|
726
|
+
returnedValue = [returnedValue, response];
|
727
|
+
} else if (response !== undefined) {
|
728
|
+
returnedValue = response;
|
729
|
+
}
|
730
|
+
|
731
|
+
return found;
|
732
|
+
},
|
733
|
+
};
|
734
|
+
|
735
|
+
if (methodInvoked) {
|
736
|
+
if (instance === undefined) {
|
737
|
+
module.initialize();
|
738
|
+
}
|
739
|
+
var $inputs = $module.find('input');
|
740
|
+
if ($inputs.length > 0) {
|
741
|
+
$inputs.trigger('blur');
|
742
|
+
setTimeout(function () {
|
743
|
+
module.invoke(query);
|
744
|
+
}, 150);
|
745
|
+
} else {
|
746
|
+
module.invoke(query);
|
747
|
+
}
|
748
|
+
} else {
|
749
|
+
if (instance !== undefined) {
|
750
|
+
instance.invoke('destroy');
|
751
|
+
}
|
752
|
+
module.initialize();
|
291
753
|
}
|
292
|
-
|
293
|
-
},
|
754
|
+
});
|
294
755
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
;
|
300
|
-
$nextSide
|
301
|
-
.addClass(className.active)
|
302
|
-
;
|
303
|
-
settings.onChange.call($nextSide[0]);
|
304
|
-
module.set.defaultSide();
|
305
|
-
}
|
306
|
-
},
|
756
|
+
return returnedValue !== undefined
|
757
|
+
? returnedValue
|
758
|
+
: this;
|
759
|
+
};
|
307
760
|
|
308
|
-
|
309
|
-
to: function(type,stage){
|
310
|
-
if(module.is.hidden()) {
|
311
|
-
module.debug('Module not visible', $nextSide);
|
312
|
-
return;
|
313
|
-
}
|
314
|
-
if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
|
315
|
-
module.debug('Side already visible', $nextSide);
|
316
|
-
return;
|
317
|
-
}
|
318
|
-
var
|
319
|
-
transform = module.get.transform[type]()
|
320
|
-
;
|
321
|
-
if( !module.is.animating()) {
|
322
|
-
module.debug('Flipping '+type, $nextSide);
|
323
|
-
module.set.stageSize();
|
324
|
-
module.stage[stage]();
|
325
|
-
module.animate(transform);
|
326
|
-
}
|
327
|
-
else {
|
328
|
-
module.queue('flip '+type);
|
329
|
-
}
|
330
|
-
},
|
761
|
+
$.fn.shape.settings = {
|
331
762
|
|
332
|
-
|
333
|
-
|
334
|
-
},
|
763
|
+
// module info
|
764
|
+
name: 'Shape',
|
335
765
|
|
336
|
-
|
337
|
-
|
338
|
-
},
|
766
|
+
// hide all debug content
|
767
|
+
silent: false,
|
339
768
|
|
340
|
-
|
341
|
-
|
342
|
-
},
|
769
|
+
// debug content outputted to console
|
770
|
+
debug: false,
|
343
771
|
|
344
|
-
|
345
|
-
|
346
|
-
},
|
772
|
+
// verbose debug output
|
773
|
+
verbose: false,
|
347
774
|
|
348
|
-
|
349
|
-
|
350
|
-
},
|
775
|
+
// fudge factor in pixels when swapping from 2d to 3d (can be useful to correct rounding errors)
|
776
|
+
jitter: 0,
|
351
777
|
|
352
|
-
|
353
|
-
|
354
|
-
}
|
778
|
+
// performance data output
|
779
|
+
performance: true,
|
355
780
|
|
356
|
-
|
781
|
+
// event namespace
|
782
|
+
namespace: 'shape',
|
357
783
|
|
358
|
-
|
359
|
-
|
360
|
-
transform: {
|
361
|
-
up: function() {
|
362
|
-
var
|
363
|
-
translateZ = $activeSide.outerHeight(true) / 2,
|
364
|
-
translateY = $nextSide.outerHeight(true) - translateZ
|
365
|
-
;
|
366
|
-
return {
|
367
|
-
transform: 'translateY(' + translateY + 'px) translateZ(-'+ translateZ + 'px) rotateX(-90deg)'
|
368
|
-
};
|
369
|
-
},
|
370
|
-
|
371
|
-
down: function() {
|
372
|
-
var
|
373
|
-
translate = {
|
374
|
-
z: $activeSide.outerHeight(true) / 2
|
375
|
-
}
|
376
|
-
;
|
377
|
-
return {
|
378
|
-
transform: 'translateY(-' + translate.z + 'px) translateZ(-'+ translate.z + 'px) rotateX(90deg)'
|
379
|
-
};
|
380
|
-
},
|
381
|
-
|
382
|
-
left: function() {
|
383
|
-
var
|
384
|
-
translateZ = $activeSide.outerWidth(true) / 2,
|
385
|
-
translateX = $nextSide.outerWidth(true) - translateZ
|
386
|
-
;
|
387
|
-
return {
|
388
|
-
transform: 'translateX(' + translateX + 'px) translateZ(-' + translateZ + 'px) rotateY(90deg)'
|
389
|
-
};
|
390
|
-
},
|
391
|
-
|
392
|
-
right: function() {
|
393
|
-
var
|
394
|
-
translate = {
|
395
|
-
z : $activeSide.outerWidth(true) / 2
|
396
|
-
}
|
397
|
-
;
|
398
|
-
return {
|
399
|
-
transform: 'translateX(-' + translate.z + 'px) translateZ(-' + translate.z + 'px) rotateY(-90deg)'
|
400
|
-
};
|
401
|
-
},
|
402
|
-
|
403
|
-
over: function() {
|
404
|
-
var
|
405
|
-
translate = {
|
406
|
-
x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2)
|
407
|
-
}
|
408
|
-
;
|
409
|
-
return {
|
410
|
-
transform: 'translateX(' + translate.x + 'px) rotateY(180deg)'
|
411
|
-
};
|
412
|
-
},
|
413
|
-
|
414
|
-
back: function() {
|
415
|
-
var
|
416
|
-
translate = {
|
417
|
-
x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2)
|
418
|
-
}
|
419
|
-
;
|
420
|
-
return {
|
421
|
-
transform: 'translateX(' + translate.x + 'px) rotateY(-180deg)'
|
422
|
-
};
|
423
|
-
}
|
424
|
-
},
|
784
|
+
// width during animation, can be set to 'auto', initial', 'next' or pixel amount
|
785
|
+
width: 'initial',
|
425
786
|
|
426
|
-
|
427
|
-
|
428
|
-
element = document.createElement('element'),
|
429
|
-
transitions = {
|
430
|
-
'transition' :'transitionend',
|
431
|
-
'OTransition' :'oTransitionEnd',
|
432
|
-
'MozTransition' :'transitionend',
|
433
|
-
'WebkitTransition' :'webkitTransitionEnd'
|
434
|
-
},
|
435
|
-
transition
|
436
|
-
;
|
437
|
-
for(transition in transitions){
|
438
|
-
if( element.style[transition] !== undefined ){
|
439
|
-
return transitions[transition];
|
440
|
-
}
|
441
|
-
}
|
442
|
-
},
|
787
|
+
// height during animation, can be set to 'auto', 'initial', 'next' or pixel amount
|
788
|
+
height: 'initial',
|
443
789
|
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
: $side.first()
|
448
|
-
;
|
449
|
-
}
|
790
|
+
// callback occurs on side change
|
791
|
+
onBeforeChange: function () {},
|
792
|
+
onChange: function () {},
|
450
793
|
|
451
|
-
|
794
|
+
// allow animation to same side
|
795
|
+
allowRepeats: false,
|
452
796
|
|
453
|
-
|
797
|
+
// animation duration
|
798
|
+
duration: false,
|
454
799
|
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
depth : {
|
460
|
-
active : ($nextSide.outerHeight(true) / 2),
|
461
|
-
next : ($activeSide.outerHeight(true) / 2)
|
462
|
-
}
|
463
|
-
}
|
464
|
-
;
|
465
|
-
module.verbose('Setting the initial animation position as above', $nextSide, box);
|
466
|
-
$activeSide
|
467
|
-
.css({
|
468
|
-
'transform' : 'rotateX(0deg)'
|
469
|
-
})
|
470
|
-
;
|
471
|
-
$nextSide
|
472
|
-
.addClass(className.animating)
|
473
|
-
.css({
|
474
|
-
'top' : box.origin + 'px',
|
475
|
-
'transform' : 'rotateX(90deg) translateZ(' + box.depth.next + 'px) translateY(-' + box.depth.active + 'px)'
|
476
|
-
})
|
477
|
-
;
|
478
|
-
},
|
479
|
-
|
480
|
-
below: function() {
|
481
|
-
var
|
482
|
-
box = {
|
483
|
-
origin : (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
|
484
|
-
depth : {
|
485
|
-
active : ($nextSide.outerHeight(true) / 2),
|
486
|
-
next : ($activeSide.outerHeight(true) / 2)
|
487
|
-
}
|
488
|
-
}
|
489
|
-
;
|
490
|
-
module.verbose('Setting the initial animation position as below', $nextSide, box);
|
491
|
-
$activeSide
|
492
|
-
.css({
|
493
|
-
'transform' : 'rotateX(0deg)'
|
494
|
-
})
|
495
|
-
;
|
496
|
-
$nextSide
|
497
|
-
.addClass(className.animating)
|
498
|
-
.css({
|
499
|
-
'top' : box.origin + 'px',
|
500
|
-
'transform' : 'rotateX(-90deg) translateZ(' + box.depth.next + 'px) translateY(' + box.depth.active + 'px)'
|
501
|
-
})
|
502
|
-
;
|
503
|
-
},
|
504
|
-
|
505
|
-
left: function() {
|
506
|
-
var
|
507
|
-
height = {
|
508
|
-
active : $activeSide.outerWidth(true),
|
509
|
-
next : $nextSide.outerWidth(true)
|
510
|
-
},
|
511
|
-
box = {
|
512
|
-
origin : ( ( height.active - height.next ) / 2),
|
513
|
-
depth : {
|
514
|
-
active : (height.next / 2),
|
515
|
-
next : (height.active / 2)
|
516
|
-
}
|
517
|
-
}
|
518
|
-
;
|
519
|
-
module.verbose('Setting the initial animation position as left', $nextSide, box);
|
520
|
-
$activeSide
|
521
|
-
.css({
|
522
|
-
'transform' : 'rotateY(0deg)'
|
523
|
-
})
|
524
|
-
;
|
525
|
-
$nextSide
|
526
|
-
.addClass(className.animating)
|
527
|
-
.css({
|
528
|
-
'left' : box.origin + 'px',
|
529
|
-
'transform' : 'rotateY(-90deg) translateZ(' + box.depth.next + 'px) translateX(-' + box.depth.active + 'px)'
|
530
|
-
})
|
531
|
-
;
|
532
|
-
},
|
533
|
-
|
534
|
-
right: function() {
|
535
|
-
var
|
536
|
-
height = {
|
537
|
-
active : $activeSide.outerWidth(true),
|
538
|
-
next : $nextSide.outerWidth(true)
|
539
|
-
},
|
540
|
-
box = {
|
541
|
-
origin : ( ( height.active - height.next ) / 2),
|
542
|
-
depth : {
|
543
|
-
active : (height.next / 2),
|
544
|
-
next : (height.active / 2)
|
545
|
-
}
|
546
|
-
}
|
547
|
-
;
|
548
|
-
module.verbose('Setting the initial animation position as right', $nextSide, box);
|
549
|
-
$activeSide
|
550
|
-
.css({
|
551
|
-
'transform' : 'rotateY(0deg)'
|
552
|
-
})
|
553
|
-
;
|
554
|
-
$nextSide
|
555
|
-
.addClass(className.animating)
|
556
|
-
.css({
|
557
|
-
'left' : box.origin + 'px',
|
558
|
-
'transform' : 'rotateY(90deg) translateZ(' + box.depth.next + 'px) translateX(' + box.depth.active + 'px)'
|
559
|
-
})
|
560
|
-
;
|
561
|
-
},
|
562
|
-
|
563
|
-
behind: function() {
|
564
|
-
var
|
565
|
-
height = {
|
566
|
-
active : $activeSide.outerWidth(true),
|
567
|
-
next : $nextSide.outerWidth(true)
|
568
|
-
},
|
569
|
-
box = {
|
570
|
-
origin : ( ( height.active - height.next ) / 2),
|
571
|
-
depth : {
|
572
|
-
active : (height.next / 2),
|
573
|
-
next : (height.active / 2)
|
574
|
-
}
|
575
|
-
}
|
576
|
-
;
|
577
|
-
module.verbose('Setting the initial animation position as behind', $nextSide, box);
|
578
|
-
$activeSide
|
579
|
-
.css({
|
580
|
-
'transform' : 'rotateY(0deg)'
|
581
|
-
})
|
582
|
-
;
|
583
|
-
$nextSide
|
584
|
-
.addClass(className.animating)
|
585
|
-
.css({
|
586
|
-
'left' : box.origin + 'px',
|
587
|
-
'transform' : 'rotateY(-180deg)'
|
588
|
-
})
|
589
|
-
;
|
590
|
-
}
|
591
|
-
},
|
592
|
-
setting: function(name, value) {
|
593
|
-
module.debug('Changing setting', name, value);
|
594
|
-
if( $.isPlainObject(name) ) {
|
595
|
-
$.extend(true, settings, name);
|
596
|
-
}
|
597
|
-
else if(value !== undefined) {
|
598
|
-
if($.isPlainObject(settings[name])) {
|
599
|
-
$.extend(true, settings[name], value);
|
600
|
-
}
|
601
|
-
else {
|
602
|
-
settings[name] = value;
|
603
|
-
}
|
604
|
-
}
|
605
|
-
else {
|
606
|
-
return settings[name];
|
607
|
-
}
|
608
|
-
},
|
609
|
-
internal: function(name, value) {
|
610
|
-
if( $.isPlainObject(name) ) {
|
611
|
-
$.extend(true, module, name);
|
612
|
-
}
|
613
|
-
else if(value !== undefined) {
|
614
|
-
module[name] = value;
|
615
|
-
}
|
616
|
-
else {
|
617
|
-
return module[name];
|
618
|
-
}
|
619
|
-
},
|
620
|
-
debug: function() {
|
621
|
-
if(!settings.silent && settings.debug) {
|
622
|
-
if(settings.performance) {
|
623
|
-
module.performance.log(arguments);
|
624
|
-
}
|
625
|
-
else {
|
626
|
-
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
627
|
-
module.debug.apply(console, arguments);
|
628
|
-
}
|
629
|
-
}
|
630
|
-
},
|
631
|
-
verbose: function() {
|
632
|
-
if(!settings.silent && settings.verbose && settings.debug) {
|
633
|
-
if(settings.performance) {
|
634
|
-
module.performance.log(arguments);
|
635
|
-
}
|
636
|
-
else {
|
637
|
-
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
638
|
-
module.verbose.apply(console, arguments);
|
639
|
-
}
|
640
|
-
}
|
800
|
+
// possible errors
|
801
|
+
error: {
|
802
|
+
side: 'You tried to switch to a side that does not exist.',
|
803
|
+
method: 'The method you called is not defined',
|
641
804
|
},
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
805
|
+
|
806
|
+
// classnames used
|
807
|
+
className: {
|
808
|
+
animating: 'animating',
|
809
|
+
hidden: 'hidden',
|
810
|
+
loading: 'loading',
|
811
|
+
active: 'active',
|
647
812
|
},
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
previousTime
|
654
|
-
;
|
655
|
-
if(settings.performance) {
|
656
|
-
currentTime = new Date().getTime();
|
657
|
-
previousTime = time || currentTime;
|
658
|
-
executionTime = currentTime - previousTime;
|
659
|
-
time = currentTime;
|
660
|
-
performance.push({
|
661
|
-
'Name' : message[0],
|
662
|
-
'Arguments' : [].slice.call(message, 1) || '',
|
663
|
-
'Element' : element,
|
664
|
-
'Execution Time' : executionTime
|
665
|
-
});
|
666
|
-
}
|
667
|
-
clearTimeout(module.performance.timer);
|
668
|
-
module.performance.timer = setTimeout(module.performance.display, 500);
|
669
|
-
},
|
670
|
-
display: function() {
|
671
|
-
var
|
672
|
-
title = settings.name + ':',
|
673
|
-
totalTime = 0
|
674
|
-
;
|
675
|
-
time = false;
|
676
|
-
clearTimeout(module.performance.timer);
|
677
|
-
$.each(performance, function(index, data) {
|
678
|
-
totalTime += data['Execution Time'];
|
679
|
-
});
|
680
|
-
title += ' ' + totalTime + 'ms';
|
681
|
-
if(moduleSelector) {
|
682
|
-
title += ' \'' + moduleSelector + '\'';
|
683
|
-
}
|
684
|
-
if($allModules.length > 1) {
|
685
|
-
title += ' ' + '(' + $allModules.length + ')';
|
686
|
-
}
|
687
|
-
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
688
|
-
console.groupCollapsed(title);
|
689
|
-
if(console.table) {
|
690
|
-
console.table(performance);
|
691
|
-
}
|
692
|
-
else {
|
693
|
-
$.each(performance, function(index, data) {
|
694
|
-
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
695
|
-
});
|
696
|
-
}
|
697
|
-
console.groupEnd();
|
698
|
-
}
|
699
|
-
performance = [];
|
700
|
-
}
|
813
|
+
|
814
|
+
// selectors used
|
815
|
+
selector: {
|
816
|
+
sides: '.sides',
|
817
|
+
side: '.side',
|
701
818
|
},
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
maxDepth,
|
706
|
-
found,
|
707
|
-
response
|
708
|
-
;
|
709
|
-
passedArguments = passedArguments || queryArguments;
|
710
|
-
context = context || element;
|
711
|
-
if(typeof query == 'string' && object !== undefined) {
|
712
|
-
query = query.split(/[\. ]/);
|
713
|
-
maxDepth = query.length - 1;
|
714
|
-
$.each(query, function(depth, value) {
|
715
|
-
var camelCaseValue = (depth != maxDepth)
|
716
|
-
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
717
|
-
: query
|
718
|
-
;
|
719
|
-
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
720
|
-
object = object[camelCaseValue];
|
721
|
-
}
|
722
|
-
else if( object[camelCaseValue] !== undefined ) {
|
723
|
-
found = object[camelCaseValue];
|
724
|
-
return false;
|
725
|
-
}
|
726
|
-
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
727
|
-
object = object[value];
|
728
|
-
}
|
729
|
-
else if( object[value] !== undefined ) {
|
730
|
-
found = object[value];
|
731
|
-
return false;
|
732
|
-
}
|
733
|
-
else {
|
734
|
-
return false;
|
735
|
-
}
|
736
|
-
});
|
737
|
-
}
|
738
|
-
if ( $.isFunction( found ) ) {
|
739
|
-
response = found.apply(context, passedArguments);
|
740
|
-
}
|
741
|
-
else if(found !== undefined) {
|
742
|
-
response = found;
|
743
|
-
}
|
744
|
-
if(Array.isArray(returnedValue)) {
|
745
|
-
returnedValue.push(response);
|
746
|
-
}
|
747
|
-
else if(returnedValue !== undefined) {
|
748
|
-
returnedValue = [returnedValue, response];
|
749
|
-
}
|
750
|
-
else if(response !== undefined) {
|
751
|
-
returnedValue = response;
|
752
|
-
}
|
753
|
-
return found;
|
754
|
-
}
|
755
|
-
};
|
756
|
-
|
757
|
-
if(methodInvoked) {
|
758
|
-
if(instance === undefined) {
|
759
|
-
module.initialize();
|
760
|
-
}
|
761
|
-
var $inputs = $module.find('input');
|
762
|
-
if( $inputs.length > 0) {
|
763
|
-
$inputs.blur();
|
764
|
-
setTimeout(function(){
|
765
|
-
module.invoke(query);
|
766
|
-
}, 150);
|
767
|
-
} else {
|
768
|
-
module.invoke(query);
|
769
|
-
}
|
770
|
-
}
|
771
|
-
else {
|
772
|
-
if(instance !== undefined) {
|
773
|
-
instance.invoke('destroy');
|
774
|
-
}
|
775
|
-
module.initialize();
|
776
|
-
}
|
777
|
-
})
|
778
|
-
;
|
779
|
-
|
780
|
-
return (returnedValue !== undefined)
|
781
|
-
? returnedValue
|
782
|
-
: this
|
783
|
-
;
|
784
|
-
};
|
785
|
-
|
786
|
-
$.fn.shape.settings = {
|
787
|
-
|
788
|
-
// module info
|
789
|
-
name : 'Shape',
|
790
|
-
|
791
|
-
// hide all debug content
|
792
|
-
silent : false,
|
793
|
-
|
794
|
-
// debug content outputted to console
|
795
|
-
debug : false,
|
796
|
-
|
797
|
-
// verbose debug output
|
798
|
-
verbose : false,
|
799
|
-
|
800
|
-
// fudge factor in pixels when swapping from 2d to 3d (can be useful to correct rounding errors)
|
801
|
-
jitter : 0,
|
802
|
-
|
803
|
-
// performance data output
|
804
|
-
performance: true,
|
805
|
-
|
806
|
-
// event namespace
|
807
|
-
namespace : 'shape',
|
808
|
-
|
809
|
-
// width during animation, can be set to 'auto', initial', 'next' or pixel amount
|
810
|
-
width: 'initial',
|
811
|
-
|
812
|
-
// height during animation, can be set to 'auto', 'initial', 'next' or pixel amount
|
813
|
-
height: 'initial',
|
814
|
-
|
815
|
-
// callback occurs on side change
|
816
|
-
onBeforeChange : function() {},
|
817
|
-
onChange : function() {},
|
818
|
-
|
819
|
-
// allow animation to same side
|
820
|
-
allowRepeats: false,
|
821
|
-
|
822
|
-
// animation duration
|
823
|
-
duration : false,
|
824
|
-
|
825
|
-
// possible errors
|
826
|
-
error: {
|
827
|
-
side : 'You tried to switch to a side that does not exist.',
|
828
|
-
method : 'The method you called is not defined'
|
829
|
-
},
|
830
|
-
|
831
|
-
// classnames used
|
832
|
-
className : {
|
833
|
-
animating : 'animating',
|
834
|
-
hidden : 'hidden',
|
835
|
-
loading : 'loading',
|
836
|
-
active : 'active'
|
837
|
-
},
|
838
|
-
|
839
|
-
// selectors used
|
840
|
-
selector : {
|
841
|
-
sides : '.sides',
|
842
|
-
side : '.side'
|
843
|
-
}
|
844
|
-
|
845
|
-
};
|
846
|
-
|
847
|
-
|
848
|
-
})( jQuery, window, document );
|
819
|
+
|
820
|
+
};
|
821
|
+
})(jQuery, window, document);
|