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/tab.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1
|
2
|
+
* # Fomantic-UI 2.9.1 - Tab
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -8,1012 +8,948 @@
|
|
8
8
|
*
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}
|
21
|
-
|
22
|
-
window =
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
$
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
activeTabPath,
|
77
|
-
parameterArray,
|
78
|
-
module,
|
79
|
-
|
80
|
-
historyEvent
|
81
|
-
|
82
|
-
;
|
83
|
-
|
84
|
-
module = {
|
85
|
-
|
86
|
-
initialize: function() {
|
87
|
-
module.debug('Initializing tab menu item', $module);
|
88
|
-
module.fix.callbacks();
|
89
|
-
module.determineTabs();
|
90
|
-
|
91
|
-
module.debug('Determining tabs', settings.context, $tabs);
|
92
|
-
// set up automatic routing
|
93
|
-
if(settings.auto) {
|
94
|
-
module.set.auto();
|
95
|
-
}
|
96
|
-
module.bind.events();
|
97
|
-
|
98
|
-
if(settings.history && !initializedHistory) {
|
99
|
-
module.initializeHistory();
|
100
|
-
initializedHistory = true;
|
101
|
-
}
|
102
|
-
|
103
|
-
var activeTab = module.determine.activeTab();
|
104
|
-
if(settings.autoTabActivation && instance === undefined && activeTab == null) {
|
105
|
-
activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
|
106
|
-
module.debug('No active tab detected, setting tab active', activeTab);
|
107
|
-
module.changeTab(activeTab);
|
108
|
-
}
|
109
|
-
if(activeTab != null && settings.history) {
|
110
|
-
var autoUpdate = $.address.autoUpdate();
|
111
|
-
$.address.autoUpdate(false);
|
112
|
-
$.address.value(activeTab);
|
113
|
-
$.address.autoUpdate(autoUpdate);
|
114
|
-
}
|
115
|
-
|
116
|
-
module.instantiate();
|
117
|
-
},
|
118
|
-
|
119
|
-
instantiate: function () {
|
120
|
-
module.verbose('Storing instance of module', module);
|
121
|
-
instance = module;
|
122
|
-
$module
|
123
|
-
.data(moduleNamespace, module)
|
124
|
-
;
|
125
|
-
},
|
126
|
-
|
127
|
-
destroy: function() {
|
128
|
-
module.debug('Destroying tabs', $module);
|
129
|
-
$module
|
130
|
-
.removeData(moduleNamespace)
|
131
|
-
.off(eventNamespace)
|
132
|
-
;
|
133
|
-
},
|
11
|
+
(function ($, window, document) {
|
12
|
+
'use strict';
|
13
|
+
|
14
|
+
function isWindow(obj) {
|
15
|
+
return obj !== null && obj === obj.window;
|
16
|
+
}
|
17
|
+
|
18
|
+
function isFunction(obj) {
|
19
|
+
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
20
|
+
}
|
21
|
+
|
22
|
+
window = window !== undefined && window.Math === Math
|
23
|
+
? window
|
24
|
+
: globalThis;
|
25
|
+
|
26
|
+
$.fn.tab = function (parameters) {
|
27
|
+
var
|
28
|
+
// use window context if none specified
|
29
|
+
$allModules = isFunction(this)
|
30
|
+
? $(window)
|
31
|
+
: $(this),
|
32
|
+
$document = $(document),
|
33
|
+
moduleSelector = $allModules.selector || '',
|
34
|
+
time = Date.now(),
|
35
|
+
performance = [],
|
36
|
+
|
37
|
+
query = arguments[0],
|
38
|
+
methodInvoked = typeof query === 'string',
|
39
|
+
queryArguments = [].slice.call(arguments, 1),
|
40
|
+
|
41
|
+
initializedHistory = false,
|
42
|
+
returnedValue
|
43
|
+
;
|
44
|
+
|
45
|
+
$allModules.each(function () {
|
46
|
+
var
|
47
|
+
settings = $.isPlainObject(parameters)
|
48
|
+
? $.extend(true, {}, $.fn.tab.settings, parameters)
|
49
|
+
: $.extend({}, $.fn.tab.settings),
|
50
|
+
|
51
|
+
className = settings.className,
|
52
|
+
metadata = settings.metadata,
|
53
|
+
selector = settings.selector,
|
54
|
+
error = settings.error,
|
55
|
+
regExp = settings.regExp,
|
56
|
+
|
57
|
+
eventNamespace = '.' + settings.namespace,
|
58
|
+
moduleNamespace = 'module-' + settings.namespace,
|
59
|
+
|
60
|
+
$module = $(this),
|
61
|
+
$context,
|
62
|
+
$tabs,
|
63
|
+
|
64
|
+
cache = {},
|
65
|
+
firstLoad = true,
|
66
|
+
recursionDepth = 0,
|
67
|
+
element = this,
|
68
|
+
instance = $module.data(moduleNamespace),
|
69
|
+
|
70
|
+
activeTabPath,
|
71
|
+
parameterArray,
|
72
|
+
module,
|
73
|
+
|
74
|
+
historyEvent
|
75
|
+
;
|
134
76
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
77
|
+
module = {
|
78
|
+
|
79
|
+
initialize: function () {
|
80
|
+
module.debug('Initializing tab menu item', $module);
|
81
|
+
module.determineTabs();
|
82
|
+
|
83
|
+
module.debug('Determining tabs', settings.context, $tabs);
|
84
|
+
// set up automatic routing
|
85
|
+
if (settings.auto) {
|
86
|
+
module.set.auto();
|
87
|
+
}
|
88
|
+
module.bind.events();
|
89
|
+
|
90
|
+
if (settings.history && !initializedHistory) {
|
91
|
+
module.initializeHistory();
|
92
|
+
initializedHistory = true;
|
93
|
+
}
|
94
|
+
|
95
|
+
var activeTab = module.determine.activeTab();
|
96
|
+
if (settings.autoTabActivation && instance === undefined && activeTab === null) {
|
97
|
+
activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
|
98
|
+
module.debug('No active tab detected, setting tab active', activeTab);
|
99
|
+
module.changeTab(activeTab);
|
100
|
+
}
|
101
|
+
if (activeTab !== null && settings.history) {
|
102
|
+
var autoUpdate = $.address.autoUpdate();
|
103
|
+
$.address.autoUpdate(false);
|
104
|
+
$.address.value(activeTab);
|
105
|
+
$.address.autoUpdate(autoUpdate);
|
106
|
+
}
|
107
|
+
|
108
|
+
module.instantiate();
|
109
|
+
},
|
146
110
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
111
|
+
instantiate: function () {
|
112
|
+
module.verbose('Storing instance of module', module);
|
113
|
+
instance = module;
|
114
|
+
$module
|
115
|
+
.data(moduleNamespace, module)
|
116
|
+
;
|
117
|
+
},
|
151
118
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
$reference = $module;
|
160
|
-
}
|
161
|
-
$context = $reference.parent();
|
162
|
-
module.verbose('Determined parent element for creating context', $context);
|
163
|
-
}
|
164
|
-
else if(settings.context) {
|
165
|
-
$context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
|
166
|
-
module.verbose('Using selector for tab context', settings.context, $context);
|
167
|
-
}
|
168
|
-
else {
|
169
|
-
$context = $('body');
|
170
|
-
}
|
171
|
-
// find tabs
|
172
|
-
if(settings.childrenOnly) {
|
173
|
-
$tabs = $context.children(selector.tabs);
|
174
|
-
module.debug('Searching tab context children for tabs', $context, $tabs);
|
175
|
-
}
|
176
|
-
else {
|
177
|
-
$tabs = $context.find(selector.tabs);
|
178
|
-
module.debug('Searching tab context for tabs', $context, $tabs);
|
179
|
-
}
|
180
|
-
},
|
119
|
+
destroy: function () {
|
120
|
+
module.debug('Destroying tabs', $module);
|
121
|
+
$module
|
122
|
+
.removeData(moduleNamespace)
|
123
|
+
.off(eventNamespace)
|
124
|
+
;
|
125
|
+
},
|
181
126
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
module.error(error.legacyInit, parameters.onFirstLoad);
|
194
|
-
}
|
195
|
-
settings = $.extend(true, {}, $.fn.tab.settings, parameters);
|
196
|
-
}
|
197
|
-
}
|
198
|
-
},
|
127
|
+
bind: {
|
128
|
+
events: function () {
|
129
|
+
// if using $.tab don't add events
|
130
|
+
if (!isWindow(element)) {
|
131
|
+
module.debug('Attaching tab activation events to element', $module);
|
132
|
+
$module
|
133
|
+
.on('click' + eventNamespace, module.event.click)
|
134
|
+
;
|
135
|
+
}
|
136
|
+
},
|
137
|
+
},
|
199
138
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
139
|
+
determineTabs: function () {
|
140
|
+
var
|
141
|
+
$reference
|
142
|
+
;
|
143
|
+
|
144
|
+
// determine tab context
|
145
|
+
if (settings.context === 'parent') {
|
146
|
+
if ($module.closest(selector.ui).length > 0) {
|
147
|
+
$reference = $module.closest(selector.ui);
|
148
|
+
module.verbose('Using closest UI element as parent', $reference);
|
149
|
+
} else {
|
150
|
+
$reference = $module;
|
151
|
+
}
|
152
|
+
$context = $reference.parent();
|
153
|
+
module.verbose('Determined parent element for creating context', $context);
|
154
|
+
} else if (settings.context) {
|
155
|
+
$context = [window, document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $(settings.context);
|
156
|
+
module.verbose('Using selector for tab context', settings.context, $context);
|
157
|
+
} else {
|
158
|
+
$context = $('body');
|
159
|
+
}
|
160
|
+
// find tabs
|
161
|
+
if (settings.childrenOnly) {
|
162
|
+
$tabs = $context.children(selector.tabs);
|
163
|
+
module.debug('Searching tab context children for tabs', $context, $tabs);
|
164
|
+
} else {
|
165
|
+
$tabs = $context.find(selector.tabs);
|
166
|
+
module.debug('Searching tab context for tabs', $context, $tabs);
|
167
|
+
}
|
168
|
+
},
|
226
169
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
;
|
253
|
-
module.performance.display();
|
254
|
-
module.debug('History change event', tabPath, event);
|
255
|
-
historyEvent = event;
|
256
|
-
if(tabPath !== undefined) {
|
257
|
-
module.changeTab(tabPath);
|
258
|
-
}
|
259
|
-
if(pageTitle) {
|
260
|
-
$.address.title(pageTitle);
|
261
|
-
}
|
262
|
-
}
|
263
|
-
}
|
264
|
-
},
|
170
|
+
initializeHistory: function () {
|
171
|
+
module.debug('Initializing page state');
|
172
|
+
if ($.address === undefined) {
|
173
|
+
module.error(error.state);
|
174
|
+
|
175
|
+
return false;
|
176
|
+
}
|
177
|
+
if (settings.historyType === 'state') {
|
178
|
+
module.debug('Using HTML5 to manage state');
|
179
|
+
if (settings.path !== false) {
|
180
|
+
$.address
|
181
|
+
.history(true)
|
182
|
+
.state(settings.path)
|
183
|
+
;
|
184
|
+
$(window).trigger('popstate');
|
185
|
+
} else {
|
186
|
+
module.error(error.path);
|
187
|
+
|
188
|
+
return false;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
$.address
|
192
|
+
.bind('change', module.event.history.change)
|
193
|
+
;
|
194
|
+
},
|
265
195
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
196
|
+
event: {
|
197
|
+
click: function (event) {
|
198
|
+
var
|
199
|
+
tabPath = $(this).data(metadata.tab)
|
200
|
+
;
|
201
|
+
if (tabPath !== undefined) {
|
202
|
+
if (settings.history) {
|
203
|
+
module.verbose('Updating page state', event);
|
204
|
+
$.address.value(tabPath);
|
205
|
+
} else {
|
206
|
+
module.verbose('Changing tab', event);
|
207
|
+
module.changeTab(tabPath);
|
208
|
+
}
|
209
|
+
event.preventDefault();
|
210
|
+
} else {
|
211
|
+
module.debug('No tab specified');
|
212
|
+
}
|
213
|
+
},
|
214
|
+
history: {
|
215
|
+
change: function (event) {
|
216
|
+
var
|
217
|
+
tabPath = event.pathNames.join('/') || module.get.initialPath(),
|
218
|
+
pageTitle = settings.templates.determineTitle(tabPath) || false
|
219
|
+
;
|
220
|
+
module.performance.display();
|
221
|
+
module.debug('History change event', tabPath, event);
|
222
|
+
historyEvent = event;
|
223
|
+
if (tabPath !== undefined) {
|
224
|
+
module.changeTab(tabPath);
|
225
|
+
}
|
226
|
+
if (pageTitle) {
|
227
|
+
$.address.title(pageTitle);
|
228
|
+
}
|
229
|
+
},
|
230
|
+
},
|
231
|
+
},
|
272
232
|
|
273
|
-
|
233
|
+
refresh: function () {
|
234
|
+
if (activeTabPath) {
|
235
|
+
module.debug('Refreshing tab', activeTabPath);
|
236
|
+
module.changeTab(activeTabPath);
|
237
|
+
}
|
238
|
+
},
|
274
239
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
240
|
+
cache: {
|
241
|
+
|
242
|
+
read: function (cacheKey) {
|
243
|
+
return cacheKey !== undefined
|
244
|
+
? cache[cacheKey]
|
245
|
+
: false;
|
246
|
+
},
|
247
|
+
add: function (cacheKey, content) {
|
248
|
+
cacheKey = cacheKey || activeTabPath;
|
249
|
+
module.debug('Adding cached content for', cacheKey);
|
250
|
+
cache[cacheKey] = content;
|
251
|
+
},
|
252
|
+
remove: function (cacheKey) {
|
253
|
+
cacheKey = cacheKey || activeTabPath;
|
254
|
+
module.debug('Removing cached content for', cacheKey);
|
255
|
+
delete cache[cacheKey];
|
256
|
+
},
|
257
|
+
},
|
292
258
|
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
return text.replace(regExp.escape, '\\$&');
|
297
|
-
}
|
298
|
-
},
|
259
|
+
escape: {
|
260
|
+
string: function (text) {
|
261
|
+
text = String(text);
|
299
262
|
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
url = (typeof settings.path == 'string')
|
304
|
-
? settings.path.replace(/\/$/, '') + '/{$tab}'
|
305
|
-
: '/{$tab}'
|
306
|
-
;
|
307
|
-
module.verbose('Setting up automatic tab retrieval from server', url);
|
308
|
-
if($.isPlainObject(settings.apiSettings)) {
|
309
|
-
settings.apiSettings.url = url;
|
310
|
-
}
|
311
|
-
else {
|
312
|
-
settings.apiSettings = {
|
313
|
-
url: url
|
314
|
-
};
|
315
|
-
}
|
316
|
-
},
|
317
|
-
loading: function(tabPath) {
|
318
|
-
var
|
319
|
-
$tab = module.get.tabElement(tabPath),
|
320
|
-
isLoading = $tab.hasClass(className.loading)
|
321
|
-
;
|
322
|
-
if(!isLoading) {
|
323
|
-
module.verbose('Setting loading state for', $tab);
|
324
|
-
$tab
|
325
|
-
.addClass(className.loading)
|
326
|
-
.siblings($tabs)
|
327
|
-
.removeClass(className.active + ' ' + className.loading)
|
328
|
-
;
|
329
|
-
if($tab.length > 0) {
|
330
|
-
settings.onRequest.call($tab[0], tabPath);
|
331
|
-
}
|
332
|
-
}
|
333
|
-
},
|
334
|
-
state: function(state) {
|
335
|
-
$.address.value(state);
|
336
|
-
}
|
337
|
-
},
|
263
|
+
return text.replace(regExp.escape, '\\$&');
|
264
|
+
},
|
265
|
+
},
|
338
266
|
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
267
|
+
set: {
|
268
|
+
auto: function () {
|
269
|
+
var
|
270
|
+
url = typeof settings.path === 'string'
|
271
|
+
? settings.path.replace(/\/$/, '') + '/{$tab}'
|
272
|
+
: '/{$tab}'
|
273
|
+
;
|
274
|
+
module.verbose('Setting up automatic tab retrieval from server', url);
|
275
|
+
if ($.isPlainObject(settings.apiSettings)) {
|
276
|
+
settings.apiSettings.url = url;
|
277
|
+
} else {
|
278
|
+
settings.apiSettings = {
|
279
|
+
url: url,
|
280
|
+
};
|
281
|
+
}
|
282
|
+
},
|
283
|
+
loading: function (tabPath) {
|
284
|
+
var
|
285
|
+
$tab = module.get.tabElement(tabPath),
|
286
|
+
isLoading = $tab.hasClass(className.loading)
|
287
|
+
;
|
288
|
+
if (!isLoading) {
|
289
|
+
module.verbose('Setting loading state for', $tab);
|
290
|
+
$tab
|
291
|
+
.addClass(className.loading)
|
292
|
+
.siblings($tabs)
|
293
|
+
.removeClass(className.active + ' ' + className.loading)
|
294
|
+
;
|
295
|
+
if ($tab.length > 0) {
|
296
|
+
settings.onRequest.call($tab[0], tabPath);
|
297
|
+
}
|
298
|
+
}
|
299
|
+
},
|
300
|
+
state: function (state) {
|
301
|
+
$.address.value(state);
|
302
|
+
},
|
303
|
+
},
|
354
304
|
|
355
|
-
|
356
|
-
|
305
|
+
changeTab: function (tabPath) {
|
306
|
+
var
|
307
|
+
pushStateAvailable = window.history && window.history.pushState,
|
308
|
+
shouldIgnoreLoad = pushStateAvailable && settings.ignoreFirstLoad && firstLoad,
|
309
|
+
remoteContent = settings.auto || $.isPlainObject(settings.apiSettings),
|
310
|
+
// only add default path if not remote content
|
311
|
+
pathArray = remoteContent && !shouldIgnoreLoad
|
312
|
+
? module.utilities.pathToArray(tabPath)
|
313
|
+
: module.get.defaultPathArray(tabPath)
|
314
|
+
;
|
315
|
+
tabPath = module.utilities.arrayToPath(pathArray);
|
316
|
+
$.each(pathArray, function (index, tab) {
|
317
|
+
var
|
318
|
+
currentPathArray = pathArray.slice(0, index + 1),
|
319
|
+
currentPath = module.utilities.arrayToPath(currentPathArray),
|
320
|
+
|
321
|
+
isTab = module.is.tab(currentPath),
|
322
|
+
isLastIndex = index + 1 === pathArray.length,
|
323
|
+
|
324
|
+
$tab = module.get.tabElement(currentPath),
|
325
|
+
$anchor,
|
326
|
+
nextPathArray,
|
327
|
+
nextPath,
|
328
|
+
isLastTab
|
329
|
+
;
|
330
|
+
module.verbose('Looking for tab', tab);
|
331
|
+
if (isTab) {
|
332
|
+
module.verbose('Tab was found', tab);
|
333
|
+
// scope up
|
334
|
+
activeTabPath = currentPath;
|
335
|
+
parameterArray = module.utilities.filterArray(pathArray, currentPathArray);
|
336
|
+
|
337
|
+
if (isLastIndex) {
|
338
|
+
isLastTab = true;
|
339
|
+
} else {
|
340
|
+
nextPathArray = pathArray.slice(0, index + 2);
|
341
|
+
nextPath = module.utilities.arrayToPath(nextPathArray);
|
342
|
+
isLastTab = !module.is.tab(nextPath);
|
343
|
+
if (isLastTab) {
|
344
|
+
module.verbose('Tab parameters found', nextPathArray);
|
345
|
+
}
|
346
|
+
}
|
347
|
+
if (settings.onBeforeChange.call(element, currentPath) === false) {
|
348
|
+
module.debug('onBeforeChange returned false, cancelling tab change', $tab);
|
349
|
+
|
350
|
+
return false;
|
351
|
+
}
|
352
|
+
if (isLastTab && remoteContent) {
|
353
|
+
if (!shouldIgnoreLoad) {
|
354
|
+
module.activate.navigation(currentPath);
|
355
|
+
module.fetch.content(currentPath, tabPath);
|
356
|
+
} else {
|
357
|
+
module.debug('Ignoring remote content on first tab load', currentPath);
|
358
|
+
firstLoad = false;
|
359
|
+
module.cache.add(tabPath, $tab.html());
|
360
|
+
module.activate.all(currentPath);
|
361
|
+
settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
362
|
+
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
363
|
+
}
|
364
|
+
|
365
|
+
return false;
|
366
|
+
}
|
367
|
+
|
368
|
+
module.debug('Opened local tab', currentPath);
|
369
|
+
module.activate.all(currentPath);
|
370
|
+
if (!module.cache.read(currentPath)) {
|
371
|
+
module.cache.add(currentPath, true);
|
372
|
+
module.debug('First time tab loaded calling tab init');
|
373
|
+
settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
374
|
+
}
|
375
|
+
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
376
|
+
} else if (tabPath.search('/') === -1 && tabPath !== '') {
|
377
|
+
// look for in page anchor
|
378
|
+
tabPath = module.escape.string(tabPath);
|
379
|
+
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]');
|
380
|
+
currentPath = $anchor.closest('[data-tab]').data(metadata.tab);
|
381
|
+
$tab = module.get.tabElement(currentPath);
|
382
|
+
// if anchor exists use parent tab
|
383
|
+
if ($anchor && $anchor.length > 0 && currentPath) {
|
384
|
+
module.debug('Anchor link used, opening parent tab', $tab, $anchor);
|
385
|
+
if (settings.onBeforeChange.call(element, currentPath) === false) {
|
386
|
+
module.debug('onBeforeChange returned false, cancelling tab change', $tab);
|
387
|
+
|
388
|
+
return false;
|
389
|
+
}
|
390
|
+
if (!$tab.hasClass(className.active)) {
|
391
|
+
setTimeout(function () {
|
392
|
+
module.scrollTo($anchor);
|
393
|
+
}, 0);
|
394
|
+
}
|
395
|
+
module.activate.all(currentPath);
|
396
|
+
if (!module.cache.read(currentPath)) {
|
397
|
+
module.cache.add(currentPath, true);
|
398
|
+
module.debug('First time tab loaded calling tab init');
|
399
|
+
settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
400
|
+
}
|
401
|
+
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
402
|
+
|
403
|
+
return false;
|
404
|
+
}
|
405
|
+
} else {
|
406
|
+
module.error(error.missingTab, $module, $context, currentPath);
|
407
|
+
|
408
|
+
return false;
|
409
|
+
}
|
410
|
+
});
|
411
|
+
},
|
357
412
|
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
parameterArray = module.utilities.filterArray(pathArray, currentPathArray);
|
370
|
-
|
371
|
-
if(isLastIndex) {
|
372
|
-
isLastTab = true;
|
373
|
-
}
|
374
|
-
else {
|
375
|
-
nextPathArray = pathArray.slice(0, index + 2);
|
376
|
-
nextPath = module.utilities.arrayToPath(nextPathArray);
|
377
|
-
isLastTab = ( !module.is.tab(nextPath) );
|
378
|
-
if(isLastTab) {
|
379
|
-
module.verbose('Tab parameters found', nextPathArray);
|
380
|
-
}
|
381
|
-
}
|
382
|
-
if (settings.onBeforeChange.call(element, currentPath) === false) {
|
383
|
-
module.debug('onBeforeChange returned false, cancelling tab change', $tab);
|
384
|
-
return false;
|
385
|
-
}
|
386
|
-
if(isLastTab && remoteContent) {
|
387
|
-
if(!shouldIgnoreLoad) {
|
388
|
-
module.activate.navigation(currentPath);
|
389
|
-
module.fetch.content(currentPath, tabPath);
|
390
|
-
}
|
391
|
-
else {
|
392
|
-
module.debug('Ignoring remote content on first tab load', currentPath);
|
393
|
-
firstLoad = false;
|
394
|
-
module.cache.add(tabPath, $tab.html());
|
395
|
-
module.activate.all(currentPath);
|
396
|
-
settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
397
|
-
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
398
|
-
}
|
399
|
-
return false;
|
400
|
-
}
|
401
|
-
else {
|
402
|
-
module.debug('Opened local tab', currentPath);
|
403
|
-
module.activate.all(currentPath);
|
404
|
-
if( !module.cache.read(currentPath) ) {
|
405
|
-
module.cache.add(currentPath, true);
|
406
|
-
module.debug('First time tab loaded calling tab init');
|
407
|
-
settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
408
|
-
}
|
409
|
-
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
410
|
-
}
|
413
|
+
scrollTo: function ($element) {
|
414
|
+
var
|
415
|
+
scrollOffset = $element && $element.length > 0
|
416
|
+
? $element.offset().top
|
417
|
+
: false
|
418
|
+
;
|
419
|
+
if (scrollOffset !== false) {
|
420
|
+
module.debug('Forcing scroll to an in-page link in a hidden tab', scrollOffset, $element);
|
421
|
+
$document.scrollTop(scrollOffset);
|
422
|
+
}
|
423
|
+
},
|
411
424
|
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
}
|
437
|
-
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
438
|
-
return false;
|
439
|
-
}
|
440
|
-
}
|
441
|
-
else {
|
442
|
-
module.error(error.missingTab, $module, $context, currentPath);
|
443
|
-
return false;
|
444
|
-
}
|
445
|
-
});
|
446
|
-
},
|
425
|
+
update: {
|
426
|
+
content: function (tabPath, html, evaluateScripts) {
|
427
|
+
var
|
428
|
+
$tab = module.get.tabElement(tabPath),
|
429
|
+
tab = $tab[0]
|
430
|
+
;
|
431
|
+
evaluateScripts = evaluateScripts !== undefined
|
432
|
+
? evaluateScripts
|
433
|
+
: settings.evaluateScripts;
|
434
|
+
if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() === 'dom' && typeof html !== 'string') {
|
435
|
+
$tab
|
436
|
+
.empty()
|
437
|
+
.append($(html).clone(true))
|
438
|
+
;
|
439
|
+
} else {
|
440
|
+
if (evaluateScripts) {
|
441
|
+
module.debug('Updating HTML and evaluating inline scripts', tabPath, html);
|
442
|
+
$tab.html(html);
|
443
|
+
} else {
|
444
|
+
module.debug('Updating HTML', tabPath, html);
|
445
|
+
tab.innerHTML = html;
|
446
|
+
}
|
447
|
+
}
|
448
|
+
},
|
449
|
+
},
|
447
450
|
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
451
|
+
fetch: {
|
452
|
+
|
453
|
+
content: function (tabPath, fullTabPath) {
|
454
|
+
var
|
455
|
+
$tab = module.get.tabElement(tabPath),
|
456
|
+
apiSettings = {
|
457
|
+
dataType: 'html',
|
458
|
+
encodeParameters: false,
|
459
|
+
on: 'now',
|
460
|
+
cache: settings.alwaysRefresh,
|
461
|
+
headers: {
|
462
|
+
'X-Remote': true,
|
463
|
+
},
|
464
|
+
onSuccess: function (response) {
|
465
|
+
if (settings.cacheType === 'response') {
|
466
|
+
module.cache.add(fullTabPath, response);
|
467
|
+
}
|
468
|
+
module.update.content(tabPath, response);
|
469
|
+
if (tabPath == activeTabPath) {
|
470
|
+
module.debug('Content loaded', tabPath);
|
471
|
+
module.activate.tab(tabPath);
|
472
|
+
} else {
|
473
|
+
module.debug('Content loaded in background', tabPath);
|
474
|
+
}
|
475
|
+
settings.onFirstLoad.call($tab[0], tabPath, parameterArray, historyEvent);
|
476
|
+
settings.onLoad.call($tab[0], tabPath, parameterArray, historyEvent);
|
477
|
+
|
478
|
+
if (settings.loadOnce) {
|
479
|
+
module.cache.add(fullTabPath, true);
|
480
|
+
} else if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() === 'dom' && $tab.children().length > 0) {
|
481
|
+
setTimeout(function () {
|
482
|
+
var
|
483
|
+
$clone = $tab.children().clone(true)
|
484
|
+
;
|
485
|
+
$clone = $clone.not('script');
|
486
|
+
module.cache.add(fullTabPath, $clone);
|
487
|
+
}, 0);
|
488
|
+
} else {
|
489
|
+
module.cache.add(fullTabPath, $tab.html());
|
490
|
+
}
|
491
|
+
},
|
492
|
+
urlData: {
|
493
|
+
tab: fullTabPath,
|
494
|
+
},
|
495
|
+
},
|
496
|
+
request = $tab.api('get request') || false,
|
497
|
+
existingRequest = request && request.state() === 'pending',
|
498
|
+
requestSettings,
|
499
|
+
cachedContent
|
500
|
+
;
|
501
|
+
|
502
|
+
fullTabPath = fullTabPath || tabPath;
|
503
|
+
cachedContent = module.cache.read(fullTabPath);
|
504
|
+
|
505
|
+
if (settings.cache && cachedContent) {
|
506
|
+
module.activate.tab(tabPath);
|
507
|
+
module.debug('Adding cached content', fullTabPath);
|
508
|
+
if (!settings.loadOnce) {
|
509
|
+
if (settings.evaluateScripts === 'once') {
|
510
|
+
module.update.content(tabPath, cachedContent, false);
|
511
|
+
} else {
|
512
|
+
module.update.content(tabPath, cachedContent);
|
513
|
+
}
|
514
|
+
}
|
515
|
+
settings.onLoad.call($tab[0], tabPath, parameterArray, historyEvent);
|
516
|
+
} else if (existingRequest) {
|
517
|
+
module.set.loading(tabPath);
|
518
|
+
module.debug('Content is already loading', fullTabPath);
|
519
|
+
} else if ($.api !== undefined) {
|
520
|
+
requestSettings = $.extend(true, {}, settings.apiSettings, apiSettings);
|
521
|
+
module.debug('Retrieving remote content', fullTabPath, requestSettings);
|
522
|
+
module.set.loading(tabPath);
|
523
|
+
$tab.api(requestSettings);
|
524
|
+
} else {
|
525
|
+
module.error(error.api);
|
526
|
+
}
|
527
|
+
},
|
528
|
+
},
|
459
529
|
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
530
|
+
activate: {
|
531
|
+
all: function (tabPath) {
|
532
|
+
module.activate.tab(tabPath);
|
533
|
+
module.activate.navigation(tabPath);
|
534
|
+
},
|
535
|
+
tab: function (tabPath) {
|
536
|
+
var
|
537
|
+
$tab = module.get.tabElement(tabPath),
|
538
|
+
$deactiveTabs = settings.deactivate === 'siblings'
|
539
|
+
? $tab.siblings($tabs)
|
540
|
+
: $tabs.not($tab),
|
541
|
+
isActive = $tab.hasClass(className.active)
|
542
|
+
;
|
543
|
+
module.verbose('Showing tab content for', $tab);
|
544
|
+
if (!isActive) {
|
545
|
+
$tab
|
546
|
+
.addClass(className.active)
|
547
|
+
;
|
548
|
+
$deactiveTabs
|
549
|
+
.removeClass(className.active + ' ' + className.loading)
|
550
|
+
;
|
551
|
+
if ($tab.length > 0) {
|
552
|
+
settings.onVisible.call($tab[0], tabPath);
|
553
|
+
}
|
554
|
+
}
|
555
|
+
},
|
556
|
+
navigation: function (tabPath) {
|
557
|
+
var
|
558
|
+
$navigation = module.get.navElement(tabPath),
|
559
|
+
$deactiveNavigation = settings.deactivate === 'siblings'
|
560
|
+
? $navigation.siblings($allModules)
|
561
|
+
: $allModules.not($navigation),
|
562
|
+
isActive = $navigation.hasClass(className.active)
|
563
|
+
;
|
564
|
+
module.verbose('Activating tab navigation for', $navigation, tabPath);
|
565
|
+
if (!isActive) {
|
566
|
+
$navigation
|
567
|
+
.addClass(className.active)
|
568
|
+
;
|
569
|
+
$deactiveNavigation
|
570
|
+
.removeClass(className.active + ' ' + className.loading)
|
571
|
+
;
|
572
|
+
}
|
573
|
+
},
|
574
|
+
},
|
488
575
|
|
489
|
-
|
576
|
+
deactivate: {
|
577
|
+
all: function () {
|
578
|
+
module.deactivate.navigation();
|
579
|
+
module.deactivate.tabs();
|
580
|
+
},
|
581
|
+
navigation: function () {
|
582
|
+
$allModules
|
583
|
+
.removeClass(className.active)
|
584
|
+
;
|
585
|
+
},
|
586
|
+
tabs: function () {
|
587
|
+
$tabs
|
588
|
+
.removeClass(className.active + ' ' + className.loading)
|
589
|
+
;
|
590
|
+
},
|
591
|
+
},
|
490
592
|
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
on : 'now',
|
498
|
-
cache : settings.alwaysRefresh,
|
499
|
-
headers : {
|
500
|
-
'X-Remote': true
|
593
|
+
is: {
|
594
|
+
tab: function (tabName) {
|
595
|
+
return tabName !== undefined
|
596
|
+
? module.get.tabElement(tabName).length > 0
|
597
|
+
: false;
|
598
|
+
},
|
501
599
|
},
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
600
|
+
|
601
|
+
get: {
|
602
|
+
initialPath: function () {
|
603
|
+
return $allModules.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
|
604
|
+
},
|
605
|
+
path: function () {
|
606
|
+
return $.address.value();
|
607
|
+
},
|
608
|
+
// adds default tabs to tab path
|
609
|
+
defaultPathArray: function (tabPath) {
|
610
|
+
return module.utilities.pathToArray(module.get.defaultPath(tabPath));
|
611
|
+
},
|
612
|
+
defaultPath: function (tabPath) {
|
613
|
+
var
|
614
|
+
$defaultNav = $allModules.filter('[data-' + metadata.tab + '^="' + module.escape.string(tabPath) + '/"]').eq(0),
|
615
|
+
defaultTab = $defaultNav.data(metadata.tab) || false
|
616
|
+
;
|
617
|
+
if (defaultTab) {
|
618
|
+
module.debug('Found default tab', defaultTab);
|
619
|
+
if (recursionDepth < settings.maxDepth) {
|
620
|
+
recursionDepth++;
|
621
|
+
|
622
|
+
return module.get.defaultPath(defaultTab);
|
623
|
+
}
|
624
|
+
module.error(error.recursion);
|
625
|
+
} else {
|
626
|
+
module.debug('No default tabs found for', tabPath, $tabs);
|
627
|
+
}
|
628
|
+
recursionDepth = 0;
|
629
|
+
|
630
|
+
return tabPath;
|
631
|
+
},
|
632
|
+
navElement: function (tabPath) {
|
633
|
+
tabPath = tabPath || activeTabPath;
|
634
|
+
|
635
|
+
return $allModules.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]');
|
636
|
+
},
|
637
|
+
tabElement: function (tabPath) {
|
638
|
+
var
|
639
|
+
$fullPathTab,
|
640
|
+
$simplePathTab,
|
641
|
+
tabPathArray,
|
642
|
+
lastTab
|
643
|
+
;
|
644
|
+
tabPath = tabPath || activeTabPath;
|
645
|
+
tabPathArray = module.utilities.pathToArray(tabPath);
|
646
|
+
lastTab = module.utilities.last(tabPathArray);
|
647
|
+
$fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]');
|
648
|
+
$simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(lastTab) + '"]');
|
649
|
+
|
650
|
+
return $fullPathTab.length > 0
|
651
|
+
? $fullPathTab
|
652
|
+
: $simplePathTab;
|
653
|
+
},
|
654
|
+
tab: function () {
|
655
|
+
return activeTabPath;
|
656
|
+
},
|
532
657
|
},
|
533
|
-
urlData: {
|
534
|
-
tab: fullTabPath
|
535
|
-
}
|
536
|
-
},
|
537
|
-
request = $tab.api('get request') || false,
|
538
|
-
existingRequest = ( request && request.state() === 'pending' ),
|
539
|
-
requestSettings,
|
540
|
-
cachedContent
|
541
|
-
;
|
542
658
|
|
543
|
-
|
544
|
-
|
659
|
+
determine: {
|
660
|
+
activeTab: function () {
|
661
|
+
var activeTab = null;
|
662
|
+
|
663
|
+
$tabs.each(function (_index, tab) {
|
664
|
+
var $tab = $(tab);
|
665
|
+
|
666
|
+
if ($tab.hasClass(className.active)) {
|
667
|
+
var
|
668
|
+
tabPath = $(this).data(metadata.tab),
|
669
|
+
$anchor = $allModules.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]')
|
670
|
+
;
|
671
|
+
|
672
|
+
if ($anchor.hasClass(className.active)) {
|
673
|
+
activeTab = tabPath;
|
674
|
+
}
|
675
|
+
}
|
676
|
+
});
|
545
677
|
|
678
|
+
return activeTab;
|
679
|
+
},
|
680
|
+
},
|
681
|
+
|
682
|
+
utilities: {
|
683
|
+
filterArray: function (keepArray, removeArray) {
|
684
|
+
return $.grep(keepArray, function (keepValue) {
|
685
|
+
return $.inArray(keepValue, removeArray) === -1;
|
686
|
+
});
|
687
|
+
},
|
688
|
+
last: function (array) {
|
689
|
+
return Array.isArray(array)
|
690
|
+
? array[array.length - 1]
|
691
|
+
: false;
|
692
|
+
},
|
693
|
+
pathToArray: function (pathName) {
|
694
|
+
if (pathName === undefined) {
|
695
|
+
pathName = activeTabPath;
|
696
|
+
}
|
697
|
+
|
698
|
+
return typeof pathName === 'string'
|
699
|
+
? pathName.split('/')
|
700
|
+
: [pathName];
|
701
|
+
},
|
702
|
+
arrayToPath: function (pathArray) {
|
703
|
+
return Array.isArray(pathArray)
|
704
|
+
? pathArray.join('/')
|
705
|
+
: false;
|
706
|
+
},
|
707
|
+
},
|
546
708
|
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
709
|
+
setting: function (name, value) {
|
710
|
+
module.debug('Changing setting', name, value);
|
711
|
+
if ($.isPlainObject(name)) {
|
712
|
+
$.extend(true, settings, name);
|
713
|
+
} else if (value !== undefined) {
|
714
|
+
if ($.isPlainObject(settings[name])) {
|
715
|
+
$.extend(true, settings[name], value);
|
716
|
+
} else {
|
717
|
+
settings[name] = value;
|
718
|
+
}
|
719
|
+
} else {
|
720
|
+
return settings[name];
|
721
|
+
}
|
722
|
+
},
|
723
|
+
internal: function (name, value) {
|
724
|
+
if ($.isPlainObject(name)) {
|
725
|
+
$.extend(true, module, name);
|
726
|
+
} else if (value !== undefined) {
|
727
|
+
module[name] = value;
|
728
|
+
} else {
|
729
|
+
return module[name];
|
730
|
+
}
|
731
|
+
},
|
732
|
+
debug: function () {
|
733
|
+
if (!settings.silent && settings.debug) {
|
734
|
+
if (settings.performance) {
|
735
|
+
module.performance.log(arguments);
|
736
|
+
} else {
|
737
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
738
|
+
module.debug.apply(console, arguments);
|
739
|
+
}
|
740
|
+
}
|
741
|
+
},
|
742
|
+
verbose: function () {
|
743
|
+
if (!settings.silent && settings.verbose && settings.debug) {
|
744
|
+
if (settings.performance) {
|
745
|
+
module.performance.log(arguments);
|
746
|
+
} else {
|
747
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
748
|
+
module.verbose.apply(console, arguments);
|
749
|
+
}
|
750
|
+
}
|
751
|
+
},
|
752
|
+
error: function () {
|
753
|
+
if (!settings.silent) {
|
754
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
755
|
+
module.error.apply(console, arguments);
|
756
|
+
}
|
757
|
+
},
|
758
|
+
performance: {
|
759
|
+
log: function (message) {
|
760
|
+
var
|
761
|
+
currentTime,
|
762
|
+
executionTime,
|
763
|
+
previousTime
|
764
|
+
;
|
765
|
+
if (settings.performance) {
|
766
|
+
currentTime = Date.now();
|
767
|
+
previousTime = time || currentTime;
|
768
|
+
executionTime = currentTime - previousTime;
|
769
|
+
time = currentTime;
|
770
|
+
performance.push({
|
771
|
+
Name: message[0],
|
772
|
+
Arguments: [].slice.call(message, 1) || '',
|
773
|
+
Element: element,
|
774
|
+
'Execution Time': executionTime,
|
775
|
+
});
|
776
|
+
}
|
777
|
+
clearTimeout(module.performance.timer);
|
778
|
+
module.performance.timer = setTimeout(module.performance.display, 500);
|
779
|
+
},
|
780
|
+
display: function () {
|
781
|
+
var
|
782
|
+
title = settings.name + ':',
|
783
|
+
totalTime = 0
|
784
|
+
;
|
785
|
+
time = false;
|
786
|
+
clearTimeout(module.performance.timer);
|
787
|
+
$.each(performance, function (index, data) {
|
788
|
+
totalTime += data['Execution Time'];
|
789
|
+
});
|
790
|
+
title += ' ' + totalTime + 'ms';
|
791
|
+
if (moduleSelector) {
|
792
|
+
title += ' \'' + moduleSelector + '\'';
|
793
|
+
}
|
794
|
+
if (performance.length > 0) {
|
795
|
+
console.groupCollapsed(title);
|
796
|
+
if (console.table) {
|
797
|
+
console.table(performance);
|
798
|
+
} else {
|
799
|
+
$.each(performance, function (index, data) {
|
800
|
+
console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
|
801
|
+
});
|
802
|
+
}
|
803
|
+
console.groupEnd();
|
804
|
+
}
|
805
|
+
performance = [];
|
806
|
+
},
|
807
|
+
},
|
808
|
+
invoke: function (query, passedArguments, context) {
|
809
|
+
var
|
810
|
+
object = instance,
|
811
|
+
maxDepth,
|
812
|
+
found,
|
813
|
+
response
|
814
|
+
;
|
815
|
+
passedArguments = passedArguments || queryArguments;
|
816
|
+
context = context || element;
|
817
|
+
if (typeof query === 'string' && object !== undefined) {
|
818
|
+
query = query.split(/[ .]/);
|
819
|
+
maxDepth = query.length - 1;
|
820
|
+
$.each(query, function (depth, value) {
|
821
|
+
var camelCaseValue = depth !== maxDepth
|
822
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
823
|
+
: query
|
824
|
+
;
|
825
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
826
|
+
object = object[camelCaseValue];
|
827
|
+
} else if (object[camelCaseValue] !== undefined) {
|
828
|
+
found = object[camelCaseValue];
|
829
|
+
|
830
|
+
return false;
|
831
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
832
|
+
object = object[value];
|
833
|
+
} else if (object[value] !== undefined) {
|
834
|
+
found = object[value];
|
835
|
+
|
836
|
+
return false;
|
837
|
+
} else {
|
838
|
+
module.error(error.method, query);
|
839
|
+
|
840
|
+
return false;
|
841
|
+
}
|
842
|
+
});
|
843
|
+
}
|
844
|
+
if (isFunction(found)) {
|
845
|
+
response = found.apply(context, passedArguments);
|
846
|
+
} else if (found !== undefined) {
|
847
|
+
response = found;
|
848
|
+
}
|
849
|
+
if (Array.isArray(returnedValue)) {
|
850
|
+
returnedValue.push(response);
|
851
|
+
} else if (returnedValue !== undefined) {
|
852
|
+
returnedValue = [returnedValue, response];
|
853
|
+
} else if (response !== undefined) {
|
854
|
+
returnedValue = response;
|
855
|
+
}
|
856
|
+
|
857
|
+
return found;
|
858
|
+
},
|
859
|
+
};
|
860
|
+
if (methodInvoked) {
|
861
|
+
if (instance === undefined) {
|
862
|
+
module.initialize();
|
553
863
|
}
|
554
|
-
|
555
|
-
|
864
|
+
module.invoke(query);
|
865
|
+
} else {
|
866
|
+
if (instance !== undefined) {
|
867
|
+
instance.invoke('destroy');
|
556
868
|
}
|
557
|
-
|
558
|
-
settings.onLoad.call($tab[0], tabPath, parameterArray, historyEvent);
|
559
|
-
}
|
560
|
-
else if(existingRequest) {
|
561
|
-
module.set.loading(tabPath);
|
562
|
-
module.debug('Content is already loading', fullTabPath);
|
563
|
-
}
|
564
|
-
else if($.api !== undefined) {
|
565
|
-
requestSettings = $.extend(true, {}, settings.apiSettings, apiSettings);
|
566
|
-
module.debug('Retrieving remote content', fullTabPath, requestSettings);
|
567
|
-
module.set.loading(tabPath);
|
568
|
-
$tab.api(requestSettings);
|
869
|
+
module.initialize();
|
569
870
|
}
|
570
|
-
|
571
|
-
module.error(error.api);
|
572
|
-
}
|
573
|
-
}
|
574
|
-
},
|
871
|
+
});
|
575
872
|
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
},
|
581
|
-
tab: function(tabPath) {
|
582
|
-
var
|
583
|
-
$tab = module.get.tabElement(tabPath),
|
584
|
-
$deactiveTabs = (settings.deactivate == 'siblings')
|
585
|
-
? $tab.siblings($tabs)
|
586
|
-
: $tabs.not($tab),
|
587
|
-
isActive = $tab.hasClass(className.active)
|
588
|
-
;
|
589
|
-
module.verbose('Showing tab content for', $tab);
|
590
|
-
if(!isActive) {
|
591
|
-
$tab
|
592
|
-
.addClass(className.active)
|
593
|
-
;
|
594
|
-
$deactiveTabs
|
595
|
-
.removeClass(className.active + ' ' + className.loading)
|
596
|
-
;
|
597
|
-
if($tab.length > 0) {
|
598
|
-
settings.onVisible.call($tab[0], tabPath);
|
599
|
-
}
|
600
|
-
}
|
601
|
-
},
|
602
|
-
navigation: function(tabPath) {
|
603
|
-
var
|
604
|
-
$navigation = module.get.navElement(tabPath),
|
605
|
-
$deactiveNavigation = (settings.deactivate == 'siblings')
|
606
|
-
? $navigation.siblings($allModules)
|
607
|
-
: $allModules.not($navigation),
|
608
|
-
isActive = $navigation.hasClass(className.active)
|
609
|
-
;
|
610
|
-
module.verbose('Activating tab navigation for', $navigation, tabPath);
|
611
|
-
if(!isActive) {
|
612
|
-
$navigation
|
613
|
-
.addClass(className.active)
|
614
|
-
;
|
615
|
-
$deactiveNavigation
|
616
|
-
.removeClass(className.active + ' ' + className.loading)
|
617
|
-
;
|
618
|
-
}
|
619
|
-
}
|
620
|
-
},
|
873
|
+
return returnedValue !== undefined
|
874
|
+
? returnedValue
|
875
|
+
: this;
|
876
|
+
};
|
621
877
|
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
},
|
627
|
-
navigation: function() {
|
628
|
-
$allModules
|
629
|
-
.removeClass(className.active)
|
630
|
-
;
|
631
|
-
},
|
632
|
-
tabs: function() {
|
633
|
-
$tabs
|
634
|
-
.removeClass(className.active + ' ' + className.loading)
|
635
|
-
;
|
636
|
-
}
|
637
|
-
},
|
878
|
+
// shortcut for tabbed content with no defined navigation
|
879
|
+
$.tab = function () {
|
880
|
+
$(window).tab.apply(this, arguments);
|
881
|
+
};
|
638
882
|
|
639
|
-
|
640
|
-
tab: function(tabName) {
|
641
|
-
return (tabName !== undefined)
|
642
|
-
? ( module.get.tabElement(tabName).length > 0 )
|
643
|
-
: false
|
644
|
-
;
|
645
|
-
}
|
646
|
-
},
|
883
|
+
$.fn.tab.settings = {
|
647
884
|
|
648
|
-
|
649
|
-
|
650
|
-
return $allModules.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
|
651
|
-
},
|
652
|
-
path: function() {
|
653
|
-
return $.address.value();
|
654
|
-
},
|
655
|
-
// adds default tabs to tab path
|
656
|
-
defaultPathArray: function(tabPath) {
|
657
|
-
return module.utilities.pathToArray( module.get.defaultPath(tabPath) );
|
658
|
-
},
|
659
|
-
defaultPath: function(tabPath) {
|
660
|
-
var
|
661
|
-
$defaultNav = $allModules.filter('[data-' + metadata.tab + '^="' + module.escape.string(tabPath) + '/"]').eq(0),
|
662
|
-
defaultTab = $defaultNav.data(metadata.tab) || false
|
663
|
-
;
|
664
|
-
if( defaultTab ) {
|
665
|
-
module.debug('Found default tab', defaultTab);
|
666
|
-
if(recursionDepth < settings.maxDepth) {
|
667
|
-
recursionDepth++;
|
668
|
-
return module.get.defaultPath(defaultTab);
|
669
|
-
}
|
670
|
-
module.error(error.recursion);
|
671
|
-
}
|
672
|
-
else {
|
673
|
-
module.debug('No default tabs found for', tabPath, $tabs);
|
674
|
-
}
|
675
|
-
recursionDepth = 0;
|
676
|
-
return tabPath;
|
677
|
-
},
|
678
|
-
navElement: function(tabPath) {
|
679
|
-
tabPath = tabPath || activeTabPath;
|
680
|
-
return $allModules.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]');
|
681
|
-
},
|
682
|
-
tabElement: function(tabPath) {
|
683
|
-
var
|
684
|
-
$fullPathTab,
|
685
|
-
$simplePathTab,
|
686
|
-
tabPathArray,
|
687
|
-
lastTab
|
688
|
-
;
|
689
|
-
tabPath = tabPath || activeTabPath;
|
690
|
-
tabPathArray = module.utilities.pathToArray(tabPath);
|
691
|
-
lastTab = module.utilities.last(tabPathArray);
|
692
|
-
$fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]');
|
693
|
-
$simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(lastTab) + '"]');
|
694
|
-
return ($fullPathTab.length > 0)
|
695
|
-
? $fullPathTab
|
696
|
-
: $simplePathTab
|
697
|
-
;
|
698
|
-
},
|
699
|
-
tab: function() {
|
700
|
-
return activeTabPath;
|
701
|
-
}
|
702
|
-
},
|
885
|
+
name: 'Tab',
|
886
|
+
namespace: 'tab',
|
703
887
|
|
704
|
-
|
705
|
-
|
706
|
-
|
888
|
+
silent: false,
|
889
|
+
debug: false,
|
890
|
+
verbose: false,
|
891
|
+
performance: true,
|
707
892
|
|
708
|
-
|
709
|
-
|
893
|
+
auto: false, // uses pjax style endpoints fetching content from same url with remote-content headers
|
894
|
+
history: false, // use browser history
|
895
|
+
historyType: 'hash', // #/ or html5 state
|
896
|
+
path: false, // base path of url
|
710
897
|
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
$anchor = $allModules.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]')
|
715
|
-
;
|
898
|
+
context: false, // specify a context that tabs must appear inside
|
899
|
+
childrenOnly: false, // use only tabs that are children of context
|
900
|
+
maxDepth: 25, // max depth a tab can be nested
|
716
901
|
|
717
|
-
|
718
|
-
activeTab = tabPath;
|
719
|
-
}
|
720
|
-
}
|
721
|
-
});
|
902
|
+
deactivate: 'siblings', // whether tabs should deactivate sibling menu elements or all elements initialized together
|
722
903
|
|
723
|
-
|
724
|
-
|
725
|
-
|
904
|
+
alwaysRefresh: false, // load tab content new every tab click
|
905
|
+
cache: true, // cache the content requests to pull locally
|
906
|
+
loadOnce: false, // Whether tab data should only be loaded once when using remote content
|
907
|
+
cacheType: 'response', // Whether to cache exact response, or to html cache contents after scripts execute
|
908
|
+
ignoreFirstLoad: false, // don't load remote content on first load
|
726
909
|
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
return ( $.inArray(keepValue, removeArray) == -1);
|
731
|
-
});
|
732
|
-
},
|
733
|
-
last: function(array) {
|
734
|
-
return Array.isArray(array)
|
735
|
-
? array[ array.length - 1]
|
736
|
-
: false
|
737
|
-
;
|
738
|
-
},
|
739
|
-
pathToArray: function(pathName) {
|
740
|
-
if(pathName === undefined) {
|
741
|
-
pathName = activeTabPath;
|
742
|
-
}
|
743
|
-
return typeof pathName == 'string'
|
744
|
-
? pathName.split('/')
|
745
|
-
: [pathName]
|
746
|
-
;
|
747
|
-
},
|
748
|
-
arrayToPath: function(pathArray) {
|
749
|
-
return Array.isArray(pathArray)
|
750
|
-
? pathArray.join('/')
|
751
|
-
: false
|
752
|
-
;
|
753
|
-
}
|
754
|
-
},
|
910
|
+
apiSettings: false, // settings for api call
|
911
|
+
evaluateScripts: 'once', // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content
|
912
|
+
autoTabActivation: true, // whether a non existing active tab will auto activate the first available tab
|
755
913
|
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
}
|
765
|
-
else {
|
766
|
-
settings[name] = value;
|
767
|
-
}
|
768
|
-
}
|
769
|
-
else {
|
770
|
-
return settings[name];
|
771
|
-
}
|
914
|
+
onFirstLoad: function (tabPath, parameterArray, historyEvent) {}, // called first time loaded
|
915
|
+
onLoad: function (tabPath, parameterArray, historyEvent) {}, // called on every load
|
916
|
+
onVisible: function (tabPath, parameterArray, historyEvent) {}, // called every time tab visible
|
917
|
+
onRequest: function (tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content
|
918
|
+
onBeforeChange: function (tabPath) {}, // called before a tab is about to be changed. Returning false will cancel the tab change
|
919
|
+
|
920
|
+
templates: {
|
921
|
+
determineTitle: function (tabArray) {}, // returns page title for path
|
772
922
|
},
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
}
|
923
|
+
|
924
|
+
error: {
|
925
|
+
api: 'You attempted to load content without API module',
|
926
|
+
method: 'The method you called is not defined',
|
927
|
+
missingTab: 'Activated tab cannot be found. Tabs are case-sensitive.',
|
928
|
+
noContent: 'The tab you specified is missing a content url.',
|
929
|
+
path: 'History enabled, but no path was specified',
|
930
|
+
recursion: 'Max recursive depth reached',
|
931
|
+
state: 'History requires Asual\'s Address library <https://github.com/asual/jquery-address>',
|
783
932
|
},
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
module.performance.log(arguments);
|
788
|
-
}
|
789
|
-
else {
|
790
|
-
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
791
|
-
module.debug.apply(console, arguments);
|
792
|
-
}
|
793
|
-
}
|
933
|
+
|
934
|
+
regExp: {
|
935
|
+
escape: /[\s#$()*+,.:=?@[\\\]^{|}-]/g,
|
794
936
|
},
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
else {
|
801
|
-
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
802
|
-
module.verbose.apply(console, arguments);
|
803
|
-
}
|
804
|
-
}
|
937
|
+
|
938
|
+
metadata: {
|
939
|
+
tab: 'tab',
|
940
|
+
loaded: 'loaded',
|
941
|
+
promise: 'promise',
|
805
942
|
},
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
}
|
943
|
+
|
944
|
+
className: {
|
945
|
+
loading: 'loading',
|
946
|
+
active: 'active',
|
811
947
|
},
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
executionTime,
|
817
|
-
previousTime
|
818
|
-
;
|
819
|
-
if(settings.performance) {
|
820
|
-
currentTime = new Date().getTime();
|
821
|
-
previousTime = time || currentTime;
|
822
|
-
executionTime = currentTime - previousTime;
|
823
|
-
time = currentTime;
|
824
|
-
performance.push({
|
825
|
-
'Name' : message[0],
|
826
|
-
'Arguments' : [].slice.call(message, 1) || '',
|
827
|
-
'Element' : element,
|
828
|
-
'Execution Time' : executionTime
|
829
|
-
});
|
830
|
-
}
|
831
|
-
clearTimeout(module.performance.timer);
|
832
|
-
module.performance.timer = setTimeout(module.performance.display, 500);
|
833
|
-
},
|
834
|
-
display: function() {
|
835
|
-
var
|
836
|
-
title = settings.name + ':',
|
837
|
-
totalTime = 0
|
838
|
-
;
|
839
|
-
time = false;
|
840
|
-
clearTimeout(module.performance.timer);
|
841
|
-
$.each(performance, function(index, data) {
|
842
|
-
totalTime += data['Execution Time'];
|
843
|
-
});
|
844
|
-
title += ' ' + totalTime + 'ms';
|
845
|
-
if(moduleSelector) {
|
846
|
-
title += ' \'' + moduleSelector + '\'';
|
847
|
-
}
|
848
|
-
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
849
|
-
console.groupCollapsed(title);
|
850
|
-
if(console.table) {
|
851
|
-
console.table(performance);
|
852
|
-
}
|
853
|
-
else {
|
854
|
-
$.each(performance, function(index, data) {
|
855
|
-
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
856
|
-
});
|
857
|
-
}
|
858
|
-
console.groupEnd();
|
859
|
-
}
|
860
|
-
performance = [];
|
861
|
-
}
|
948
|
+
|
949
|
+
selector: {
|
950
|
+
tabs: '.ui.tab',
|
951
|
+
ui: '.ui',
|
862
952
|
},
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
maxDepth,
|
867
|
-
found,
|
868
|
-
response
|
869
|
-
;
|
870
|
-
passedArguments = passedArguments || queryArguments;
|
871
|
-
context = context || element;
|
872
|
-
if(typeof query == 'string' && object !== undefined) {
|
873
|
-
query = query.split(/[\. ]/);
|
874
|
-
maxDepth = query.length - 1;
|
875
|
-
$.each(query, function(depth, value) {
|
876
|
-
var camelCaseValue = (depth != maxDepth)
|
877
|
-
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
878
|
-
: query
|
879
|
-
;
|
880
|
-
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
881
|
-
object = object[camelCaseValue];
|
882
|
-
}
|
883
|
-
else if( object[camelCaseValue] !== undefined ) {
|
884
|
-
found = object[camelCaseValue];
|
885
|
-
return false;
|
886
|
-
}
|
887
|
-
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
888
|
-
object = object[value];
|
889
|
-
}
|
890
|
-
else if( object[value] !== undefined ) {
|
891
|
-
found = object[value];
|
892
|
-
return false;
|
893
|
-
}
|
894
|
-
else {
|
895
|
-
module.error(error.method, query);
|
896
|
-
return false;
|
897
|
-
}
|
898
|
-
});
|
899
|
-
}
|
900
|
-
if ( $.isFunction( found ) ) {
|
901
|
-
response = found.apply(context, passedArguments);
|
902
|
-
}
|
903
|
-
else if(found !== undefined) {
|
904
|
-
response = found;
|
905
|
-
}
|
906
|
-
if(Array.isArray(returnedValue)) {
|
907
|
-
returnedValue.push(response);
|
908
|
-
}
|
909
|
-
else if(returnedValue !== undefined) {
|
910
|
-
returnedValue = [returnedValue, response];
|
911
|
-
}
|
912
|
-
else if(response !== undefined) {
|
913
|
-
returnedValue = response;
|
914
|
-
}
|
915
|
-
return found;
|
916
|
-
}
|
917
|
-
};
|
918
|
-
if(methodInvoked) {
|
919
|
-
if(instance === undefined) {
|
920
|
-
module.initialize();
|
921
|
-
}
|
922
|
-
module.invoke(query);
|
923
|
-
}
|
924
|
-
else {
|
925
|
-
if(instance !== undefined) {
|
926
|
-
instance.invoke('destroy');
|
927
|
-
}
|
928
|
-
module.initialize();
|
929
|
-
}
|
930
|
-
})
|
931
|
-
;
|
932
|
-
return (returnedValue !== undefined)
|
933
|
-
? returnedValue
|
934
|
-
: this
|
935
|
-
;
|
936
|
-
|
937
|
-
};
|
938
|
-
|
939
|
-
// shortcut for tabbed content with no defined navigation
|
940
|
-
$.tab = function() {
|
941
|
-
$(window).tab.apply(this, arguments);
|
942
|
-
};
|
943
|
-
|
944
|
-
$.fn.tab.settings = {
|
945
|
-
|
946
|
-
name : 'Tab',
|
947
|
-
namespace : 'tab',
|
948
|
-
|
949
|
-
silent : false,
|
950
|
-
debug : false,
|
951
|
-
verbose : false,
|
952
|
-
performance : true,
|
953
|
-
|
954
|
-
auto : false, // uses pjax style endpoints fetching content from same url with remote-content headers
|
955
|
-
history : false, // use browser history
|
956
|
-
historyType : 'hash', // #/ or html5 state
|
957
|
-
path : false, // base path of url
|
958
|
-
|
959
|
-
context : false, // specify a context that tabs must appear inside
|
960
|
-
childrenOnly : false, // use only tabs that are children of context
|
961
|
-
maxDepth : 25, // max depth a tab can be nested
|
962
|
-
|
963
|
-
deactivate : 'siblings', // whether tabs should deactivate sibling menu elements or all elements initialized together
|
964
|
-
|
965
|
-
alwaysRefresh : false, // load tab content new every tab click
|
966
|
-
cache : true, // cache the content requests to pull locally
|
967
|
-
loadOnce : false, // Whether tab data should only be loaded once when using remote content
|
968
|
-
cacheType : 'response', // Whether to cache exact response, or to html cache contents after scripts execute
|
969
|
-
ignoreFirstLoad : false, // don't load remote content on first load
|
970
|
-
|
971
|
-
apiSettings : false, // settings for api call
|
972
|
-
evaluateScripts : 'once', // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content
|
973
|
-
autoTabActivation: true, // whether a non existing active tab will auto activate the first available tab
|
974
|
-
|
975
|
-
onFirstLoad : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
|
976
|
-
onLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
|
977
|
-
onVisible : function(tabPath, parameterArray, historyEvent) {}, // called every time tab visible
|
978
|
-
onRequest : function(tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content
|
979
|
-
onBeforeChange: function(tabPath) {}, // called before a tab is about to be changed. Returning false will cancel the tab change
|
980
|
-
|
981
|
-
templates : {
|
982
|
-
determineTitle: function(tabArray) {} // returns page title for path
|
983
|
-
},
|
984
|
-
|
985
|
-
error: {
|
986
|
-
api : 'You attempted to load content without API module',
|
987
|
-
method : 'The method you called is not defined',
|
988
|
-
missingTab : 'Activated tab cannot be found. Tabs are case-sensitive.',
|
989
|
-
noContent : 'The tab you specified is missing a content url.',
|
990
|
-
path : 'History enabled, but no path was specified',
|
991
|
-
recursion : 'Max recursive depth reached',
|
992
|
-
legacyInit : 'onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.',
|
993
|
-
legacyLoad : 'onTabLoad has been renamed to onLoad in 2.0. Please adjust your code',
|
994
|
-
state : 'History requires Asual\'s Address library <https://github.com/asual/jquery-address>'
|
995
|
-
},
|
996
|
-
|
997
|
-
regExp : {
|
998
|
-
escape : /[-[\]{}()*+?.,\\^$|#\s:=@]/g
|
999
|
-
},
|
1000
|
-
|
1001
|
-
metadata : {
|
1002
|
-
tab : 'tab',
|
1003
|
-
loaded : 'loaded',
|
1004
|
-
promise: 'promise'
|
1005
|
-
},
|
1006
|
-
|
1007
|
-
className : {
|
1008
|
-
loading : 'loading',
|
1009
|
-
active : 'active'
|
1010
|
-
},
|
1011
|
-
|
1012
|
-
selector : {
|
1013
|
-
tabs : '.ui.tab',
|
1014
|
-
ui : '.ui'
|
1015
|
-
}
|
1016
|
-
|
1017
|
-
};
|
1018
|
-
|
1019
|
-
})( jQuery, window, document );
|
953
|
+
|
954
|
+
};
|
955
|
+
})(jQuery, window, document);
|