From e66c8c2ee44ce9fd3aa8b314bcabb80c73e4fdb8 Mon Sep 17 00:00:00 2001 From: pascallapointe Date: Tue, 16 Apr 2019 11:45:03 -0400 Subject: [PATCH] General: Fix js, update outdated script. Query optimisation. --- .../entry/global/{app.js => _app_global.js} | 16 +- assets/entry/global/docready.js | 3 +- assets/entry/site/app.js | 6 - assets/entry/site/homepage.js | 22 + assets/entry/site/search.js | 5 - .../plugins/bootstrap-hover-dropdown/LICENSE | 3 - .../bootstrap-hover-dropdown/README.md | 15 +- .../bootstrap-hover-dropdown.js | 130 +- .../bootstrap-hover-dropdown.min.js | 13 +- .../bootstrap-hover-dropdown/bower.json | 21 + .../bootstrap-hover-dropdown/composer.json | 33 + .../bootstrap-hover-dropdown/demo.html | 297 + .../bootstrap-hover-dropdown/gulpfile.js | 89 + .../bootstrap-hover-dropdown/package.json | 41 + assets/plugins/reactjsx/react-0.13.3.js | 21642 ---------------- assets/plugins/reactjsx/react-0.13.3.min.js | 18 - .../sass/global/components/_social-icons.scss | 190 - assets/{js => scripts}/global/core-scripts.js | 9 +- .../global/jquery.tablednd_0_5.js | 0 assets/{js => scripts}/global/metronic.js | 313 +- assets/{js => scripts}/global/translations.js | 2 +- assets/{js => scripts}/site/layout.js | 16 +- assets/{js => scripts}/site/search_engine.jsx | 7 +- assets/{js => scripts}/site/user/log.jsx | 0 assets/{js => scripts}/site/user/mailbox.jsx | 0 .../statics/site/layout/img/ajax-loading.gif | Bin 0 -> 29959 bytes .../site/layout/img/ajax-modal-loading.gif | Bin 0 -> 27953 bytes assets/statics/site/layout/img/avatar.png | Bin 0 -> 2016 bytes .../site/layout/img/icon-color-close.png | Bin 0 -> 1031 bytes assets/statics/site/layout/img/icon-color.png | Bin 0 -> 1240 bytes .../site/layout/img/loading-spinner-blue.gif | Bin 0 -> 5200 bytes .../layout/img/loading-spinner-default.gif | Bin 0 -> 5209 bytes .../site/layout/img/loading-spinner-grey.gif | Bin 0 -> 5203 bytes assets/statics/site/layout/img/loading.gif | Bin 0 -> 2906 bytes .../statics/site/layout/img/menu-toggler.png | Bin 0 -> 966 bytes .../statics/site/layout/img/social/Thumbs.db | Bin 0 -> 23040 bytes .../site/layout/img/social/aboutme.png | Bin 0 -> 604 bytes .../statics/site/layout/img/social/amazon.png | Bin 0 -> 3300 bytes .../site/layout/img/social/behance.png | Bin 0 -> 3217 bytes .../site/layout/img/social/blogger.png | Bin 0 -> 3169 bytes .../site/layout/img/social/deviantart.png | Bin 0 -> 3028 bytes .../site/layout/img/social/dribbble.png | Bin 0 -> 3248 bytes .../site/layout/img/social/dropbox.png | Bin 0 -> 3403 bytes .../site/layout/img/social/evernote.png | Bin 0 -> 3095 bytes .../site/layout/img/social/facebook.png | Bin 0 -> 2973 bytes .../statics/site/layout/img/social/flickr.png | Bin 0 -> 614 bytes .../statics/site/layout/img/social/forrst.png | Bin 0 -> 3108 bytes .../site/layout/img/social/foursquare.png | Bin 0 -> 2296 bytes .../statics/site/layout/img/social/github.png | Bin 0 -> 3025 bytes .../site/layout/img/social/googleplus.png | Bin 0 -> 1236 bytes .../site/layout/img/social/gravatar.png | Bin 0 -> 1866 bytes .../site/layout/img/social/instagram.png | Bin 0 -> 382 bytes .../site/layout/img/social/jolicloud.png | Bin 0 -> 3076 bytes .../statics/site/layout/img/social/klout.png | Bin 0 -> 1662 bytes .../site/layout/img/social/last-fm.png | Bin 0 -> 3320 bytes .../site/layout/img/social/linkedin.png | Bin 0 -> 3004 bytes .../site/layout/img/social/myspace.png | Bin 0 -> 1187 bytes .../statics/site/layout/img/social/picasa.png | Bin 0 -> 3119 bytes .../site/layout/img/social/pintrest.png | Bin 0 -> 3116 bytes .../statics/site/layout/img/social/quora.png | Bin 0 -> 1636 bytes .../statics/site/layout/img/social/reddit.png | Bin 0 -> 934 bytes assets/statics/site/layout/img/social/rss.png | Bin 0 -> 3358 bytes .../statics/site/layout/img/social/skype.png | Bin 0 -> 3241 bytes .../site/layout/img/social/spotify.png | Bin 0 -> 3124 bytes .../site/layout/img/social/stumbleupon.png | Bin 0 -> 3105 bytes .../statics/site/layout/img/social/tumblr.png | Bin 0 -> 3025 bytes .../site/layout/img/social/twitter.png | Bin 0 -> 3055 bytes .../statics/site/layout/img/social/vimeo.png | Bin 0 -> 3216 bytes assets/statics/site/layout/img/social/vk.png | Bin 0 -> 366 bytes .../site/layout/img/social/wordpress.png | Bin 0 -> 3415 bytes .../statics/site/layout/img/social/xing.png | Bin 0 -> 3081 bytes .../statics/site/layout/img/social/yahoo.png | Bin 0 -> 3068 bytes .../site/layout/img/social/youtube.png | Bin 0 -> 3300 bytes .../cms/layout/_tutoriux.scss | 0 .../cms/layout/_variables.scss | 0 .../{sass => styles}/cms/layout/layout.scss | 0 .../cms/layout/layout/_content.scss | 0 .../cms/layout/layout/_footer.scss | 0 .../cms/layout/layout/_header.scss | 0 .../cms/layout/layout/_page-container.scss | 0 .../cms/layout/layout/_print.scss | 0 .../cms/layout/layout/_quick-sidebar.scss | 0 .../cms/layout/layout/_sidebar.scss | 0 .../cms/layout/layout/_theme-panel.scss | 0 .../cms/layout/themes/_base.scss | 0 .../cms/layout/themes/blue.scss | 0 .../cms/layout/themes/darkblue.scss | 0 .../cms/layout/themes/default.scss | 0 .../cms/layout/themes/grey.scss | 0 .../cms/layout/themes/light.scss | 0 .../cms/layout/themes/light2.scss | 0 .../{sass => styles}/cms/pages/about-us.scss | 0 assets/{sass => styles}/cms/pages/blog.scss | 0 .../cms/pages/coming-soon.scss | 0 assets/{sass => styles}/cms/pages/error.scss | 0 .../cms/pages/image-crop.scss | 0 assets/{sass => styles}/cms/pages/inbox.scss | 0 .../{sass => styles}/cms/pages/invoice.scss | 0 assets/{sass => styles}/cms/pages/lock.scss | 0 assets/{sass => styles}/cms/pages/lock2.scss | 0 .../cms/pages/login-soft.scss | 0 assets/{sass => styles}/cms/pages/login.scss | 0 assets/{sass => styles}/cms/pages/login2.scss | 0 assets/{sass => styles}/cms/pages/login3.scss | 0 assets/{sass => styles}/cms/pages/news.scss | 0 .../{sass => styles}/cms/pages/portfolio.scss | 0 .../cms/pages/pricing-tables.scss | 0 .../cms/pages/profile-old.scss | 0 .../{sass => styles}/cms/pages/profile.scss | 0 assets/{sass => styles}/cms/pages/search.scss | 0 assets/{sass => styles}/cms/pages/tasks.scss | 0 .../cms/pages/timeline-old.scss | 0 .../{sass => styles}/cms/pages/timeline.scss | 0 assets/{sass => styles}/cms/pages/todo.scss | 0 .../global/_variables-md.scss | 0 .../{sass => styles}/global/_variables.scss | 0 .../global/components-md.scss | 0 .../global/components-rounded.scss | 0 .../{sass => styles}/global/components.scss | 0 .../global/components/_alerts.scss | 0 .../global/components/_animate.scss | 0 .../global/components/_badges.scss | 0 .../global/components/_buttons.scss | 0 .../global/components/_carousel.scss | 0 .../global/components/_charts.scss | 0 .../global/components/_chats.scss | 0 .../global/components/_close.scss | 0 .../global/components/_dropdowns.scss | 0 .../global/components/_feeds.scss | 0 .../components/_flatui-color-variants.scss | 0 .../global/components/_font-icons.scss | 0 .../global/components/_form-layouts.scss | 0 .../global/components/_forms.scss | 0 .../global/components/_icon-buttons.scss | 0 .../global/components/_input-icons.scss | 0 .../global/components/_inputs.scss | 0 .../global/components/_labels.scss | 0 .../global/components/_list-groups.scss | 0 .../global/components/_loaders.scss | 0 .../global/components/_md-base.scss | 0 .../global/components/_md-checkboxes.scss | 0 .../global/components/_md-inputs.scss | 0 .../global/components/_md-radios.scss | 0 .../global/components/_metro-icons.scss | 0 .../global/components/_mixins.scss | 0 .../global/components/_modals.scss | 0 .../global/components/_notes.scss | 0 .../global/components/_pagination.scss | 0 .../global/components/_panels.scss | 0 .../global/components/_popovers.scss | 0 .../global/components/_portlets.scss | 0 .../global/components/_progress-bars.scss | 0 .../global/components/_reset-general.scss | 0 .../global/components/_reset-rounds.scss | 0 .../global/components/_social-icons.scss | 190 + .../global/components/_statistic-blocks.scss | 0 .../global/components/_tables.scss | 0 .../global/components/_tabs.scss | 0 .../global/components/_tiles.scss | 0 .../global/components/_typography.scss | 0 .../global/components/_utils.scss | 0 .../global/components/_wells.scss | 0 .../global/components/_widgets.scss | 0 .../{sass => styles}/global/plugins-md.scss | 0 assets/{sass => styles}/global/plugins.scss | 0 .../global/plugins/_amchart.scss | 0 .../global/plugins/_bootbox.scss | 0 .../plugins/_bootstrap-colorpicker.scss | 0 .../plugins/_bootstrap-datepaginator.scss | 0 .../global/plugins/_bootstrap-datepicker.scss | 0 .../plugins/_bootstrap-daterangepicker.scss | 0 .../plugins/_bootstrap-datetimepicker.scss | 0 .../global/plugins/_bootstrap-editable.scss | 0 .../global/plugins/_bootstrap-fileinput.scss | 0 .../global/plugins/_bootstrap-gtreetable.scss | 0 .../global/plugins/_bootstrap-markdown.scss | 0 .../global/plugins/_bootstrap-modal.scss | 0 .../global/plugins/_bootstrap-select.scss | 0 .../global/plugins/_bootstrap-summercode.scss | 0 .../global/plugins/_bootstrap-switch.scss | 0 .../global/plugins/_bootstrap-tabdrop.scss | 0 .../global/plugins/_bootstrap-timepicker.scss | 0 .../global/plugins/_bootstrap-toastr.scss | 0 .../global/plugins/_bootstrap-wizard.scss | 0 .../global/plugins/_bootstrap-wysihtml5.scss | 0 .../global/plugins/_ckeditor.scss | 0 .../global/plugins/_clockface.scss | 0 .../global/plugins/_datatables.scss | 0 .../global/plugins/_dropzone.scss | 0 .../global/plugins/_fancybox.scss | 0 .../global/plugins/_fuelux.scss | 0 .../global/plugins/_fullcalendar.scss | 0 .../global/plugins/_gmaps.scss | 0 .../global/plugins/_gritter.scss | 0 .../global/plugins/_icheck.scss | 0 .../plugins/_jquery-easy-pie-chart.scss | 0 .../global/plugins/_jquery-file-upload.scss | 0 .../global/plugins/_jquery-multi-select.scss | 0 .../global/plugins/_jquery-notific8.scss | 0 .../plugins/_jquery-pwstrength-bootstrap.scss | 0 .../global/plugins/_jquery-slimscroll.scss | 0 .../global/plugins/_jquery-sparkline.scss | 0 .../global/plugins/_jquery-tags-input.scss | 0 .../global/plugins/_jquery-ui.scss | 0 .../global/plugins/_jqvmap.scss | 0 .../global/plugins/_jstree.scss | 0 .../global/plugins/_minicolors.scss | 0 .../global/plugins/_morris.scss | 0 .../global/plugins/_nouislider.scss | 0 .../global/plugins/_recaptcha.scss | 0 .../global/plugins/_select2.scss | 0 .../global/plugins/_ui-select.scss | 0 .../global/plugins/_uniform.scss | 0 assets/{sass => styles}/site/home.scss | 0 .../site/layout/_tutoriux.scss | 0 .../site/layout/_variables.scss | 0 .../{sass => styles}/site/layout/layout.scss | 0 .../site/layout/layout/_content.scss | 0 .../site/layout/layout/_footer.scss | 0 .../site/layout/layout/_header.scss | 2 +- .../site/layout/layout/_print.scss | 0 .../site/layout/layout/_quick-sidebar.scss | 0 .../site/layout/layout/_theme-panel.scss | 0 .../site/layout/themes/_base.scss | 0 .../site/layout/themes/blue-hoki.scss | 0 .../site/layout/themes/blue-steel.scss | 0 .../site/layout/themes/default.scss | 0 .../site/layout/themes/green-haze.scss | 0 .../site/layout/themes/purple-plum.scss | 0 .../site/layout/themes/purple-studio.scss | 0 .../site/layout/themes/red-intense.scss | 0 .../site/layout/themes/red-sunglo.scss | 0 .../site/layout/themes/tutoriux.scss | 0 .../site/layout/themes/yellow-crusta.scss | 0 .../site/layout/themes/yellow-orange.scss | 0 assets/{sass => styles}/site/search.scss | 0 config/routes/mapping/site/admin.yaml | 3 + config/routes/mapping/site/authors.yaml | 9 + config/routes/mapping/site/section.yaml | 10 +- config/routes/mapping/site/text.yaml | 3 + config/routes/site/security.yaml | 18 +- package.json | 3 +- .../Site/Admin/FeedbackController.php | 58 + src/Controller/Site/SectionController.php | 2 +- src/Controller/Site/User/AuthorController.php | 237 + .../ApplicationContextExtension.php | 12 +- src/Extensions/TranslationExtension.php | 9 +- src/Form/Site/Admin/FeedbackType.php | 160 + src/Repository/NavigationRepository.php | 21 +- .../SectionNavigationRepository.php | 7 +- src/Repository/SectionRepository.php | 19 +- templates/global/_stylesheets.html.twig | 4 +- templates/global/entity_title.html.twig | 4 +- .../form/_form_fields_vertical.html.twig | 56 +- .../admin/feedback/feedback_form.html.twig | 66 + .../feedback/feedback_form_email.txt.twig | 32 + .../form/form_fields_vertical_md.html.twig | 16 +- templates/site/core/javascripts.html.twig | 22 +- templates/site/core/stylesheets.html.twig | 5 +- .../notification/header_dropdown.html.twig | 6 +- templates/site/section/home_page.html.twig | 4 +- .../user/_author_sidebar_module.html.twig | 4 +- templates/site/user/_authors_items.html.twig | 4 +- templates/site/user/_users_items.html.twig | 4 +- webpack.config.js | 6 +- yarn.lock | 13 +- 266 files changed, 1740 insertions(+), 22160 deletions(-) rename assets/entry/global/{app.js => _app_global.js} (75%) delete mode 100644 assets/entry/site/app.js create mode 100644 assets/entry/site/homepage.js delete mode 100644 assets/entry/site/search.js create mode 100755 assets/plugins/bootstrap-hover-dropdown/bower.json create mode 100755 assets/plugins/bootstrap-hover-dropdown/composer.json create mode 100755 assets/plugins/bootstrap-hover-dropdown/demo.html create mode 100755 assets/plugins/bootstrap-hover-dropdown/gulpfile.js create mode 100755 assets/plugins/bootstrap-hover-dropdown/package.json delete mode 100755 assets/plugins/reactjsx/react-0.13.3.js delete mode 100755 assets/plugins/reactjsx/react-0.13.3.min.js delete mode 100755 assets/sass/global/components/_social-icons.scss rename assets/{js => scripts}/global/core-scripts.js (99%) rename assets/{js => scripts}/global/jquery.tablednd_0_5.js (100%) rename assets/{js => scripts}/global/metronic.js (83%) rename assets/{js => scripts}/global/translations.js (99%) rename assets/{js => scripts}/site/layout.js (96%) rename assets/{js => scripts}/site/search_engine.jsx (98%) rename assets/{js => scripts}/site/user/log.jsx (100%) rename assets/{js => scripts}/site/user/mailbox.jsx (100%) create mode 100755 assets/statics/site/layout/img/ajax-loading.gif create mode 100755 assets/statics/site/layout/img/ajax-modal-loading.gif create mode 100755 assets/statics/site/layout/img/avatar.png create mode 100755 assets/statics/site/layout/img/icon-color-close.png create mode 100755 assets/statics/site/layout/img/icon-color.png create mode 100755 assets/statics/site/layout/img/loading-spinner-blue.gif create mode 100755 assets/statics/site/layout/img/loading-spinner-default.gif create mode 100755 assets/statics/site/layout/img/loading-spinner-grey.gif create mode 100755 assets/statics/site/layout/img/loading.gif create mode 100755 assets/statics/site/layout/img/menu-toggler.png create mode 100755 assets/statics/site/layout/img/social/Thumbs.db create mode 100755 assets/statics/site/layout/img/social/aboutme.png create mode 100755 assets/statics/site/layout/img/social/amazon.png create mode 100755 assets/statics/site/layout/img/social/behance.png create mode 100755 assets/statics/site/layout/img/social/blogger.png create mode 100755 assets/statics/site/layout/img/social/deviantart.png create mode 100755 assets/statics/site/layout/img/social/dribbble.png create mode 100755 assets/statics/site/layout/img/social/dropbox.png create mode 100755 assets/statics/site/layout/img/social/evernote.png create mode 100755 assets/statics/site/layout/img/social/facebook.png create mode 100755 assets/statics/site/layout/img/social/flickr.png create mode 100755 assets/statics/site/layout/img/social/forrst.png create mode 100755 assets/statics/site/layout/img/social/foursquare.png create mode 100755 assets/statics/site/layout/img/social/github.png create mode 100755 assets/statics/site/layout/img/social/googleplus.png create mode 100755 assets/statics/site/layout/img/social/gravatar.png create mode 100755 assets/statics/site/layout/img/social/instagram.png create mode 100755 assets/statics/site/layout/img/social/jolicloud.png create mode 100755 assets/statics/site/layout/img/social/klout.png create mode 100755 assets/statics/site/layout/img/social/last-fm.png create mode 100755 assets/statics/site/layout/img/social/linkedin.png create mode 100755 assets/statics/site/layout/img/social/myspace.png create mode 100755 assets/statics/site/layout/img/social/picasa.png create mode 100755 assets/statics/site/layout/img/social/pintrest.png create mode 100755 assets/statics/site/layout/img/social/quora.png create mode 100755 assets/statics/site/layout/img/social/reddit.png create mode 100755 assets/statics/site/layout/img/social/rss.png create mode 100755 assets/statics/site/layout/img/social/skype.png create mode 100755 assets/statics/site/layout/img/social/spotify.png create mode 100755 assets/statics/site/layout/img/social/stumbleupon.png create mode 100755 assets/statics/site/layout/img/social/tumblr.png create mode 100755 assets/statics/site/layout/img/social/twitter.png create mode 100755 assets/statics/site/layout/img/social/vimeo.png create mode 100755 assets/statics/site/layout/img/social/vk.png create mode 100755 assets/statics/site/layout/img/social/wordpress.png create mode 100755 assets/statics/site/layout/img/social/xing.png create mode 100755 assets/statics/site/layout/img/social/yahoo.png create mode 100755 assets/statics/site/layout/img/social/youtube.png rename assets/{sass => styles}/cms/layout/_tutoriux.scss (100%) rename assets/{sass => styles}/cms/layout/_variables.scss (100%) rename assets/{sass => styles}/cms/layout/layout.scss (100%) rename assets/{sass => styles}/cms/layout/layout/_content.scss (100%) rename assets/{sass => styles}/cms/layout/layout/_footer.scss (100%) rename assets/{sass => styles}/cms/layout/layout/_header.scss (100%) rename assets/{sass => styles}/cms/layout/layout/_page-container.scss (100%) rename assets/{sass => styles}/cms/layout/layout/_print.scss (100%) rename assets/{sass => styles}/cms/layout/layout/_quick-sidebar.scss (100%) rename assets/{sass => styles}/cms/layout/layout/_sidebar.scss (100%) rename assets/{sass => styles}/cms/layout/layout/_theme-panel.scss (100%) rename assets/{sass => styles}/cms/layout/themes/_base.scss (100%) rename assets/{sass => styles}/cms/layout/themes/blue.scss (100%) rename assets/{sass => styles}/cms/layout/themes/darkblue.scss (100%) rename assets/{sass => styles}/cms/layout/themes/default.scss (100%) rename assets/{sass => styles}/cms/layout/themes/grey.scss (100%) rename assets/{sass => styles}/cms/layout/themes/light.scss (100%) rename assets/{sass => styles}/cms/layout/themes/light2.scss (100%) rename assets/{sass => styles}/cms/pages/about-us.scss (100%) rename assets/{sass => styles}/cms/pages/blog.scss (100%) rename assets/{sass => styles}/cms/pages/coming-soon.scss (100%) rename assets/{sass => styles}/cms/pages/error.scss (100%) rename assets/{sass => styles}/cms/pages/image-crop.scss (100%) rename assets/{sass => styles}/cms/pages/inbox.scss (100%) rename assets/{sass => styles}/cms/pages/invoice.scss (100%) rename assets/{sass => styles}/cms/pages/lock.scss (100%) rename assets/{sass => styles}/cms/pages/lock2.scss (100%) rename assets/{sass => styles}/cms/pages/login-soft.scss (100%) rename assets/{sass => styles}/cms/pages/login.scss (100%) rename assets/{sass => styles}/cms/pages/login2.scss (100%) rename assets/{sass => styles}/cms/pages/login3.scss (100%) rename assets/{sass => styles}/cms/pages/news.scss (100%) rename assets/{sass => styles}/cms/pages/portfolio.scss (100%) rename assets/{sass => styles}/cms/pages/pricing-tables.scss (100%) rename assets/{sass => styles}/cms/pages/profile-old.scss (100%) rename assets/{sass => styles}/cms/pages/profile.scss (100%) rename assets/{sass => styles}/cms/pages/search.scss (100%) rename assets/{sass => styles}/cms/pages/tasks.scss (100%) rename assets/{sass => styles}/cms/pages/timeline-old.scss (100%) rename assets/{sass => styles}/cms/pages/timeline.scss (100%) rename assets/{sass => styles}/cms/pages/todo.scss (100%) rename assets/{sass => styles}/global/_variables-md.scss (100%) rename assets/{sass => styles}/global/_variables.scss (100%) rename assets/{sass => styles}/global/components-md.scss (100%) rename assets/{sass => styles}/global/components-rounded.scss (100%) rename assets/{sass => styles}/global/components.scss (100%) rename assets/{sass => styles}/global/components/_alerts.scss (100%) rename assets/{sass => styles}/global/components/_animate.scss (100%) rename assets/{sass => styles}/global/components/_badges.scss (100%) rename assets/{sass => styles}/global/components/_buttons.scss (100%) rename assets/{sass => styles}/global/components/_carousel.scss (100%) rename assets/{sass => styles}/global/components/_charts.scss (100%) rename assets/{sass => styles}/global/components/_chats.scss (100%) rename assets/{sass => styles}/global/components/_close.scss (100%) rename assets/{sass => styles}/global/components/_dropdowns.scss (100%) rename assets/{sass => styles}/global/components/_feeds.scss (100%) rename assets/{sass => styles}/global/components/_flatui-color-variants.scss (100%) rename assets/{sass => styles}/global/components/_font-icons.scss (100%) rename assets/{sass => styles}/global/components/_form-layouts.scss (100%) rename assets/{sass => styles}/global/components/_forms.scss (100%) rename assets/{sass => styles}/global/components/_icon-buttons.scss (100%) rename assets/{sass => styles}/global/components/_input-icons.scss (100%) rename assets/{sass => styles}/global/components/_inputs.scss (100%) rename assets/{sass => styles}/global/components/_labels.scss (100%) rename assets/{sass => styles}/global/components/_list-groups.scss (100%) rename assets/{sass => styles}/global/components/_loaders.scss (100%) rename assets/{sass => styles}/global/components/_md-base.scss (100%) rename assets/{sass => styles}/global/components/_md-checkboxes.scss (100%) rename assets/{sass => styles}/global/components/_md-inputs.scss (100%) rename assets/{sass => styles}/global/components/_md-radios.scss (100%) rename assets/{sass => styles}/global/components/_metro-icons.scss (100%) rename assets/{sass => styles}/global/components/_mixins.scss (100%) rename assets/{sass => styles}/global/components/_modals.scss (100%) rename assets/{sass => styles}/global/components/_notes.scss (100%) rename assets/{sass => styles}/global/components/_pagination.scss (100%) rename assets/{sass => styles}/global/components/_panels.scss (100%) rename assets/{sass => styles}/global/components/_popovers.scss (100%) rename assets/{sass => styles}/global/components/_portlets.scss (100%) rename assets/{sass => styles}/global/components/_progress-bars.scss (100%) rename assets/{sass => styles}/global/components/_reset-general.scss (100%) rename assets/{sass => styles}/global/components/_reset-rounds.scss (100%) create mode 100755 assets/styles/global/components/_social-icons.scss rename assets/{sass => styles}/global/components/_statistic-blocks.scss (100%) rename assets/{sass => styles}/global/components/_tables.scss (100%) rename assets/{sass => styles}/global/components/_tabs.scss (100%) rename assets/{sass => styles}/global/components/_tiles.scss (100%) rename assets/{sass => styles}/global/components/_typography.scss (100%) rename assets/{sass => styles}/global/components/_utils.scss (100%) rename assets/{sass => styles}/global/components/_wells.scss (100%) rename assets/{sass => styles}/global/components/_widgets.scss (100%) rename assets/{sass => styles}/global/plugins-md.scss (100%) rename assets/{sass => styles}/global/plugins.scss (100%) rename assets/{sass => styles}/global/plugins/_amchart.scss (100%) rename assets/{sass => styles}/global/plugins/_bootbox.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-colorpicker.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-datepaginator.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-datepicker.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-daterangepicker.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-datetimepicker.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-editable.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-fileinput.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-gtreetable.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-markdown.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-modal.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-select.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-summercode.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-switch.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-tabdrop.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-timepicker.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-toastr.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-wizard.scss (100%) rename assets/{sass => styles}/global/plugins/_bootstrap-wysihtml5.scss (100%) rename assets/{sass => styles}/global/plugins/_ckeditor.scss (100%) rename assets/{sass => styles}/global/plugins/_clockface.scss (100%) rename assets/{sass => styles}/global/plugins/_datatables.scss (100%) rename assets/{sass => styles}/global/plugins/_dropzone.scss (100%) rename assets/{sass => styles}/global/plugins/_fancybox.scss (100%) rename assets/{sass => styles}/global/plugins/_fuelux.scss (100%) rename assets/{sass => styles}/global/plugins/_fullcalendar.scss (100%) rename assets/{sass => styles}/global/plugins/_gmaps.scss (100%) rename assets/{sass => styles}/global/plugins/_gritter.scss (100%) rename assets/{sass => styles}/global/plugins/_icheck.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-easy-pie-chart.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-file-upload.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-multi-select.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-notific8.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-pwstrength-bootstrap.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-slimscroll.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-sparkline.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-tags-input.scss (100%) rename assets/{sass => styles}/global/plugins/_jquery-ui.scss (100%) rename assets/{sass => styles}/global/plugins/_jqvmap.scss (100%) rename assets/{sass => styles}/global/plugins/_jstree.scss (100%) rename assets/{sass => styles}/global/plugins/_minicolors.scss (100%) rename assets/{sass => styles}/global/plugins/_morris.scss (100%) rename assets/{sass => styles}/global/plugins/_nouislider.scss (100%) rename assets/{sass => styles}/global/plugins/_recaptcha.scss (100%) rename assets/{sass => styles}/global/plugins/_select2.scss (100%) rename assets/{sass => styles}/global/plugins/_ui-select.scss (100%) rename assets/{sass => styles}/global/plugins/_uniform.scss (100%) rename assets/{sass => styles}/site/home.scss (100%) rename assets/{sass => styles}/site/layout/_tutoriux.scss (100%) rename assets/{sass => styles}/site/layout/_variables.scss (100%) rename assets/{sass => styles}/site/layout/layout.scss (100%) rename assets/{sass => styles}/site/layout/layout/_content.scss (100%) rename assets/{sass => styles}/site/layout/layout/_footer.scss (100%) rename assets/{sass => styles}/site/layout/layout/_header.scss (99%) rename assets/{sass => styles}/site/layout/layout/_print.scss (100%) rename assets/{sass => styles}/site/layout/layout/_quick-sidebar.scss (100%) rename assets/{sass => styles}/site/layout/layout/_theme-panel.scss (100%) rename assets/{sass => styles}/site/layout/themes/_base.scss (100%) rename assets/{sass => styles}/site/layout/themes/blue-hoki.scss (100%) rename assets/{sass => styles}/site/layout/themes/blue-steel.scss (100%) rename assets/{sass => styles}/site/layout/themes/default.scss (100%) rename assets/{sass => styles}/site/layout/themes/green-haze.scss (100%) rename assets/{sass => styles}/site/layout/themes/purple-plum.scss (100%) rename assets/{sass => styles}/site/layout/themes/purple-studio.scss (100%) rename assets/{sass => styles}/site/layout/themes/red-intense.scss (100%) rename assets/{sass => styles}/site/layout/themes/red-sunglo.scss (100%) rename assets/{sass => styles}/site/layout/themes/tutoriux.scss (100%) rename assets/{sass => styles}/site/layout/themes/yellow-crusta.scss (100%) rename assets/{sass => styles}/site/layout/themes/yellow-orange.scss (100%) rename assets/{sass => styles}/site/search.scss (100%) create mode 100644 config/routes/mapping/site/admin.yaml create mode 100644 config/routes/mapping/site/authors.yaml create mode 100644 config/routes/mapping/site/text.yaml create mode 100644 src/Controller/Site/Admin/FeedbackController.php create mode 100644 src/Controller/Site/User/AuthorController.php create mode 100644 src/Form/Site/Admin/FeedbackType.php create mode 100644 templates/site/admin/feedback/feedback_form.html.twig create mode 100644 templates/site/admin/feedback/feedback_form_email.txt.twig diff --git a/assets/entry/global/app.js b/assets/entry/global/_app_global.js similarity index 75% rename from assets/entry/global/app.js rename to assets/entry/global/_app_global.js index b5de81e..6234fe7 100644 --- a/assets/entry/global/app.js +++ b/assets/entry/global/_app_global.js @@ -8,14 +8,13 @@ require('../../plugins/jquery-ui/jquery-ui-1.10.3.custom.min.css'); require('../../plugins/bootstrap-toastr/toastr.css'); // Global Theme CSS -require('../../sass/global/components-rounded.scss'); -require('../../sass/global/plugins.scss'); +require('../../styles/global/components-rounded.scss'); +require('../../styles/global/plugins.scss'); // Global Plugins -var $ = require('../../plugins/jquery.min'); -global.$ = $; -global.jQuery = $; +var $ = require('jquery'); +global.$ = global.jQuery = $; require('../../plugins/jquery-migrate.min'); require('../../plugins/jquery-ui/jquery-ui-1.10.3.custom'); require('../../plugins/jquery.ui.touch-punch.min'); @@ -26,12 +25,9 @@ require('../../plugins/jquery.blockui'); require('../../plugins/uniform/jquery.uniform'); require('../../plugins/reactjsx/react-0.14.3'); require('../../plugins/reactjsx/react-dom-0.14.3'); -require('../../plugins/moment/moment'); -require('../../plugins/bootstrap-toastr/toastr'); +// require('../../plugins/bootstrap-toastr/toastr'); // Global Scripts require('../../../public/bundles/fosjsrouting/js/router'); require('../../../public/js/fos_js_routes'); -require('../../js/global/metronic'); -require('../../js/global/translations'); -require('../../js/global/core-scripts'); + diff --git a/assets/entry/global/docready.js b/assets/entry/global/docready.js index 46d780a..15811a6 100644 --- a/assets/entry/global/docready.js +++ b/assets/entry/global/docready.js @@ -1 +1,2 @@ -require('../../plugins/docready'); \ No newline at end of file +require('../../plugins/docready'); +global.docReady = docReady; \ No newline at end of file diff --git a/assets/entry/site/app.js b/assets/entry/site/app.js deleted file mode 100644 index f6ae165..0000000 --- a/assets/entry/site/app.js +++ /dev/null @@ -1,6 +0,0 @@ -// Site layout CSS -require('../../sass/site/layout/layout.scss'); -require('../../sass/site/layout/themes/tutoriux.scss'); - -// Site layout Script -require('../../js/site/layout'); \ No newline at end of file diff --git a/assets/entry/site/homepage.js b/assets/entry/site/homepage.js new file mode 100644 index 0000000..c94dc4e --- /dev/null +++ b/assets/entry/site/homepage.js @@ -0,0 +1,22 @@ +// Global CSS and Scripts +require('../global/_app_global'); + +// Page CSS +require('../../styles/site/layout/layout.scss'); +require('../../styles/site/layout/themes/tutoriux.scss'); +require('../../styles/site/search.scss'); + +// Page Script +var Metronic = require('../../scripts/global/metronic'); +var Layout = require('../../scripts/site/layout'); +var Tutoriux = require('../../scripts/global/core-scripts'); +var TutoriuxSearch = require('../../scripts/site/search_engine'); + +// Page Script +jQuery(document).ready(function() { + Metronic.init(); + Layout.init(); + Tutoriux.init(); + Tutoriux.initFrontend(); + TutoriuxSearch.init(algolia_config); +}); \ No newline at end of file diff --git a/assets/entry/site/search.js b/assets/entry/site/search.js deleted file mode 100644 index 3625a99..0000000 --- a/assets/entry/site/search.js +++ /dev/null @@ -1,5 +0,0 @@ -// Search CSS -require('../../sass/site/search.scss'); - -// Search Script -require('../../js/site/search_engine'); \ No newline at end of file diff --git a/assets/plugins/bootstrap-hover-dropdown/LICENSE b/assets/plugins/bootstrap-hover-dropdown/LICENSE index d2ee10f..050b5a0 100755 --- a/assets/plugins/bootstrap-hover-dropdown/LICENSE +++ b/assets/plugins/bootstrap-hover-dropdown/LICENSE @@ -19,6 +19,3 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - \ No newline at end of file diff --git a/assets/plugins/bootstrap-hover-dropdown/README.md b/assets/plugins/bootstrap-hover-dropdown/README.md index 338e4c1..a055568 100755 --- a/assets/plugins/bootstrap-hover-dropdown/README.md +++ b/assets/plugins/bootstrap-hover-dropdown/README.md @@ -78,6 +78,7 @@ This also works with submenus without any other configuring since Bootstrap alre * **delay**: *(optional)* The delay in miliseconds. This is the time to wait before closing a dropdown when the mouse is no longer over the dropdown or the button/nav item that activated it. Defaults to `500`. * **instantlyCloseOthers**: *(optional)* A boolean value that when true, will instantly close all other dropdowns matched by the selector used when you activate a new navigation. This is nice for when you have dropdowns close together that may overlap. Default is `true`. +* **hoverDelay**: *(optional)* A delay *before opening* in miliseconds. Some people argue this improves user experience as it decreases the number of accidental menu openings. Defaults to `0`. ## Demo @@ -93,6 +94,14 @@ This plugin purposedly lets you choose a selector (as opposed to apply this to e I'm a slacker and only started keeping track of changes/bug fixes starting in March of 2013. +* **2015-12-01** *[v2.2.1]* Update README +* **2015-12-01** *[v2.2.0]* New logic: don't do anything when the navbar is collapsed +* **2015-02-07** *[v2.1.3]* Update version in JS files +* **2015-02-07** *[v2.1.2]* Forgot to minify the last couple updates... +* **2015-02-07** *[v2.1.1]* Merged another PR: `browserify` compatibility [#100](/../../issues/100). +* **2015-02-07** *[v2.1.0]* Merged a couple PRs: ARIA support [#95](/../../issues/95) and hover delay support [#99](/../../issues/99). +* **2014-06-16** Added package to composer. +* **2014-05-12** Fixed an issue where you could click a parent menu item to close it, but moving away from it would re-open the menu. Also cleaned up some code, removed some redundency. * **2014-01-27** Fixed an issue where chaining could break on mobile and cleaned up the the way the plugin triggered events. Also cleaned up the demo (fixed navbar appearance). * **2013-12-05** Change all references of *Twitter Bootstrap* to *Bootstrap* to reflect Bootstrap's name change. * **2013-11-09** Disable this plugin for devices that support touch. The plugin was causing issues with some mobile devices, and it's not necessary for them. @@ -107,7 +116,11 @@ I'm a slacker and only started keeping track of changes/bug fixes starting in Ma ## Contributions -[Mattia Larentis](https://github.com/nostalgiaz) helped me with the idea for the data-attributes and doing the options via an object. +Thanks to all of you who have contributed to this project, whether by code or by filing an issue to help improve it. But of course, especially the [ones that contribute code](/../../graphs/contributors) =) + +A special thanks to [Mattia Larentis](https://github.com/nostalgiaz). He isn't in the contributor list, but he helped me with the idea for the data-attributes and doing the options via an object. + +I will also issue a very special thanks in the README for help with setting up a [testing suite](/../../issues/69)! ## Roadmap diff --git a/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js b/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js index fac00fd..d933827 100755 --- a/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js +++ b/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js @@ -1,14 +1,130 @@ /** + * @preserve * Project: Bootstrap Hover Dropdown * Author: Cameron Spear + * Version: v2.2.1 * Contributors: Mattia Larentis - * * Dependencies: Bootstrap's Dropdown plugin, jQuery - * - * A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience. - * + * Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience. * License: MIT - * - * http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/ + * Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/ */ -!function(e,n){var o=e();e.fn.dropdownHover=function(t){return"ontouchstart"in document?this:(o=o.add(this.parent()),this.each(function(){var i,r=e(this),s=r.parent(),d={delay:500,instantlyCloseOthers:!0},a={delay:e(this).data("delay"),instantlyCloseOthers:e(this).data("close-others")},h="show.bs.dropdown",u="hide.bs.dropdown",l=e.extend(!0,{},d,t,a);s.hover(function(e){return s.hasClass("open")||r.is(e.target)?(o.find(":focus").blur(),l.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(i),s.addClass("open"),void r.trigger(h)):!0},function(){i=n.setTimeout(function(){s.removeClass("open"),r.trigger(u)},l.delay)}),r.hover(function(){o.find(":focus").blur(),l.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(i),s.addClass("open"),r.trigger(h)}),s.find(".dropdown-submenu").each(function(){var o,t=e(this);t.hover(function(){n.clearTimeout(o),t.children(".dropdown-menu").show(),t.siblings().children(".dropdown-menu").hide()},function(){var e=t.children(".dropdown-menu");o=n.setTimeout(function(){e.hide()},l.delay)})})}))},e(document).ready(function(){e('[data-hover="dropdown"]').not(".hover-initialized").each(function(){e(this).dropdownHover(),e(this).addClass("hover-initialized")})})}(jQuery,this); +;(function ($, window, undefined) { + // outside the scope of the jQuery plugin to + // keep track of all dropdowns + var $allDropdowns = $(); + + // if instantlyCloseOthers is true, then it will instantly + // shut other nav items when a new one is hovered over + $.fn.dropdownHover = function (options) { + // don't do anything if touch is supported + // (plugin causes some issues on mobile) + if('ontouchstart' in document) return this; // don't want to affect chaining + + // the element we really care about + // is the dropdown-toggle's parent + $allDropdowns = $allDropdowns.add(this.parent()); + + return this.each(function () { + var $this = $(this), + $parent = $this.parent(), + defaults = { + delay: 500, + hoverDelay: 0, + instantlyCloseOthers: true + }, + data = { + delay: $(this).data('delay'), + hoverDelay: $(this).data('hover-delay'), + instantlyCloseOthers: $(this).data('close-others') + }, + showEvent = 'show.bs.dropdown', + hideEvent = 'hide.bs.dropdown', + // shownEvent = 'shown.bs.dropdown', + // hiddenEvent = 'hidden.bs.dropdown', + settings = $.extend(true, {}, defaults, options, data), + timeout, timeoutHover; + + $parent.hover(function (event) { + // so a neighbor can't open the dropdown + if(!$parent.hasClass('open') && !$this.is(event.target)) { + // stop this event, stop executing any code + // in this callback but continue to propagate + return true; + } + + openDropdown(event); + }, function () { + // clear timer for hover event + window.clearTimeout(timeoutHover) + timeout = window.setTimeout(function () { + $this.attr('aria-expanded', 'false'); + $parent.removeClass('open'); + $this.trigger(hideEvent); + }, settings.delay); + }); + + // this helps with button groups! + $this.hover(function (event) { + // this helps prevent a double event from firing. + // see https://github.com/CWSpear/bootstrap-hover-dropdown/issues/55 + if(!$parent.hasClass('open') && !$parent.is(event.target)) { + // stop this event, stop executing any code + // in this callback but continue to propagate + return true; + } + + openDropdown(event); + }); + + // handle submenus + $parent.find('.dropdown-submenu').each(function (){ + var $this = $(this); + var subTimeout; + $this.hover(function () { + window.clearTimeout(subTimeout); + $this.children('.dropdown-menu').show(); + // always close submenu siblings instantly + $this.siblings().children('.dropdown-menu').hide(); + }, function () { + var $submenu = $this.children('.dropdown-menu'); + subTimeout = window.setTimeout(function () { + $submenu.hide(); + }, settings.delay); + }); + }); + + function openDropdown(event) { + if($this.parents(".navbar").find(".navbar-toggle").is(":visible")) { + // If we're inside a navbar, don't do anything when the + // navbar is collapsed, as it makes the navbar pretty unusable. + return; + } + + // clear dropdown timeout here so it doesnt close before it should + window.clearTimeout(timeout); + // restart hover timer + window.clearTimeout(timeoutHover); + + // delay for hover event. + timeoutHover = window.setTimeout(function () { + $allDropdowns.find(':focus').blur(); + + if(settings.instantlyCloseOthers === true) + $allDropdowns.removeClass('open'); + + // clear timer for hover event + window.clearTimeout(timeoutHover); + $this.attr('aria-expanded', 'true'); + $parent.addClass('open'); + $this.trigger(showEvent); + }, settings.hoverDelay); + } + }); + }; + + $(document).ready(function () { + // apply dropdownHover to all elements with the data-hover="dropdown" attribute + $('[data-hover="dropdown"]').dropdownHover(); + }); +})(jQuery, window); diff --git a/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js b/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js index 0bf4687..6918463 100755 --- a/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js +++ b/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js @@ -1,13 +1,12 @@ /** + * @preserve * Project: Bootstrap Hover Dropdown * Author: Cameron Spear + * Version: v2.2.1 * Contributors: Mattia Larentis - * * Dependencies: Bootstrap's Dropdown plugin, jQuery - * - * A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience. - * + * Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience. * License: MIT - * - * http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/ - */(function(b,a,c){var d=b();b.fn.dropdownHover=function(e){if("ontouchstart" in document){return this}d=d.add(this.parent());return this.each(function(){var m=b(this),l=m.parent(),k={delay:500,instantlyCloseOthers:true},i={delay:b(this).data("delay"),instantlyCloseOthers:b(this).data("close-others")},f="show.bs.dropdown",j="hide.bs.dropdown",g=b.extend(true,{},k,e,i),h;l.hover(function(n){if(!l.hasClass("open")&&!m.is(n.target)){return true}d.find(":focus").blur();if(g.instantlyCloseOthers===true){d.removeClass("open")}a.clearTimeout(h);l.addClass("open");m.trigger(f)},function(){h=a.setTimeout(function(){l.removeClass("open");m.trigger(j)},g.delay)});m.hover(function(){d.find(":focus").blur();if(g.instantlyCloseOthers===true){d.removeClass("open")}a.clearTimeout(h);l.addClass("open");m.trigger(f)});l.find(".dropdown-submenu").each(function(){var o=b(this);var n;o.hover(function(){a.clearTimeout(n);o.children(".dropdown-menu").show();o.siblings().children(".dropdown-menu").hide()},function(){var p=o.children(".dropdown-menu");n=a.setTimeout(function(){p.hide()},g.delay)})})})};b(document).ready(function(){b('[data-hover="dropdown"]').dropdownHover()})})(jQuery,this); \ No newline at end of file + * Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/ + */ +!function(e,n){var o=e();e.fn.dropdownHover=function(t){return"ontouchstart"in document?this:(o=o.add(this.parent()),this.each(function(){function r(){d.parents(".navbar").find(".navbar-toggle").is(":visible")||(n.clearTimeout(a),n.clearTimeout(i),i=n.setTimeout(function(){o.find(":focus").blur(),v.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(i),d.attr("aria-expanded","true"),s.addClass("open"),d.trigger(h)},v.hoverDelay))}var a,i,d=e(this),s=d.parent(),u={delay:500,hoverDelay:0,instantlyCloseOthers:!0},l={delay:e(this).data("delay"),hoverDelay:e(this).data("hover-delay"),instantlyCloseOthers:e(this).data("close-others")},h="show.bs.dropdown",c="hide.bs.dropdown",v=e.extend(!0,{},u,t,l);s.hover(function(e){return s.hasClass("open")||d.is(e.target)?void r(e):!0},function(){n.clearTimeout(i),a=n.setTimeout(function(){d.attr("aria-expanded","false"),s.removeClass("open"),d.trigger(c)},v.delay)}),d.hover(function(e){return s.hasClass("open")||s.is(e.target)?void r(e):!0}),s.find(".dropdown-submenu").each(function(){var o,t=e(this);t.hover(function(){n.clearTimeout(o),t.children(".dropdown-menu").show(),t.siblings().children(".dropdown-menu").hide()},function(){var e=t.children(".dropdown-menu");o=n.setTimeout(function(){e.hide()},v.delay)})})}))},e(document).ready(function(){e('[data-hover="dropdown"]').dropdownHover()})}(jQuery,window); \ No newline at end of file diff --git a/assets/plugins/bootstrap-hover-dropdown/bower.json b/assets/plugins/bootstrap-hover-dropdown/bower.json new file mode 100755 index 0000000..129e74a --- /dev/null +++ b/assets/plugins/bootstrap-hover-dropdown/bower.json @@ -0,0 +1,21 @@ +{ + "name": "bootstrap-hover-dropdown", + "version": "2.2.1", + "description": "An unofficial Bootstrap plugin to enable Bootstrap dropdowns to activate on hover and provide a nice user experience.", + "main": "./bootstrap-hover-dropdown.js", + "keywords": [ + "twitter", + "bootstrap", + "hover", + "dropdowns" + ], + "homepage": "https://github.com/CWSpear/bootstrap-hover-dropdown", + "dependencies": { + "bootstrap": "^3.0.0", + "jquery": ">= 1.9.0" + }, + "author": { + "name": "Cameron Spear", + "web": "http://cameronspear.com" + } +} diff --git a/assets/plugins/bootstrap-hover-dropdown/composer.json b/assets/plugins/bootstrap-hover-dropdown/composer.json new file mode 100755 index 0000000..b1e4166 --- /dev/null +++ b/assets/plugins/bootstrap-hover-dropdown/composer.json @@ -0,0 +1,33 @@ +{ + "name": "cwspear/bootstrap-hover-dropdown", + "version": "2.2.1", + "type": "component", + "description": "An unofficial Bootstrap plugin to enable Bootstrap dropdowns to activate on hover and provide a nice user experience.", + "keywords": [ + "twitter", + "bootstrap", + "hover", + "dropdowns" + ], + "license": "MIT", + "authors": [ + { + "name": "Cameron Spear", + "email": "cam@cameronspear.com", + "homepage": "http://cameronspear.com", + "role": "Developer" + } + ], + "require": { + "components/jquery": ">=1.9", + "components/bootstrap": "~3.0" + }, + "extra": { + "component": { + "name": "bootstrap-hover-dropdown", + "files": [ + "bootstrap-hover-dropdown.js" + ] + } + } +} diff --git a/assets/plugins/bootstrap-hover-dropdown/demo.html b/assets/plugins/bootstrap-hover-dropdown/demo.html new file mode 100755 index 0000000..85bf5c0 --- /dev/null +++ b/assets/plugins/bootstrap-hover-dropdown/demo.html @@ -0,0 +1,297 @@ + + + + + Bootstrap: Dropdown on Hover Plugin Demo + + + + + + + + + + + + + +
+
+
+ Please note that Bootstrap 3 does not support submenus. See this comment from one of the original authors. +
+ +

Bootstrap: Dropdown on Hover Plugin Demo

+

Hover over the nav items to see that they activate on hover. I'm setting the instantlyCloseOthers flag to true, so when you hover over a new nav item, the other ones instantly close (instead of waiting for their timeouts). See cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/ for more.

+ +

New! Try it with data-attributes

+ +
+
+ + +
+
+ + +
+ +
+ +

It also works with buttons and tabs

+

Just add data-hover="dropdown" where you'd put data-toggle="dropdown"

+ + + +

Works with button groups

+

This was trickier than you might think!

+ +
+ + + + +
+ + +
+
+ +
+ +
+ +
+
+

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

+
+
+

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

+
+ + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/assets/plugins/bootstrap-hover-dropdown/gulpfile.js b/assets/plugins/bootstrap-hover-dropdown/gulpfile.js new file mode 100755 index 0000000..4ad35ce --- /dev/null +++ b/assets/plugins/bootstrap-hover-dropdown/gulpfile.js @@ -0,0 +1,89 @@ +var gulp = require('gulp'); +var uglify = require('gulp-uglify'); +var rename = require('gulp-rename'); + +gulp.task('default', function() { + return gulp.src('bootstrap-hover-dropdown.js') + + // minifiy preserving preserved comments + .pipe(uglify({ + preserveComments: 'some' + })) + + // rename to .min. + .pipe(rename('bootstrap-hover-dropdown.min.js')) + + .pipe(gulp.dest('.')); +}); + + +var fs = require('fs'); +var bump = require('gulp-bump'); +var filter = require('gulp-filter'); +var git = require('gulp-git'); +var tagVersion = require('gulp-tag-version'); +var replace = require('gulp-replace'); +var streamqueue = require('streamqueue'); + +/** + * Bumping version number and tagging the repository with it. + * Please read http://semver.org/ + * + * You can use the commands + * + * gulp patch # makes v0.1.0 → v0.1.1 + * gulp feature # makes v0.1.1 → v0.2.0 + * gulp release # makes v0.2.1 → v1.0.0 + * + * To bump the version numbers accordingly after you did a patch, + * introduced a feature or made a backwards-incompatible release. + */ +function increment(importance) { + var packages = ['package.json', 'bower.json', 'composer.json']; + var currentVersion = JSON.parse(fs.readFileSync('bower.json')).version; + + // get all the files to bump version in + gulp.src(packages) + + // bump the version number in those files + .pipe(bump({ type: importance })) + + // save it back to filesystem + .pipe(gulp.dest('.')) + + .on('end', function () { + var newVersion = JSON.parse(fs.readFileSync('bower.json')).version; + + var packagesStream = gulp.src(packages); + + var jsStream = gulp.src(['bootstrap-hover-dropdown.js', 'bootstrap-hover-dropdown.min.js']) + + // replace version # in the JS files + .pipe(replace('Version: v' + currentVersion, 'Version: v' + newVersion)) + + // save it back to filesystem + .pipe(gulp.dest('.')); + + // merge the streams together to commit + streamqueue({ objectMode: true }, jsStream, packagesStream) + + // commit the changed version number + .pipe(git.commit('bump packages\' version')) + + // read only one file to get the version number + .pipe(filter('package.json')) + + // **tag it in the repository** + .pipe(tagVersion()) + + // run npm publish + .on('end', function () { + var spawn = require('child_process').spawn; + spawn('npm', ['publish'], { stdio: 'inherit' }); + }); + }); +} + +gulp.task('patch', ['default'], function() { return increment('patch'); }); +gulp.task('feature', ['default'], function() { return increment('minor'); }); +gulp.task('release', ['default'], function() { return increment('major'); }); diff --git a/assets/plugins/bootstrap-hover-dropdown/package.json b/assets/plugins/bootstrap-hover-dropdown/package.json new file mode 100755 index 0000000..8106da1 --- /dev/null +++ b/assets/plugins/bootstrap-hover-dropdown/package.json @@ -0,0 +1,41 @@ +{ + "name": "bootstrap-hover-dropdown", + "version": "2.2.1", + "description": "An unofficial Bootstrap plugin to enable Bootstrap dropdowns to activate on hover and provide a nice user experience.", + "main": "bootstrap-hover-dropdown.js", + "dependencies": { + "streamqueue": "^0.1.1" + }, + "devDependencies": { + "gulp": "^3.8.10", + "gulp-bump": "^0.1.13", + "gulp-filter": "^2.0.0", + "gulp-git": "^0.5.6", + "gulp-rename": "^1.2.0", + "gulp-tag-version": "^1.2.1", + "gulp-uglify": "^1.1.0", + "streamqueue": "^0.1.1" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/CWSpear/bootstrap-hover-dropdown.git" + }, + "keywords": [ + "twitter", + "bootstrap", + "hover", + "dropdowns" + ], + "author": { + "name": "Cameron Spear", + "url": "https://cameronspear.com" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/CWSpear/bootstrap-hover-dropdown/issues" + }, + "homepage": "https://github.com/CWSpear/bootstrap-hover-dropdown" +} diff --git a/assets/plugins/reactjsx/react-0.13.3.js b/assets/plugins/reactjsx/react-0.13.3.js deleted file mode 100755 index 443f2bd..0000000 --- a/assets/plugins/reactjsx/react-0.13.3.js +++ /dev/null @@ -1,21642 +0,0 @@ -/** - * React (with addons) v0.13.3 - */ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 8 && documentMode <= 11) - ) - ); - - /** - * Opera <= 12 includes TextEvent in window, but does not fire - * text input events. Rely on keypress instead. - */ - function isPresto() { - var opera = window.opera; - return ( - typeof opera === 'object' && - typeof opera.version === 'function' && - parseInt(opera.version(), 10) <= 12 - ); - } - - var SPACEBAR_CODE = 32; - var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); - - var topLevelTypes = EventConstants.topLevelTypes; - -// Events and their corresponding property names. - var eventTypes = { - beforeInput: { - phasedRegistrationNames: { - bubbled: keyOf({onBeforeInput: null}), - captured: keyOf({onBeforeInputCapture: null}) - }, - dependencies: [ - topLevelTypes.topCompositionEnd, - topLevelTypes.topKeyPress, - topLevelTypes.topTextInput, - topLevelTypes.topPaste - ] - }, - compositionEnd: { - phasedRegistrationNames: { - bubbled: keyOf({onCompositionEnd: null}), - captured: keyOf({onCompositionEndCapture: null}) - }, - dependencies: [ - topLevelTypes.topBlur, - topLevelTypes.topCompositionEnd, - topLevelTypes.topKeyDown, - topLevelTypes.topKeyPress, - topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] - }, - compositionStart: { - phasedRegistrationNames: { - bubbled: keyOf({onCompositionStart: null}), - captured: keyOf({onCompositionStartCapture: null}) - }, - dependencies: [ - topLevelTypes.topBlur, - topLevelTypes.topCompositionStart, - topLevelTypes.topKeyDown, - topLevelTypes.topKeyPress, - topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] - }, - compositionUpdate: { - phasedRegistrationNames: { - bubbled: keyOf({onCompositionUpdate: null}), - captured: keyOf({onCompositionUpdateCapture: null}) - }, - dependencies: [ - topLevelTypes.topBlur, - topLevelTypes.topCompositionUpdate, - topLevelTypes.topKeyDown, - topLevelTypes.topKeyPress, - topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] - } - }; - -// Track whether we've ever handled a keypress on the space key. - var hasSpaceKeypress = false; - - /** - * Return whether a native keypress event is assumed to be a command. - * This is required because Firefox fires `keypress` events for key commands - * (cut, copy, select-all, etc.) even though no character is inserted. - */ - function isKeypressCommand(nativeEvent) { - return ( - (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && - // ctrlKey && altKey is equivalent to AltGr, and is not a command. - !(nativeEvent.ctrlKey && nativeEvent.altKey) - ); - } - - - /** - * Translate native top level events into event types. - * - * @param {string} topLevelType - * @return {object} - */ - function getCompositionEventType(topLevelType) { - switch (topLevelType) { - case topLevelTypes.topCompositionStart: - return eventTypes.compositionStart; - case topLevelTypes.topCompositionEnd: - return eventTypes.compositionEnd; - case topLevelTypes.topCompositionUpdate: - return eventTypes.compositionUpdate; - } - } - - /** - * Does our fallback best-guess model think this event signifies that - * composition has begun? - * - * @param {string} topLevelType - * @param {object} nativeEvent - * @return {boolean} - */ - function isFallbackCompositionStart(topLevelType, nativeEvent) { - return ( - topLevelType === topLevelTypes.topKeyDown && - nativeEvent.keyCode === START_KEYCODE - ); - } - - /** - * Does our fallback mode think that this event is the end of composition? - * - * @param {string} topLevelType - * @param {object} nativeEvent - * @return {boolean} - */ - function isFallbackCompositionEnd(topLevelType, nativeEvent) { - switch (topLevelType) { - case topLevelTypes.topKeyUp: - // Command keys insert or clear IME input. - return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1); - case topLevelTypes.topKeyDown: - // Expect IME keyCode on each keydown. If we get any other - // code we must have exited earlier. - return (nativeEvent.keyCode !== START_KEYCODE); - case topLevelTypes.topKeyPress: - case topLevelTypes.topMouseDown: - case topLevelTypes.topBlur: - // Events are not possible without cancelling IME. - return true; - default: - return false; - } - } - - /** - * Google Input Tools provides composition data via a CustomEvent, - * with the `data` property populated in the `detail` object. If this - * is available on the event object, use it. If not, this is a plain - * composition event and we have nothing special to extract. - * - * @param {object} nativeEvent - * @return {?string} - */ - function getDataFromCustomEvent(nativeEvent) { - var detail = nativeEvent.detail; - if (typeof detail === 'object' && 'data' in detail) { - return detail.data; - } - return null; - } - -// Track the current IME composition fallback object, if any. - var currentComposition = null; - - /** - * @param {string} topLevelType Record from `EventConstants`. - * @param {DOMEventTarget} topLevelTarget The listening component root node. - * @param {string} topLevelTargetID ID of `topLevelTarget`. - * @param {object} nativeEvent Native browser event. - * @return {?object} A SyntheticCompositionEvent. - */ - function extractCompositionEvent( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent - ) { - var eventType; - var fallbackData; - - if (canUseCompositionEvent) { - eventType = getCompositionEventType(topLevelType); - } else if (!currentComposition) { - if (isFallbackCompositionStart(topLevelType, nativeEvent)) { - eventType = eventTypes.compositionStart; - } - } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) { - eventType = eventTypes.compositionEnd; - } - - if (!eventType) { - return null; - } - - if (useFallbackCompositionData) { - // The current composition is stored statically and must not be - // overwritten while composition continues. - if (!currentComposition && eventType === eventTypes.compositionStart) { - currentComposition = FallbackCompositionState.getPooled(topLevelTarget); - } else if (eventType === eventTypes.compositionEnd) { - if (currentComposition) { - fallbackData = currentComposition.getData(); - } - } - } - - var event = SyntheticCompositionEvent.getPooled( - eventType, - topLevelTargetID, - nativeEvent - ); - - if (fallbackData) { - // Inject data generated from fallback path into the synthetic event. - // This matches the property of native CompositionEventInterface. - event.data = fallbackData; - } else { - var customData = getDataFromCustomEvent(nativeEvent); - if (customData !== null) { - event.data = customData; - } - } - - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; - } - - /** - * @param {string} topLevelType Record from `EventConstants`. - * @param {object} nativeEvent Native browser event. - * @return {?string} The string corresponding to this `beforeInput` event. - */ - function getNativeBeforeInputChars(topLevelType, nativeEvent) { - switch (topLevelType) { - case topLevelTypes.topCompositionEnd: - return getDataFromCustomEvent(nativeEvent); - case topLevelTypes.topKeyPress: - /** - * If native `textInput` events are available, our goal is to make - * use of them. However, there is a special case: the spacebar key. - * In Webkit, preventing default on a spacebar `textInput` event - * cancels character insertion, but it *also* causes the browser - * to fall back to its default spacebar behavior of scrolling the - * page. - * - * Tracking at: - * https://code.google.com/p/chromium/issues/detail?id=355103 - * - * To avoid this issue, use the keypress event as if no `textInput` - * event is available. - */ - var which = nativeEvent.which; - if (which !== SPACEBAR_CODE) { - return null; - } - - hasSpaceKeypress = true; - return SPACEBAR_CHAR; - - case topLevelTypes.topTextInput: - // Record the characters to be added to the DOM. - var chars = nativeEvent.data; - - // If it's a spacebar character, assume that we have already handled - // it at the keypress level and bail immediately. Android Chrome - // doesn't give us keycodes, so we need to blacklist it. - if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { - return null; - } - - return chars; - - default: - // For other native event types, do nothing. - return null; - } - } - - /** - * For browsers that do not provide the `textInput` event, extract the - * appropriate string to use for SyntheticInputEvent. - * - * @param {string} topLevelType Record from `EventConstants`. - * @param {object} nativeEvent Native browser event. - * @return {?string} The fallback string for this `beforeInput` event. - */ - function getFallbackBeforeInputChars(topLevelType, nativeEvent) { - // If we are currently composing (IME) and using a fallback to do so, - // try to extract the composed characters from the fallback object. - if (currentComposition) { - if ( - topLevelType === topLevelTypes.topCompositionEnd || - isFallbackCompositionEnd(topLevelType, nativeEvent) - ) { - var chars = currentComposition.getData(); - FallbackCompositionState.release(currentComposition); - currentComposition = null; - return chars; - } - return null; - } - - switch (topLevelType) { - case topLevelTypes.topPaste: - // If a paste event occurs after a keypress, throw out the input - // chars. Paste events should not lead to BeforeInput events. - return null; - case topLevelTypes.topKeyPress: - /** - * As of v27, Firefox may fire keypress events even when no character - * will be inserted. A few possibilities: - * - * - `which` is `0`. Arrow keys, Esc key, etc. - * - * - `which` is the pressed key code, but no char is available. - * Ex: 'AltGr + d` in Polish. There is no modified character for - * this key combination and no character is inserted into the - * document, but FF fires the keypress for char code `100` anyway. - * No `input` event will occur. - * - * - `which` is the pressed key code, but a command combination is - * being used. Ex: `Cmd+C`. No character is inserted, and no - * `input` event will occur. - */ - if (nativeEvent.which && !isKeypressCommand(nativeEvent)) { - return String.fromCharCode(nativeEvent.which); - } - return null; - case topLevelTypes.topCompositionEnd: - return useFallbackCompositionData ? null : nativeEvent.data; - default: - return null; - } - } - - /** - * Extract a SyntheticInputEvent for `beforeInput`, based on either native - * `textInput` or fallback behavior. - * - * @param {string} topLevelType Record from `EventConstants`. - * @param {DOMEventTarget} topLevelTarget The listening component root node. - * @param {string} topLevelTargetID ID of `topLevelTarget`. - * @param {object} nativeEvent Native browser event. - * @return {?object} A SyntheticInputEvent. - */ - function extractBeforeInputEvent( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent - ) { - var chars; - - if (canUseTextInputEvent) { - chars = getNativeBeforeInputChars(topLevelType, nativeEvent); - } else { - chars = getFallbackBeforeInputChars(topLevelType, nativeEvent); - } - - // If no characters are being inserted, no BeforeInput event should - // be fired. - if (!chars) { - return null; - } - - var event = SyntheticInputEvent.getPooled( - eventTypes.beforeInput, - topLevelTargetID, - nativeEvent - ); - - event.data = chars; - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; - } - - /** - * Create an `onBeforeInput` event to match - * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. - * - * This event plugin is based on the native `textInput` event - * available in Chrome, Safari, Opera, and IE. This event fires after - * `onKeyPress` and `onCompositionEnd`, but before `onInput`. - * - * `beforeInput` is spec'd but not implemented in any browsers, and - * the `input` event does not provide any useful information about what has - * actually been added, contrary to the spec. Thus, `textInput` is the best - * available event to identify the characters that have actually been inserted - * into the target node. - * - * This plugin is also responsible for emitting `composition` events, thus - * allowing us to share composition fallback code for both `beforeInput` and - * `composition` event types. - */ - var BeforeInputEventPlugin = { - - eventTypes: eventTypes, - - /** - * @param {string} topLevelType Record from `EventConstants`. - * @param {DOMEventTarget} topLevelTarget The listening component root node. - * @param {string} topLevelTargetID ID of `topLevelTarget`. - * @param {object} nativeEvent Native browser event. - * @return {*} An accumulation of synthetic events. - * @see {EventPluginHub.extractEvents} - */ - extractEvents: function( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent - ) { - return [ - extractCompositionEvent( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent - ), - extractBeforeInputEvent( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent - ) - ]; - } - }; - - module.exports = BeforeInputEventPlugin; - -},{"106":106,"110":110,"157":157,"16":16,"21":21,"22":22,"23":23}],4:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CSSCore - * @typechecks - */ - - var invariant = _dereq_(150); - - /** - * The CSSCore module specifies the API (and implements most of the methods) - * that should be used when dealing with the display of elements (via their - * CSS classes and visibility on screen. It is an API focused on mutating the - * display and not reading it as no logical state should be encoded in the - * display of elements. - */ - - var CSSCore = { - - /** - * Adds the class passed in to the element if it doesn't already have it. - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @return {DOMElement} the element passed in - */ - addClass: function(element, className) { - ("production" !== "development" ? invariant( - !/\s/.test(className), - 'CSSCore.addClass takes only a single class name. "%s" contains ' + - 'multiple classes.', className - ) : invariant(!/\s/.test(className))); - - if (className) { - if (element.classList) { - element.classList.add(className); - } else if (!CSSCore.hasClass(element, className)) { - element.className = element.className + ' ' + className; - } - } - return element; - }, - - /** - * Removes the class passed in from the element - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @return {DOMElement} the element passed in - */ - removeClass: function(element, className) { - ("production" !== "development" ? invariant( - !/\s/.test(className), - 'CSSCore.removeClass takes only a single class name. "%s" contains ' + - 'multiple classes.', className - ) : invariant(!/\s/.test(className))); - - if (className) { - if (element.classList) { - element.classList.remove(className); - } else if (CSSCore.hasClass(element, className)) { - element.className = element.className - .replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1') - .replace(/\s+/g, ' ') // multiple spaces to one - .replace(/^\s*|\s*$/g, ''); // trim the ends - } - } - return element; - }, - - /** - * Helper to add or remove a class from an element based on a condition. - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @param {*} bool condition to whether to add or remove the class - * @return {DOMElement} the element passed in - */ - conditionClass: function(element, className, bool) { - return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className); - }, - - /** - * Tests whether the element has the class specified. - * - * @param {DOMNode|DOMWindow} element the element to set the class on - * @param {string} className the CSS className - * @return {boolean} true if the element has the class, false if not - */ - hasClass: function(element, className) { - ("production" !== "development" ? invariant( - !/\s/.test(className), - 'CSS.hasClass takes only a single class name.' - ) : invariant(!/\s/.test(className))); - if (element.classList) { - return !!className && element.classList.contains(className); - } - return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1; - } - - }; - - module.exports = CSSCore; - -},{"150":150}],5:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CSSProperty - */ - - 'use strict'; - - /** - * CSS properties which accept numbers but are not in units of "px". - */ - var isUnitlessNumber = { - boxFlex: true, - boxFlexGroup: true, - columnCount: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - widows: true, - zIndex: true, - zoom: true, - - // SVG-related properties - fillOpacity: true, - strokeDashoffset: true, - strokeOpacity: true, - strokeWidth: true - }; - - /** - * @param {string} prefix vendor-specific prefix, eg: Webkit - * @param {string} key style name, eg: transitionDuration - * @return {string} style name prefixed with `prefix`, properly camelCased, eg: - * WebkitTransitionDuration - */ - function prefixKey(prefix, key) { - return prefix + key.charAt(0).toUpperCase() + key.substring(1); - } - - /** - * Support style names that may come passed in prefixed by adding permutations - * of vendor prefixes. - */ - var prefixes = ['Webkit', 'ms', 'Moz', 'O']; - -// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an -// infinite loop, because it iterates over the newly added props too. - Object.keys(isUnitlessNumber).forEach(function(prop) { - prefixes.forEach(function(prefix) { - isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; - }); - }); - - /** - * Most style properties can be unset by doing .style[prop] = '' but IE8 - * doesn't like doing that with shorthand properties so for the properties that - * IE8 breaks on, which are listed here, we instead unset each of the - * individual properties. See http://bugs.jquery.com/ticket/12385. - * The 4-value 'clock' properties like margin, padding, border-width seem to - * behave without any problems. Curiously, list-style works too without any - * special prodding. - */ - var shorthandPropertyExpansions = { - background: { - backgroundImage: true, - backgroundPosition: true, - backgroundRepeat: true, - backgroundColor: true - }, - border: { - borderWidth: true, - borderStyle: true, - borderColor: true - }, - borderBottom: { - borderBottomWidth: true, - borderBottomStyle: true, - borderBottomColor: true - }, - borderLeft: { - borderLeftWidth: true, - borderLeftStyle: true, - borderLeftColor: true - }, - borderRight: { - borderRightWidth: true, - borderRightStyle: true, - borderRightColor: true - }, - borderTop: { - borderTopWidth: true, - borderTopStyle: true, - borderTopColor: true - }, - font: { - fontStyle: true, - fontVariant: true, - fontWeight: true, - fontSize: true, - lineHeight: true, - fontFamily: true - } - }; - - var CSSProperty = { - isUnitlessNumber: isUnitlessNumber, - shorthandPropertyExpansions: shorthandPropertyExpansions - }; - - module.exports = CSSProperty; - -},{}],6:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CSSPropertyOperations - * @typechecks static-only - */ - - 'use strict'; - - var CSSProperty = _dereq_(5); - var ExecutionEnvironment = _dereq_(22); - - var camelizeStyleName = _dereq_(121); - var dangerousStyleValue = _dereq_(128); - var hyphenateStyleName = _dereq_(148); - var memoizeStringOnly = _dereq_(159); - var warning = _dereq_(171); - - var processStyleName = memoizeStringOnly(function(styleName) { - return hyphenateStyleName(styleName); - }); - - var styleFloatAccessor = 'cssFloat'; - if (ExecutionEnvironment.canUseDOM) { - // IE8 only supports accessing cssFloat (standard) as styleFloat - if (document.documentElement.style.cssFloat === undefined) { - styleFloatAccessor = 'styleFloat'; - } - } - - if ("production" !== "development") { - // 'msTransform' is correct, but the other prefixes should be capitalized - var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; - - // style values shouldn't contain a semicolon - var badStyleValueWithSemicolonPattern = /;\s*$/; - - var warnedStyleNames = {}; - var warnedStyleValues = {}; - - var warnHyphenatedStyleName = function(name) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - ("production" !== "development" ? warning( - false, - 'Unsupported style property %s. Did you mean %s?', - name, - camelizeStyleName(name) - ) : null); - }; - - var warnBadVendoredStyleName = function(name) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - ("production" !== "development" ? warning( - false, - 'Unsupported vendor-prefixed style property %s. Did you mean %s?', - name, - name.charAt(0).toUpperCase() + name.slice(1) - ) : null); - }; - - var warnStyleValueWithSemicolon = function(name, value) { - if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { - return; - } - - warnedStyleValues[value] = true; - ("production" !== "development" ? warning( - false, - 'Style property values shouldn\'t contain a semicolon. ' + - 'Try "%s: %s" instead.', - name, - value.replace(badStyleValueWithSemicolonPattern, '') - ) : null); - }; - - /** - * @param {string} name - * @param {*} value - */ - var warnValidStyle = function(name, value) { - if (name.indexOf('-') > -1) { - warnHyphenatedStyleName(name); - } else if (badVendoredStyleNamePattern.test(name)) { - warnBadVendoredStyleName(name); - } else if (badStyleValueWithSemicolonPattern.test(value)) { - warnStyleValueWithSemicolon(name, value); - } - }; - } - - /** - * Operations for dealing with CSS properties. - */ - var CSSPropertyOperations = { - - /** - * Serializes a mapping of style properties for use as inline styles: - * - * > createMarkupForStyles({width: '200px', height: 0}) - * "width:200px;height:0;" - * - * Undefined values are ignored so that declarative programming is easier. - * The result should be HTML-escaped before insertion into the DOM. - * - * @param {object} styles - * @return {?string} - */ - createMarkupForStyles: function(styles) { - var serialized = ''; - for (var styleName in styles) { - if (!styles.hasOwnProperty(styleName)) { - continue; - } - var styleValue = styles[styleName]; - if ("production" !== "development") { - warnValidStyle(styleName, styleValue); - } - if (styleValue != null) { - serialized += processStyleName(styleName) + ':'; - serialized += dangerousStyleValue(styleName, styleValue) + ';'; - } - } - return serialized || null; - }, - - /** - * Sets the value for multiple styles on a node. If a value is specified as - * '' (empty string), the corresponding style property will be unset. - * - * @param {DOMElement} node - * @param {object} styles - */ - setValueForStyles: function(node, styles) { - var style = node.style; - for (var styleName in styles) { - if (!styles.hasOwnProperty(styleName)) { - continue; - } - if ("production" !== "development") { - warnValidStyle(styleName, styles[styleName]); - } - var styleValue = dangerousStyleValue(styleName, styles[styleName]); - if (styleName === 'float') { - styleName = styleFloatAccessor; - } - if (styleValue) { - style[styleName] = styleValue; - } else { - var expansion = CSSProperty.shorthandPropertyExpansions[styleName]; - if (expansion) { - // Shorthand property that IE8 won't like unsetting, so unset each - // component to placate it - for (var individualStyleName in expansion) { - style[individualStyleName] = ''; - } - } else { - style[styleName] = ''; - } - } - } - } - - }; - - module.exports = CSSPropertyOperations; - -},{"121":121,"128":128,"148":148,"159":159,"171":171,"22":22,"5":5}],7:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CallbackQueue - */ - - 'use strict'; - - var PooledClass = _dereq_(30); - - var assign = _dereq_(29); - var invariant = _dereq_(150); - - /** - * A specialized pseudo-event module to help keep track of components waiting to - * be notified when their DOM representations are available for use. - * - * This implements `PooledClass`, so you should never need to instantiate this. - * Instead, use `CallbackQueue.getPooled()`. - * - * @class ReactMountReady - * @implements PooledClass - * @internal - */ - function CallbackQueue() { - this._callbacks = null; - this._contexts = null; - } - - assign(CallbackQueue.prototype, { - - /** - * Enqueues a callback to be invoked when `notifyAll` is invoked. - * - * @param {function} callback Invoked when `notifyAll` is invoked. - * @param {?object} context Context to call `callback` with. - * @internal - */ - enqueue: function(callback, context) { - this._callbacks = this._callbacks || []; - this._contexts = this._contexts || []; - this._callbacks.push(callback); - this._contexts.push(context); - }, - - /** - * Invokes all enqueued callbacks and clears the queue. This is invoked after - * the DOM representation of a component has been created or updated. - * - * @internal - */ - notifyAll: function() { - var callbacks = this._callbacks; - var contexts = this._contexts; - if (callbacks) { - ("production" !== "development" ? invariant( - callbacks.length === contexts.length, - 'Mismatched list of contexts in callback queue' - ) : invariant(callbacks.length === contexts.length)); - this._callbacks = null; - this._contexts = null; - for (var i = 0, l = callbacks.length; i < l; i++) { - callbacks[i].call(contexts[i]); - } - callbacks.length = 0; - contexts.length = 0; - } - }, - - /** - * Resets the internal queue. - * - * @internal - */ - reset: function() { - this._callbacks = null; - this._contexts = null; - }, - - /** - * `PooledClass` looks for this. - */ - destructor: function() { - this.reset(); - } - - }); - - PooledClass.addPoolingTo(CallbackQueue); - - module.exports = CallbackQueue; - -},{"150":150,"29":29,"30":30}],8:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ChangeEventPlugin - */ - - 'use strict'; - - var EventConstants = _dereq_(16); - var EventPluginHub = _dereq_(18); - var EventPropagators = _dereq_(21); - var ExecutionEnvironment = _dereq_(22); - var ReactUpdates = _dereq_(100); - var SyntheticEvent = _dereq_(108); - - var isEventSupported = _dereq_(151); - var isTextInputElement = _dereq_(153); - var keyOf = _dereq_(157); - - var topLevelTypes = EventConstants.topLevelTypes; - - var eventTypes = { - change: { - phasedRegistrationNames: { - bubbled: keyOf({onChange: null}), - captured: keyOf({onChangeCapture: null}) - }, - dependencies: [ - topLevelTypes.topBlur, - topLevelTypes.topChange, - topLevelTypes.topClick, - topLevelTypes.topFocus, - topLevelTypes.topInput, - topLevelTypes.topKeyDown, - topLevelTypes.topKeyUp, - topLevelTypes.topSelectionChange - ] - } - }; - - /** - * For IE shims - */ - var activeElement = null; - var activeElementID = null; - var activeElementValue = null; - var activeElementValueProp = null; - - /** - * SECTION: handle `change` event - */ - function shouldUseChangeEvent(elem) { - return ( - elem.nodeName === 'SELECT' || - (elem.nodeName === 'INPUT' && elem.type === 'file') - ); - } - - var doesChangeEventBubble = false; - if (ExecutionEnvironment.canUseDOM) { - // See `handleChange` comment below - doesChangeEventBubble = isEventSupported('change') && ( - (!('documentMode' in document) || document.documentMode > 8) - ); - } - - function manualDispatchChangeEvent(nativeEvent) { - var event = SyntheticEvent.getPooled( - eventTypes.change, - activeElementID, - nativeEvent - ); - EventPropagators.accumulateTwoPhaseDispatches(event); - - // If change and propertychange bubbled, we'd just bind to it like all the - // other events and have it go through ReactBrowserEventEmitter. Since it - // doesn't, we manually listen for the events and so we have to enqueue and - // process the abstract event manually. - // - // Batching is necessary here in order to ensure that all event handlers run - // before the next rerender (including event handlers attached to ancestor - // elements instead of directly on the input). Without this, controlled - // components don't work properly in conjunction with event bubbling because - // the component is rerendered and the value reverted before all the event - // handlers can run. See https://github.com/facebook/react/issues/708. - ReactUpdates.batchedUpdates(runEventInBatch, event); - } - - function runEventInBatch(event) { - EventPluginHub.enqueueEvents(event); - EventPluginHub.processEventQueue(); - } - - function startWatchingForChangeEventIE8(target, targetID) { - activeElement = target; - activeElementID = targetID; - activeElement.attachEvent('onchange', manualDispatchChangeEvent); - } - - function stopWatchingForChangeEventIE8() { - if (!activeElement) { - return; - } - activeElement.detachEvent('onchange', manualDispatchChangeEvent); - activeElement = null; - activeElementID = null; - } - - function getTargetIDForChangeEvent( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topChange) { - return topLevelTargetID; - } - } - function handleEventsForChangeEventIE8( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topFocus) { - // stopWatching() should be a noop here but we call it just in case we - // missed a blur event somehow. - stopWatchingForChangeEventIE8(); - startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID); - } else if (topLevelType === topLevelTypes.topBlur) { - stopWatchingForChangeEventIE8(); - } - } - - - /** - * SECTION: handle `input` event - */ - var isInputEventSupported = false; - if (ExecutionEnvironment.canUseDOM) { - // IE9 claims to support the input event but fails to trigger it when - // deleting text, so we ignore its input events - isInputEventSupported = isEventSupported('input') && ( - (!('documentMode' in document) || document.documentMode > 9) - ); - } - - /** - * (For old IE.) Replacement getter/setter for the `value` property that gets - * set on the active element. - */ - var newValueProp = { - get: function() { - return activeElementValueProp.get.call(this); - }, - set: function(val) { - // Cast to a string so we can do equality checks. - activeElementValue = '' + val; - activeElementValueProp.set.call(this, val); - } - }; - - /** - * (For old IE.) Starts tracking propertychange events on the passed-in element - * and override the value property so that we can distinguish user events from - * value changes in JS. - */ - function startWatchingForValueChange(target, targetID) { - activeElement = target; - activeElementID = targetID; - activeElementValue = target.value; - activeElementValueProp = Object.getOwnPropertyDescriptor( - target.constructor.prototype, - 'value' - ); - - Object.defineProperty(activeElement, 'value', newValueProp); - activeElement.attachEvent('onpropertychange', handlePropertyChange); - } - - /** - * (For old IE.) Removes the event listeners from the currently-tracked element, - * if any exists. - */ - function stopWatchingForValueChange() { - if (!activeElement) { - return; - } - - // delete restores the original property definition - delete activeElement.value; - activeElement.detachEvent('onpropertychange', handlePropertyChange); - - activeElement = null; - activeElementID = null; - activeElementValue = null; - activeElementValueProp = null; - } - - /** - * (For old IE.) Handles a propertychange event, sending a `change` event if - * the value of the active element has changed. - */ - function handlePropertyChange(nativeEvent) { - if (nativeEvent.propertyName !== 'value') { - return; - } - var value = nativeEvent.srcElement.value; - if (value === activeElementValue) { - return; - } - activeElementValue = value; - - manualDispatchChangeEvent(nativeEvent); - } - - /** - * If a `change` event should be fired, returns the target's ID. - */ - function getTargetIDForInputEvent( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topInput) { - // In modern browsers (i.e., not IE8 or IE9), the input event is exactly - // what we want so fall through here and trigger an abstract event - return topLevelTargetID; - } - } - -// For IE8 and IE9. - function handleEventsForInputEventIE( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topFocus) { - // In IE8, we can capture almost all .value changes by adding a - // propertychange handler and looking for events with propertyName - // equal to 'value' - // In IE9, propertychange fires for most input events but is buggy and - // doesn't fire when text is deleted, but conveniently, selectionchange - // appears to fire in all of the remaining cases so we catch those and - // forward the event if the value has changed - // In either case, we don't want to call the event handler if the value - // is changed from JS so we redefine a setter for `.value` that updates - // our activeElementValue variable, allowing us to ignore those changes - // - // stopWatching() should be a noop here but we call it just in case we - // missed a blur event somehow. - stopWatchingForValueChange(); - startWatchingForValueChange(topLevelTarget, topLevelTargetID); - } else if (topLevelType === topLevelTypes.topBlur) { - stopWatchingForValueChange(); - } - } - -// For IE8 and IE9. - function getTargetIDForInputEventIE( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topSelectionChange || - topLevelType === topLevelTypes.topKeyUp || - topLevelType === topLevelTypes.topKeyDown) { - // On the selectionchange event, the target is just document which isn't - // helpful for us so just check activeElement instead. - // - // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire - // propertychange on the first input event after setting `value` from a - // script and fires only keydown, keypress, keyup. Catching keyup usually - // gets it and catching keydown lets us fire an event for the first - // keystroke if user does a key repeat (it'll be a little delayed: right - // before the second keystroke). Other input methods (e.g., paste) seem to - // fire selectionchange normally. - if (activeElement && activeElement.value !== activeElementValue) { - activeElementValue = activeElement.value; - return activeElementID; - } - } - } - - - /** - * SECTION: handle `click` event - */ - function shouldUseClickEvent(elem) { - // Use the `click` event to detect changes to checkbox and radio inputs. - // This approach works across all browsers, whereas `change` does not fire - // until `blur` in IE8. - return ( - elem.nodeName === 'INPUT' && - (elem.type === 'checkbox' || elem.type === 'radio') - ); - } - - function getTargetIDForClickEvent( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topClick) { - return topLevelTargetID; - } - } - - /** - * This plugin creates an `onChange` event that normalizes change events - * across form elements. This event fires at a time when it's possible to - * change the element's value without seeing a flicker. - * - * Supported elements are: - * - input (see `isTextInputElement`) - * - textarea - * - select - */ - var ChangeEventPlugin = { - - eventTypes: eventTypes, - - /** - * @param {string} topLevelType Record from `EventConstants`. - * @param {DOMEventTarget} topLevelTarget The listening component root node. - * @param {string} topLevelTargetID ID of `topLevelTarget`. - * @param {object} nativeEvent Native browser event. - * @return {*} An accumulation of synthetic events. - * @see {EventPluginHub.extractEvents} - */ - extractEvents: function( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent) { - - var getTargetIDFunc, handleEventFunc; - if (shouldUseChangeEvent(topLevelTarget)) { - if (doesChangeEventBubble) { - getTargetIDFunc = getTargetIDForChangeEvent; - } else { - handleEventFunc = handleEventsForChangeEventIE8; - } - } else if (isTextInputElement(topLevelTarget)) { - if (isInputEventSupported) { - getTargetIDFunc = getTargetIDForInputEvent; - } else { - getTargetIDFunc = getTargetIDForInputEventIE; - handleEventFunc = handleEventsForInputEventIE; - } - } else if (shouldUseClickEvent(topLevelTarget)) { - getTargetIDFunc = getTargetIDForClickEvent; - } - - if (getTargetIDFunc) { - var targetID = getTargetIDFunc( - topLevelType, - topLevelTarget, - topLevelTargetID - ); - if (targetID) { - var event = SyntheticEvent.getPooled( - eventTypes.change, - targetID, - nativeEvent - ); - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; - } - } - - if (handleEventFunc) { - handleEventFunc( - topLevelType, - topLevelTarget, - topLevelTargetID - ); - } - } - - }; - - module.exports = ChangeEventPlugin; - -},{"100":100,"108":108,"151":151,"153":153,"157":157,"16":16,"18":18,"21":21,"22":22}],9:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ClientReactRootIndex - * @typechecks - */ - - 'use strict'; - - var nextReactRootIndex = 0; - - var ClientReactRootIndex = { - createReactRootIndex: function() { - return nextReactRootIndex++; - } - }; - - module.exports = ClientReactRootIndex; - -},{}],10:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule DOMChildrenOperations - * @typechecks static-only - */ - - 'use strict'; - - var Danger = _dereq_(13); - var ReactMultiChildUpdateTypes = _dereq_(79); - - var setTextContent = _dereq_(165); - var invariant = _dereq_(150); - - /** - * Inserts `childNode` as a child of `parentNode` at the `index`. - * - * @param {DOMElement} parentNode Parent node in which to insert. - * @param {DOMElement} childNode Child node to insert. - * @param {number} index Index at which to insert the child. - * @internal - */ - function insertChildAt(parentNode, childNode, index) { - // By exploiting arrays returning `undefined` for an undefined index, we can - // rely exclusively on `insertBefore(node, null)` instead of also using - // `appendChild(node)`. However, using `undefined` is not allowed by all - // browsers so we must replace it with `null`. - parentNode.insertBefore( - childNode, - parentNode.childNodes[index] || null - ); - } - - /** - * Operations for updating with DOM children. - */ - var DOMChildrenOperations = { - - dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup, - - updateTextContent: setTextContent, - - /** - * Updates a component's children by processing a series of updates. The - * update configurations are each expected to have a `parentNode` property. - * - * @param {array} updates List of update configurations. - * @param {array} markupList List of markup strings. - * @internal - */ - processUpdates: function(updates, markupList) { - var update; - // Mapping from parent IDs to initial child orderings. - var initialChildren = null; - // List of children that will be moved or removed. - var updatedChildren = null; - - for (var i = 0; i < updates.length; i++) { - update = updates[i]; - if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || - update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) { - var updatedIndex = update.fromIndex; - var updatedChild = update.parentNode.childNodes[updatedIndex]; - var parentID = update.parentID; - - ("production" !== "development" ? invariant( - updatedChild, - 'processUpdates(): Unable to find child %s of element. This ' + - 'probably means the DOM was unexpectedly mutated (e.g., by the ' + - 'browser), usually due to forgetting a when using tables, ' + - 'nesting tags like
,

, or , or using non-SVG elements ' + - 'in an parent. Try inspecting the child nodes of the element ' + - 'with React ID `%s`.', - updatedIndex, - parentID - ) : invariant(updatedChild)); - - initialChildren = initialChildren || {}; - initialChildren[parentID] = initialChildren[parentID] || []; - initialChildren[parentID][updatedIndex] = updatedChild; - - updatedChildren = updatedChildren || []; - updatedChildren.push(updatedChild); - } - } - - var renderedMarkup = Danger.dangerouslyRenderMarkup(markupList); - - // Remove updated children first so that `toIndex` is consistent. - if (updatedChildren) { - for (var j = 0; j < updatedChildren.length; j++) { - updatedChildren[j].parentNode.removeChild(updatedChildren[j]); - } - } - - for (var k = 0; k < updates.length; k++) { - update = updates[k]; - switch (update.type) { - case ReactMultiChildUpdateTypes.INSERT_MARKUP: - insertChildAt( - update.parentNode, - renderedMarkup[update.markupIndex], - update.toIndex - ); - break; - case ReactMultiChildUpdateTypes.MOVE_EXISTING: - insertChildAt( - update.parentNode, - initialChildren[update.parentID][update.fromIndex], - update.toIndex - ); - break; - case ReactMultiChildUpdateTypes.TEXT_CONTENT: - setTextContent( - update.parentNode, - update.textContent - ); - break; - case ReactMultiChildUpdateTypes.REMOVE_NODE: - // Already removed by the for-loop above. - break; - } - } - } - - }; - - module.exports = DOMChildrenOperations; - -},{"13":13,"150":150,"165":165,"79":79}],11:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule DOMProperty - * @typechecks static-only - */ - - /*jslint bitwise: true */ - - 'use strict'; - - var invariant = _dereq_(150); - - function checkMask(value, bitmask) { - return (value & bitmask) === bitmask; - } - - var DOMPropertyInjection = { - /** - * Mapping from normalized, camelcased property names to a configuration that - * specifies how the associated DOM property should be accessed or rendered. - */ - MUST_USE_ATTRIBUTE: 0x1, - MUST_USE_PROPERTY: 0x2, - HAS_SIDE_EFFECTS: 0x4, - HAS_BOOLEAN_VALUE: 0x8, - HAS_NUMERIC_VALUE: 0x10, - HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10, - HAS_OVERLOADED_BOOLEAN_VALUE: 0x40, - - /** - * Inject some specialized knowledge about the DOM. This takes a config object - * with the following properties: - * - * isCustomAttribute: function that given an attribute name will return true - * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* - * attributes where it's impossible to enumerate all of the possible - * attribute names, - * - * Properties: object mapping DOM property name to one of the - * DOMPropertyInjection constants or null. If your attribute isn't in here, - * it won't get written to the DOM. - * - * DOMAttributeNames: object mapping React attribute name to the DOM - * attribute name. Attribute names not specified use the **lowercase** - * normalized name. - * - * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. - * Property names not specified use the normalized name. - * - * DOMMutationMethods: Properties that require special mutation methods. If - * `value` is undefined, the mutation method should unset the property. - * - * @param {object} domPropertyConfig the config as described above. - */ - injectDOMPropertyConfig: function(domPropertyConfig) { - var Properties = domPropertyConfig.Properties || {}; - var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; - var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; - var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; - - if (domPropertyConfig.isCustomAttribute) { - DOMProperty._isCustomAttributeFunctions.push( - domPropertyConfig.isCustomAttribute - ); - } - - for (var propName in Properties) { - ("production" !== "development" ? invariant( - !DOMProperty.isStandardName.hasOwnProperty(propName), - 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + - '\'%s\' which has already been injected. You may be accidentally ' + - 'injecting the same DOM property config twice, or you may be ' + - 'injecting two configs that have conflicting property names.', - propName - ) : invariant(!DOMProperty.isStandardName.hasOwnProperty(propName))); - - DOMProperty.isStandardName[propName] = true; - - var lowerCased = propName.toLowerCase(); - DOMProperty.getPossibleStandardName[lowerCased] = propName; - - if (DOMAttributeNames.hasOwnProperty(propName)) { - var attributeName = DOMAttributeNames[propName]; - DOMProperty.getPossibleStandardName[attributeName] = propName; - DOMProperty.getAttributeName[propName] = attributeName; - } else { - DOMProperty.getAttributeName[propName] = lowerCased; - } - - DOMProperty.getPropertyName[propName] = - DOMPropertyNames.hasOwnProperty(propName) ? - DOMPropertyNames[propName] : - propName; - - if (DOMMutationMethods.hasOwnProperty(propName)) { - DOMProperty.getMutationMethod[propName] = DOMMutationMethods[propName]; - } else { - DOMProperty.getMutationMethod[propName] = null; - } - - var propConfig = Properties[propName]; - DOMProperty.mustUseAttribute[propName] = - checkMask(propConfig, DOMPropertyInjection.MUST_USE_ATTRIBUTE); - DOMProperty.mustUseProperty[propName] = - checkMask(propConfig, DOMPropertyInjection.MUST_USE_PROPERTY); - DOMProperty.hasSideEffects[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_SIDE_EFFECTS); - DOMProperty.hasBooleanValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_BOOLEAN_VALUE); - DOMProperty.hasNumericValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_NUMERIC_VALUE); - DOMProperty.hasPositiveNumericValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE); - DOMProperty.hasOverloadedBooleanValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE); - - ("production" !== "development" ? invariant( - !DOMProperty.mustUseAttribute[propName] || - !DOMProperty.mustUseProperty[propName], - 'DOMProperty: Cannot require using both attribute and property: %s', - propName - ) : invariant(!DOMProperty.mustUseAttribute[propName] || - !DOMProperty.mustUseProperty[propName])); - ("production" !== "development" ? invariant( - DOMProperty.mustUseProperty[propName] || - !DOMProperty.hasSideEffects[propName], - 'DOMProperty: Properties that have side effects must use property: %s', - propName - ) : invariant(DOMProperty.mustUseProperty[propName] || - !DOMProperty.hasSideEffects[propName])); - ("production" !== "development" ? invariant( - !!DOMProperty.hasBooleanValue[propName] + - !!DOMProperty.hasNumericValue[propName] + - !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1, - 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + - 'numeric value, but not a combination: %s', - propName - ) : invariant(!!DOMProperty.hasBooleanValue[propName] + - !!DOMProperty.hasNumericValue[propName] + - !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1)); - } - } - }; - var defaultValueCache = {}; - - /** - * DOMProperty exports lookup objects that can be used like functions: - * - * > DOMProperty.isValid['id'] - * true - * > DOMProperty.isValid['foobar'] - * undefined - * - * Although this may be confusing, it performs better in general. - * - * @see http://jsperf.com/key-exists - * @see http://jsperf.com/key-missing - */ - var DOMProperty = { - - ID_ATTRIBUTE_NAME: 'data-reactid', - - /** - * Checks whether a property name is a standard property. - * @type {Object} - */ - isStandardName: {}, - - /** - * Mapping from lowercase property names to the properly cased version, used - * to warn in the case of missing properties. - * @type {Object} - */ - getPossibleStandardName: {}, - - /** - * Mapping from normalized names to attribute names that differ. Attribute - * names are used when rendering markup or with `*Attribute()`. - * @type {Object} - */ - getAttributeName: {}, - - /** - * Mapping from normalized names to properties on DOM node instances. - * (This includes properties that mutate due to external factors.) - * @type {Object} - */ - getPropertyName: {}, - - /** - * Mapping from normalized names to mutation methods. This will only exist if - * mutation cannot be set simply by the property or `setAttribute()`. - * @type {Object} - */ - getMutationMethod: {}, - - /** - * Whether the property must be accessed and mutated as an object property. - * @type {Object} - */ - mustUseAttribute: {}, - - /** - * Whether the property must be accessed and mutated using `*Attribute()`. - * (This includes anything that fails ` in `.) - * @type {Object} - */ - mustUseProperty: {}, - - /** - * Whether or not setting a value causes side effects such as triggering - * resources to be loaded or text selection changes. We must ensure that - * the value is only set if it has changed. - * @type {Object} - */ - hasSideEffects: {}, - - /** - * Whether the property should be removed when set to a falsey value. - * @type {Object} - */ - hasBooleanValue: {}, - - /** - * Whether the property must be numeric or parse as a - * numeric and should be removed when set to a falsey value. - * @type {Object} - */ - hasNumericValue: {}, - - /** - * Whether the property must be positive numeric or parse as a positive - * numeric and should be removed when set to a falsey value. - * @type {Object} - */ - hasPositiveNumericValue: {}, - - /** - * Whether the property can be used as a flag as well as with a value. Removed - * when strictly equal to false; present without a value when strictly equal - * to true; present with a value otherwise. - * @type {Object} - */ - hasOverloadedBooleanValue: {}, - - /** - * All of the isCustomAttribute() functions that have been injected. - */ - _isCustomAttributeFunctions: [], - - /** - * Checks whether a property name is a custom attribute. - * @method - */ - isCustomAttribute: function(attributeName) { - for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { - var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; - if (isCustomAttributeFn(attributeName)) { - return true; - } - } - return false; - }, - - /** - * Returns the default property value for a DOM property (i.e., not an - * attribute). Most default values are '' or false, but not all. Worse yet, - * some (in particular, `type`) vary depending on the type of element. - * - * TODO: Is it better to grab all the possible properties when creating an - * element to avoid having to create the same element twice? - */ - getDefaultValueForProperty: function(nodeName, prop) { - var nodeDefaults = defaultValueCache[nodeName]; - var testElement; - if (!nodeDefaults) { - defaultValueCache[nodeName] = nodeDefaults = {}; - } - if (!(prop in nodeDefaults)) { - testElement = document.createElement(nodeName); - nodeDefaults[prop] = testElement[prop]; - } - return nodeDefaults[prop]; - }, - - injection: DOMPropertyInjection - }; - - module.exports = DOMProperty; - -},{"150":150}],12:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule DOMPropertyOperations - * @typechecks static-only - */ - - 'use strict'; - - var DOMProperty = _dereq_(11); - - var quoteAttributeValueForBrowser = _dereq_(163); - var warning = _dereq_(171); - - function shouldIgnoreValue(name, value) { - return value == null || - (DOMProperty.hasBooleanValue[name] && !value) || - (DOMProperty.hasNumericValue[name] && isNaN(value)) || - (DOMProperty.hasPositiveNumericValue[name] && (value < 1)) || - (DOMProperty.hasOverloadedBooleanValue[name] && value === false); - } - - if ("production" !== "development") { - var reactProps = { - children: true, - dangerouslySetInnerHTML: true, - key: true, - ref: true - }; - var warnedProperties = {}; - - var warnUnknownProperty = function(name) { - if (reactProps.hasOwnProperty(name) && reactProps[name] || - warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { - return; - } - - warnedProperties[name] = true; - var lowerCasedName = name.toLowerCase(); - - // data-* attributes should be lowercase; suggest the lowercase version - var standardName = ( - DOMProperty.isCustomAttribute(lowerCasedName) ? - lowerCasedName : - DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? - DOMProperty.getPossibleStandardName[lowerCasedName] : - null - ); - - // For now, only warn when we have a suggested correction. This prevents - // logging too much when using transferPropsTo. - ("production" !== "development" ? warning( - standardName == null, - 'Unknown DOM property %s. Did you mean %s?', - name, - standardName - ) : null); - - }; - } - - /** - * Operations for dealing with DOM properties. - */ - var DOMPropertyOperations = { - - /** - * Creates markup for the ID property. - * - * @param {string} id Unescaped ID. - * @return {string} Markup string. - */ - createMarkupForID: function(id) { - return DOMProperty.ID_ATTRIBUTE_NAME + '=' + - quoteAttributeValueForBrowser(id); - }, - - /** - * Creates markup for a property. - * - * @param {string} name - * @param {*} value - * @return {?string} Markup string, or null if the property was invalid. - */ - createMarkupForProperty: function(name, value) { - if (DOMProperty.isStandardName.hasOwnProperty(name) && - DOMProperty.isStandardName[name]) { - if (shouldIgnoreValue(name, value)) { - return ''; - } - var attributeName = DOMProperty.getAttributeName[name]; - if (DOMProperty.hasBooleanValue[name] || - (DOMProperty.hasOverloadedBooleanValue[name] && value === true)) { - return attributeName; - } - return attributeName + '=' + quoteAttributeValueForBrowser(value); - } else if (DOMProperty.isCustomAttribute(name)) { - if (value == null) { - return ''; - } - return name + '=' + quoteAttributeValueForBrowser(value); - } else if ("production" !== "development") { - warnUnknownProperty(name); - } - return null; - }, - - /** - * Sets the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - * @param {*} value - */ - setValueForProperty: function(node, name, value) { - if (DOMProperty.isStandardName.hasOwnProperty(name) && - DOMProperty.isStandardName[name]) { - var mutationMethod = DOMProperty.getMutationMethod[name]; - if (mutationMethod) { - mutationMethod(node, value); - } else if (shouldIgnoreValue(name, value)) { - this.deleteValueForProperty(node, name); - } else if (DOMProperty.mustUseAttribute[name]) { - // `setAttribute` with objects becomes only `[object]` in IE8/9, - // ('' + value) makes it output the correct toString()-value. - node.setAttribute(DOMProperty.getAttributeName[name], '' + value); - } else { - var propName = DOMProperty.getPropertyName[name]; - // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the - // property type before comparing; only `value` does and is string. - if (!DOMProperty.hasSideEffects[name] || - ('' + node[propName]) !== ('' + value)) { - // Contrary to `setAttribute`, object properties are properly - // `toString`ed by IE8/9. - node[propName] = value; - } - } - } else if (DOMProperty.isCustomAttribute(name)) { - if (value == null) { - node.removeAttribute(name); - } else { - node.setAttribute(name, '' + value); - } - } else if ("production" !== "development") { - warnUnknownProperty(name); - } - }, - - /** - * Deletes the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - */ - deleteValueForProperty: function(node, name) { - if (DOMProperty.isStandardName.hasOwnProperty(name) && - DOMProperty.isStandardName[name]) { - var mutationMethod = DOMProperty.getMutationMethod[name]; - if (mutationMethod) { - mutationMethod(node, undefined); - } else if (DOMProperty.mustUseAttribute[name]) { - node.removeAttribute(DOMProperty.getAttributeName[name]); - } else { - var propName = DOMProperty.getPropertyName[name]; - var defaultValue = DOMProperty.getDefaultValueForProperty( - node.nodeName, - propName - ); - if (!DOMProperty.hasSideEffects[name] || - ('' + node[propName]) !== defaultValue) { - node[propName] = defaultValue; - } - } - } else if (DOMProperty.isCustomAttribute(name)) { - node.removeAttribute(name); - } else if ("production" !== "development") { - warnUnknownProperty(name); - } - } - - }; - - module.exports = DOMPropertyOperations; - -},{"11":11,"163":163,"171":171}],13:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule Danger - * @typechecks static-only - */ - - /*jslint evil: true, sub: true */ - - 'use strict'; - - var ExecutionEnvironment = _dereq_(22); - - var createNodesFromMarkup = _dereq_(126); - var emptyFunction = _dereq_(129); - var getMarkupWrap = _dereq_(142); - var invariant = _dereq_(150); - - var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/; - var RESULT_INDEX_ATTR = 'data-danger-index'; - - /** - * Extracts the `nodeName` from a string of markup. - * - * NOTE: Extracting the `nodeName` does not require a regular expression match - * because we make assumptions about React-generated markup (i.e. there are no - * spaces surrounding the opening tag and there is at least one attribute). - * - * @param {string} markup String of markup. - * @return {string} Node name of the supplied markup. - * @see http://jsperf.com/extract-nodename - */ - function getNodeName(markup) { - return markup.substring(1, markup.indexOf(' ')); - } - - var Danger = { - - /** - * Renders markup into an array of nodes. The markup is expected to render - * into a list of root nodes. Also, the length of `resultList` and - * `markupList` should be the same. - * - * @param {array} markupList List of markup strings to render. - * @return {array} List of rendered nodes. - * @internal - */ - dangerouslyRenderMarkup: function(markupList) { - ("production" !== "development" ? invariant( - ExecutionEnvironment.canUseDOM, - 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + - 'thread. Make sure `window` and `document` are available globally ' + - 'before requiring React when unit testing or use ' + - 'React.renderToString for server rendering.' - ) : invariant(ExecutionEnvironment.canUseDOM)); - var nodeName; - var markupByNodeName = {}; - // Group markup by `nodeName` if a wrap is necessary, else by '*'. - for (var i = 0; i < markupList.length; i++) { - ("production" !== "development" ? invariant( - markupList[i], - 'dangerouslyRenderMarkup(...): Missing markup.' - ) : invariant(markupList[i])); - nodeName = getNodeName(markupList[i]); - nodeName = getMarkupWrap(nodeName) ? nodeName : '*'; - markupByNodeName[nodeName] = markupByNodeName[nodeName] || []; - markupByNodeName[nodeName][i] = markupList[i]; - } - var resultList = []; - var resultListAssignmentCount = 0; - for (nodeName in markupByNodeName) { - if (!markupByNodeName.hasOwnProperty(nodeName)) { - continue; - } - var markupListByNodeName = markupByNodeName[nodeName]; - - // This for-in loop skips the holes of the sparse array. The order of - // iteration should follow the order of assignment, which happens to match - // numerical index order, but we don't rely on that. - var resultIndex; - for (resultIndex in markupListByNodeName) { - if (markupListByNodeName.hasOwnProperty(resultIndex)) { - var markup = markupListByNodeName[resultIndex]; - - // Push the requested markup with an additional RESULT_INDEX_ATTR - // attribute. If the markup does not start with a < character, it - // will be discarded below (with an appropriate console.error). - markupListByNodeName[resultIndex] = markup.replace( - OPEN_TAG_NAME_EXP, - // This index will be parsed back out below. - '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ' - ); - } - } - - // Render each group of markup with similar wrapping `nodeName`. - var renderNodes = createNodesFromMarkup( - markupListByNodeName.join(''), - emptyFunction // Do nothing special with

; - * } - * }); - * - * The class specification supports a specific protocol of methods that have - * special meaning (e.g. `render`). See `ReactClassInterface` for - * more the comprehensive protocol. Any other properties and methods in the - * class specification will available on the prototype. - * - * @interface ReactClassInterface - * @internal - */ - var ReactClassInterface = { - - /** - * An array of Mixin objects to include when defining your component. - * - * @type {array} - * @optional - */ - mixins: SpecPolicy.DEFINE_MANY, - - /** - * An object containing properties and methods that should be defined on - * the component's constructor instead of its prototype (static methods). - * - * @type {object} - * @optional - */ - statics: SpecPolicy.DEFINE_MANY, - - /** - * Definition of prop types for this component. - * - * @type {object} - * @optional - */ - propTypes: SpecPolicy.DEFINE_MANY, - - /** - * Definition of context types for this component. - * - * @type {object} - * @optional - */ - contextTypes: SpecPolicy.DEFINE_MANY, - - /** - * Definition of context types this component sets for its children. - * - * @type {object} - * @optional - */ - childContextTypes: SpecPolicy.DEFINE_MANY, - - // ==== Definition methods ==== - - /** - * Invoked when the component is mounted. Values in the mapping will be set on - * `this.props` if that prop is not specified (i.e. using an `in` check). - * - * This method is invoked before `getInitialState` and therefore cannot rely - * on `this.state` or use `this.setState`. - * - * @return {object} - * @optional - */ - getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, - - /** - * Invoked once before the component is mounted. The return value will be used - * as the initial value of `this.state`. - * - * getInitialState: function() { - * return { - * isOn: false, - * fooBaz: new BazFoo() - * } - * } - * - * @return {object} - * @optional - */ - getInitialState: SpecPolicy.DEFINE_MANY_MERGED, - - /** - * @return {object} - * @optional - */ - getChildContext: SpecPolicy.DEFINE_MANY_MERGED, - - /** - * Uses props from `this.props` and state from `this.state` to render the - * structure of the component. - * - * No guarantees are made about when or how often this method is invoked, so - * it must not have side effects. - * - * render: function() { - * var name = this.props.name; - * return
Hello, {name}!
; - * } - * - * @return {ReactComponent} - * @nosideeffects - * @required - */ - render: SpecPolicy.DEFINE_ONCE, - - - - // ==== Delegate methods ==== - - /** - * Invoked when the component is initially created and about to be mounted. - * This may have side effects, but any external subscriptions or data created - * by this method must be cleaned up in `componentWillUnmount`. - * - * @optional - */ - componentWillMount: SpecPolicy.DEFINE_MANY, - - /** - * Invoked when the component has been mounted and has a DOM representation. - * However, there is no guarantee that the DOM node is in the document. - * - * Use this as an opportunity to operate on the DOM when the component has - * been mounted (initialized and rendered) for the first time. - * - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidMount: SpecPolicy.DEFINE_MANY, - - /** - * Invoked before the component receives new props. - * - * Use this as an opportunity to react to a prop transition by updating the - * state using `this.setState`. Current props are accessed via `this.props`. - * - * componentWillReceiveProps: function(nextProps, nextContext) { - * this.setState({ - * likesIncreasing: nextProps.likeCount > this.props.likeCount - * }); - * } - * - * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop - * transition may cause a state change, but the opposite is not true. If you - * need it, you are probably looking for `componentWillUpdate`. - * - * @param {object} nextProps - * @optional - */ - componentWillReceiveProps: SpecPolicy.DEFINE_MANY, - - /** - * Invoked while deciding if the component should be updated as a result of - * receiving new props, state and/or context. - * - * Use this as an opportunity to `return false` when you're certain that the - * transition to the new props/state/context will not require a component - * update. - * - * shouldComponentUpdate: function(nextProps, nextState, nextContext) { - * return !equal(nextProps, this.props) || - * !equal(nextState, this.state) || - * !equal(nextContext, this.context); - * } - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @return {boolean} True if the component should update. - * @optional - */ - shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, - - /** - * Invoked when the component is about to update due to a transition from - * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` - * and `nextContext`. - * - * Use this as an opportunity to perform preparation before an update occurs. - * - * NOTE: You **cannot** use `this.setState()` in this method. - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @param {ReactReconcileTransaction} transaction - * @optional - */ - componentWillUpdate: SpecPolicy.DEFINE_MANY, - - /** - * Invoked when the component's DOM representation has been updated. - * - * Use this as an opportunity to operate on the DOM when the component has - * been updated. - * - * @param {object} prevProps - * @param {?object} prevState - * @param {?object} prevContext - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidUpdate: SpecPolicy.DEFINE_MANY, - - /** - * Invoked when the component is about to be removed from its parent and have - * its DOM representation destroyed. - * - * Use this as an opportunity to deallocate any external resources. - * - * NOTE: There is no `componentDidUnmount` since your component will have been - * destroyed by that point. - * - * @optional - */ - componentWillUnmount: SpecPolicy.DEFINE_MANY, - - - - // ==== Advanced methods ==== - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @internal - * @overridable - */ - updateComponent: SpecPolicy.OVERRIDE_BASE - - }; - - /** - * Mapping from class specification keys to special processing functions. - * - * Although these are declared like instance properties in the specification - * when defining classes using `React.createClass`, they are actually static - * and are accessible on the constructor instead of the prototype. Despite - * being static, they must be defined outside of the "statics" key under - * which all other static methods are defined. - */ - var RESERVED_SPEC_KEYS = { - displayName: function(Constructor, displayName) { - Constructor.displayName = displayName; - }, - mixins: function(Constructor, mixins) { - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - mixSpecIntoComponent(Constructor, mixins[i]); - } - } - }, - childContextTypes: function(Constructor, childContextTypes) { - if ("production" !== "development") { - validateTypeDef( - Constructor, - childContextTypes, - ReactPropTypeLocations.childContext - ); - } - Constructor.childContextTypes = assign( - {}, - Constructor.childContextTypes, - childContextTypes - ); - }, - contextTypes: function(Constructor, contextTypes) { - if ("production" !== "development") { - validateTypeDef( - Constructor, - contextTypes, - ReactPropTypeLocations.context - ); - } - Constructor.contextTypes = assign( - {}, - Constructor.contextTypes, - contextTypes - ); - }, - /** - * Special case getDefaultProps which should move into statics but requires - * automatic merging. - */ - getDefaultProps: function(Constructor, getDefaultProps) { - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction( - Constructor.getDefaultProps, - getDefaultProps - ); - } else { - Constructor.getDefaultProps = getDefaultProps; - } - }, - propTypes: function(Constructor, propTypes) { - if ("production" !== "development") { - validateTypeDef( - Constructor, - propTypes, - ReactPropTypeLocations.prop - ); - } - Constructor.propTypes = assign( - {}, - Constructor.propTypes, - propTypes - ); - }, - statics: function(Constructor, statics) { - mixStaticSpecIntoComponent(Constructor, statics); - } - }; - - function validateTypeDef(Constructor, typeDef, location) { - for (var propName in typeDef) { - if (typeDef.hasOwnProperty(propName)) { - // use a warning instead of an invariant so components - // don't show up in prod but not in __DEV__ - ("production" !== "development" ? warning( - typeof typeDef[propName] === 'function', - '%s: %s type `%s` is invalid; it must be a function, usually from ' + - 'React.PropTypes.', - Constructor.displayName || 'ReactClass', - ReactPropTypeLocationNames[location], - propName - ) : null); - } - } - } - - function validateMethodOverride(proto, name) { - var specPolicy = ReactClassInterface.hasOwnProperty(name) ? - ReactClassInterface[name] : - null; - - // Disallow overriding of base class methods unless explicitly allowed. - if (ReactClassMixin.hasOwnProperty(name)) { - ("production" !== "development" ? invariant( - specPolicy === SpecPolicy.OVERRIDE_BASE, - 'ReactClassInterface: You are attempting to override ' + - '`%s` from your class specification. Ensure that your method names ' + - 'do not overlap with React methods.', - name - ) : invariant(specPolicy === SpecPolicy.OVERRIDE_BASE)); - } - - // Disallow defining methods more than once unless explicitly allowed. - if (proto.hasOwnProperty(name)) { - ("production" !== "development" ? invariant( - specPolicy === SpecPolicy.DEFINE_MANY || - specPolicy === SpecPolicy.DEFINE_MANY_MERGED, - 'ReactClassInterface: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be due ' + - 'to a mixin.', - name - ) : invariant(specPolicy === SpecPolicy.DEFINE_MANY || - specPolicy === SpecPolicy.DEFINE_MANY_MERGED)); - } - } - - /** - * Mixin helper which handles policy validation and reserved - * specification keys when building React classses. - */ - function mixSpecIntoComponent(Constructor, spec) { - if (!spec) { - return; - } - - ("production" !== "development" ? invariant( - typeof spec !== 'function', - 'ReactClass: You\'re attempting to ' + - 'use a component class as a mixin. Instead, just use a regular object.' - ) : invariant(typeof spec !== 'function')); - ("production" !== "development" ? invariant( - !ReactElement.isValidElement(spec), - 'ReactClass: You\'re attempting to ' + - 'use a component as a mixin. Instead, just use a regular object.' - ) : invariant(!ReactElement.isValidElement(spec))); - - var proto = Constructor.prototype; - - // By handling mixins before any other properties, we ensure the same - // chaining order is applied to methods with DEFINE_MANY policy, whether - // mixins are listed before or after these methods in the spec. - if (spec.hasOwnProperty(MIXINS_KEY)) { - RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); - } - - for (var name in spec) { - if (!spec.hasOwnProperty(name)) { - continue; - } - - if (name === MIXINS_KEY) { - // We have already handled mixins in a special case above - continue; - } - - var property = spec[name]; - validateMethodOverride(proto, name); - - if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { - RESERVED_SPEC_KEYS[name](Constructor, property); - } else { - // Setup methods on prototype: - // The following member methods should not be automatically bound: - // 1. Expected ReactClass methods (in the "interface"). - // 2. Overridden methods (that were mixed in). - var isReactClassMethod = - ReactClassInterface.hasOwnProperty(name); - var isAlreadyDefined = proto.hasOwnProperty(name); - var markedDontBind = property && property.__reactDontBind; - var isFunction = typeof property === 'function'; - var shouldAutoBind = - isFunction && - !isReactClassMethod && - !isAlreadyDefined && - !markedDontBind; - - if (shouldAutoBind) { - if (!proto.__reactAutoBindMap) { - proto.__reactAutoBindMap = {}; - } - proto.__reactAutoBindMap[name] = property; - proto[name] = property; - } else { - if (isAlreadyDefined) { - var specPolicy = ReactClassInterface[name]; - - // These cases should already be caught by validateMethodOverride - ("production" !== "development" ? invariant( - isReactClassMethod && ( - (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY) - ), - 'ReactClass: Unexpected spec policy %s for key %s ' + - 'when mixing in component specs.', - specPolicy, - name - ) : invariant(isReactClassMethod && ( - (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY) - ))); - - // For methods which are defined more than once, call the existing - // methods before calling the new property, merging if appropriate. - if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { - proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === SpecPolicy.DEFINE_MANY) { - proto[name] = createChainedFunction(proto[name], property); - } - } else { - proto[name] = property; - if ("production" !== "development") { - // Add verbose displayName to the function, which helps when looking - // at profiling tools. - if (typeof property === 'function' && spec.displayName) { - proto[name].displayName = spec.displayName + '_' + name; - } - } - } - } - } - } - } - - function mixStaticSpecIntoComponent(Constructor, statics) { - if (!statics) { - return; - } - for (var name in statics) { - var property = statics[name]; - if (!statics.hasOwnProperty(name)) { - continue; - } - - var isReserved = name in RESERVED_SPEC_KEYS; - ("production" !== "development" ? invariant( - !isReserved, - 'ReactClass: You are attempting to define a reserved ' + - 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + - 'as an instance property instead; it will still be accessible on the ' + - 'constructor.', - name - ) : invariant(!isReserved)); - - var isInherited = name in Constructor; - ("production" !== "development" ? invariant( - !isInherited, - 'ReactClass: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be ' + - 'due to a mixin.', - name - ) : invariant(!isInherited)); - Constructor[name] = property; - } - } - - /** - * Merge two objects, but throw if both contain the same key. - * - * @param {object} one The first object, which is mutated. - * @param {object} two The second object - * @return {object} one after it has been mutated to contain everything in two. - */ - function mergeIntoWithNoDuplicateKeys(one, two) { - ("production" !== "development" ? invariant( - one && two && typeof one === 'object' && typeof two === 'object', - 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' - ) : invariant(one && two && typeof one === 'object' && typeof two === 'object')); - - for (var key in two) { - if (two.hasOwnProperty(key)) { - ("production" !== "development" ? invariant( - one[key] === undefined, - 'mergeIntoWithNoDuplicateKeys(): ' + - 'Tried to merge two objects with the same key: `%s`. This conflict ' + - 'may be due to a mixin; in particular, this may be caused by two ' + - 'getInitialState() or getDefaultProps() methods returning objects ' + - 'with clashing keys.', - key - ) : invariant(one[key] === undefined)); - one[key] = two[key]; - } - } - return one; - } - - /** - * Creates a function that invokes two functions and merges their return values. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createMergedResultFunction(one, two) { - return function mergedResult() { - var a = one.apply(this, arguments); - var b = two.apply(this, arguments); - if (a == null) { - return b; - } else if (b == null) { - return a; - } - var c = {}; - mergeIntoWithNoDuplicateKeys(c, a); - mergeIntoWithNoDuplicateKeys(c, b); - return c; - }; - } - - /** - * Creates a function that invokes two functions and ignores their return vales. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createChainedFunction(one, two) { - return function chainedFunction() { - one.apply(this, arguments); - two.apply(this, arguments); - }; - } - - /** - * Binds a method to the component. - * - * @param {object} component Component whose method is going to be bound. - * @param {function} method Method to be bound. - * @return {function} The bound method. - */ - function bindAutoBindMethod(component, method) { - var boundMethod = method.bind(component); - if ("production" !== "development") { - boundMethod.__reactBoundContext = component; - boundMethod.__reactBoundMethod = method; - boundMethod.__reactBoundArguments = null; - var componentName = component.constructor.displayName; - var _bind = boundMethod.bind; - /* eslint-disable block-scoped-var, no-undef */ - boundMethod.bind = function(newThis ) {for (var args=[],$__0=1,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); - // User is trying to bind() an autobound method; we effectively will - // ignore the value of "this" that the user is trying to use, so - // let's warn. - if (newThis !== component && newThis !== null) { - ("production" !== "development" ? warning( - false, - 'bind(): React component methods may only be bound to the ' + - 'component instance. See %s', - componentName - ) : null); - } else if (!args.length) { - ("production" !== "development" ? warning( - false, - 'bind(): You are binding a component method to the component. ' + - 'React does this for you automatically in a high-performance ' + - 'way, so you can safely remove this call. See %s', - componentName - ) : null); - return boundMethod; - } - var reboundMethod = _bind.apply(boundMethod, arguments); - reboundMethod.__reactBoundContext = component; - reboundMethod.__reactBoundMethod = method; - reboundMethod.__reactBoundArguments = args; - return reboundMethod; - /* eslint-enable */ - }; - } - return boundMethod; - } - - /** - * Binds all auto-bound methods in a component. - * - * @param {object} component Component whose method is going to be bound. - */ - function bindAutoBindMethods(component) { - for (var autoBindKey in component.__reactAutoBindMap) { - if (component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) { - var method = component.__reactAutoBindMap[autoBindKey]; - component[autoBindKey] = bindAutoBindMethod( - component, - ReactErrorUtils.guard( - method, - component.constructor.displayName + '.' + autoBindKey - ) - ); - } - } - } - - var typeDeprecationDescriptor = { - enumerable: false, - get: function() { - var displayName = this.displayName || this.name || 'Component'; - ("production" !== "development" ? warning( - false, - '%s.type is deprecated. Use %s directly to access the class.', - displayName, - displayName - ) : null); - Object.defineProperty(this, 'type', { - value: this - }); - return this; - } - }; - - /** - * Add more to the ReactClass base class. These are all legacy features and - * therefore not already part of the modern ReactComponent. - */ - var ReactClassMixin = { - - /** - * TODO: This will be deprecated because state should always keep a consistent - * type signature and the only use case for this, is to avoid that. - */ - replaceState: function(newState, callback) { - ReactUpdateQueue.enqueueReplaceState(this, newState); - if (callback) { - ReactUpdateQueue.enqueueCallback(this, callback); - } - }, - - /** - * Checks whether or not this composite component is mounted. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function() { - if ("production" !== "development") { - var owner = ReactCurrentOwner.current; - if (owner !== null) { - ("production" !== "development" ? warning( - owner._warnedAboutRefsInRender, - '%s is accessing isMounted inside its render() function. ' + - 'render() should be a pure function of props and state. It should ' + - 'never access something that requires stale data from the previous ' + - 'render, such as refs. Move this logic to componentDidMount and ' + - 'componentDidUpdate instead.', - owner.getName() || 'A component' - ) : null); - owner._warnedAboutRefsInRender = true; - } - } - var internalInstance = ReactInstanceMap.get(this); - return ( - internalInstance && - internalInstance !== ReactLifeCycle.currentlyMountingInstance - ); - }, - - /** - * Sets a subset of the props. - * - * @param {object} partialProps Subset of the next props. - * @param {?function} callback Called after props are updated. - * @final - * @public - * @deprecated - */ - setProps: function(partialProps, callback) { - ReactUpdateQueue.enqueueSetProps(this, partialProps); - if (callback) { - ReactUpdateQueue.enqueueCallback(this, callback); - } - }, - - /** - * Replace all the props. - * - * @param {object} newProps Subset of the next props. - * @param {?function} callback Called after props are updated. - * @final - * @public - * @deprecated - */ - replaceProps: function(newProps, callback) { - ReactUpdateQueue.enqueueReplaceProps(this, newProps); - if (callback) { - ReactUpdateQueue.enqueueCallback(this, callback); - } - } - }; - - var ReactClassComponent = function() {}; - assign( - ReactClassComponent.prototype, - ReactComponent.prototype, - ReactClassMixin - ); - - /** - * Module for creating composite components. - * - * @class ReactClass - */ - var ReactClass = { - - /** - * Creates a composite component class given a class specification. - * - * @param {object} spec Class specification (which must define `render`). - * @return {function} Component constructor function. - * @public - */ - createClass: function(spec) { - var Constructor = function(props, context) { - // This constructor is overridden by mocks. The argument is used - // by mocks to assert on what gets mounted. - - if ("production" !== "development") { - ("production" !== "development" ? warning( - this instanceof Constructor, - 'Something is calling a React component directly. Use a factory or ' + - 'JSX instead. See: https://fb.me/react-legacyfactory' - ) : null); - } - - // Wire up auto-binding - if (this.__reactAutoBindMap) { - bindAutoBindMethods(this); - } - - this.props = props; - this.context = context; - this.state = null; - - // ReactClasses doesn't have constructors. Instead, they use the - // getInitialState and componentWillMount methods for initialization. - - var initialState = this.getInitialState ? this.getInitialState() : null; - if ("production" !== "development") { - // We allow auto-mocks to proceed as if they're returning null. - if (typeof initialState === 'undefined' && - this.getInitialState._isMockFunction) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - initialState = null; - } - } - ("production" !== "development" ? invariant( - typeof initialState === 'object' && !Array.isArray(initialState), - '%s.getInitialState(): must return an object or null', - Constructor.displayName || 'ReactCompositeComponent' - ) : invariant(typeof initialState === 'object' && !Array.isArray(initialState))); - - this.state = initialState; - }; - Constructor.prototype = new ReactClassComponent(); - Constructor.prototype.constructor = Constructor; - - injectedMixins.forEach( - mixSpecIntoComponent.bind(null, Constructor) - ); - - mixSpecIntoComponent(Constructor, spec); - - // Initialize the defaultProps property after all mixins have been merged - if (Constructor.getDefaultProps) { - Constructor.defaultProps = Constructor.getDefaultProps(); - } - - if ("production" !== "development") { - // This is a tag to indicate that the use of these method names is ok, - // since it's used with createClass. If it's not, then it's likely a - // mistake so we'll warn you to use the static property, property - // initializer or constructor respectively. - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps.isReactClassApproved = {}; - } - if (Constructor.prototype.getInitialState) { - Constructor.prototype.getInitialState.isReactClassApproved = {}; - } - } - - ("production" !== "development" ? invariant( - Constructor.prototype.render, - 'createClass(...): Class specification must implement a `render` method.' - ) : invariant(Constructor.prototype.render)); - - if ("production" !== "development") { - ("production" !== "development" ? warning( - !Constructor.prototype.componentShouldUpdate, - '%s has a method called ' + - 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + - 'The name is phrased as a question because the function is ' + - 'expected to return a value.', - spec.displayName || 'A component' - ) : null); - } - - // Reduce time spent doing lookups by setting these on the prototype. - for (var methodName in ReactClassInterface) { - if (!Constructor.prototype[methodName]) { - Constructor.prototype[methodName] = null; - } - } - - // Legacy hook - Constructor.type = Constructor; - if ("production" !== "development") { - try { - Object.defineProperty(Constructor, 'type', typeDeprecationDescriptor); - } catch (x) { - // IE will fail on defineProperty (es5-shim/sham too) - } - } - - return Constructor; - }, - - injection: { - injectMixin: function(mixin) { - injectedMixins.push(mixin); - } - } - - }; - - module.exports = ReactClass; - -},{"150":150,"156":156,"157":157,"171":171,"29":29,"39":39,"45":45,"63":63,"66":66,"73":73,"74":74,"84":84,"85":85,"99":99}],39:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactComponent - */ - - 'use strict'; - - var ReactUpdateQueue = _dereq_(99); - - var invariant = _dereq_(150); - var warning = _dereq_(171); - - /** - * Base class helpers for the updating state of a component. - */ - function ReactComponent(props, context) { - this.props = props; - this.context = context; - } - - /** - * Sets a subset of the state. Always use this to mutate - * state. You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * There is no guarantee that calls to `setState` will run synchronously, - * as they may eventually be batched together. You can provide an optional - * callback that will be executed when the call to setState is actually - * completed. - * - * When a function is provided to setState, it will be called at some point in - * the future (not synchronously). It will be called with the up to date - * component arguments (state, props, context). These values can be different - * from this.* because your function may be called after receiveProps but before - * shouldComponentUpdate, and this new state, props, and context will not yet be - * assigned to this. - * - * @param {object|function} partialState Next partial state or function to - * produce next partial state to be merged with current state. - * @param {?function} callback Called after state is updated. - * @final - * @protected - */ - ReactComponent.prototype.setState = function(partialState, callback) { - ("production" !== "development" ? invariant( - typeof partialState === 'object' || - typeof partialState === 'function' || - partialState == null, - 'setState(...): takes an object of state variables to update or a ' + - 'function which returns an object of state variables.' - ) : invariant(typeof partialState === 'object' || - typeof partialState === 'function' || - partialState == null)); - if ("production" !== "development") { - ("production" !== "development" ? warning( - partialState != null, - 'setState(...): You passed an undefined or null state object; ' + - 'instead, use forceUpdate().' - ) : null); - } - ReactUpdateQueue.enqueueSetState(this, partialState); - if (callback) { - ReactUpdateQueue.enqueueCallback(this, callback); - } - }; - - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {?function} callback Called after update is complete. - * @final - * @protected - */ - ReactComponent.prototype.forceUpdate = function(callback) { - ReactUpdateQueue.enqueueForceUpdate(this); - if (callback) { - ReactUpdateQueue.enqueueCallback(this, callback); - } - }; - - /** - * Deprecated APIs. These APIs used to exist on classic React classes but since - * we would like to deprecate them, we're not going to move them over to this - * modern base class. Instead, we define a getter that warns if it's accessed. - */ - if ("production" !== "development") { - var deprecatedAPIs = { - getDOMNode: [ - 'getDOMNode', - 'Use React.findDOMNode(component) instead.' - ], - isMounted: [ - 'isMounted', - 'Instead, make sure to clean up subscriptions and pending requests in ' + - 'componentWillUnmount to prevent memory leaks.' - ], - replaceProps: [ - 'replaceProps', - 'Instead call React.render again at the top level.' - ], - replaceState: [ - 'replaceState', - 'Refactor your code to use setState instead (see ' + - 'https://github.com/facebook/react/issues/3236).' - ], - setProps: [ - 'setProps', - 'Instead call React.render again at the top level.' - ] - }; - var defineDeprecationWarning = function(methodName, info) { - try { - Object.defineProperty(ReactComponent.prototype, methodName, { - get: function() { - ("production" !== "development" ? warning( - false, - '%s(...) is deprecated in plain JavaScript React classes. %s', - info[0], - info[1] - ) : null); - return undefined; - } - }); - } catch (x) { - // IE will fail on defineProperty (es5-shim/sham too) - } - }; - for (var fnName in deprecatedAPIs) { - if (deprecatedAPIs.hasOwnProperty(fnName)) { - defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); - } - } - } - - module.exports = ReactComponent; - -},{"150":150,"171":171,"99":99}],40:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactComponentBrowserEnvironment - */ - - /*jslint evil: true */ - - 'use strict'; - - var ReactDOMIDOperations = _dereq_(50); - var ReactMount = _dereq_(77); - - /** - * Abstracts away all functionality of the reconciler that requires knowledge of - * the browser context. TODO: These callers should be refactored to avoid the - * need for this injection. - */ - var ReactComponentBrowserEnvironment = { - - processChildrenUpdates: - ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, - - replaceNodeWithMarkupByID: - ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID, - - /** - * If a particular environment requires that some resources be cleaned up, - * specify this in the injected Mixin. In the DOM, we would likely want to - * purge any cached node ID lookups. - * - * @private - */ - unmountIDFromEnvironment: function(rootNodeID) { - ReactMount.purgeID(rootNodeID); - } - - }; - - module.exports = ReactComponentBrowserEnvironment; - -},{"50":50,"77":77}],41:[function(_dereq_,module,exports){ - /** - * Copyright 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactComponentEnvironment - */ - - 'use strict'; - - var invariant = _dereq_(150); - - var injected = false; - - var ReactComponentEnvironment = { - - /** - * Optionally injectable environment dependent cleanup hook. (server vs. - * browser etc). Example: A browser system caches DOM nodes based on component - * ID and must remove that cache entry when this instance is unmounted. - */ - unmountIDFromEnvironment: null, - - /** - * Optionally injectable hook for swapping out mount images in the middle of - * the tree. - */ - replaceNodeWithMarkupByID: null, - - /** - * Optionally injectable hook for processing a queue of child updates. Will - * later move into MultiChildComponents. - */ - processChildrenUpdates: null, - - injection: { - injectEnvironment: function(environment) { - ("production" !== "development" ? invariant( - !injected, - 'ReactCompositeComponent: injectEnvironment() can only be called once.' - ) : invariant(!injected)); - ReactComponentEnvironment.unmountIDFromEnvironment = - environment.unmountIDFromEnvironment; - ReactComponentEnvironment.replaceNodeWithMarkupByID = - environment.replaceNodeWithMarkupByID; - ReactComponentEnvironment.processChildrenUpdates = - environment.processChildrenUpdates; - injected = true; - } - } - - }; - - module.exports = ReactComponentEnvironment; - -},{"150":150}],42:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactComponentWithPureRenderMixin - */ - - 'use strict'; - - var shallowEqual = _dereq_(166); - - /** - * If your React component's render function is "pure", e.g. it will render the - * same result given the same props and state, provide this Mixin for a - * considerable performance boost. - * - * Most React components have pure render functions. - * - * Example: - * - * var ReactComponentWithPureRenderMixin = - * require('ReactComponentWithPureRenderMixin'); - * React.createClass({ - * mixins: [ReactComponentWithPureRenderMixin], - * - * render: function() { - * return
foo
; - * } - * }); - * - * Note: This only checks shallow equality for props and state. If these contain - * complex data structures this mixin may have false-negatives for deeper - * differences. Only mixin to components which have simple props and state, or - * use `forceUpdate()` when you know deep data structures have changed. - */ - var ReactComponentWithPureRenderMixin = { - shouldComponentUpdate: function(nextProps, nextState) { - return !shallowEqual(this.props, nextProps) || - !shallowEqual(this.state, nextState); - } - }; - - module.exports = ReactComponentWithPureRenderMixin; - -},{"166":166}],43:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactCompositeComponent - */ - - 'use strict'; - - var ReactComponentEnvironment = _dereq_(41); - var ReactContext = _dereq_(44); - var ReactCurrentOwner = _dereq_(45); - var ReactElement = _dereq_(63); - var ReactElementValidator = _dereq_(64); - var ReactInstanceMap = _dereq_(73); - var ReactLifeCycle = _dereq_(74); - var ReactNativeComponent = _dereq_(80); - var ReactPerf = _dereq_(82); - var ReactPropTypeLocations = _dereq_(85); - var ReactPropTypeLocationNames = _dereq_(84); - var ReactReconciler = _dereq_(89); - var ReactUpdates = _dereq_(100); - - var assign = _dereq_(29); - var emptyObject = _dereq_(130); - var invariant = _dereq_(150); - var shouldUpdateReactComponent = _dereq_(167); - var warning = _dereq_(171); - - function getDeclarationErrorAddendum(component) { - var owner = component._currentElement._owner || null; - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; - } - - /** - * ------------------ The Life-Cycle of a Composite Component ------------------ - * - * - constructor: Initialization of state. The instance is now retained. - * - componentWillMount - * - render - * - [children's constructors] - * - [children's componentWillMount and render] - * - [children's componentDidMount] - * - componentDidMount - * - * Update Phases: - * - componentWillReceiveProps (only called if parent updated) - * - shouldComponentUpdate - * - componentWillUpdate - * - render - * - [children's constructors or receive props phases] - * - componentDidUpdate - * - * - componentWillUnmount - * - [children's componentWillUnmount] - * - [children destroyed] - * - (destroyed): The instance is now blank, released by React and ready for GC. - * - * ----------------------------------------------------------------------------- - */ - - /** - * An incrementing ID assigned to each component when it is mounted. This is - * used to enforce the order in which `ReactUpdates` updates dirty components. - * - * @private - */ - var nextMountID = 1; - - /** - * @lends {ReactCompositeComponent.prototype} - */ - var ReactCompositeComponentMixin = { - - /** - * Base constructor for all composite component. - * - * @param {ReactElement} element - * @final - * @internal - */ - construct: function(element) { - this._currentElement = element; - this._rootNodeID = null; - this._instance = null; - - // See ReactUpdateQueue - this._pendingElement = null; - this._pendingStateQueue = null; - this._pendingReplaceState = false; - this._pendingForceUpdate = false; - - this._renderedComponent = null; - - this._context = null; - this._mountOrder = 0; - this._isTopLevel = false; - - // See ReactUpdates and ReactUpdateQueue. - this._pendingCallbacks = null; - }, - - /** - * Initializes the component, renders markup, and registers event listeners. - * - * @param {string} rootID DOM ID of the root node. - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @return {?string} Rendered markup to be inserted into the DOM. - * @final - * @internal - */ - mountComponent: function(rootID, transaction, context) { - this._context = context; - this._mountOrder = nextMountID++; - this._rootNodeID = rootID; - - var publicProps = this._processProps(this._currentElement.props); - var publicContext = this._processContext(this._currentElement._context); - - var Component = ReactNativeComponent.getComponentClassForElement( - this._currentElement - ); - - // Initialize the public class - var inst = new Component(publicProps, publicContext); - - if ("production" !== "development") { - // This will throw later in _renderValidatedComponent, but add an early - // warning now to help debugging - ("production" !== "development" ? warning( - inst.render != null, - '%s(...): No `render` method found on the returned component ' + - 'instance: you may have forgotten to define `render` in your ' + - 'component or you may have accidentally tried to render an element ' + - 'whose type is a function that isn\'t a React component.', - Component.displayName || Component.name || 'Component' - ) : null); - } - - // These should be set up in the constructor, but as a convenience for - // simpler class abstractions, we set them up after the fact. - inst.props = publicProps; - inst.context = publicContext; - inst.refs = emptyObject; - - this._instance = inst; - - // Store a reference from the instance back to the internal representation - ReactInstanceMap.set(inst, this); - - if ("production" !== "development") { - this._warnIfContextsDiffer(this._currentElement._context, context); - } - - if ("production" !== "development") { - // Since plain JS classes are defined without any special initialization - // logic, we can not catch common errors early. Therefore, we have to - // catch them here, at initialization time, instead. - ("production" !== "development" ? warning( - !inst.getInitialState || - inst.getInitialState.isReactClassApproved, - 'getInitialState was defined on %s, a plain JavaScript class. ' + - 'This is only supported for classes created using React.createClass. ' + - 'Did you mean to define a state property instead?', - this.getName() || 'a component' - ) : null); - ("production" !== "development" ? warning( - !inst.getDefaultProps || - inst.getDefaultProps.isReactClassApproved, - 'getDefaultProps was defined on %s, a plain JavaScript class. ' + - 'This is only supported for classes created using React.createClass. ' + - 'Use a static property to define defaultProps instead.', - this.getName() || 'a component' - ) : null); - ("production" !== "development" ? warning( - !inst.propTypes, - 'propTypes was defined as an instance property on %s. Use a static ' + - 'property to define propTypes instead.', - this.getName() || 'a component' - ) : null); - ("production" !== "development" ? warning( - !inst.contextTypes, - 'contextTypes was defined as an instance property on %s. Use a ' + - 'static property to define contextTypes instead.', - this.getName() || 'a component' - ) : null); - ("production" !== "development" ? warning( - typeof inst.componentShouldUpdate !== 'function', - '%s has a method called ' + - 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + - 'The name is phrased as a question because the function is ' + - 'expected to return a value.', - (this.getName() || 'A component') - ) : null); - } - - var initialState = inst.state; - if (initialState === undefined) { - inst.state = initialState = null; - } - ("production" !== "development" ? invariant( - typeof initialState === 'object' && !Array.isArray(initialState), - '%s.state: must be set to an object or null', - this.getName() || 'ReactCompositeComponent' - ) : invariant(typeof initialState === 'object' && !Array.isArray(initialState))); - - this._pendingStateQueue = null; - this._pendingReplaceState = false; - this._pendingForceUpdate = false; - - var childContext; - var renderedElement; - - var previouslyMounting = ReactLifeCycle.currentlyMountingInstance; - ReactLifeCycle.currentlyMountingInstance = this; - try { - if (inst.componentWillMount) { - inst.componentWillMount(); - // When mounting, calls to `setState` by `componentWillMount` will set - // `this._pendingStateQueue` without triggering a re-render. - if (this._pendingStateQueue) { - inst.state = this._processPendingState(inst.props, inst.context); - } - } - - childContext = this._getValidatedChildContext(context); - renderedElement = this._renderValidatedComponent(childContext); - } finally { - ReactLifeCycle.currentlyMountingInstance = previouslyMounting; - } - - this._renderedComponent = this._instantiateReactComponent( - renderedElement, - this._currentElement.type // The wrapping type - ); - - var markup = ReactReconciler.mountComponent( - this._renderedComponent, - rootID, - transaction, - this._mergeChildContext(context, childContext) - ); - if (inst.componentDidMount) { - transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); - } - - return markup; - }, - - /** - * Releases any resources allocated by `mountComponent`. - * - * @final - * @internal - */ - unmountComponent: function() { - var inst = this._instance; - - if (inst.componentWillUnmount) { - var previouslyUnmounting = ReactLifeCycle.currentlyUnmountingInstance; - ReactLifeCycle.currentlyUnmountingInstance = this; - try { - inst.componentWillUnmount(); - } finally { - ReactLifeCycle.currentlyUnmountingInstance = previouslyUnmounting; - } - } - - ReactReconciler.unmountComponent(this._renderedComponent); - this._renderedComponent = null; - - // Reset pending fields - this._pendingStateQueue = null; - this._pendingReplaceState = false; - this._pendingForceUpdate = false; - this._pendingCallbacks = null; - this._pendingElement = null; - - // These fields do not really need to be reset since this object is no - // longer accessible. - this._context = null; - this._rootNodeID = null; - - // Delete the reference from the instance to this internal representation - // which allow the internals to be properly cleaned up even if the user - // leaks a reference to the public instance. - ReactInstanceMap.remove(inst); - - // Some existing components rely on inst.props even after they've been - // destroyed (in event handlers). - // TODO: inst.props = null; - // TODO: inst.state = null; - // TODO: inst.context = null; - }, - - /** - * Schedule a partial update to the props. Only used for internal testing. - * - * @param {object} partialProps Subset of the next props. - * @param {?function} callback Called after props are updated. - * @final - * @internal - */ - _setPropsInternal: function(partialProps, callback) { - // This is a deoptimized path. We optimize for always having an element. - // This creates an extra internal element. - var element = this._pendingElement || this._currentElement; - this._pendingElement = ReactElement.cloneAndReplaceProps( - element, - assign({}, element.props, partialProps) - ); - ReactUpdates.enqueueUpdate(this, callback); - }, - - /** - * Filters the context object to only contain keys specified in - * `contextTypes` - * - * @param {object} context - * @return {?object} - * @private - */ - _maskContext: function(context) { - var maskedContext = null; - // This really should be getting the component class for the element, - // but we know that we're not going to need it for built-ins. - if (typeof this._currentElement.type === 'string') { - return emptyObject; - } - var contextTypes = this._currentElement.type.contextTypes; - if (!contextTypes) { - return emptyObject; - } - maskedContext = {}; - for (var contextName in contextTypes) { - maskedContext[contextName] = context[contextName]; - } - return maskedContext; - }, - - /** - * Filters the context object to only contain keys specified in - * `contextTypes`, and asserts that they are valid. - * - * @param {object} context - * @return {?object} - * @private - */ - _processContext: function(context) { - var maskedContext = this._maskContext(context); - if ("production" !== "development") { - var Component = ReactNativeComponent.getComponentClassForElement( - this._currentElement - ); - if (Component.contextTypes) { - this._checkPropTypes( - Component.contextTypes, - maskedContext, - ReactPropTypeLocations.context - ); - } - } - return maskedContext; - }, - - /** - * @param {object} currentContext - * @return {object} - * @private - */ - _getValidatedChildContext: function(currentContext) { - var inst = this._instance; - var childContext = inst.getChildContext && inst.getChildContext(); - if (childContext) { - ("production" !== "development" ? invariant( - typeof inst.constructor.childContextTypes === 'object', - '%s.getChildContext(): childContextTypes must be defined in order to ' + - 'use getChildContext().', - this.getName() || 'ReactCompositeComponent' - ) : invariant(typeof inst.constructor.childContextTypes === 'object')); - if ("production" !== "development") { - this._checkPropTypes( - inst.constructor.childContextTypes, - childContext, - ReactPropTypeLocations.childContext - ); - } - for (var name in childContext) { - ("production" !== "development" ? invariant( - name in inst.constructor.childContextTypes, - '%s.getChildContext(): key "%s" is not defined in childContextTypes.', - this.getName() || 'ReactCompositeComponent', - name - ) : invariant(name in inst.constructor.childContextTypes)); - } - return childContext; - } - return null; - }, - - _mergeChildContext: function(currentContext, childContext) { - if (childContext) { - return assign({}, currentContext, childContext); - } - return currentContext; - }, - - /** - * Processes props by setting default values for unspecified props and - * asserting that the props are valid. Does not mutate its argument; returns - * a new props object with defaults merged in. - * - * @param {object} newProps - * @return {object} - * @private - */ - _processProps: function(newProps) { - if ("production" !== "development") { - var Component = ReactNativeComponent.getComponentClassForElement( - this._currentElement - ); - if (Component.propTypes) { - this._checkPropTypes( - Component.propTypes, - newProps, - ReactPropTypeLocations.prop - ); - } - } - return newProps; - }, - - /** - * Assert that the props are valid - * - * @param {object} propTypes Map of prop name to a ReactPropType - * @param {object} props - * @param {string} location e.g. "prop", "context", "child context" - * @private - */ - _checkPropTypes: function(propTypes, props, location) { - // TODO: Stop validating prop types here and only use the element - // validation. - var componentName = this.getName(); - for (var propName in propTypes) { - if (propTypes.hasOwnProperty(propName)) { - var error; - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - ("production" !== "development" ? invariant( - typeof propTypes[propName] === 'function', - '%s: %s type `%s` is invalid; it must be a function, usually ' + - 'from React.PropTypes.', - componentName || 'React class', - ReactPropTypeLocationNames[location], - propName - ) : invariant(typeof propTypes[propName] === 'function')); - error = propTypes[propName](props, propName, componentName, location); - } catch (ex) { - error = ex; - } - if (error instanceof Error) { - // We may want to extend this logic for similar errors in - // React.render calls, so I'm abstracting it away into - // a function to minimize refactoring in the future - var addendum = getDeclarationErrorAddendum(this); - - if (location === ReactPropTypeLocations.prop) { - // Preface gives us something to blacklist in warning module - ("production" !== "development" ? warning( - false, - 'Failed Composite propType: %s%s', - error.message, - addendum - ) : null); - } else { - ("production" !== "development" ? warning( - false, - 'Failed Context Types: %s%s', - error.message, - addendum - ) : null); - } - } - } - } - }, - - receiveComponent: function(nextElement, transaction, nextContext) { - var prevElement = this._currentElement; - var prevContext = this._context; - - this._pendingElement = null; - - this.updateComponent( - transaction, - prevElement, - nextElement, - prevContext, - nextContext - ); - }, - - /** - * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate` - * is set, update the component. - * - * @param {ReactReconcileTransaction} transaction - * @internal - */ - performUpdateIfNecessary: function(transaction) { - if (this._pendingElement != null) { - ReactReconciler.receiveComponent( - this, - this._pendingElement || this._currentElement, - transaction, - this._context - ); - } - - if (this._pendingStateQueue !== null || this._pendingForceUpdate) { - if ("production" !== "development") { - ReactElementValidator.checkAndWarnForMutatedProps( - this._currentElement - ); - } - - this.updateComponent( - transaction, - this._currentElement, - this._currentElement, - this._context, - this._context - ); - } - }, - - /** - * Compare two contexts, warning if they are different - * TODO: Remove this check when owner-context is removed - */ - _warnIfContextsDiffer: function(ownerBasedContext, parentBasedContext) { - ownerBasedContext = this._maskContext(ownerBasedContext); - parentBasedContext = this._maskContext(parentBasedContext); - var parentKeys = Object.keys(parentBasedContext).sort(); - var displayName = this.getName() || 'ReactCompositeComponent'; - for (var i = 0; i < parentKeys.length; i++) { - var key = parentKeys[i]; - ("production" !== "development" ? warning( - ownerBasedContext[key] === parentBasedContext[key], - 'owner-based and parent-based contexts differ ' + - '(values: `%s` vs `%s`) for key (%s) while mounting %s ' + - '(see: http://fb.me/react-context-by-parent)', - ownerBasedContext[key], - parentBasedContext[key], - key, - displayName - ) : null); - } - }, - - /** - * Perform an update to a mounted component. The componentWillReceiveProps and - * shouldComponentUpdate methods are called, then (assuming the update isn't - * skipped) the remaining update lifecycle methods are called and the DOM - * representation is updated. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @param {ReactElement} prevParentElement - * @param {ReactElement} nextParentElement - * @internal - * @overridable - */ - updateComponent: function( - transaction, - prevParentElement, - nextParentElement, - prevUnmaskedContext, - nextUnmaskedContext - ) { - var inst = this._instance; - - var nextContext = inst.context; - var nextProps = inst.props; - - // Distinguish between a props update versus a simple state update - if (prevParentElement !== nextParentElement) { - nextContext = this._processContext(nextParentElement._context); - nextProps = this._processProps(nextParentElement.props); - - if ("production" !== "development") { - if (nextUnmaskedContext != null) { - this._warnIfContextsDiffer( - nextParentElement._context, - nextUnmaskedContext - ); - } - } - - // An update here will schedule an update but immediately set - // _pendingStateQueue which will ensure that any state updates gets - // immediately reconciled instead of waiting for the next batch. - - if (inst.componentWillReceiveProps) { - inst.componentWillReceiveProps(nextProps, nextContext); - } - } - - var nextState = this._processPendingState(nextProps, nextContext); - - var shouldUpdate = - this._pendingForceUpdate || - !inst.shouldComponentUpdate || - inst.shouldComponentUpdate(nextProps, nextState, nextContext); - - if ("production" !== "development") { - ("production" !== "development" ? warning( - typeof shouldUpdate !== 'undefined', - '%s.shouldComponentUpdate(): Returned undefined instead of a ' + - 'boolean value. Make sure to return true or false.', - this.getName() || 'ReactCompositeComponent' - ) : null); - } - - if (shouldUpdate) { - this._pendingForceUpdate = false; - // Will set `this.props`, `this.state` and `this.context`. - this._performComponentUpdate( - nextParentElement, - nextProps, - nextState, - nextContext, - transaction, - nextUnmaskedContext - ); - } else { - // If it's determined that a component should not update, we still want - // to set props and state but we shortcut the rest of the update. - this._currentElement = nextParentElement; - this._context = nextUnmaskedContext; - inst.props = nextProps; - inst.state = nextState; - inst.context = nextContext; - } - }, - - _processPendingState: function(props, context) { - var inst = this._instance; - var queue = this._pendingStateQueue; - var replace = this._pendingReplaceState; - this._pendingReplaceState = false; - this._pendingStateQueue = null; - - if (!queue) { - return inst.state; - } - - if (replace && queue.length === 1) { - return queue[0]; - } - - var nextState = assign({}, replace ? queue[0] : inst.state); - for (var i = replace ? 1 : 0; i < queue.length; i++) { - var partial = queue[i]; - assign( - nextState, - typeof partial === 'function' ? - partial.call(inst, nextState, props, context) : - partial - ); - } - - return nextState; - }, - - /** - * Merges new props and state, notifies delegate methods of update and - * performs update. - * - * @param {ReactElement} nextElement Next element - * @param {object} nextProps Next public object to set as properties. - * @param {?object} nextState Next object to set as state. - * @param {?object} nextContext Next public object to set as context. - * @param {ReactReconcileTransaction} transaction - * @param {?object} unmaskedContext - * @private - */ - _performComponentUpdate: function( - nextElement, - nextProps, - nextState, - nextContext, - transaction, - unmaskedContext - ) { - var inst = this._instance; - - var prevProps = inst.props; - var prevState = inst.state; - var prevContext = inst.context; - - if (inst.componentWillUpdate) { - inst.componentWillUpdate(nextProps, nextState, nextContext); - } - - this._currentElement = nextElement; - this._context = unmaskedContext; - inst.props = nextProps; - inst.state = nextState; - inst.context = nextContext; - - this._updateRenderedComponent(transaction, unmaskedContext); - - if (inst.componentDidUpdate) { - transaction.getReactMountReady().enqueue( - inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), - inst - ); - } - }, - - /** - * Call the component's `render` method and update the DOM accordingly. - * - * @param {ReactReconcileTransaction} transaction - * @internal - */ - _updateRenderedComponent: function(transaction, context) { - var prevComponentInstance = this._renderedComponent; - var prevRenderedElement = prevComponentInstance._currentElement; - var childContext = this._getValidatedChildContext(); - var nextRenderedElement = this._renderValidatedComponent(childContext); - if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) { - ReactReconciler.receiveComponent( - prevComponentInstance, - nextRenderedElement, - transaction, - this._mergeChildContext(context, childContext) - ); - } else { - // These two IDs are actually the same! But nothing should rely on that. - var thisID = this._rootNodeID; - var prevComponentID = prevComponentInstance._rootNodeID; - ReactReconciler.unmountComponent(prevComponentInstance); - - this._renderedComponent = this._instantiateReactComponent( - nextRenderedElement, - this._currentElement.type - ); - var nextMarkup = ReactReconciler.mountComponent( - this._renderedComponent, - thisID, - transaction, - this._mergeChildContext(context, childContext) - ); - this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup); - } - }, - - /** - * @protected - */ - _replaceNodeWithMarkupByID: function(prevComponentID, nextMarkup) { - ReactComponentEnvironment.replaceNodeWithMarkupByID( - prevComponentID, - nextMarkup - ); - }, - - /** - * @protected - */ - _renderValidatedComponentWithoutOwnerOrContext: function() { - var inst = this._instance; - var renderedComponent = inst.render(); - if ("production" !== "development") { - // We allow auto-mocks to proceed as if they're returning null. - if (typeof renderedComponent === 'undefined' && - inst.render._isMockFunction) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - renderedComponent = null; - } - } - - return renderedComponent; - }, - - /** - * @private - */ - _renderValidatedComponent: function(childContext) { - var renderedComponent; - var previousContext = ReactContext.current; - ReactContext.current = this._mergeChildContext( - this._currentElement._context, - childContext - ); - ReactCurrentOwner.current = this; - try { - renderedComponent = - this._renderValidatedComponentWithoutOwnerOrContext(); - } finally { - ReactContext.current = previousContext; - ReactCurrentOwner.current = null; - } - ("production" !== "development" ? invariant( - // TODO: An `isValidNode` function would probably be more appropriate - renderedComponent === null || renderedComponent === false || - ReactElement.isValidElement(renderedComponent), - '%s.render(): A valid ReactComponent must be returned. You may have ' + - 'returned undefined, an array or some other invalid object.', - this.getName() || 'ReactCompositeComponent' - ) : invariant(// TODO: An `isValidNode` function would probably be more appropriate - renderedComponent === null || renderedComponent === false || - ReactElement.isValidElement(renderedComponent))); - return renderedComponent; - }, - - /** - * Lazily allocates the refs object and stores `component` as `ref`. - * - * @param {string} ref Reference name. - * @param {component} component Component to store as `ref`. - * @final - * @private - */ - attachRef: function(ref, component) { - var inst = this.getPublicInstance(); - var refs = inst.refs === emptyObject ? (inst.refs = {}) : inst.refs; - refs[ref] = component.getPublicInstance(); - }, - - /** - * Detaches a reference name. - * - * @param {string} ref Name to dereference. - * @final - * @private - */ - detachRef: function(ref) { - var refs = this.getPublicInstance().refs; - delete refs[ref]; - }, - - /** - * Get a text description of the component that can be used to identify it - * in error messages. - * @return {string} The name or null. - * @internal - */ - getName: function() { - var type = this._currentElement.type; - var constructor = this._instance && this._instance.constructor; - return ( - type.displayName || (constructor && constructor.displayName) || - type.name || (constructor && constructor.name) || - null - ); - }, - - /** - * Get the publicly accessible representation of this component - i.e. what - * is exposed by refs and returned by React.render. Can be null for stateless - * components. - * - * @return {ReactComponent} the public component instance. - * @internal - */ - getPublicInstance: function() { - return this._instance; - }, - - // Stub - _instantiateReactComponent: null - - }; - - ReactPerf.measureMethods( - ReactCompositeComponentMixin, - 'ReactCompositeComponent', - { - mountComponent: 'mountComponent', - updateComponent: 'updateComponent', - _renderValidatedComponent: '_renderValidatedComponent' - } - ); - - var ReactCompositeComponent = { - - Mixin: ReactCompositeComponentMixin - - }; - - module.exports = ReactCompositeComponent; - -},{"100":100,"130":130,"150":150,"167":167,"171":171,"29":29,"41":41,"44":44,"45":45,"63":63,"64":64,"73":73,"74":74,"80":80,"82":82,"84":84,"85":85,"89":89}],44:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactContext - */ - - 'use strict'; - - var assign = _dereq_(29); - var emptyObject = _dereq_(130); - var warning = _dereq_(171); - - var didWarn = false; - - /** - * Keeps track of the current context. - * - * The context is automatically passed down the component ownership hierarchy - * and is accessible via `this.context` on ReactCompositeComponents. - */ - var ReactContext = { - - /** - * @internal - * @type {object} - */ - current: emptyObject, - - /** - * Temporarily extends the current context while executing scopedCallback. - * - * A typical use case might look like - * - * render: function() { - * var children = ReactContext.withContext({foo: 'foo'}, () => ( - * - * )); - * return
{children}
; - * } - * - * @param {object} newContext New context to merge into the existing context - * @param {function} scopedCallback Callback to run with the new context - * @return {ReactComponent|array} - */ - withContext: function(newContext, scopedCallback) { - if ("production" !== "development") { - ("production" !== "development" ? warning( - didWarn, - 'withContext is deprecated and will be removed in a future version. ' + - 'Use a wrapper component with getChildContext instead.' - ) : null); - - didWarn = true; - } - - var result; - var previousContext = ReactContext.current; - ReactContext.current = assign({}, previousContext, newContext); - try { - result = scopedCallback(); - } finally { - ReactContext.current = previousContext; - } - return result; - } - - }; - - module.exports = ReactContext; - -},{"130":130,"171":171,"29":29}],45:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactCurrentOwner - */ - - 'use strict'; - - /** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - * - * The depth indicate how many composite components are above this render level. - */ - var ReactCurrentOwner = { - - /** - * @internal - * @type {ReactComponent} - */ - current: null - - }; - - module.exports = ReactCurrentOwner; - -},{}],46:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactDOM - * @typechecks static-only - */ - - 'use strict'; - - var ReactElement = _dereq_(63); - var ReactElementValidator = _dereq_(64); - - var mapObject = _dereq_(158); - - /** - * Create a factory that creates HTML tag elements. - * - * @param {string} tag Tag name (e.g. `div`). - * @private - */ - function createDOMFactory(tag) { - if ("production" !== "development") { - return ReactElementValidator.createFactory(tag); - } - return ReactElement.createFactory(tag); - } - - /** - * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. - * This is also accessible via `React.DOM`. - * - * @public - */ - var ReactDOM = mapObject({ - a: 'a', - abbr: 'abbr', - address: 'address', - area: 'area', - article: 'article', - aside: 'aside', - audio: 'audio', - b: 'b', - base: 'base', - bdi: 'bdi', - bdo: 'bdo', - big: 'big', - blockquote: 'blockquote', - body: 'body', - br: 'br', - button: 'button', - canvas: 'canvas', - caption: 'caption', - cite: 'cite', - code: 'code', - col: 'col', - colgroup: 'colgroup', - data: 'data', - datalist: 'datalist', - dd: 'dd', - del: 'del', - details: 'details', - dfn: 'dfn', - dialog: 'dialog', - div: 'div', - dl: 'dl', - dt: 'dt', - em: 'em', - embed: 'embed', - fieldset: 'fieldset', - figcaption: 'figcaption', - figure: 'figure', - footer: 'footer', - form: 'form', - h1: 'h1', - h2: 'h2', - h3: 'h3', - h4: 'h4', - h5: 'h5', - h6: 'h6', - head: 'head', - header: 'header', - hr: 'hr', - html: 'html', - i: 'i', - iframe: 'iframe', - img: 'img', - input: 'input', - ins: 'ins', - kbd: 'kbd', - keygen: 'keygen', - label: 'label', - legend: 'legend', - li: 'li', - link: 'link', - main: 'main', - map: 'map', - mark: 'mark', - menu: 'menu', - menuitem: 'menuitem', - meta: 'meta', - meter: 'meter', - nav: 'nav', - noscript: 'noscript', - object: 'object', - ol: 'ol', - optgroup: 'optgroup', - option: 'option', - output: 'output', - p: 'p', - param: 'param', - picture: 'picture', - pre: 'pre', - progress: 'progress', - q: 'q', - rp: 'rp', - rt: 'rt', - ruby: 'ruby', - s: 's', - samp: 'samp', - script: 'script', - section: 'section', - select: 'select', - small: 'small', - source: 'source', - span: 'span', - strong: 'strong', - style: 'style', - sub: 'sub', - summary: 'summary', - sup: 'sup', - table: 'table', - tbody: 'tbody', - td: 'td', - textarea: 'textarea', - tfoot: 'tfoot', - th: 'th', - thead: 'thead', - time: 'time', - title: 'title', - tr: 'tr', - track: 'track', - u: 'u', - ul: 'ul', - 'var': 'var', - video: 'video', - wbr: 'wbr', - - // SVG - circle: 'circle', - clipPath: 'clipPath', - defs: 'defs', - ellipse: 'ellipse', - g: 'g', - line: 'line', - linearGradient: 'linearGradient', - mask: 'mask', - path: 'path', - pattern: 'pattern', - polygon: 'polygon', - polyline: 'polyline', - radialGradient: 'radialGradient', - rect: 'rect', - stop: 'stop', - svg: 'svg', - text: 'text', - tspan: 'tspan' - - }, createDOMFactory); - - module.exports = ReactDOM; - -},{"158":158,"63":63,"64":64}],47:[function(_dereq_,module,exports){ - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactDOMButton - */ - - 'use strict'; - - var AutoFocusMixin = _dereq_(2); - var ReactBrowserComponentMixin = _dereq_(32); - var ReactClass = _dereq_(38); - var ReactElement = _dereq_(63); - - var keyMirror = _dereq_(156); - - var button = ReactElement.createFactory('button'); - - var mouseListenerNames = keyMirror({ - onClick: true, - onDoubleClick: true, - onMouseDown: true, - onMouseMove: true, - onMouseUp: true, - onClickCapture: true, - onDoubleClickCapture: true, - onMouseDownCapture: true, - onMouseMoveCapture: true, - onMouseUpCapture: true - }); - - /** - * Implements a