Merge branch 'MDL-50733' of git://github.com/stronk7/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 19 Jul 2019 22:24:27 +0000 (00:24 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 19 Jul 2019 22:24:27 +0000 (00:24 +0200)
652 files changed:
.eslintignore
.eslintrc
.stylelintignore
Gruntfile.js
admin/tool/analytics/amd/build/log_info.min.js
admin/tool/analytics/amd/build/log_info.min.js.map [new file with mode: 0644]
admin/tool/analytics/amd/build/model.min.js
admin/tool/analytics/amd/build/model.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/add_category.min.js
admin/tool/dataprivacy/amd/build/add_category.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/add_purpose.min.js
admin/tool/dataprivacy/amd/build/add_purpose.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/categoriesactions.min.js
admin/tool/dataprivacy/amd/build/categoriesactions.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/data_deletion.min.js
admin/tool/dataprivacy/amd/build/data_deletion.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/data_registry.min.js
admin/tool/dataprivacy/amd/build/data_registry.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/data_request_modal.min.js
admin/tool/dataprivacy/amd/build/data_request_modal.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/defaultsactions.min.js
admin/tool/dataprivacy/amd/build/defaultsactions.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/effective_retention_period.min.js
admin/tool/dataprivacy/amd/build/effective_retention_period.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/events.min.js
admin/tool/dataprivacy/amd/build/events.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/expand_contract.min.js
admin/tool/dataprivacy/amd/build/expand_contract.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/form-user-selector.min.js
admin/tool/dataprivacy/amd/build/form-user-selector.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/myrequestactions.min.js
admin/tool/dataprivacy/amd/build/myrequestactions.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/purposesactions.min.js
admin/tool/dataprivacy/amd/build/purposesactions.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/request_filter.min.js
admin/tool/dataprivacy/amd/build/request_filter.min.js.map [new file with mode: 0644]
admin/tool/dataprivacy/amd/build/requestactions.min.js
admin/tool/dataprivacy/amd/build/requestactions.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/actionselector.min.js
admin/tool/lp/amd/build/actionselector.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competencies.min.js
admin/tool/lp/amd/build/competencies.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competency_outcomes.min.js
admin/tool/lp/amd/build/competency_outcomes.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competency_plan_navigation.min.js
admin/tool/lp/amd/build/competency_plan_navigation.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competency_rule.min.js
admin/tool/lp/amd/build/competency_rule.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competency_rule_all.min.js
admin/tool/lp/amd/build/competency_rule_all.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competency_rule_points.min.js
admin/tool/lp/amd/build/competency_rule_points.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competencyactions.min.js
admin/tool/lp/amd/build/competencyactions.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competencydialogue.min.js
admin/tool/lp/amd/build/competencydialogue.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competencypicker.min.js
admin/tool/lp/amd/build/competencypicker.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competencypicker_user_plans.min.js
admin/tool/lp/amd/build/competencypicker_user_plans.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competencyruleconfig.min.js
admin/tool/lp/amd/build/competencyruleconfig.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/competencytree.min.js
admin/tool/lp/amd/build/competencytree.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/course_competency_settings.min.js
admin/tool/lp/amd/build/course_competency_settings.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/dialogue.min.js
admin/tool/lp/amd/build/dialogue.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/dragdrop-reorder.min.js
admin/tool/lp/amd/build/dragdrop-reorder.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/event_base.min.js
admin/tool/lp/amd/build/event_base.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/evidence_delete.min.js
admin/tool/lp/amd/build/evidence_delete.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/form-cohort-selector.min.js
admin/tool/lp/amd/build/form-cohort-selector.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/form-user-selector.min.js
admin/tool/lp/amd/build/form-user-selector.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/form_competency_element.min.js
admin/tool/lp/amd/build/form_competency_element.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/frameworkactions.min.js
admin/tool/lp/amd/build/frameworkactions.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/frameworks_datasource.min.js
admin/tool/lp/amd/build/frameworks_datasource.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/grade_dialogue.min.js
admin/tool/lp/amd/build/grade_dialogue.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/grade_user_competency_inline.min.js
admin/tool/lp/amd/build/grade_user_competency_inline.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/menubar.min.js
admin/tool/lp/amd/build/menubar.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/module_navigation.min.js
admin/tool/lp/amd/build/module_navigation.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/parentcompetency_form.min.js
admin/tool/lp/amd/build/parentcompetency_form.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/planactions.min.js
admin/tool/lp/amd/build/planactions.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/scaleconfig.min.js
admin/tool/lp/amd/build/scaleconfig.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/scalevalues.min.js
admin/tool/lp/amd/build/scalevalues.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/templateactions.min.js
admin/tool/lp/amd/build/templateactions.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/tree.min.js
admin/tool/lp/amd/build/tree.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/user_competency_course_navigation.min.js
admin/tool/lp/amd/build/user_competency_course_navigation.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/user_competency_info.min.js
admin/tool/lp/amd/build/user_competency_info.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/user_competency_plan_popup.min.js
admin/tool/lp/amd/build/user_competency_plan_popup.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/user_competency_workflow.min.js
admin/tool/lp/amd/build/user_competency_workflow.min.js.map [new file with mode: 0644]
admin/tool/lp/amd/build/user_evidence_actions.min.js
admin/tool/lp/amd/build/user_evidence_actions.min.js.map [new file with mode: 0644]
admin/tool/policy/amd/build/acceptances_filter.min.js
admin/tool/policy/amd/build/acceptances_filter.min.js.map [new file with mode: 0644]
admin/tool/policy/amd/build/acceptances_filter_datasource.min.js
admin/tool/policy/amd/build/acceptances_filter_datasource.min.js.map [new file with mode: 0644]
admin/tool/policy/amd/build/acceptmodal.min.js
admin/tool/policy/amd/build/acceptmodal.min.js.map [new file with mode: 0644]
admin/tool/policy/amd/build/jquery-eu-cookie-law-popup.min.js
admin/tool/policy/amd/build/jquery-eu-cookie-law-popup.min.js.map [new file with mode: 0644]
admin/tool/policy/amd/build/managedocsactions.min.js
admin/tool/policy/amd/build/managedocsactions.min.js.map [new file with mode: 0644]
admin/tool/policy/amd/build/policyactions.min.js
admin/tool/policy/amd/build/policyactions.min.js.map [new file with mode: 0644]
admin/tool/templatelibrary/amd/build/display.min.js
admin/tool/templatelibrary/amd/build/display.min.js.map [new file with mode: 0644]
admin/tool/templatelibrary/amd/build/search.min.js
admin/tool/templatelibrary/amd/build/search.min.js.map [new file with mode: 0644]
admin/tool/usertours/amd/build/managesteps.min.js
admin/tool/usertours/amd/build/managesteps.min.js.map [new file with mode: 0644]
admin/tool/usertours/amd/build/managetours.min.js
admin/tool/usertours/amd/build/managetours.min.js.map [new file with mode: 0644]
admin/tool/usertours/amd/build/tour.min.js
admin/tool/usertours/amd/build/tour.min.js.map [new file with mode: 0644]
admin/tool/usertours/amd/build/usertours.min.js
admin/tool/usertours/amd/build/usertours.min.js.map [new file with mode: 0644]
admin/tool/usertours/amd/readme_moodle.txt [deleted file]
admin/tool/usertours/amd/src/tour.js
admin/tool/usertours/thirdpartylibs.xml [deleted file]
admin/tool/xmldb/amd/build/move.min.js
admin/tool/xmldb/amd/build/move.min.js.map [new file with mode: 0644]
babel-plugin-add-module-to-define.js [new file with mode: 0644]
backup/util/ui/amd/build/async_backup.min.js
backup/util/ui/amd/build/async_backup.min.js.map [new file with mode: 0644]
blocks/myoverview/amd/build/main.min.js
blocks/myoverview/amd/build/main.min.js.map [new file with mode: 0644]
blocks/myoverview/amd/build/repository.min.js
blocks/myoverview/amd/build/repository.min.js.map [new file with mode: 0644]
blocks/myoverview/amd/build/selectors.min.js
blocks/myoverview/amd/build/selectors.min.js.map [new file with mode: 0644]
blocks/myoverview/amd/build/view.min.js
blocks/myoverview/amd/build/view.min.js.map [new file with mode: 0644]
blocks/myoverview/amd/build/view_nav.min.js
blocks/myoverview/amd/build/view_nav.min.js.map [new file with mode: 0644]
blocks/navigation/amd/build/ajax_response_renderer.min.js
blocks/navigation/amd/build/ajax_response_renderer.min.js.map [new file with mode: 0644]
blocks/navigation/amd/build/nav_loader.min.js
blocks/navigation/amd/build/nav_loader.min.js.map [new file with mode: 0644]
blocks/navigation/amd/build/navblock.min.js
blocks/navigation/amd/build/navblock.min.js.map [new file with mode: 0644]
blocks/navigation/amd/build/site_admin_loader.min.js
blocks/navigation/amd/build/site_admin_loader.min.js.map [new file with mode: 0644]
blocks/online_users/amd/build/change_user_visibility.min.js
blocks/online_users/amd/build/change_user_visibility.min.js.map [new file with mode: 0644]
blocks/recentlyaccessedcourses/amd/build/main.min.js
blocks/recentlyaccessedcourses/amd/build/main.min.js.map [new file with mode: 0644]
blocks/recentlyaccesseditems/amd/build/main.min.js
blocks/recentlyaccesseditems/amd/build/main.min.js.map [new file with mode: 0644]
blocks/recentlyaccesseditems/amd/build/repository.min.js
blocks/recentlyaccesseditems/amd/build/repository.min.js.map [new file with mode: 0644]
blocks/settings/amd/build/settingsblock.min.js
blocks/settings/amd/build/settingsblock.min.js.map [new file with mode: 0644]
blocks/starredcourses/amd/build/main.min.js
blocks/starredcourses/amd/build/main.min.js.map [new file with mode: 0644]
blocks/starredcourses/amd/build/repository.min.js
blocks/starredcourses/amd/build/repository.min.js.map [new file with mode: 0644]
blocks/timeline/amd/build/calendar_events_repository.min.js
blocks/timeline/amd/build/calendar_events_repository.min.js.map [new file with mode: 0644]
blocks/timeline/amd/build/event_list.min.js
blocks/timeline/amd/build/event_list.min.js.map [new file with mode: 0644]
blocks/timeline/amd/build/main.min.js
blocks/timeline/amd/build/main.min.js.map [new file with mode: 0644]
blocks/timeline/amd/build/view.min.js
blocks/timeline/amd/build/view.min.js.map [new file with mode: 0644]
blocks/timeline/amd/build/view_courses.min.js
blocks/timeline/amd/build/view_courses.min.js.map [new file with mode: 0644]
blocks/timeline/amd/build/view_dates.min.js
blocks/timeline/amd/build/view_dates.min.js.map [new file with mode: 0644]
blocks/timeline/amd/build/view_nav.min.js
blocks/timeline/amd/build/view_nav.min.js.map [new file with mode: 0644]
calendar/amd/build/calendar.min.js
calendar/amd/build/calendar.min.js.map [new file with mode: 0644]
calendar/amd/build/calendar_filter.min.js
calendar/amd/build/calendar_filter.min.js.map [new file with mode: 0644]
calendar/amd/build/calendar_mini.min.js
calendar/amd/build/calendar_mini.min.js.map [new file with mode: 0644]
calendar/amd/build/calendar_threemonth.min.js
calendar/amd/build/calendar_threemonth.min.js.map [new file with mode: 0644]
calendar/amd/build/calendar_view.min.js
calendar/amd/build/calendar_view.min.js.map [new file with mode: 0644]
calendar/amd/build/crud.min.js
calendar/amd/build/crud.min.js.map [new file with mode: 0644]
calendar/amd/build/drag_drop_data_store.min.js
calendar/amd/build/drag_drop_data_store.min.js.map [new file with mode: 0644]
calendar/amd/build/event_form.min.js
calendar/amd/build/event_form.min.js.map [new file with mode: 0644]
calendar/amd/build/events.min.js
calendar/amd/build/events.min.js.map [new file with mode: 0644]
calendar/amd/build/modal_delete.min.js
calendar/amd/build/modal_delete.min.js.map [new file with mode: 0644]
calendar/amd/build/modal_event_form.min.js
calendar/amd/build/modal_event_form.min.js.map [new file with mode: 0644]
calendar/amd/build/month_navigation_drag_drop.min.js
calendar/amd/build/month_navigation_drag_drop.min.js.map [new file with mode: 0644]
calendar/amd/build/month_view_drag_drop.min.js
calendar/amd/build/month_view_drag_drop.min.js.map [new file with mode: 0644]
calendar/amd/build/repository.min.js
calendar/amd/build/repository.min.js.map [new file with mode: 0644]
calendar/amd/build/selectors.min.js
calendar/amd/build/selectors.min.js.map [new file with mode: 0644]
calendar/amd/build/summary_modal.min.js
calendar/amd/build/summary_modal.min.js.map [new file with mode: 0644]
calendar/amd/build/view_manager.min.js
calendar/amd/build/view_manager.min.js.map [new file with mode: 0644]
course/amd/build/actions.min.js
course/amd/build/actions.min.js.map [new file with mode: 0644]
course/amd/build/events.min.js
course/amd/build/events.min.js.map [new file with mode: 0644]
course/amd/build/repository.min.js
course/amd/build/repository.min.js.map [new file with mode: 0644]
customfield/amd/build/form.min.js
customfield/amd/build/form.min.js.map [new file with mode: 0644]
enrol/manual/amd/build/form-potential-user-selector.min.js
enrol/manual/amd/build/form-potential-user-selector.min.js.map [new file with mode: 0644]
enrol/manual/amd/build/quickenrolment.min.js
enrol/manual/amd/build/quickenrolment.min.js.map [new file with mode: 0644]
grade/amd/build/edittree_index.min.js
grade/amd/build/edittree_index.min.js.map [new file with mode: 0644]
grade/grading/form/guide/amd/build/comment_chooser.min.js
grade/grading/form/guide/amd/build/comment_chooser.min.js.map [new file with mode: 0644]
lib/amd/build/adapter.min.js
lib/amd/build/adapter.min.js.map [new file with mode: 0644]
lib/amd/build/addblockmodal.min.js
lib/amd/build/addblockmodal.min.js.map [new file with mode: 0644]
lib/amd/build/ajax.min.js
lib/amd/build/ajax.min.js.map [new file with mode: 0644]
lib/amd/build/auto_rows.min.js
lib/amd/build/auto_rows.min.js.map [new file with mode: 0644]
lib/amd/build/autoscroll.min.js
lib/amd/build/autoscroll.min.js.map [new file with mode: 0644]
lib/amd/build/backoff_timer.min.js
lib/amd/build/backoff_timer.min.js.map [new file with mode: 0644]
lib/amd/build/chart_axis.min.js
lib/amd/build/chart_axis.min.js.map [new file with mode: 0644]
lib/amd/build/chart_bar.min.js
lib/amd/build/chart_bar.min.js.map [new file with mode: 0644]
lib/amd/build/chart_base.min.js
lib/amd/build/chart_base.min.js.map [new file with mode: 0644]
lib/amd/build/chart_builder.min.js
lib/amd/build/chart_builder.min.js.map [new file with mode: 0644]
lib/amd/build/chart_line.min.js
lib/amd/build/chart_line.min.js.map [new file with mode: 0644]
lib/amd/build/chart_output.min.js
lib/amd/build/chart_output.min.js.map [new file with mode: 0644]
lib/amd/build/chart_output_base.min.js
lib/amd/build/chart_output_base.min.js.map [new file with mode: 0644]
lib/amd/build/chart_output_chartjs.min.js
lib/amd/build/chart_output_chartjs.min.js.map [new file with mode: 0644]
lib/amd/build/chart_output_htmltable.min.js
lib/amd/build/chart_output_htmltable.min.js.map [new file with mode: 0644]
lib/amd/build/chart_pie.min.js
lib/amd/build/chart_pie.min.js.map [new file with mode: 0644]
lib/amd/build/chart_series.min.js
lib/amd/build/chart_series.min.js.map [new file with mode: 0644]
lib/amd/build/chartjs-lazy.min.js
lib/amd/build/chartjs-lazy.min.js.map [new file with mode: 0644]
lib/amd/build/chartjs.min.js
lib/amd/build/chartjs.min.js.map [new file with mode: 0644]
lib/amd/build/checkbox-toggleall.min.js
lib/amd/build/checkbox-toggleall.min.js.map [new file with mode: 0644]
lib/amd/build/config.min.js
lib/amd/build/config.min.js.map [new file with mode: 0644]
lib/amd/build/custom_interaction_events.min.js
lib/amd/build/custom_interaction_events.min.js.map [new file with mode: 0644]
lib/amd/build/dragdrop.min.js
lib/amd/build/dragdrop.min.js.map [new file with mode: 0644]
lib/amd/build/event.min.js
lib/amd/build/event.min.js.map [new file with mode: 0644]
lib/amd/build/first.min.js
lib/amd/build/first.min.js.map [new file with mode: 0644]
lib/amd/build/form-autocomplete.min.js
lib/amd/build/form-autocomplete.min.js.map [new file with mode: 0644]
lib/amd/build/form-cohort-selector.min.js
lib/amd/build/form-cohort-selector.min.js.map [new file with mode: 0644]
lib/amd/build/form-course-selector.min.js
lib/amd/build/form-course-selector.min.js.map [new file with mode: 0644]
lib/amd/build/fragment.min.js
lib/amd/build/fragment.min.js.map [new file with mode: 0644]
lib/amd/build/icon_system.min.js
lib/amd/build/icon_system.min.js.map [new file with mode: 0644]
lib/amd/build/icon_system_fontawesome.min.js
lib/amd/build/icon_system_fontawesome.min.js.map [new file with mode: 0644]
lib/amd/build/icon_system_standard.min.js
lib/amd/build/icon_system_standard.min.js.map [new file with mode: 0644]
lib/amd/build/inplace_editable.min.js
lib/amd/build/inplace_editable.min.js.map [new file with mode: 0644]
lib/amd/build/key_codes.min.js
lib/amd/build/key_codes.min.js.map [new file with mode: 0644]
lib/amd/build/loadingicon.min.js
lib/amd/build/loadingicon.min.js.map [new file with mode: 0644]
lib/amd/build/localstorage.min.js
lib/amd/build/localstorage.min.js.map [new file with mode: 0644]
lib/amd/build/log.min.js
lib/amd/build/log.min.js.map [new file with mode: 0644]
lib/amd/build/loglevel.min.js
lib/amd/build/loglevel.min.js.map [new file with mode: 0644]
lib/amd/build/modal.min.js
lib/amd/build/modal.min.js.map [new file with mode: 0644]
lib/amd/build/modal_backdrop.min.js
lib/amd/build/modal_backdrop.min.js.map [new file with mode: 0644]
lib/amd/build/modal_cancel.min.js
lib/amd/build/modal_cancel.min.js.map [new file with mode: 0644]
lib/amd/build/modal_events.min.js
lib/amd/build/modal_events.min.js.map [new file with mode: 0644]
lib/amd/build/modal_factory.min.js
lib/amd/build/modal_factory.min.js.map [new file with mode: 0644]
lib/amd/build/modal_registry.min.js
lib/amd/build/modal_registry.min.js.map [new file with mode: 0644]
lib/amd/build/modal_save_cancel.min.js
lib/amd/build/modal_save_cancel.min.js.map [new file with mode: 0644]
lib/amd/build/mustache.min.js
lib/amd/build/mustache.min.js.map [new file with mode: 0644]
lib/amd/build/network.min.js
lib/amd/build/network.min.js.map [new file with mode: 0644]
lib/amd/build/notification.min.js
lib/amd/build/notification.min.js.map [new file with mode: 0644]
lib/amd/build/page_global.min.js
lib/amd/build/page_global.min.js.map [new file with mode: 0644]
lib/amd/build/paged_content.min.js
lib/amd/build/paged_content.min.js.map [new file with mode: 0644]
lib/amd/build/paged_content_events.min.js
lib/amd/build/paged_content_events.min.js.map [new file with mode: 0644]
lib/amd/build/paged_content_factory.min.js
lib/amd/build/paged_content_factory.min.js.map [new file with mode: 0644]
lib/amd/build/paged_content_pages.min.js
lib/amd/build/paged_content_pages.min.js.map [new file with mode: 0644]
lib/amd/build/paged_content_paging_bar.min.js
lib/amd/build/paged_content_paging_bar.min.js.map [new file with mode: 0644]
lib/amd/build/paged_content_paging_bar_limit_selector.min.js
lib/amd/build/paged_content_paging_bar_limit_selector.min.js.map [new file with mode: 0644]
lib/amd/build/paged_content_paging_dropdown.min.js
lib/amd/build/paged_content_paging_dropdown.min.js.map [new file with mode: 0644]
lib/amd/build/pending.min.js
lib/amd/build/pending.min.js.map [new file with mode: 0644]
lib/amd/build/permissionmanager.min.js
lib/amd/build/permissionmanager.min.js.map [new file with mode: 0644]
lib/amd/build/popover_region_controller.min.js
lib/amd/build/popover_region_controller.min.js.map [new file with mode: 0644]
lib/amd/build/popper.min.js
lib/amd/build/popper.min.js.map [new file with mode: 0644]
lib/amd/build/pubsub.min.js
lib/amd/build/pubsub.min.js.map [new file with mode: 0644]
lib/amd/build/search-input.min.js
lib/amd/build/search-input.min.js.map [new file with mode: 0644]
lib/amd/build/sessionstorage.min.js
lib/amd/build/sessionstorage.min.js.map [new file with mode: 0644]
lib/amd/build/showhidesettings.min.js
lib/amd/build/showhidesettings.min.js.map [new file with mode: 0644]
lib/amd/build/sortable_list.min.js
lib/amd/build/sortable_list.min.js.map [new file with mode: 0644]
lib/amd/build/storagewrapper.min.js
lib/amd/build/storagewrapper.min.js.map [new file with mode: 0644]
lib/amd/build/str.min.js
lib/amd/build/str.min.js.map [new file with mode: 0644]
lib/amd/build/tag.min.js
lib/amd/build/tag.min.js.map [new file with mode: 0644]
lib/amd/build/templates.min.js
lib/amd/build/templates.min.js.map [new file with mode: 0644]
lib/amd/build/tooltip.min.js
lib/amd/build/tooltip.min.js.map [new file with mode: 0644]
lib/amd/build/tree.min.js
lib/amd/build/tree.min.js.map [new file with mode: 0644]
lib/amd/build/truncate.min.js
lib/amd/build/truncate.min.js.map [new file with mode: 0644]
lib/amd/build/url.min.js
lib/amd/build/url.min.js.map [new file with mode: 0644]
lib/amd/build/user_date.min.js
lib/amd/build/user_date.min.js.map [new file with mode: 0644]
lib/amd/build/yui.min.js
lib/amd/build/yui.min.js.map [new file with mode: 0644]
lib/amd/src/str.js
lib/amd/src/truncate.js
lib/babel-polyfill/polyfill.js [new file with mode: 0644]
lib/babel-polyfill/polyfill.min.js [new file with mode: 0644]
lib/babel-polyfill/readme_moodle.txt [new file with mode: 0644]
lib/classes/requirejs.php
lib/form/amd/build/defaultcustom.min.js
lib/form/amd/build/defaultcustom.min.js.map [new file with mode: 0644]
lib/form/amd/build/filetypes.min.js
lib/form/amd/build/filetypes.min.js.map [new file with mode: 0644]
lib/form/amd/build/passwordunmask.min.js
lib/form/amd/build/passwordunmask.min.js.map [new file with mode: 0644]
lib/form/amd/build/showadvanced.min.js
lib/form/amd/build/showadvanced.min.js.map [new file with mode: 0644]
lib/jssourcemap.php [new file with mode: 0644]
lib/outputrequirementslib.php
lib/requirejs.php
lib/thirdpartylibs.xml
media/player/videojs/amd/build/Youtube-lazy.min.js
media/player/videojs/amd/build/Youtube-lazy.min.js.map [new file with mode: 0644]
media/player/videojs/amd/build/loader.min.js
media/player/videojs/amd/build/loader.min.js.map [new file with mode: 0644]
media/player/videojs/amd/build/video-lazy.min.js
media/player/videojs/amd/build/video-lazy.min.js.map [new file with mode: 0644]
media/player/videojs/amd/build/videojs-flash-lazy.min.js
media/player/videojs/amd/build/videojs-flash-lazy.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer.min.js
message/amd/build/message_drawer.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_events.min.js
message/amd/build/message_drawer_events.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_helper.min.js
message/amd/build/message_drawer_helper.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_lazy_load_list.min.js
message/amd/build/message_drawer_lazy_load_list.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_router.min.js
message/amd/build/message_drawer_router.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_routes.min.js
message/amd/build/message_drawer_routes.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_contact.min.js
message/amd/build/message_drawer_view_contact.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_contacts.min.js
message/amd/build/message_drawer_view_contacts.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_contacts_section_contacts.min.js
message/amd/build/message_drawer_view_contacts_section_contacts.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_contacts_section_requests.min.js
message/amd/build/message_drawer_view_contacts_section_requests.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_conversation.min.js
message/amd/build/message_drawer_view_conversation.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_conversation_constants.min.js
message/amd/build/message_drawer_view_conversation_constants.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_conversation_patcher.min.js
message/amd/build/message_drawer_view_conversation_patcher.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_conversation_renderer.min.js
message/amd/build/message_drawer_view_conversation_renderer.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_conversation_state_manager.min.js
message/amd/build/message_drawer_view_conversation_state_manager.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_group_info.min.js
message/amd/build/message_drawer_view_group_info.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_overview.min.js
message/amd/build/message_drawer_view_overview.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_overview_section.min.js
message/amd/build/message_drawer_view_overview_section.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_search.min.js
message/amd/build/message_drawer_view_search.min.js.map [new file with mode: 0644]
message/amd/build/message_drawer_view_settings.min.js
message/amd/build/message_drawer_view_settings.min.js.map [new file with mode: 0644]
message/amd/build/message_notification_preference.min.js
message/amd/build/message_notification_preference.min.js.map [new file with mode: 0644]
message/amd/build/message_popover.min.js
message/amd/build/message_popover.min.js.map [new file with mode: 0644]
message/amd/build/message_repository.min.js
message/amd/build/message_repository.min.js.map [new file with mode: 0644]
message/amd/build/message_user_button.min.js
message/amd/build/message_user_button.min.js.map [new file with mode: 0644]
message/amd/build/notification_preference.min.js
message/amd/build/notification_preference.min.js.map [new file with mode: 0644]
message/amd/build/notification_processor.min.js
message/amd/build/notification_processor.min.js.map [new file with mode: 0644]
message/amd/build/notification_processor_settings.min.js
message/amd/build/notification_processor_settings.min.js.map [new file with mode: 0644]
message/amd/build/preferences_notifications_list_controller.min.js
message/amd/build/preferences_notifications_list_controller.min.js.map [new file with mode: 0644]
message/amd/build/preferences_processor_form.min.js
message/amd/build/preferences_processor_form.min.js.map [new file with mode: 0644]
message/amd/build/toggle_contact_button.min.js
message/amd/build/toggle_contact_button.min.js.map [new file with mode: 0644]
message/output/popup/amd/build/notification_area_content_area.min.js
message/output/popup/amd/build/notification_area_content_area.min.js.map [new file with mode: 0644]
message/output/popup/amd/build/notification_area_control_area.min.js
message/output/popup/amd/build/notification_area_control_area.min.js.map [new file with mode: 0644]
message/output/popup/amd/build/notification_area_events.min.js
message/output/popup/amd/build/notification_area_events.min.js.map [new file with mode: 0644]
message/output/popup/amd/build/notification_popover_controller.min.js
message/output/popup/amd/build/notification_popover_controller.min.js.map [new file with mode: 0644]
message/output/popup/amd/build/notification_repository.min.js
message/output/popup/amd/build/notification_repository.min.js.map [new file with mode: 0644]
mod/assign/amd/build/grading_actions.min.js
mod/assign/amd/build/grading_actions.min.js.map [new file with mode: 0644]
mod/assign/amd/build/grading_events.min.js
mod/assign/amd/build/grading_events.min.js.map [new file with mode: 0644]
mod/assign/amd/build/grading_form_change_checker.min.js
mod/assign/amd/build/grading_form_change_checker.min.js.map [new file with mode: 0644]
mod/assign/amd/build/grading_navigation.min.js
mod/assign/amd/build/grading_navigation.min.js.map [new file with mode: 0644]
mod/assign/amd/build/grading_navigation_user_info.min.js
mod/assign/amd/build/grading_navigation_user_info.min.js.map [new file with mode: 0644]
mod/assign/amd/build/grading_panel.min.js
mod/assign/amd/build/grading_panel.min.js.map [new file with mode: 0644]
mod/assign/amd/build/grading_review_panel.min.js
mod/assign/amd/build/grading_review_panel.min.js.map [new file with mode: 0644]
mod/assign/amd/build/participant_selector.min.js
mod/assign/amd/build/participant_selector.min.js.map [new file with mode: 0644]
mod/feedback/amd/build/edit.min.js
mod/feedback/amd/build/edit.min.js.map [new file with mode: 0644]
mod/forum/amd/build/discussion.min.js
mod/forum/amd/build/discussion.min.js.map [new file with mode: 0644]
mod/forum/amd/build/discussion_list.min.js
mod/forum/amd/build/discussion_list.min.js.map [new file with mode: 0644]
mod/forum/amd/build/favourite_toggle.min.js
mod/forum/amd/build/favourite_toggle.min.js.map [new file with mode: 0644]
mod/forum/amd/build/inpage_reply.min.js
mod/forum/amd/build/inpage_reply.min.js.map [new file with mode: 0644]
mod/forum/amd/build/lock_toggle.min.js
mod/forum/amd/build/lock_toggle.min.js.map [new file with mode: 0644]
mod/forum/amd/build/pin_toggle.min.js
mod/forum/amd/build/pin_toggle.min.js.map [new file with mode: 0644]
mod/forum/amd/build/posts_list.min.js
mod/forum/amd/build/posts_list.min.js.map [new file with mode: 0644]
mod/forum/amd/build/repository.min.js
mod/forum/amd/build/repository.min.js.map [new file with mode: 0644]
mod/forum/amd/build/selectors.min.js
mod/forum/amd/build/selectors.min.js.map [new file with mode: 0644]
mod/forum/amd/build/subscription_toggle.min.js
mod/forum/amd/build/subscription_toggle.min.js.map [new file with mode: 0644]
mod/lti/amd/build/cartridge_registration_form.min.js
mod/lti/amd/build/cartridge_registration_form.min.js.map [new file with mode: 0644]
mod/lti/amd/build/contentitem.min.js
mod/lti/amd/build/contentitem.min.js.map [new file with mode: 0644]
mod/lti/amd/build/contentitem_return.min.js
mod/lti/amd/build/contentitem_return.min.js.map [new file with mode: 0644]
mod/lti/amd/build/events.min.js
mod/lti/amd/build/events.min.js.map [new file with mode: 0644]
mod/lti/amd/build/external_registration.min.js
mod/lti/amd/build/external_registration.min.js.map [new file with mode: 0644]
mod/lti/amd/build/external_registration_return.min.js
mod/lti/amd/build/external_registration_return.min.js.map [new file with mode: 0644]
mod/lti/amd/build/form-field.min.js
mod/lti/amd/build/form-field.min.js.map [new file with mode: 0644]
mod/lti/amd/build/keys.min.js
mod/lti/amd/build/keys.min.js.map [new file with mode: 0644]
mod/lti/amd/build/tool_card_controller.min.js
mod/lti/amd/build/tool_card_controller.min.js.map [new file with mode: 0644]
mod/lti/amd/build/tool_configure_controller.min.js
mod/lti/amd/build/tool_configure_controller.min.js.map [new file with mode: 0644]
mod/lti/amd/build/tool_proxy.min.js
mod/lti/amd/build/tool_proxy.min.js.map [new file with mode: 0644]
mod/lti/amd/build/tool_proxy_card_controller.min.js
mod/lti/amd/build/tool_proxy_card_controller.min.js.map [new file with mode: 0644]
mod/lti/amd/build/tool_type.min.js
mod/lti/amd/build/tool_type.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/add_question_modal_launcher.min.js
mod/quiz/amd/build/add_question_modal_launcher.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/add_random_form.min.js
mod/quiz/amd/build/add_random_form.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/add_random_question.min.js
mod/quiz/amd/build/add_random_question.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/modal_add_random_question.min.js
mod/quiz/amd/build/modal_add_random_question.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/modal_quiz_question_bank.min.js
mod/quiz/amd/build/modal_quiz_question_bank.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/preflightcheck.min.js
mod/quiz/amd/build/preflightcheck.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/quizquestionbank.min.js
mod/quiz/amd/build/quizquestionbank.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/random_question_form_preview.min.js
mod/quiz/amd/build/random_question_form_preview.min.js.map [new file with mode: 0644]
mod/quiz/amd/build/repaginate.min.js
mod/quiz/amd/build/repaginate.min.js.map [new file with mode: 0644]
mod/survey/amd/build/validation.min.js
mod/survey/amd/build/validation.min.js.map [new file with mode: 0644]
mod/workshop/amd/build/modform.min.js
mod/workshop/amd/build/modform.min.js.map [new file with mode: 0644]
mod/workshop/amd/build/workshopview.min.js
mod/workshop/amd/build/workshopview.min.js.map [new file with mode: 0644]
npm-shrinkwrap.json
package.json
question/amd/build/edit_tags.min.js
question/amd/build/edit_tags.min.js.map [new file with mode: 0644]
question/amd/build/qbankmanager.min.js
question/amd/build/qbankmanager.min.js.map [new file with mode: 0644]
question/amd/build/repository.min.js
question/amd/build/repository.min.js.map [new file with mode: 0644]
question/amd/build/selectors.min.js
question/amd/build/selectors.min.js.map [new file with mode: 0644]
question/type/ddimageortext/amd/build/form.min.js
question/type/ddimageortext/amd/build/form.min.js.map [new file with mode: 0644]
question/type/ddimageortext/amd/build/question.min.js
question/type/ddimageortext/amd/build/question.min.js.map [new file with mode: 0644]
question/type/ddmarker/amd/build/form.min.js
question/type/ddmarker/amd/build/form.min.js.map [new file with mode: 0644]
question/type/ddmarker/amd/build/question.min.js
question/type/ddmarker/amd/build/question.min.js.map [new file with mode: 0644]
question/type/ddmarker/amd/build/shapes.min.js
question/type/ddmarker/amd/build/shapes.min.js.map [new file with mode: 0644]
question/type/ddwtos/amd/build/ddwtos.min.js
question/type/ddwtos/amd/build/ddwtos.min.js.map [new file with mode: 0644]
question/type/multichoice/amd/build/clearchoice.min.js
question/type/multichoice/amd/build/clearchoice.min.js.map [new file with mode: 0644]
report/competency/amd/build/grading_popup.min.js
report/competency/amd/build/grading_popup.min.js.map [new file with mode: 0644]
report/competency/amd/build/user_course_navigation.min.js
report/competency/amd/build/user_course_navigation.min.js.map [new file with mode: 0644]
report/insights/amd/build/actions.min.js
report/insights/amd/build/actions.min.js.map [new file with mode: 0644]
report/progress/amd/build/completion_override.min.js
report/progress/amd/build/completion_override.min.js.map [new file with mode: 0644]
search/amd/build/form-search-user-selector.min.js
search/amd/build/form-search-user-selector.min.js.map [new file with mode: 0644]
theme/boost/amd/build/alert.min.js
theme/boost/amd/build/alert.min.js.map [new file with mode: 0644]
theme/boost/amd/build/aria.min.js
theme/boost/amd/build/aria.min.js.map [new file with mode: 0644]
theme/boost/amd/build/button.min.js
theme/boost/amd/build/button.min.js.map [new file with mode: 0644]
theme/boost/amd/build/carousel.min.js
theme/boost/amd/build/carousel.min.js.map [new file with mode: 0644]
theme/boost/amd/build/collapse.min.js
theme/boost/amd/build/collapse.min.js.map [new file with mode: 0644]
theme/boost/amd/build/drawer.min.js
theme/boost/amd/build/drawer.min.js.map [new file with mode: 0644]
theme/boost/amd/build/dropdown.min.js
theme/boost/amd/build/dropdown.min.js.map [new file with mode: 0644]
theme/boost/amd/build/form-display-errors.min.js
theme/boost/amd/build/form-display-errors.min.js.map [new file with mode: 0644]
theme/boost/amd/build/loader.min.js
theme/boost/amd/build/loader.min.js.map [new file with mode: 0644]
theme/boost/amd/build/modal.min.js
theme/boost/amd/build/modal.min.js.map [new file with mode: 0644]
theme/boost/amd/build/pending.min.js
theme/boost/amd/build/pending.min.js.map [new file with mode: 0644]
theme/boost/amd/build/popover.min.js
theme/boost/amd/build/popover.min.js.map [new file with mode: 0644]
theme/boost/amd/build/scrollspy.min.js
theme/boost/amd/build/scrollspy.min.js.map [new file with mode: 0644]
theme/boost/amd/build/tab.min.js
theme/boost/amd/build/tab.min.js.map [new file with mode: 0644]
theme/boost/amd/build/tether.min.js
theme/boost/amd/build/tether.min.js.map [new file with mode: 0644]
theme/boost/amd/build/tooltip.min.js
theme/boost/amd/build/tooltip.min.js.map [new file with mode: 0644]
theme/boost/amd/build/util.min.js
theme/boost/amd/build/util.min.js.map [new file with mode: 0644]
user/amd/build/participants.min.js
user/amd/build/participants.min.js.map [new file with mode: 0644]
user/amd/build/status_field.min.js
user/amd/build/status_field.min.js.map [new file with mode: 0644]
user/amd/build/unified_filter.min.js
user/amd/build/unified_filter.min.js.map [new file with mode: 0644]
user/amd/build/unified_filter_datasource.min.js
user/amd/build/unified_filter_datasource.min.js.map [new file with mode: 0644]

index bb36d0c..e645472 100644 (file)
@@ -4,7 +4,6 @@
 node_modules/
 vendor/
 admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
-admin/tool/usertours/amd/src/tour.js
 auth/cas/CAS/
 cache/stores/mongodb/MongoDB/
 enrol/lti/ims-blti/
@@ -61,6 +60,7 @@ lib/validateurlsyntax.php
 lib/amd/src/popper.js
 lib/geopattern-php/
 lib/php-jwt/
+lib/babel-polyfill/
 media/player/videojs/amd/src/video-lazy.js
 media/player/videojs/amd/src/Youtube-lazy.js
 media/player/videojs/videojs/
index 961467d..8020549 100644 (file)
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,5 +1,6 @@
 {
   'plugins': [
+    'babel',
     'promise',
   ],
   'env': {
     },
     {
       files: ["**/amd/src/*.js"],
+      // We support es6 now. Woot!
+      env: {
+        es6: true
+      },
+      // We're using babel transpiling so use their parser
+      // for linting.
+      parser: 'babel-eslint',
       // Check AMD with some slightly stricter rules.
       rules: {
         'no-unused-vars': 'error',
-        'no-implicit-globals': 'error'
+        'no-implicit-globals': 'error',
+        // Disable all of the rules that have babel versions.
+        'new-cap': 'off',
+        // Not using this rule for the time being because it isn't
+        // compatible with jQuery and ES6.
+        'no-invalid-this': 'off',
+        'object-curly-spacing': 'off',
+        'quotes': 'off',
+        'semi': 'off',
+        'no-unused-expressions': 'off',
+        // Enable all of the babel version of these rules.
+        'babel/new-cap': ['warn', { 'properties': false }],
+        // Not using this rule for the time being because it isn't
+        // compatible with jQuery and ES6.
+        'babel/no-invalid-this': 'off',
+        'babel/object-curly-spacing': 'warn',
+        // This is off in the original style int.
+        'babel/quotes': 'off',
+        'babel/semi': 'error',
+        'babel/no-unused-expressions': 'error',
+        // === Promises ===
+        // We have Promise now that we're using ES6.
+        'promise/no-native': 'off',
+        'promise/avoid-new': 'off'
+      },
+      parserOptions: {
+        'ecmaVersion': 9,
+        'sourceType': 'module'
       }
     }
   ]
index adf95b6..e0b754e 100644 (file)
@@ -5,7 +5,6 @@ theme/classic/style/moodle.css
 node_modules/
 vendor/
 admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
-admin/tool/usertours/amd/src/tour.js
 auth/cas/CAS/
 cache/stores/mongodb/MongoDB/
 enrol/lti/ims-blti/
@@ -62,6 +61,7 @@ lib/validateurlsyntax.php
 lib/amd/src/popper.js
 lib/geopattern-php/
 lib/php-jwt/
+lib/babel-polyfill/
 media/player/videojs/amd/src/video-lazy.js
 media/player/videojs/amd/src/Youtube-lazy.js
 media/player/videojs/videojs/
index 85e3abe..765a5a2 100644 (file)
@@ -31,7 +31,10 @@ module.exports = function(grunt) {
         async = require('async'),
         DOMParser = require('xmldom').DOMParser,
         xpath = require('xpath'),
-        semver = require('semver');
+        semver = require('semver'),
+        watchman = require('fb-watchman'),
+        watchmanClient = new watchman.Client(),
+        gruntFilePath = process.cwd();
 
     // Verify the node version is new enough.
     var expected = semver.validRange(grunt.file.readJSON('package.json').engines.node);
@@ -52,6 +55,12 @@ module.exports = function(grunt) {
         }
     }
 
+    var files = null;
+    if (grunt.option('files')) {
+        // Accept a comma separated list of files to process.
+        files = grunt.option('files').split(',');
+    }
+
     var inAMD = path.basename(cwd) == 'amd';
 
     // Globbing pattern for matching all AMD JS source files.
@@ -67,10 +76,9 @@ module.exports = function(grunt) {
      * @param {String} srcPath the  matched src path
      * @return {String} The rewritten destination path.
      */
-    var uglifyRename = function(destPath, srcPath) {
+    var babelRename = function(destPath, srcPath) {
         destPath = srcPath.replace('src', 'build');
         destPath = destPath.replace('.js', '.min.js');
-        destPath = path.resolve(cwd, destPath);
         return destPath;
     };
 
@@ -112,18 +120,57 @@ module.exports = function(grunt) {
             // Even though warnings dont stop the build we don't display warnings by default because
             // at this moment we've got too many core warnings.
             options: {quiet: !grunt.option('show-lint-warnings')},
-            amd: {src: amdSrc},
+            amd: {src: files ? files : amdSrc},
             // Check YUI module source files.
-            yui: {src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js']}
+            yui: {src: files ? files : ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js']}
         },
-        uglify: {
-            amd: {
+        babel: {
+            options: {
+                sourceMaps: true,
+                comments: false,
+                plugins: [
+                    'transform-es2015-modules-amd-lazy',
+                    // This plugin modifies the Babel transpiling for "export default"
+                    // so that if it's used then only the exported value is returned
+                    // by the generated AMD module.
+                    //
+                    // It also adds the Moodle plugin name to the AMD module definition
+                    // so that it can be imported as expected in other modules.
+                    path.resolve('babel-plugin-add-module-to-define.js'),
+                    '@babel/plugin-syntax-dynamic-import',
+                    '@babel/plugin-syntax-import-meta',
+                    ['@babel/plugin-proposal-class-properties', {'loose': false}],
+                    '@babel/plugin-proposal-json-strings'
+                ],
+                presets: [
+                    ['minify', {
+                        // This minification plugin needs to be disabled because it breaks the
+                        // source map generation and causes invalid source maps to be output.
+                        simplify: false,
+                        builtIns: false
+                    }],
+                    ['@babel/preset-env', {
+                        targets: {
+                            browsers: [
+                                ">0.25%",
+                                "last 2 versions",
+                                "not ie <= 10",
+                                "not op_mini all",
+                                "not Opera > 0",
+                                "not dead"
+                            ]
+                        },
+                        modules: false,
+                        useBuiltIns: false
+                    }]
+                ]
+            },
+            dist: {
                 files: [{
                     expand: true,
-                    src: amdSrc,
-                    rename: uglifyRename
-                }],
-                options: {report: 'none'}
+                    src: files ? files : amdSrc,
+                    rename: babelRename
+                }]
             }
         },
         sass: {
@@ -145,6 +192,14 @@ module.exports = function(grunt) {
                 files: ['**/amd/src/**/*.js'],
                 tasks: ['amd']
             },
+            boost: {
+                files: ['**/theme/boost/scss/**/*.scss'],
+                tasks: ['scss']
+            },
+            rawcss: {
+                files: ['**/*.css', '**/theme/**/!(moodle.css|editor.css)'],
+                tasks: ['rawcss']
+            },
             yui: {
                 files: ['**/yui/src/**/*.js'],
                 tasks: ['yui']
@@ -157,21 +212,21 @@ module.exports = function(grunt) {
         shifter: {
             options: {
                 recursive: true,
-                paths: [cwd]
+                paths: files ? files : [cwd]
             }
         },
         gherkinlint: {
             options: {
-                files: ['**/tests/behat/*.feature'],
+                files: files ? files : ['**/tests/behat/*.feature'],
             }
         },
         stylelint: {
             scss: {
                 options: {syntax: 'scss'},
-                src: ['*/**/*.scss']
+                src: files ? files : ['*/**/*.scss']
             },
             css: {
-                src: ['*/**/*.css'],
+                src: files ? files : ['*/**/*.css'],
                 options: {
                     configOverrides: {
                         rules: {
@@ -322,23 +377,231 @@ module.exports = function(grunt) {
         }
     };
 
+    /**
+     * This is a wrapper task to handle the grunt watch command. It attempts to use
+     * Watchman to monitor for file changes, if it's installed, because it's much faster.
+     *
+     * If Watchman isn't installed then it falls back to the grunt-contrib-watch file
+     * watcher for backwards compatibility.
+     */
+    tasks.watch = function() {
+        var watchTaskDone = this.async();
+        var watchInitialised = false;
+        var watchTaskQueue = {};
+        var processingQueue = false;
+
+        // Grab the tasks and files that have been queued up and execute them.
+        var processWatchTaskQueue = function() {
+            if (!Object.keys(watchTaskQueue).length || processingQueue) {
+                // If there is nothing in the queue or we're already processing then wait.
+                return;
+            }
+
+            processingQueue = true;
+
+            // Grab all tasks currently in the queue.
+            var queueToProcess = watchTaskQueue;
+            // Reset the queue.
+            watchTaskQueue = {};
+
+            async.forEachSeries(
+                Object.keys(queueToProcess),
+                function(task, next) {
+                    var files = queueToProcess[task];
+                    var filesOption = '--files=' + files.join(',');
+                    grunt.log.ok('Running task ' + task + ' for files ' + filesOption);
+
+                    // Spawn the task in a child process so that it doesn't kill this one
+                    // if it failed.
+                    grunt.util.spawn(
+                        {
+                            // Spawn with the grunt bin.
+                            grunt: true,
+                            // Run from current working dir and inherit stdio from process.
+                            opts: {
+                                cwd: cwd,
+                                stdio: 'inherit'
+                            },
+                            args: [task, filesOption]
+                        },
+                        function(err, res, code) {
+                            if (code !== 0) {
+                                // The grunt task failed.
+                                grunt.log.error(err);
+                            }
+
+                            // Move on to the next task.
+                            next();
+                        }
+                    );
+                },
+                function() {
+                    // No longer processing.
+                    processingQueue = false;
+                    // Once all of the tasks are done then recurse just in case more tasks
+                    // were queued while we were processing.
+                    processWatchTaskQueue();
+                }
+            );
+        };
+
+        var watchConfig = grunt.config.get(['watch']);
+        watchConfig = Object.keys(watchConfig).reduce(function(carry, key) {
+            if (key == 'options') {
+                return carry;
+            }
+
+            var value = watchConfig[key];
+            var fileGlobs = value.files;
+            var taskNames = value.tasks;
+
+            taskNames.forEach(function(taskName) {
+                carry[taskName] = fileGlobs;
+            });
+
+            return carry;
+        }, {});
+
+        watchmanClient.on('error', function(error) {
+            // We have to add an error handler here and parse the error string because the
+            // example way from the docs to check if Watchman is installed doesn't actually work!!
+            // See: https://github.com/facebook/watchman/issues/509
+            if (error.message.match('Watchman was not found')) {
+                // If watchman isn't installed then we should fallback to the other watch task.
+                grunt.log.ok('It is recommended that you install Watchman for better performance using the "watch" command.');
+
+                // Fallback to the old grunt-contrib-watch task.
+                grunt.renameTask('watch-grunt', 'watch');
+                grunt.task.run(['watch']);
+                // This task is finished.
+                watchTaskDone(0);
+            } else {
+                grunt.log.error(error);
+                // Fatal error.
+                watchTaskDone(1);
+            }
+        });
+
+        watchmanClient.on('subscription', function(resp) {
+            if (resp.subscription !== 'grunt-watch') {
+                return;
+            }
+
+            resp.files.forEach(function(file) {
+                grunt.log.ok('File changed: ' + file.name);
+
+                var fullPath = cwd + '/' + file.name;
+                Object.keys(watchConfig).forEach(function(task) {
+                    var fileGlobs = watchConfig[task];
+                    var match = fileGlobs.every(function(fileGlob) {
+                        return grunt.file.isMatch(fileGlob, fullPath);
+                    });
+                    if (match) {
+                        // If we are watching a subdirectory then the file.name will be relative
+                        // to that directory. However the grunt tasks  expect the file paths to be
+                        // relative to the Gruntfile.js location so let's normalise them before
+                        // adding them to the queue.
+                        var relativePath = fullPath.replace(gruntFilePath + '/', '');
+                        if (task in watchTaskQueue) {
+                            if (!watchTaskQueue[task].includes(relativePath)) {
+                                watchTaskQueue[task] = watchTaskQueue[task].concat(relativePath);
+                            }
+                        } else {
+                            watchTaskQueue[task] = [relativePath];
+                        }
+                    }
+                });
+            });
+
+            processWatchTaskQueue();
+        });
+
+        process.on('SIGINT', function() {
+            // Let the user know that they may need to manually stop the Watchman daemon if they
+            // no longer want it running.
+            if (watchInitialised) {
+                grunt.log.ok('The Watchman daemon may still be running and may need to be stopped manually.');
+            }
+
+            process.exit();
+        });
+
+        // Initiate the watch on the current directory.
+        watchmanClient.command(['watch-project', cwd], function(watchError, watchResponse) {
+            if (watchError) {
+                grunt.log.error('Error initiating watch:', watchError);
+                watchTaskDone(1);
+                return;
+            }
+
+            if ('warning' in watchResponse) {
+                grunt.log.error('warning: ', watchResponse.warning);
+            }
+
+            var watch = watchResponse.watch;
+            var relativePath = watchResponse.relative_path;
+            watchInitialised = true;
+
+            watchmanClient.command(['clock', watch], function(clockError, clockResponse) {
+                if (clockError) {
+                    grunt.log.error('Failed to query clock:', clockError);
+                    watchTaskDone(1);
+                    return;
+                }
+
+                // Use the matching patterns specified in the watch config.
+                var matches = Object.keys(watchConfig).map(function(task) {
+                    var fileGlobs = watchConfig[task];
+                    var fileGlobMatches = fileGlobs.map(function(fileGlob) {
+                        return ['match', fileGlob, 'wholename'];
+                    });
+
+                    return ['allof'].concat(fileGlobMatches);
+                });
+
+                var sub = {
+                    expression: ["anyof"].concat(matches),
+                    // Which fields we're interested in.
+                    fields: ["name", "size", "type"],
+                    // Add our time constraint.
+                    since: clockResponse.clock
+                };
+
+                if (relativePath) {
+                    sub.relative_root = relativePath;
+                }
+
+                watchmanClient.command(['subscribe', watch, 'grunt-watch', sub], function(subscribeError) {
+                    if (subscribeError) {
+                        // Probably an error in the subscription criteria.
+                        grunt.log.error('failed to subscribe: ', subscribeError);
+                        watchTaskDone(1);
+                        return;
+                    }
+
+                    grunt.log.ok('Listening for changes to files in ' + cwd);
+                });
+            });
+        });
+    };
+
     // On watch, we dynamically modify config to build only affected files. This
     // method is slightly complicated to deal with multiple changed files at once (copied
     // from the grunt-contrib-watch readme).
     var changedFiles = Object.create(null);
     var onChange = grunt.util._.debounce(function() {
-          var files = Object.keys(changedFiles);
-          grunt.config('eslint.amd.src', files);
-          grunt.config('eslint.yui.src', files);
-          grunt.config('uglify.amd.files', [{expand: true, src: files, rename: uglifyRename}]);
-          grunt.config('shifter.options.paths', files);
-          grunt.config('gherkinlint.options.files', files);
-          changedFiles = Object.create(null);
+        var files = Object.keys(changedFiles);
+        grunt.config('eslint.amd.src', files);
+        grunt.config('eslint.yui.src', files);
+        grunt.config('shifter.options.paths', files);
+        grunt.config('gherkinlint.options.files', files);
+        grunt.config('babel.dist.files', [{expand: true, src: files, rename: babelRename}]);
+        changedFiles = Object.create(null);
     }, 200);
 
     grunt.event.on('watch', function(action, filepath) {
-          changedFiles[filepath] = action;
-          onChange();
+        changedFiles[filepath] = action;
+        onChange();
     });
 
     // Register NPM tasks.
@@ -347,17 +610,24 @@ module.exports = function(grunt) {
     grunt.loadNpmTasks('grunt-sass');
     grunt.loadNpmTasks('grunt-eslint');
     grunt.loadNpmTasks('grunt-stylelint');
+    grunt.loadNpmTasks('grunt-babel');
+
+    // Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
+    grunt.renameTask('watch', 'watch-grunt');
 
     // Register JS tasks.
     grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
     grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', tasks.gherkinlint);
     grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles);
+    grunt.registerTask('watch', 'Run tasks on file changes', tasks.watch);
     grunt.registerTask('yui', ['eslint:yui', 'shifter']);
-    grunt.registerTask('amd', ['eslint:amd', 'uglify']);
+    grunt.registerTask('amd', ['eslint:amd', 'babel']);
     grunt.registerTask('js', ['amd', 'yui']);
 
     // Register CSS taks.
     grunt.registerTask('css', ['stylelint:scss', 'sass', 'stylelint:css']);
+    grunt.registerTask('scss', ['stylelint:scss', 'sass']);
+    grunt.registerTask('rawcss', ['stylelint:css']);
 
     // Register the startup task.
     grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup);
index c2715aa..9b48cc9 100644 (file)
Binary files a/admin/tool/analytics/amd/build/log_info.min.js and b/admin/tool/analytics/amd/build/log_info.min.js differ
diff --git a/admin/tool/analytics/amd/build/log_info.min.js.map b/admin/tool/analytics/amd/build/log_info.min.js.map
new file mode 100644 (file)
index 0000000..643ee19
Binary files /dev/null and b/admin/tool/analytics/amd/build/log_info.min.js.map differ
index 15a5501..9cdfe5e 100644 (file)
Binary files a/admin/tool/analytics/amd/build/model.min.js and b/admin/tool/analytics/amd/build/model.min.js differ
diff --git a/admin/tool/analytics/amd/build/model.min.js.map b/admin/tool/analytics/amd/build/model.min.js.map
new file mode 100644 (file)
index 0000000..fab51a0
Binary files /dev/null and b/admin/tool/analytics/amd/build/model.min.js.map differ
index 92cd4ee..52f6aeb 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/add_category.min.js and b/admin/tool/dataprivacy/amd/build/add_category.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/add_category.min.js.map b/admin/tool/dataprivacy/amd/build/add_category.min.js.map
new file mode 100644 (file)
index 0000000..718f655
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/add_category.min.js.map differ
index dec27cc..d3bcb8b 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/add_purpose.min.js and b/admin/tool/dataprivacy/amd/build/add_purpose.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/add_purpose.min.js.map b/admin/tool/dataprivacy/amd/build/add_purpose.min.js.map
new file mode 100644 (file)
index 0000000..aabef23
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/add_purpose.min.js.map differ
index cac33a4..0b47fca 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/categoriesactions.min.js and b/admin/tool/dataprivacy/amd/build/categoriesactions.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/categoriesactions.min.js.map b/admin/tool/dataprivacy/amd/build/categoriesactions.min.js.map
new file mode 100644 (file)
index 0000000..b88fd11
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/categoriesactions.min.js.map differ
index 5aa1e48..88f9f42 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/data_deletion.min.js and b/admin/tool/dataprivacy/amd/build/data_deletion.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/data_deletion.min.js.map b/admin/tool/dataprivacy/amd/build/data_deletion.min.js.map
new file mode 100644 (file)
index 0000000..6933bcc
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/data_deletion.min.js.map differ
index f2964fe..85868ed 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/data_registry.min.js and b/admin/tool/dataprivacy/amd/build/data_registry.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/data_registry.min.js.map b/admin/tool/dataprivacy/amd/build/data_registry.min.js.map
new file mode 100644 (file)
index 0000000..eb4269a
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/data_registry.min.js.map differ
index e8b22a2..2027d44 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/data_request_modal.min.js and b/admin/tool/dataprivacy/amd/build/data_request_modal.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/data_request_modal.min.js.map b/admin/tool/dataprivacy/amd/build/data_request_modal.min.js.map
new file mode 100644 (file)
index 0000000..ee4933a
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/data_request_modal.min.js.map differ
index b8f0bc3..fa8e7fc 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/defaultsactions.min.js and b/admin/tool/dataprivacy/amd/build/defaultsactions.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/defaultsactions.min.js.map b/admin/tool/dataprivacy/amd/build/defaultsactions.min.js.map
new file mode 100644 (file)
index 0000000..73b2824
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/defaultsactions.min.js.map differ
index 1fba508..b7bd5b7 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js and b/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js.map b/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js.map
new file mode 100644 (file)
index 0000000..0452cf7
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js.map differ
index 6c94ab3..acae406 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/events.min.js and b/admin/tool/dataprivacy/amd/build/events.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/events.min.js.map b/admin/tool/dataprivacy/amd/build/events.min.js.map
new file mode 100644 (file)
index 0000000..262b82f
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/events.min.js.map differ
index 3419d58..ac0d11f 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/expand_contract.min.js and b/admin/tool/dataprivacy/amd/build/expand_contract.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/expand_contract.min.js.map b/admin/tool/dataprivacy/amd/build/expand_contract.min.js.map
new file mode 100644 (file)
index 0000000..9ee561c
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/expand_contract.min.js.map differ
index faa073f..72a0c40 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/form-user-selector.min.js and b/admin/tool/dataprivacy/amd/build/form-user-selector.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/form-user-selector.min.js.map b/admin/tool/dataprivacy/amd/build/form-user-selector.min.js.map
new file mode 100644 (file)
index 0000000..9050ecd
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/form-user-selector.min.js.map differ
index 937367c..f510cd2 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/myrequestactions.min.js and b/admin/tool/dataprivacy/amd/build/myrequestactions.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/myrequestactions.min.js.map b/admin/tool/dataprivacy/amd/build/myrequestactions.min.js.map
new file mode 100644 (file)
index 0000000..6d17dee
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/myrequestactions.min.js.map differ
index 33b773c..765e5ef 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/purposesactions.min.js and b/admin/tool/dataprivacy/amd/build/purposesactions.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/purposesactions.min.js.map b/admin/tool/dataprivacy/amd/build/purposesactions.min.js.map
new file mode 100644 (file)
index 0000000..3762f30
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/purposesactions.min.js.map differ
index 61344eb..ed60834 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/request_filter.min.js and b/admin/tool/dataprivacy/amd/build/request_filter.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/request_filter.min.js.map b/admin/tool/dataprivacy/amd/build/request_filter.min.js.map
new file mode 100644 (file)
index 0000000..0bb55f0
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/request_filter.min.js.map differ
index 2260ee3..3c081e8 100644 (file)
Binary files a/admin/tool/dataprivacy/amd/build/requestactions.min.js and b/admin/tool/dataprivacy/amd/build/requestactions.min.js differ
diff --git a/admin/tool/dataprivacy/amd/build/requestactions.min.js.map b/admin/tool/dataprivacy/amd/build/requestactions.min.js.map
new file mode 100644 (file)
index 0000000..4f39d13
Binary files /dev/null and b/admin/tool/dataprivacy/amd/build/requestactions.min.js.map differ
index 0d03dea..b082d80 100644 (file)
Binary files a/admin/tool/lp/amd/build/actionselector.min.js and b/admin/tool/lp/amd/build/actionselector.min.js differ
diff --git a/admin/tool/lp/amd/build/actionselector.min.js.map b/admin/tool/lp/amd/build/actionselector.min.js.map
new file mode 100644 (file)
index 0000000..4309e71
Binary files /dev/null and b/admin/tool/lp/amd/build/actionselector.min.js.map differ
index 6d24fd8..fd8cb9c 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencies.min.js and b/admin/tool/lp/amd/build/competencies.min.js differ
diff --git a/admin/tool/lp/amd/build/competencies.min.js.map b/admin/tool/lp/amd/build/competencies.min.js.map
new file mode 100644 (file)
index 0000000..aa66f0b
Binary files /dev/null and b/admin/tool/lp/amd/build/competencies.min.js.map differ
index 2da1745..ae3938f 100644 (file)
Binary files a/admin/tool/lp/amd/build/competency_outcomes.min.js and b/admin/tool/lp/amd/build/competency_outcomes.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_outcomes.min.js.map b/admin/tool/lp/amd/build/competency_outcomes.min.js.map
new file mode 100644 (file)
index 0000000..9d51fae
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_outcomes.min.js.map differ
index 1862243..fbf44da 100644 (file)
Binary files a/admin/tool/lp/amd/build/competency_plan_navigation.min.js and b/admin/tool/lp/amd/build/competency_plan_navigation.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_plan_navigation.min.js.map b/admin/tool/lp/amd/build/competency_plan_navigation.min.js.map
new file mode 100644 (file)
index 0000000..bb2bb21
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_plan_navigation.min.js.map differ
index 8939576..1315e57 100644 (file)
Binary files a/admin/tool/lp/amd/build/competency_rule.min.js and b/admin/tool/lp/amd/build/competency_rule.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_rule.min.js.map b/admin/tool/lp/amd/build/competency_rule.min.js.map
new file mode 100644 (file)
index 0000000..a3f79cf
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_rule.min.js.map differ
index d95f6a0..c396c7f 100644 (file)
Binary files a/admin/tool/lp/amd/build/competency_rule_all.min.js and b/admin/tool/lp/amd/build/competency_rule_all.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_rule_all.min.js.map b/admin/tool/lp/amd/build/competency_rule_all.min.js.map
new file mode 100644 (file)
index 0000000..ec8e34c
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_rule_all.min.js.map differ
index 4afbdab..1a03420 100644 (file)
Binary files a/admin/tool/lp/amd/build/competency_rule_points.min.js and b/admin/tool/lp/amd/build/competency_rule_points.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_rule_points.min.js.map b/admin/tool/lp/amd/build/competency_rule_points.min.js.map
new file mode 100644 (file)
index 0000000..b75176e
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_rule_points.min.js.map differ
index 993a3ef..5314ff2 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencyactions.min.js and b/admin/tool/lp/amd/build/competencyactions.min.js differ
diff --git a/admin/tool/lp/amd/build/competencyactions.min.js.map b/admin/tool/lp/amd/build/competencyactions.min.js.map
new file mode 100644 (file)
index 0000000..baafad8
Binary files /dev/null and b/admin/tool/lp/amd/build/competencyactions.min.js.map differ
index 2ef99e4..53a0e33 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencydialogue.min.js and b/admin/tool/lp/amd/build/competencydialogue.min.js differ
diff --git a/admin/tool/lp/amd/build/competencydialogue.min.js.map b/admin/tool/lp/amd/build/competencydialogue.min.js.map
new file mode 100644 (file)
index 0000000..0b54b11
Binary files /dev/null and b/admin/tool/lp/amd/build/competencydialogue.min.js.map differ
index e32b080..e9f3dff 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencypicker.min.js and b/admin/tool/lp/amd/build/competencypicker.min.js differ
diff --git a/admin/tool/lp/amd/build/competencypicker.min.js.map b/admin/tool/lp/amd/build/competencypicker.min.js.map
new file mode 100644 (file)
index 0000000..822d4ea
Binary files /dev/null and b/admin/tool/lp/amd/build/competencypicker.min.js.map differ
index fd3bf2d..460dd5c 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencypicker_user_plans.min.js and b/admin/tool/lp/amd/build/competencypicker_user_plans.min.js differ
diff --git a/admin/tool/lp/amd/build/competencypicker_user_plans.min.js.map b/admin/tool/lp/amd/build/competencypicker_user_plans.min.js.map
new file mode 100644 (file)
index 0000000..ba55e4a
Binary files /dev/null and b/admin/tool/lp/amd/build/competencypicker_user_plans.min.js.map differ
index db877a5..d52ffcb 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencyruleconfig.min.js and b/admin/tool/lp/amd/build/competencyruleconfig.min.js differ
diff --git a/admin/tool/lp/amd/build/competencyruleconfig.min.js.map b/admin/tool/lp/amd/build/competencyruleconfig.min.js.map
new file mode 100644 (file)
index 0000000..7136347
Binary files /dev/null and b/admin/tool/lp/amd/build/competencyruleconfig.min.js.map differ
index 3c19f04..305c88a 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencytree.min.js and b/admin/tool/lp/amd/build/competencytree.min.js differ
diff --git a/admin/tool/lp/amd/build/competencytree.min.js.map b/admin/tool/lp/amd/build/competencytree.min.js.map
new file mode 100644 (file)
index 0000000..d579d0b
Binary files /dev/null and b/admin/tool/lp/amd/build/competencytree.min.js.map differ
index fe53dc6..dce39b1 100644 (file)
Binary files a/admin/tool/lp/amd/build/course_competency_settings.min.js and b/admin/tool/lp/amd/build/course_competency_settings.min.js differ
diff --git a/admin/tool/lp/amd/build/course_competency_settings.min.js.map b/admin/tool/lp/amd/build/course_competency_settings.min.js.map
new file mode 100644 (file)
index 0000000..329c557
Binary files /dev/null and b/admin/tool/lp/amd/build/course_competency_settings.min.js.map differ
index 7538d6a..b2f77e0 100644 (file)
Binary files a/admin/tool/lp/amd/build/dialogue.min.js and b/admin/tool/lp/amd/build/dialogue.min.js differ
diff --git a/admin/tool/lp/amd/build/dialogue.min.js.map b/admin/tool/lp/amd/build/dialogue.min.js.map
new file mode 100644 (file)
index 0000000..7045a6f
Binary files /dev/null and b/admin/tool/lp/amd/build/dialogue.min.js.map differ
index 48751b5..d83b1c6 100644 (file)
Binary files a/admin/tool/lp/amd/build/dragdrop-reorder.min.js and b/admin/tool/lp/amd/build/dragdrop-reorder.min.js differ
diff --git a/admin/tool/lp/amd/build/dragdrop-reorder.min.js.map b/admin/tool/lp/amd/build/dragdrop-reorder.min.js.map
new file mode 100644 (file)
index 0000000..dd6b103
Binary files /dev/null and b/admin/tool/lp/amd/build/dragdrop-reorder.min.js.map differ
index c9e4818..bd20aa1 100644 (file)
Binary files a/admin/tool/lp/amd/build/event_base.min.js and b/admin/tool/lp/amd/build/event_base.min.js differ
diff --git a/admin/tool/lp/amd/build/event_base.min.js.map b/admin/tool/lp/amd/build/event_base.min.js.map
new file mode 100644 (file)
index 0000000..2ca46e0
Binary files /dev/null and b/admin/tool/lp/amd/build/event_base.min.js.map differ
index aebb3f1..d74b0d9 100644 (file)
Binary files a/admin/tool/lp/amd/build/evidence_delete.min.js and b/admin/tool/lp/amd/build/evidence_delete.min.js differ
diff --git a/admin/tool/lp/amd/build/evidence_delete.min.js.map b/admin/tool/lp/amd/build/evidence_delete.min.js.map
new file mode 100644 (file)
index 0000000..4a11ed2
Binary files /dev/null and b/admin/tool/lp/amd/build/evidence_delete.min.js.map differ
index fd26ffb..5a7a014 100644 (file)
Binary files a/admin/tool/lp/amd/build/form-cohort-selector.min.js and b/admin/tool/lp/amd/build/form-cohort-selector.min.js differ
diff --git a/admin/tool/lp/amd/build/form-cohort-selector.min.js.map b/admin/tool/lp/amd/build/form-cohort-selector.min.js.map
new file mode 100644 (file)
index 0000000..a280743
Binary files /dev/null and b/admin/tool/lp/amd/build/form-cohort-selector.min.js.map differ
index febb8d4..0870d75 100644 (file)
Binary files a/admin/tool/lp/amd/build/form-user-selector.min.js and b/admin/tool/lp/amd/build/form-user-selector.min.js differ
diff --git a/admin/tool/lp/amd/build/form-user-selector.min.js.map b/admin/tool/lp/amd/build/form-user-selector.min.js.map
new file mode 100644 (file)
index 0000000..ea192dd
Binary files /dev/null and b/admin/tool/lp/amd/build/form-user-selector.min.js.map differ
index 20679d9..c3937f2 100644 (file)
Binary files a/admin/tool/lp/amd/build/form_competency_element.min.js and b/admin/tool/lp/amd/build/form_competency_element.min.js differ
diff --git a/admin/tool/lp/amd/build/form_competency_element.min.js.map b/admin/tool/lp/amd/build/form_competency_element.min.js.map
new file mode 100644 (file)
index 0000000..7661707
Binary files /dev/null and b/admin/tool/lp/amd/build/form_competency_element.min.js.map differ
index 32c694d..523461f 100644 (file)
Binary files a/admin/tool/lp/amd/build/frameworkactions.min.js and b/admin/tool/lp/amd/build/frameworkactions.min.js differ
diff --git a/admin/tool/lp/amd/build/frameworkactions.min.js.map b/admin/tool/lp/amd/build/frameworkactions.min.js.map
new file mode 100644 (file)
index 0000000..eab5c15
Binary files /dev/null and b/admin/tool/lp/amd/build/frameworkactions.min.js.map differ
index 9f2ec48..7e4abb6 100644 (file)
Binary files a/admin/tool/lp/amd/build/frameworks_datasource.min.js and b/admin/tool/lp/amd/build/frameworks_datasource.min.js differ
diff --git a/admin/tool/lp/amd/build/frameworks_datasource.min.js.map b/admin/tool/lp/amd/build/frameworks_datasource.min.js.map
new file mode 100644 (file)
index 0000000..96501a3
Binary files /dev/null and b/admin/tool/lp/amd/build/frameworks_datasource.min.js.map differ
index 6bfa3df..9c0ecbd 100644 (file)
Binary files a/admin/tool/lp/amd/build/grade_dialogue.min.js and b/admin/tool/lp/amd/build/grade_dialogue.min.js differ
diff --git a/admin/tool/lp/amd/build/grade_dialogue.min.js.map b/admin/tool/lp/amd/build/grade_dialogue.min.js.map
new file mode 100644 (file)
index 0000000..6f0202f
Binary files /dev/null and b/admin/tool/lp/amd/build/grade_dialogue.min.js.map differ
index 6ea9624..4d52c20 100644 (file)
Binary files a/admin/tool/lp/amd/build/grade_user_competency_inline.min.js and b/admin/tool/lp/amd/build/grade_user_competency_inline.min.js differ
diff --git a/admin/tool/lp/amd/build/grade_user_competency_inline.min.js.map b/admin/tool/lp/amd/build/grade_user_competency_inline.min.js.map
new file mode 100644 (file)
index 0000000..4459d47
Binary files /dev/null and b/admin/tool/lp/amd/build/grade_user_competency_inline.min.js.map differ
index 627c7b7..b00dbac 100644 (file)
Binary files a/admin/tool/lp/amd/build/menubar.min.js and b/admin/tool/lp/amd/build/menubar.min.js differ
diff --git a/admin/tool/lp/amd/build/menubar.min.js.map b/admin/tool/lp/amd/build/menubar.min.js.map
new file mode 100644 (file)
index 0000000..209a5c7
Binary files /dev/null and b/admin/tool/lp/amd/build/menubar.min.js.map differ
index db9d241..917da94 100644 (file)
Binary files a/admin/tool/lp/amd/build/module_navigation.min.js and b/admin/tool/lp/amd/build/module_navigation.min.js differ
diff --git a/admin/tool/lp/amd/build/module_navigation.min.js.map b/admin/tool/lp/amd/build/module_navigation.min.js.map
new file mode 100644 (file)
index 0000000..000ae63
Binary files /dev/null and b/admin/tool/lp/amd/build/module_navigation.min.js.map differ
index 4212884..87e8535 100644 (file)
Binary files a/admin/tool/lp/amd/build/parentcompetency_form.min.js and b/admin/tool/lp/amd/build/parentcompetency_form.min.js differ
diff --git a/admin/tool/lp/amd/build/parentcompetency_form.min.js.map b/admin/tool/lp/amd/build/parentcompetency_form.min.js.map
new file mode 100644 (file)
index 0000000..7939dd2
Binary files /dev/null and b/admin/tool/lp/amd/build/parentcompetency_form.min.js.map differ
index 8390ffa..4edcfa0 100644 (file)
Binary files a/admin/tool/lp/amd/build/planactions.min.js and b/admin/tool/lp/amd/build/planactions.min.js differ
diff --git a/admin/tool/lp/amd/build/planactions.min.js.map b/admin/tool/lp/amd/build/planactions.min.js.map
new file mode 100644 (file)
index 0000000..5fcba7c
Binary files /dev/null and b/admin/tool/lp/amd/build/planactions.min.js.map differ
index 4c5b700..3e275c2 100644 (file)
Binary files a/admin/tool/lp/amd/build/scaleconfig.min.js and b/admin/tool/lp/amd/build/scaleconfig.min.js differ
diff --git a/admin/tool/lp/amd/build/scaleconfig.min.js.map b/admin/tool/lp/amd/build/scaleconfig.min.js.map
new file mode 100644 (file)
index 0000000..e5cae05
Binary files /dev/null and b/admin/tool/lp/amd/build/scaleconfig.min.js.map differ
index 53c3286..637c17f 100644 (file)
Binary files a/admin/tool/lp/amd/build/scalevalues.min.js and b/admin/tool/lp/amd/build/scalevalues.min.js differ
diff --git a/admin/tool/lp/amd/build/scalevalues.min.js.map b/admin/tool/lp/amd/build/scalevalues.min.js.map
new file mode 100644 (file)
index 0000000..687f331
Binary files /dev/null and b/admin/tool/lp/amd/build/scalevalues.min.js.map differ
index 02fd09b..e57f961 100644 (file)
Binary files a/admin/tool/lp/amd/build/templateactions.min.js and b/admin/tool/lp/amd/build/templateactions.min.js differ
diff --git a/admin/tool/lp/amd/build/templateactions.min.js.map b/admin/tool/lp/amd/build/templateactions.min.js.map
new file mode 100644 (file)
index 0000000..e44ab4f
Binary files /dev/null and b/admin/tool/lp/amd/build/templateactions.min.js.map differ
index 2113400..a5a4ecd 100644 (file)
Binary files a/admin/tool/lp/amd/build/tree.min.js and b/admin/tool/lp/amd/build/tree.min.js differ
diff --git a/admin/tool/lp/amd/build/tree.min.js.map b/admin/tool/lp/amd/build/tree.min.js.map
new file mode 100644 (file)
index 0000000..0d9d004
Binary files /dev/null and b/admin/tool/lp/amd/build/tree.min.js.map differ
index 674172f..6bf2849 100644 (file)
Binary files a/admin/tool/lp/amd/build/user_competency_course_navigation.min.js and b/admin/tool/lp/amd/build/user_competency_course_navigation.min.js differ
diff --git a/admin/tool/lp/amd/build/user_competency_course_navigation.min.js.map b/admin/tool/lp/amd/build/user_competency_course_navigation.min.js.map
new file mode 100644 (file)
index 0000000..2ad4133
Binary files /dev/null and b/admin/tool/lp/amd/build/user_competency_course_navigation.min.js.map differ
index edd32c2..c4a3f72 100644 (file)
Binary files a/admin/tool/lp/amd/build/user_competency_info.min.js and b/admin/tool/lp/amd/build/user_competency_info.min.js differ
diff --git a/admin/tool/lp/amd/build/user_competency_info.min.js.map b/admin/tool/lp/amd/build/user_competency_info.min.js.map
new file mode 100644 (file)
index 0000000..af6f8b4
Binary files /dev/null and b/admin/tool/lp/amd/build/user_competency_info.min.js.map differ
index 755a664..cda67b4 100644 (file)
Binary files a/admin/tool/lp/amd/build/user_competency_plan_popup.min.js and b/admin/tool/lp/amd/build/user_competency_plan_popup.min.js differ
diff --git a/admin/tool/lp/amd/build/user_competency_plan_popup.min.js.map b/admin/tool/lp/amd/build/user_competency_plan_popup.min.js.map
new file mode 100644 (file)
index 0000000..88d6b17
Binary files /dev/null and b/admin/tool/lp/amd/build/user_competency_plan_popup.min.js.map differ
index deab0e1..b975a28 100644 (file)
Binary files a/admin/tool/lp/amd/build/user_competency_workflow.min.js and b/admin/tool/lp/amd/build/user_competency_workflow.min.js differ
diff --git a/admin/tool/lp/amd/build/user_competency_workflow.min.js.map b/admin/tool/lp/amd/build/user_competency_workflow.min.js.map
new file mode 100644 (file)
index 0000000..afc0a4c
Binary files /dev/null and b/admin/tool/lp/amd/build/user_competency_workflow.min.js.map differ
index f8b28d7..d8c7b8e 100644 (file)
Binary files a/admin/tool/lp/amd/build/user_evidence_actions.min.js and b/admin/tool/lp/amd/build/user_evidence_actions.min.js differ
diff --git a/admin/tool/lp/amd/build/user_evidence_actions.min.js.map b/admin/tool/lp/amd/build/user_evidence_actions.min.js.map
new file mode 100644 (file)
index 0000000..47d584c
Binary files /dev/null and b/admin/tool/lp/amd/build/user_evidence_actions.min.js.map differ
index 793e5af..0cb2282 100644 (file)
Binary files a/admin/tool/policy/amd/build/acceptances_filter.min.js and b/admin/tool/policy/amd/build/acceptances_filter.min.js differ
diff --git a/admin/tool/policy/amd/build/acceptances_filter.min.js.map b/admin/tool/policy/amd/build/acceptances_filter.min.js.map
new file mode 100644 (file)
index 0000000..85eb1b0
Binary files /dev/null and b/admin/tool/policy/amd/build/acceptances_filter.min.js.map differ
index 567ed4a..b255da7 100644 (file)
Binary files a/admin/tool/policy/amd/build/acceptances_filter_datasource.min.js and b/admin/tool/policy/amd/build/acceptances_filter_datasource.min.js differ
diff --git a/admin/tool/policy/amd/build/acceptances_filter_datasource.min.js.map b/admin/tool/policy/amd/build/acceptances_filter_datasource.min.js.map
new file mode 100644 (file)
index 0000000..723fef3
Binary files /dev/null and b/admin/tool/policy/amd/build/acceptances_filter_datasource.min.js.map differ
index cdd3496..0caa34f 100644 (file)
Binary files a/admin/tool/policy/amd/build/acceptmodal.min.js and b/admin/tool/policy/amd/build/acceptmodal.min.js differ
diff --git a/admin/tool/policy/amd/build/acceptmodal.min.js.map b/admin/tool/policy/amd/build/acceptmodal.min.js.map
new file mode 100644 (file)
index 0000000..705150e
Binary files /dev/null and b/admin/tool/policy/amd/build/acceptmodal.min.js.map differ
index 1ed6d8b..22045d5 100644 (file)
Binary files a/admin/tool/policy/amd/build/jquery-eu-cookie-law-popup.min.js and b/admin/tool/policy/amd/build/jquery-eu-cookie-law-popup.min.js differ
diff --git a/admin/tool/policy/amd/build/jquery-eu-cookie-law-popup.min.js.map b/admin/tool/policy/amd/build/jquery-eu-cookie-law-popup.min.js.map
new file mode 100644 (file)
index 0000000..c676cc1
Binary files /dev/null and b/admin/tool/policy/amd/build/jquery-eu-cookie-law-popup.min.js.map differ
index 5c351dc..e5a1692 100644 (file)
Binary files a/admin/tool/policy/amd/build/managedocsactions.min.js and b/admin/tool/policy/amd/build/managedocsactions.min.js differ
diff --git a/admin/tool/policy/amd/build/managedocsactions.min.js.map b/admin/tool/policy/amd/build/managedocsactions.min.js.map
new file mode 100644 (file)
index 0000000..171cecc
Binary files /dev/null and b/admin/tool/policy/amd/build/managedocsactions.min.js.map differ
index 2e54773..d9d40af 100644 (file)
Binary files a/admin/tool/policy/amd/build/policyactions.min.js and b/admin/tool/policy/amd/build/policyactions.min.js differ
diff --git a/admin/tool/policy/amd/build/policyactions.min.js.map b/admin/tool/policy/amd/build/policyactions.min.js.map
new file mode 100644 (file)
index 0000000..fe3a635
Binary files /dev/null and b/admin/tool/policy/amd/build/policyactions.min.js.map differ
index 0c75544..76ec813 100644 (file)
Binary files a/admin/tool/templatelibrary/amd/build/display.min.js and b/admin/tool/templatelibrary/amd/build/display.min.js differ
diff --git a/admin/tool/templatelibrary/amd/build/display.min.js.map b/admin/tool/templatelibrary/amd/build/display.min.js.map
new file mode 100644 (file)
index 0000000..183fe03
Binary files /dev/null and b/admin/tool/templatelibrary/amd/build/display.min.js.map differ
index 01f2d04..ea1aac5 100644 (file)
Binary files a/admin/tool/templatelibrary/amd/build/search.min.js and b/admin/tool/templatelibrary/amd/build/search.min.js differ
diff --git a/admin/tool/templatelibrary/amd/build/search.min.js.map b/admin/tool/templatelibrary/amd/build/search.min.js.map
new file mode 100644 (file)
index 0000000..1611c7e
Binary files /dev/null and b/admin/tool/templatelibrary/amd/build/search.min.js.map differ
index 3771835..e585d63 100644 (file)
Binary files a/admin/tool/usertours/amd/build/managesteps.min.js and b/admin/tool/usertours/amd/build/managesteps.min.js differ
diff --git a/admin/tool/usertours/amd/build/managesteps.min.js.map b/admin/tool/usertours/amd/build/managesteps.min.js.map
new file mode 100644 (file)
index 0000000..84e5f29
Binary files /dev/null and b/admin/tool/usertours/amd/build/managesteps.min.js.map differ
index 75c7d1b..a1bd2e1 100644 (file)
Binary files a/admin/tool/usertours/amd/build/managetours.min.js and b/admin/tool/usertours/amd/build/managetours.min.js differ
diff --git a/admin/tool/usertours/amd/build/managetours.min.js.map b/admin/tool/usertours/amd/build/managetours.min.js.map
new file mode 100644 (file)
index 0000000..6fa4688
Binary files /dev/null and b/admin/tool/usertours/amd/build/managetours.min.js.map differ
index 7b9e567..dcf72ce 100644 (file)
Binary files a/admin/tool/usertours/amd/build/tour.min.js and b/admin/tool/usertours/amd/build/tour.min.js differ
diff --git a/admin/tool/usertours/amd/build/tour.min.js.map b/admin/tool/usertours/amd/build/tour.min.js.map
new file mode 100644 (file)
index 0000000..9ebad30
Binary files /dev/null and b/admin/tool/usertours/amd/build/tour.min.js.map differ
index 3caa790..6895e75 100644 (file)
Binary files a/admin/tool/usertours/amd/build/usertours.min.js and b/admin/tool/usertours/amd/build/usertours.min.js differ
diff --git a/admin/tool/usertours/amd/build/usertours.min.js.map b/admin/tool/usertours/amd/build/usertours.min.js.map
new file mode 100644 (file)
index 0000000..ebfcda0
Binary files /dev/null and b/admin/tool/usertours/amd/build/usertours.min.js.map differ
diff --git a/admin/tool/usertours/amd/readme_moodle.txt b/admin/tool/usertours/amd/readme_moodle.txt
deleted file mode 100644 (file)
index 1fb69a3..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Description of External library imports into Moodle
-
-Flexitour Instructions
-----------------------
-1. Clone https://github.com/andrewnicols/flexitour into an unrelated directory
-2. Copy /build/tour.js to amd/src/tour.js
-3. Open the amd/src/tour.js file and find the AMD module define.
-4. Change the "popper" inclusion to "core/popper"
-5. Update thirdpartylibs.xml
-6. Run `grunt amd`
index 65e48a7..0f9ad94 100644 (file)
-// jshint ignore: start
-(function (root, factory) {
-  if (typeof define === 'function' && define.amd) {
-    // AMD. Register as an anonymous module unless amdModuleId is set
-    define(["jquery","core/popper"], function (a0,b1) {
-      return (root['Tour'] = factory(a0,b1));
-    });
-  } else if (typeof module === 'object' && module.exports) {
-    // Node. Does not work with strict CommonJS, but
-    // only CommonJS-like environments that support module.exports,
-    // like Node.
-    module.exports = factory(require("jquery"),require("popper.js"));
-  } else {
-    root['Tour'] = factory(root["$"],root["Popper"]);
-  }
-}(this, function ($, Popper) {
-
-"use strict";
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * A Tour.
- *
- * @class   Tour
- * @param   {object}    config  The configuration object.
- */
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
-function Tour(config) {
-    this.init(config);
-}
-
-/**
- * The name of the tour.
+ * Manage user tours in Moodle.
  *
- * @property    {String}    tourName
+ * @copyright  2018 Andrew Nicols <andrew@nicols.co.uk>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-Tour.prototype.tourName;
 
-/**
- * The name of the tour storage key.
- *
- * @property    {String}    storageKey
- */
-Tour.prototype.storageKey;
-
-/**
- * The session storage object
- *
- * @property    {Storage}   storage
- */
-Tour.prototype.storage;
+import $ from 'jquery';
+import Popper from 'core/popper';
 
 /**
- * The original configuration as passed into the constructor.
+ * A Tour.
  *
- * @property    {Object}    originalConfiguration
+ * @class Tour
  */
-Tour.prototype.originalConfiguration;
+export default class Tour {
+    /**
+     * @param   {object}    config  The configuration object.
+     */
+    constructor(config) {
+        this.init(config);
+    }
 
-/**
- * The list of step listeners.
- *
- * @property    {Array}     listeners
- */
-Tour.prototype.listeners;
+    /**
+     * Initialise the tour.
+     *
+     * @method  init
+     * @param   {Object}    config  The configuration object.
+     * @chainable
+     * @return {Object} this.
+     */
+    init(config) {
+        // Unset all handlers.
+        this.eventHandlers = {};
 
-/**
- * The list of event handlers.
- *
- * @property    {Object}    eventHandlers
- */
-Tour.prototype.eventHandlers;
+        // Reset the current tour states.
+        this.reset();
 
-/**
- * The list of steps.
- *
- * @property    {Object[]}      steps
- */
-Tour.prototype.steps;
+        // Store the initial configuration.
+        this.originalConfiguration = config || {};
 
-/**
- * The current step node.
- *
- * @property    {jQuery}        currentStepNode
- */
-Tour.prototype.currentStepNode;
+        // Apply configuration.
+        this.configure.apply(this, arguments);
 
-/**
- * The current step number.
- *
- * @property    {Number}        currentStepNumber
- */
-Tour.prototype.currentStepNumber;
+        try {
+            this.storage = window.sessionStorage;
+            this.storageKey = 'tourstate_' + this.tourName;
+        } catch (e) {
+            this.storage = false;
+            this.storageKey = '';
+        }
 
-/**
- * The popper for the current step.
- *
- * @property    {Popper}        currentStepPopper
- */
-Tour.prototype.currentStepPopper;
+        return this;
+    }
 
-/**
- * The config for the current step.
- *
- * @property    {Object}        currentStepConfig
- */
-Tour.prototype.currentStepConfig;
+    /**
+     * Reset the current tour state.
+     *
+     * @method  reset
+     * @chainable
+     * @return {Object} this.
+     */
+    reset() {
+        // Hide the current step.
+        this.hide();
 
-/**
- * The template content.
- *
- * @property    {String}        templateContent
- */
-Tour.prototype.templateContent;
+        // Unset all handlers.
+        this.eventHandlers = [];
 
-/**
- * Initialise the tour.
- *
- * @method  init
- * @param   {Object}    config  The configuration object.
- * @chainable
- */
-Tour.prototype.init = function (config) {
-    // Unset all handlers.
-    this.eventHandlers = {};
+        // Unset all listeners.
+        this.resetStepListeners();
 
-    // Reset the current tour states.
-    this.reset();
+        // Unset the original configuration.
+        this.originalConfiguration = {};
 
-    // Store the initial configuration.
-    this.originalConfiguration = config || {};
+        // Reset the current step number and list of steps.
+        this.steps = [];
 
-    // Apply configuration.
-    this.configure.apply(this, arguments);
+        // Reset the current step number.
+        this.currentStepNumber = 0;
 
-    try {
-        this.storage = window.sessionStorage;
-        this.storageKey = 'tourstate_' + this.tourName;
-    } catch (e) {
-        this.storage = false;
-        this.storageKey = '';
+        return this;
     }
 
-    return this;
-};
-
-/**
- * Reset the current tour state.
- *
- * @method  reset
- * @chainable
- */
-Tour.prototype.reset = function () {
-    // Hide the current step.
-    this.hide();
-
-    // Unset all handlers.
-    this.eventHandlers = [];
-
-    // Unset all listeners.
-    this.resetStepListeners();
-
-    // Unset the original configuration.
-    this.originalConfiguration = {};
-
-    // Reset the current step number and list of steps.
-    this.steps = [];
+    /**
+     * Prepare tour configuration.
+     *
+     * @method  configure
+     * @param {Object} config The configuration object.
+     * @chainable
+     * @return {Object} this.
+     */
+    configure(config) {
+        if (typeof config === 'object') {
+            // Tour name.
+            if (typeof config.tourName !== 'undefined') {
+                this.tourName = config.tourName;
+            }
 
-    // Reset the current step number.
-    this.currentStepNumber = 0;
+            // Set up eventHandlers.
+            if (config.eventHandlers) {
+                for (let eventName in config.eventHandlers) {
+                    config.eventHandlers[eventName].forEach(function(handler) {
+                        this.addEventHandler(eventName, handler);
+                    }, this);
+                }
+            }
 
-    return this;
-};
+            // Reset the step configuration.
+            this.resetStepDefaults(true);
 
-/**
- * Prepare tour configuration.
- *
- * @method  configure
- * @chainable
- */
-Tour.prototype.configure = function (config) {
-    var _this = this;
+            // Configure the steps.
+            if (typeof config.steps === 'object') {
+                this.steps = config.steps;
+            }
 
-    if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') {
-        // Tour name.
-        if (typeof config.tourName !== 'undefined') {
-            this.tourName = config.tourName;
+            if (typeof config.template !== 'undefined') {
+                this.templateContent = config.template;
+            }
         }
 
-        // Set up eventHandlers.
-        if (config.eventHandlers) {
-            (function () {
-                var eventName = void 0;
-                for (eventName in config.eventHandlers) {
-                    config.eventHandlers[eventName].forEach(function (handler) {
-                        this.addEventHandler(eventName, handler);
-                    }, _this);
-                }
-            })();
-        }
+        // Check that we have enough to start the tour.
+        this.checkMinimumRequirements();
 
-        // Reset the step configuration.
-        this.resetStepDefaults(true);
+        return this;
+    }
 
-        // Configure the steps.
-        if (_typeof(config.steps) === 'object') {
-            this.steps = config.steps;
+    /**
+     * Check that the configuration meets the minimum requirements.
+     *
+     * @method  checkMinimumRequirements
+     */
+    checkMinimumRequirements() {
+        // Need a tourName.
+        if (!this.tourName) {
+            throw new Error("Tour Name required");
         }
 
-        if (typeof config.template !== 'undefined') {
-            this.templateContent = config.template;
+        // Need a minimum of one step.
+        if (!this.steps || !this.steps.length) {
+            throw new Error("Steps must be specified");
         }
     }
 
-    // Check that we have enough to start the tour.
-    this.checkMinimumRequirements();
+    /**
+     * Reset step default configuration.
+     *
+     * @method  resetStepDefaults
+     * @param   {Boolean}   loadOriginalConfiguration   Whether to load the original configuration supplied with the Tour.
+     * @chainable
+     * @return {Object} this.
+     */
+    resetStepDefaults(loadOriginalConfiguration) {
+        if (typeof loadOriginalConfiguration === 'undefined') {
+            loadOriginalConfiguration = true;
+        }
 
-    return this;
-};
+        this.stepDefaults = {};
+        if (!loadOriginalConfiguration || typeof this.originalConfiguration.stepDefaults === 'undefined') {
+            this.setStepDefaults({});
+        } else {
+            this.setStepDefaults(this.originalConfiguration.stepDefaults);
+        }
 
-/**
- * Check that the configuration meets the minimum requirements.
- *
- * @method  checkMinimumRequirements
- * @chainable
- */
-Tour.prototype.checkMinimumRequirements = function () {
-    // Need a tourName.
-    if (!this.tourName) {
-        throw new Error("Tour Name required");
+        return this;
     }
 
-    // Need a minimum of one step.
-    if (!this.steps || !this.steps.length) {
-        throw new Error("Steps must be specified");
-    }
-};
+    /**
+     * Set the step defaults.
+     *
+     * @method  setStepDefaults
+     * @param   {Object}    stepDefaults                The step defaults to apply to all steps
+     * @chainable
+     * @return {Object} this.
+     */
+    setStepDefaults(stepDefaults) {
+        if (!this.stepDefaults) {
+            this.stepDefaults = {};
+        }
+        $.extend(
+            this.stepDefaults,
+            {
+                element:        '',
+                placement:      'top',
+                delay:          0,
+                moveOnClick:    false,
+                moveAfterTime:  0,
+                orphan:         false,
+                direction:      1,
+            },
+            stepDefaults
+        );
 
-/**
- * Reset step default configuration.
- *
- * @method  resetStepDefaults
- * @param   {Boolean}   loadOriginalConfiguration   Whether to load the original configuration supplied with the Tour.
- * @chainable
- */
-Tour.prototype.resetStepDefaults = function (loadOriginalConfiguration) {
-    if (typeof loadOriginalConfiguration === 'undefined') {
-        loadOriginalConfiguration = true;
+        return this;
     }
 
-    this.stepDefaults = {};
-    if (!loadOriginalConfiguration || typeof this.originalConfiguration.stepDefaults === 'undefined') {
-        this.setStepDefaults({});
-    } else {
-        this.setStepDefaults(this.originalConfiguration.stepDefaults);
+    /**
+     * Retrieve the current step number.
+     *
+     * @method  getCurrentStepNumber
+     * @return  {Integer}                   The current step number
+     */
+    getCurrentStepNumber() {
+        return parseInt(this.currentStepNumber, 10);
     }
 
-    return this;
-};
-
-/**
- * Set the step defaults.
- *
- * @method  setStepDefaults
- * @param   {Object}    stepDefaults                The step defaults to apply to all steps
- * @chainable
- */
-Tour.prototype.setStepDefaults = function (stepDefaults) {
-    if (!this.stepDefaults) {
-        this.stepDefaults = {};
+    /**
+     * Store the current step number.
+     *
+     * @method  setCurrentStepNumber
+     * @param   {Integer}   stepNumber      The current step number
+     * @chainable
+     */
+    setCurrentStepNumber(stepNumber) {
+        this.currentStepNumber = stepNumber;
+        if (this.storage) {
+            try {
+                this.storage.setItem(this.storageKey, stepNumber);
+            } catch (e) {
+                if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {
+                    this.storage.removeItem(this.storageKey);
+                }
+            }
+        }
     }
-    $.extend(this.stepDefaults, {
-        element: '',
-        placement: 'top',
-        delay: 0,
-        moveOnClick: false,
-        moveAfterTime: 0,
-        orphan: false,
-        direction: 1
-    }, stepDefaults);
-
-    return this;
-};
 
-/**
- * Retrieve the current step number.
- *
- * @method  getCurrentStepNumber
- * @return  {Integer}                   The current step number
- */
-Tour.prototype.getCurrentStepNumber = function () {
-    return parseInt(this.currentStepNumber, 10);
-};
+    /**
+     * Get the next step number after the currently displayed step.
+     *
+     * @method  getNextStepNumber
+     * @param   {Integer}   stepNumber      The current step number
+     * @return  {Integer}    The next step number to display
+     */
+    getNextStepNumber(stepNumber) {
+        if (typeof stepNumber === 'undefined') {
+            stepNumber = this.getCurrentStepNumber();
+        }
+        let nextStepNumber = stepNumber + 1;
 
-/**
- * Store the current step number.
- *
- * @method  setCurrentStepNumber
- * @param   {Integer}   stepNumber      The current step number
- * @chainable
- */
-Tour.prototype.setCurrentStepNumber = function (stepNumber) {
-    this.currentStepNumber = stepNumber;
-    if (this.storage) {
-        try {
-            this.storage.setItem(this.storageKey, stepNumber);
-        } catch (e) {
-            if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {
-                this.storage.removeItem(this.storageKey);
+        // Keep checking the remaining steps.
+        while (nextStepNumber <= this.steps.length) {
+            if (this.isStepPotentiallyVisible(this.getStepConfig(nextStepNumber))) {
+                return nextStepNumber;
             }
+            nextStepNumber++;
         }
-    }
-};
 
-/**
- * Get the next step number after the currently displayed step.
- *
- * @method  getNextStepNumber
- * @return  {Integer}    The next step number to display
- */
-Tour.prototype.getNextStepNumber = function (stepNumber) {
-    if (typeof stepNumber === 'undefined') {
-        stepNumber = this.getCurrentStepNumber();
+        return null;
     }
-    var nextStepNumber = stepNumber + 1;
 
-    // Keep checking the remaining steps.
-    while (nextStepNumber <= this.steps.length) {
-        if (this.isStepPotentiallyVisible(this.getStepConfig(nextStepNumber))) {
-            return nextStepNumber;
+    /**
+     * Get the previous step number before the currently displayed step.
+     *
+     * @method  getPreviousStepNumber
+     * @param   {Integer}   stepNumber      The current step number
+     * @return  {Integer}    The previous step number to display
+     */
+    getPreviousStepNumber(stepNumber) {
+        if (typeof stepNumber === 'undefined') {
+            stepNumber = this.getCurrentStepNumber();
         }
-        nextStepNumber++;
-    }
+        let previousStepNumber = stepNumber - 1;
 
-    return null;
-};
+        // Keep checking the remaining steps.
+        while (previousStepNumber >= 0) {
+            if (this.isStepPotentiallyVisible(this.getStepConfig(previousStepNumber))) {
+                return previousStepNumber;
+            }
+            previousStepNumber--;
+        }
 
-/**
- * Get the previous step number before the currently displayed step.
- *
- * @method  getPreviousStepNumber
- * @return  {Integer}    The previous step number to display
- */
-Tour.prototype.getPreviousStepNumber = function (stepNumber) {
-    if (typeof stepNumber === 'undefined') {
-        stepNumber = this.getCurrentStepNumber();
+        return null;
     }
-    var previousStepNumber = stepNumber - 1;
 
-    // Keep checking the remaining steps.
-    while (previousStepNumber >= 0) {
-        if (this.isStepPotentiallyVisible(this.getStepConfig(previousStepNumber))) {
-            return previousStepNumber;
-        }
-        previousStepNumber--;
+    /**
+     * Is the step the final step number?
+     *
+     * @method  isLastStep
+     * @param   {Integer}   stepNumber  Step number to test
+     * @return  {Boolean}               Whether the step is the final step
+     */
+    isLastStep(stepNumber) {
+        let nextStepNumber = this.getNextStepNumber(stepNumber);
+
+        return nextStepNumber === null;
     }
 
-    return null;
-};
+    /**
+     * Is the step the first step number?
+     *
+     * @method  isFirstStep
+     * @param   {Integer}   stepNumber  Step number to test
+     * @return  {Boolean}               Whether the step is the first step
+     */
+    isFirstStep(stepNumber) {
+        let previousStepNumber = this.getPreviousStepNumber(stepNumber);
+
+        return previousStepNumber === null;
+    }
 
-/**
- * Is the step the final step number?
- *
- * @method  isLastStep
- * @param   {Integer}   stepNumber  Step number to test
- * @return  {Boolean}               Whether the step is the final step
- */
-Tour.prototype.isLastStep = function (stepNumber) {
-    var nextStepNumber = this.getNextStepNumber(stepNumber);
+    /**
+     * Is this step potentially visible?
+     *
+     * @method  isStepPotentiallyVisible
+     * @param   {Object}    stepConfig      The step configuration to normalise
+     * @return  {Boolean}               Whether the step is the potentially visible
+     */
+    isStepPotentiallyVisible(stepConfig) {
+        if (!stepConfig) {
+            // Without step config, there can be no step.
+            return false;
+        }
 
-    return nextStepNumber === null;
-};
+        if (this.isStepActuallyVisible(stepConfig)) {
+            // If it is actually visible, it is already potentially visible.
+            return true;
+        }
 
-/**
- * Is the step the first step number?
- *
- * @method  isFirstStep
- * @param   {Integer}   stepNumber  Step number to test
- * @return  {Boolean}               Whether the step is the first step
- */
-Tour.prototype.isFirstStep = function (stepNumber) {
-    var previousStepNumber = this.getPreviousStepNumber(stepNumber);
+        if (typeof stepConfig.orphan !== 'undefined' && stepConfig.orphan) {
+            // Orphan steps have no target. They are always visible.
+            return true;
+        }
 
-    return previousStepNumber === null;
-};
+        if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay) {
+            // Only return true if the activated has not been used yet.
+            return true;
+        }
 
-/**
- * Is this step potentially visible?
- *
- * @method  isStepPotentiallyVisible
- * @param   {Integer}   stepNumber  Step number to test
- * @return  {Boolean}               Whether the step is the potentially visible
- */
-Tour.prototype.isStepPotentiallyVisible = function (stepConfig) {
-    if (!stepConfig) {
-        // Without step config, there can be no step.
+        // Not theoretically, or actually visible.
         return false;
     }
 
-    if (this.isStepActuallyVisible(stepConfig)) {
-        // If it is actually visible, it is already potentially visible.
-        return true;
-    }
-
-    if (typeof stepConfig.orphan !== 'undefined' && stepConfig.orphan) {
-        // Orphan steps have no target. They are always visible.
-        return true;
-    }
-
-    if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay) {
-        // Only return true if the activated has not been used yet.
-        return true;
-    }
+    /**
+     * Is this step actually visible?
+     *
+     * @method  isStepActuallyVisible
+     * @param   {Object}    stepConfig      The step configuration to normalise
+     * @return  {Boolean}               Whether the step is actually visible
+     */
+    isStepActuallyVisible(stepConfig) {
+        if (!stepConfig) {
+            // Without step config, there can be no step.
+            return false;
+        }
 
-    // Not theoretically, or actually visible.
-    return false;
-};
+        let target = this.getStepTarget(stepConfig);
+        if (target && target.length && target.is(':visible')) {
+            // Without a target, there can be no step.
+            return !!target.length;
+        }
 
-/**
- * Is this step actually visible?
- *
- * @method  isStepActuallyVisible
- * @param   {Integer}   stepNumber  Step number to test
- * @return  {Boolean}               Whether the step is actually visible
- */
-Tour.prototype.isStepActuallyVisible = function (stepConfig) {
-    if (!stepConfig) {
-        // Without step config, there can be no step.
         return false;
     }
 
-    var target = this.getStepTarget(stepConfig);
-    if (target && target.length && target.is(':visible')) {
-        // Without a target, there can be no step.
-        return !!target.length;
+    /**
+     * Go to the next step in the tour.
+     *
+     * @method  next
+     * @chainable
+     * @return {Object} this.
+     */
+    next() {
+        return this.gotoStep(this.getNextStepNumber());
     }
 
-    return false;
-};
+    /**
+     * Go to the previous step in the tour.
+     *
+     * @method  previous
+     * @chainable
+     * @return {Object} this.
+     */
+    previous() {
+        return this.gotoStep(this.getPreviousStepNumber(), -1);
+    }
 
-/**
- * Go to the next step in the tour.
- *
- * @method  next
- * @chainable
- */
-Tour.prototype.next = function () {
-    return this.gotoStep(this.getNextStepNumber());
-};
+    /**
+     * Go to the specified step in the tour.
+     *
+     * @method  gotoStep
+     * @param   {Integer}   stepNumber     The step number to display
+     * @param   {Integer}   direction      Next or previous step
+     * @chainable
+     * @return {Object} this.
+     */
+    gotoStep(stepNumber, direction) {
+        if (stepNumber < 0) {
+            return this.endTour();
+        }
 
-/**
- * Go to the previous step in the tour.
- *
- * @method  previous
- * @chainable
- */
-Tour.prototype.previous = function () {
-    return this.gotoStep(this.getPreviousStepNumber(), -1);
-};
+        let stepConfig = this.getStepConfig(stepNumber);
+        if (stepConfig === null) {
+            return this.endTour();
+        }
 
-/**
- * Go to the specified step in the tour.
- *
- * @method  gotoStep
- * @param   {Integer}   stepNumber      The step number to display
- * @chainable
- */
-Tour.prototype.gotoStep = function (stepNumber, direction) {
-    if (stepNumber < 0) {
-        return this.endTour();
+        return this._gotoStep(stepConfig, direction);
     }
 
-    var stepConfig = this.getStepConfig(stepNumber);
-    if (stepConfig === null) {
-        return this.endTour();
-    }
+    _gotoStep(stepConfig, direction) {
+        if (!stepConfig) {
+            return this.endTour();
+        }
 
-    return this._gotoStep(stepConfig, direction);
-};
+        if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay && !stepConfig.delayed) {
+            stepConfig.delayed = true;
+            window.setTimeout(this._gotoStep.bind(this), stepConfig.delay, stepConfig, direction);
 
-Tour.prototype._gotoStep = function (stepConfig, direction) {
-    if (!stepConfig) {
-        return this.endTour();
-    }
+            return this;
+        } else if (!stepConfig.orphan && !this.isStepActuallyVisible(stepConfig)) {
+            let fn = direction == -1 ? 'getPreviousStepNumber' : 'getNextStepNumber';
+            return this.gotoStep(this[fn](stepConfig.stepNumber), direction);
+        }
 
-    if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay && !stepConfig.delayed) {
-        stepConfig.delayed = true;
-        window.setTimeout(this._gotoStep.bind(this), stepConfig.delay, stepConfig, direction);
+        this.hide();
+
+        this.fireEventHandlers('beforeRender', stepConfig);
+        this.renderStep(stepConfig);
+        this.fireEventHandlers('afterRender', stepConfig);
 
         return this;
-    } else if (!stepConfig.orphan && !this.isStepActuallyVisible(stepConfig)) {
-        var fn = direction == -1 ? 'getPreviousStepNumber' : 'getNextStepNumber';
-        return this.gotoStep(this[fn](stepConfig.stepNumber), direction);
     }
 
-    this.hide();
+    /**
+     * Fetch the normalised step configuration for the specified step number.
+     *
+     * @method  getStepConfig
+     * @param   {Integer}   stepNumber      The step number to fetch configuration for
+     * @return  {Object}                    The step configuration
+     */
+    getStepConfig(stepNumber) {
+        if (stepNumber === null || stepNumber < 0 || stepNumber >= this.steps.length) {
+            return null;
+        }
 
-    this.fireEventHandlers('beforeRender', stepConfig);
-    this.renderStep(stepConfig);
-    this.fireEventHandlers('afterRender', stepConfig);
+        // Normalise the step configuration.
+        let stepConfig = this.normalizeStepConfig(this.steps[stepNumber]);
 
-    return this;
-};
+        // Add the stepNumber to the stepConfig.
+        stepConfig = $.extend(stepConfig, {stepNumber: stepNumber});
 
-/**
- * Fetch the normalised step configuration for the specified step number.
- *
- * @method  getStepConfig
- * @param   {Integer}   stepNumber      The step number to fetch configuration for
- * @return  {Object}                    The step configuration
- */
-Tour.prototype.getStepConfig = function (stepNumber) {
-    if (stepNumber === null || stepNumber < 0 || stepNumber >= this.steps.length) {
-        return null;
+        return stepConfig;
     }
 
-    // Normalise the step configuration.
-    var stepConfig = this.normalizeStepConfig(this.steps[stepNumber]);
+    /**
+     * Normalise the supplied step configuration.
+     *
+     * @method  normalizeStepConfig
+     * @param   {Object}    stepConfig      The step configuration to normalise
+     * @return  {Object}                    The normalised step configuration
+     */
+    normalizeStepConfig(stepConfig) {
+
+        if (typeof stepConfig.reflex !== 'undefined' && typeof stepConfig.moveAfterClick === 'undefined') {
+            stepConfig.moveAfterClick = stepConfig.reflex;
+        }
 
-    // Add the stepNumber to the stepConfig.
-    stepConfig = $.extend(stepConfig, { stepNumber: stepNumber });
+        if (typeof stepConfig.element !== 'undefined' && typeof stepConfig.target === 'undefined') {
+            stepConfig.target = stepConfig.element;
+        }
 
-    return stepConfig;
-};
+        if (typeof stepConfig.content !== 'undefined' && typeof stepConfig.body === 'undefined') {
+            stepConfig.body = stepConfig.content;
+        }
 
-/**
- * Normalise the supplied step configuration.
- *
- * @method  normalizeStepConfig
- * @param   {Object}    stepConfig      The step configuration to normalise
- * @return  {Object}                    The normalised step configuration
- */
-Tour.prototype.normalizeStepConfig = function (stepConfig) {
+        stepConfig = $.extend({}, this.stepDefaults, stepConfig);
 
-    if (typeof stepConfig.reflex !== 'undefined' && typeof stepConfig.moveAfterClick === 'undefined') {
-        stepConfig.moveAfterClick = stepConfig.reflex;
-    }
+        stepConfig = $.extend({}, {
+            attachTo: stepConfig.target,
+            attachPoint: 'after',
+        }, stepConfig);
 
-    if (typeof stepConfig.element !== 'undefined' && typeof stepConfig.target === 'undefined') {
-        stepConfig.target = stepConfig.element;
-    }
+        if (stepConfig.attachTo) {
+            stepConfig.attachTo = $(stepConfig.attachTo).first();
+        }
 
-    if (typeof stepConfig.content !== 'undefined' && typeof stepConfig.body === 'undefined') {
-        stepConfig.body = stepConfig.content;
+        return stepConfig;
     }
 
-    stepConfig = $.extend({}, this.stepDefaults, stepConfig);
-
-    stepConfig = $.extend({}, {
-        attachTo: stepConfig.target,
-        attachPoint: 'after'
-    }, stepConfig);
+    /**
+     * Fetch the actual step target from the selector.
+     *
+     * This should not be called until after any delay has completed.
+     *
+     * @method  getStepTarget
+     * @param   {Object}    stepConfig      The step configuration
+     * @return  {$}
+     */
+    getStepTarget(stepConfig) {
+        if (stepConfig.target) {
+            return $(stepConfig.target);
+        }
 
-    if (stepConfig.attachTo) {
-        stepConfig.attachTo = $(stepConfig.attachTo).first();
+        return null;
     }
 
-    return stepConfig;
-};
-
-/**
- * Fetch the actual step target from the selector.
- *
- * This should not be called until after any delay has completed.
- *
- * @method  getStepTarget
- * @param   {Object}    stepConfig      The step configuration
- * @return  {$}
- */
-Tour.prototype.getStepTarget = function (stepConfig) {
-    if (stepConfig.target) {
-        return $(stepConfig.target);
-    }
+    /**
+     * Fire any event handlers for the specified event.
+     *
+     * @param   {String}    eventName       The name of the event to handle
+     * @param   {Object}    data            Any data to pass to the event
+     * @chainable
+     * @return {Object} this.
+     */
+    fireEventHandlers(eventName, data) {
+        if (typeof this.eventHandlers[eventName] === 'undefined') {
+            return this;
+        }
 
-    return null;
-};
+        this.eventHandlers[eventName].forEach(function(thisEvent) {
+            thisEvent.call(this, data);
+        }, this);
 
-/**
- * Fire any event handlers for the specified event.
- *
- * @param   {String}    eventName       The name of the event to handle
- * @param   {Object}    data            Any data to pass to the event
- * @chainable
- */
-Tour.prototype.fireEventHandlers = function (eventName, data) {
-    if (typeof this.eventHandlers[eventName] === 'undefined') {
         return this;
     }
 
-    this.eventHandlers[eventName].forEach(function (thisEvent) {
-        thisEvent.call(this, data);
-    }, this);
+    /**
+     * @method addEventHandler
+     * @param  {string}      eventName       The name of the event to listen for
+     * @param  {function}    handler         The event handler to call
+     * @return {Object} this.
+     */
+    addEventHandler(eventName, handler) {
+        if (typeof this.eventHandlers[eventName] === 'undefined') {
+            this.eventHandlers[eventName] = [];
+        }
 
-    return this;
-};
+        this.eventHandlers[eventName].push(handler);
 
-/**
- * @method  addEventHandler
- * @param   string      eventName       The name of the event to listen for
- * @param   function    handler         The event handler to call
- */
-Tour.prototype.addEventHandler = function (eventName, handler) {
-    if (typeof this.eventHandlers[eventName] === 'undefined') {
-        this.eventHandlers[eventName] = [];
+        return this;
     }
 
-    this.eventHandlers[eventName].push(handler);
+    /**
+     * Process listeners for the step being shown.
+     *
+     * @method  processStepListeners
+     * @param   {object}    stepConfig      The configuration for the step
+     * @chainable
+     * @return {Object} this.
+     */
+    processStepListeners(stepConfig) {
+        this.listeners.push(
+        // Next/Previous buttons.
+        {
+            node: this.currentStepNode,
+            args: ['click', '[data-role="next"]', $.proxy(this.next, this)]
+        }, {
+            node: this.currentStepNode,
+            args: ['click', '[data-role="previous"]', $.proxy(this.previous, this)]
+        },
 
-    return this;
-};
+        // Close and end tour buttons.
+        {
+            node: this.currentStepNode,
+            args: ['click', '[data-role="end"]', $.proxy(this.endTour, this)]
+        },
 
-/**
- * Process listeners for the step being shown.
- *
- * @method  processStepListeners
- * @param   {object}    stepConfig      The configuration for the step
- * @chainable
- */
-Tour.prototype.processStepListeners = function (stepConfig) {
-    this.listeners.push(
-    // Next/Previous buttons.
-    {
-        node: this.currentStepNode,
-        args: ['click', '[data-role="next"]', $.proxy(this.next, this)]
-    }, {
-        node: this.currentStepNode,
-        args: ['click', '[data-role="previous"]', $.proxy(this.previous, this)]
-    },
-
-    // Close and end tour buttons.
-    {
-        node: this.currentStepNode,
-        args: ['click', '[data-role="end"]', $.proxy(this.endTour, this)]
-    },
-
-    // Click backdrop and hide tour.
-    {
-        node: $('[data-flexitour="backdrop"]'),
-        args: ['click', $.proxy(this.hide, this)]
-    },
-
-    // Keypresses.
-    {
-        node: $('body'),
-        args: ['keydown', $.proxy(this.handleKeyDown, this)]
-    });
-
-    if (stepConfig.moveOnClick) {
-        var targetNode = this.getStepTarget(stepConfig);
-        this.listeners.push({
-            node: targetNode,
-            args: ['click', $.proxy(function (e) {
-                if ($(e.target).parents('[data-flexitour="container"]').length === 0) {
-                    // Ignore clicks when they are in the flexitour.
-                    window.setTimeout($.proxy(this.next, this), 500);
-                }
-            }, this)]
-        });
-    }
+        // Click backdrop and hide tour.
+        {
+            node: $('[data-flexitour="backdrop"]'),
+            args: ['click', $.proxy(this.hide, this)]
+        },
 
-    this.listeners.forEach(function (listener) {
-        listener.node.on.apply(listener.node, listener.args);
-    });
+        // Keypresses.
+        {
+            node: $('body'),
+            args: ['keydown', $.proxy(this.handleKeyDown, this)]
+        });
 
-    return this;
-};
+        if (stepConfig.moveOnClick) {
+            var targetNode = this.getStepTarget(stepConfig);
+            this.listeners.push({
+                node: targetNode,
+                args: ['click', $.proxy(function(e) {
+                    if ($(e.target).parents('[data-flexitour="container"]').length === 0) {
+                        // Ignore clicks when they are in the flexitour.
+                        window.setTimeout($.proxy(this.next, this), 500);
+                    }
+                }, this)]
+            });
+        }
 
-/**
- * Reset step listeners.
- *
- * @method  resetStepListeners
- * @chainable
- */
-Tour.prototype.resetStepListeners = function () {
-    // Stop listening to all external handlers.
-    if (this.listeners) {
         this.listeners.forEach(function (listener) {
-            listener.node.off.apply(listener.node, listener.args);
+            listener.node.on.apply(listener.node, listener.args);
         });
-    }
-    this.listeners = [];
 
-    return this;
-};
-
-/**
- * The standard step renderer.
- *
- * @method  renderStep
- * @param   {Object}    stepConfig      The step configuration of the step
- * @chainable
- */
-Tour.prototype.renderStep = function (stepConfig) {
-    // Store the current step configuration for later.
-    this.currentStepConfig = stepConfig;
-    this.setCurrentStepNumber(stepConfig.stepNumber);
-
-    // Fetch the template and convert it to a $ object.
-    var template = $(this.getTemplateContent());
-
-    // Title.
-    template.find('[data-placeholder="title"]').html(stepConfig.title);
-
-    // Body.
-    template.find('[data-placeholder="body"]').html(stepConfig.body);
-
-    // Is this the first step?
-    if (this.isFirstStep(stepConfig.stepNumber)) {
-        template.find('[data-role="previous"]').prop('disabled', true);
-    } else {
-        template.find('[data-role="previous"]').prop('disabled', false);
+        return this;
     }
 
-    // Is this the final step?
-    if (this.isLastStep(stepConfig.stepNumber)) {
-        template.find('[data-role="next"]').prop('disabled', true);
-    } else {
-        template.find('[data-role="next"]').prop('disabled', false);
-    }
+    /**
+     * Reset step listeners.
+     *
+     * @method  resetStepListeners
+     * @chainable
+     * @return {Object} this.
+     */
+    resetStepListeners() {
+        // Stop listening to all external handlers.
+        if (this.listeners) {
+            this.listeners.forEach(function(listener) {
+                listener.node.off.apply(listener.node, listener.args);
+            });
+        }
+        this.listeners = [];
 
-    template.find('[data-role="previous"]').attr('role', 'button');
-    template.find('[data-role="next"]').attr('role', 'button');
-    template.find('[data-role="end"]').attr('role', 'button');
+        return this;
+    }
 
-    // Replace the template with the updated version.
-    stepConfig.template = template;
+    /**
+     * The standard step renderer.
+     *
+     * @method  renderStep
+     * @param   {Object}    stepConfig      The step configuration of the step
+     * @chainable
+     * @return {Object} this.
+     */
+    renderStep(stepConfig) {
+        // Store the current step configuration for later.
+        this.currentStepConfig = stepConfig;
+        this.setCurrentStepNumber(stepConfig.stepNumber);
+
+        // Fetch the template and convert it to a $ object.
+        let template = $(this.getTemplateContent());
+
+        // Title.
+        template.find('[data-placeholder="title"]')
+            .html(stepConfig.title);
+
+        // Body.
+        template.find('[data-placeholder="body"]')
+            .html(stepConfig.body);
+
+        // Is this the first step?
+        if (this.isFirstStep(stepConfig.stepNumber)) {
+            template.find('[data-role="previous"]').prop('disabled', true);
+        } else {
+            template.find('[data-role="previous"]').prop('disabled', false);
+        }
 
-    // Add to the page.
-    this.addStepToPage(stepConfig);
+        // Is this the final step?
+        if (this.isLastStep(stepConfig.stepNumber)) {
+            template.find('[data-role="next"]').prop('disabled', true);
+        } else {
+            template.find('[data-role="next"]').prop('disabled', false);
+        }
 
-    // Process step listeners after adding to the page.
-    // This uses the currentNode.
-    this.processStepListeners(stepConfig);
+        template.find('[data-role="previous"]').attr('role', 'button');
+        template.find('[data-role="next"]').attr('role', 'button');
+        template.find('[data-role="end"]').attr('role', 'button');
 
-    return this;
-};
+        // Replace the template with the updated version.
+        stepConfig.template = template;
 
-/**
- * Getter for the template content.
- *
- * @method  getTemplateContent
- * @return  {$}
- */
-Tour.prototype.getTemplateContent = function () {
-    return $(this.templateContent).clone();
-};
+        // Add to the page.
+        this.addStepToPage(stepConfig);
 
-/**
- * Helper to add a step to the page.
- *
- * @method  addStepToPage
- * @param   {Object}    stepConfig      The step configuration of the step
- * @chainable
- */
-Tour.prototype.addStepToPage = function (stepConfig) {
-    var stepContent = stepConfig.template;
+        // Process step listeners after adding to the page.
+        // This uses the currentNode.
+        this.processStepListeners(stepConfig);
 
-    // Create the stepNode from the template data.
-    var currentStepNode = $('<span data-flexitour="container"></span>').html(stepConfig.template).hide();
+        return this;
+    }
 
-    // The scroll animation occurs on the body or html.
-    var animationTarget = $('body, html').stop(true, true);
+    /**
+     * Getter for the template content.
+     *
+     * @method  getTemplateContent
+     * @return  {$}
+     */
+    getTemplateContent() {
+        return $(this.templateContent).clone();
+    }
 
-    if (this.isStepActuallyVisible(stepConfig)) {
-        var targetNode = this.getStepTarget(stepConfig);
+    /**
+     * Helper to add a step to the page.
+     *
+     * @method  addStepToPage
+     * @param   {Object}    stepConfig      The step configuration of the step
+     * @chainable
+     * @return {Object} this.
+     */
+    addStepToPage(stepConfig) {
+        // Create the stepNode from the template data.
+        let currentStepNode = $('<span data-flexitour="container"></span>')
+            .html(stepConfig.template)
+            .hide();
+
+        // The scroll animation occurs on the body or html.
+        let animationTarget = $('body, html')
+            .stop(true, true);
 
-        targetNode.data('flexitour', 'target');
+        if (this.isStepActuallyVisible(stepConfig)) {
+            let targetNode = this.getStepTarget(stepConfig);
 
-        var zIndex = this.calculateZIndex(targetNode);
-        if (zIndex) {
-            stepConfig.zIndex = zIndex + 1;
-        }
+            targetNode.data('flexitour', 'target');
 
-        if (stepConfig.zIndex) {
-            currentStepNode.css('zIndex', stepConfig.zIndex + 1);
-        }
+            let zIndex = this.calculateZIndex(targetNode);
+            if (zIndex) {
+                stepConfig.zIndex = zIndex + 1;
+            }
 
-        // Add the backdrop.
-        this.positionBackdrop(stepConfig);
+            if (stepConfig.zIndex) {
+                currentStepNode.css('zIndex', stepConfig.zIndex + 1);
+            }
 
-        $(document.body).append(currentStepNode);
-        this.currentStepNode = currentStepNode;
+            // Add the backdrop.
+            this.positionBackdrop(stepConfig);
 
-        // Ensure that the step node is positioned.
-        // Some situations mean that the value is not properly calculated without this step.
-        this.currentStepNode.css({
-            top: 0,
-            left: 0
-        });
+            $(document.body).append(currentStepNode);
+            this.currentStepNode = currentStepNode;
 
-        animationTarget.animate({
-            scrollTop: this.calculateScrollTop(stepConfig)
-        }).promise().then(function () {
-            this.positionStep(stepConfig);
-            this.revealStep(stepConfig);
-        }.bind(this));
-    } else if (stepConfig.orphan) {
-        stepConfig.isOrphan = true;
+            // Ensure that the step node is positioned.
+            // Some situations mean that the value is not properly calculated without this step.
+            this.currentStepNode.css({
+                top: 0,
+                left: 0,
+            });
 
-        // This will be appended to the body instead.
-        stepConfig.attachTo = $('body').first();
-        stepConfig.attachPoint = 'append';
+            animationTarget
+                .animate({
+                    scrollTop: this.calculateScrollTop(stepConfig),
+                }).promise().then(function() {
+                        this.positionStep(stepConfig);
+                        this.revealStep(stepConfig);
+                        return;
+                    }.bind(this))
+                    .catch(function() {
+                        // Silently fail.
+                    });
 
-        // Add the backdrop.
-        this.positionBackdrop(stepConfig);
+        } else if (stepConfig.orphan) {
+            stepConfig.isOrphan = true;
+
+            // This will be appended to the body instead.
+            stepConfig.attachTo = $('body').first();
+            stepConfig.attachPoint = 'append';
+
+            // Add the backdrop.
+            this.positionBackdrop(stepConfig);
+
+            // This is an orphaned step.
+            currentStepNode.addClass('orphan');
+
+            // It lives in the body.
+            $(document.body).append(currentStepNode);
+            this.currentStepNode = currentStepNode;
+
+            this.currentStepNode.offset(this.calculateStepPositionInPage());
+            this.currentStepNode.css('position', 'fixed');
+
+            this.currentStepPopper = new Popper(
+                $('body'),
+                this.currentStepNode[0], {
+                    removeOnDestroy: true,
+                    placement: stepConfig.placement + '-start',
+                    arrowElement: '[data-role="arrow"]',
+                    // Empty the modifiers. We've already placed the step and don't want it moved.
+                    modifiers: {
+                        hide: {
+                            enabled: false,
+                        },
+                        applyStyle: {
+                            onLoad: null,
+                            enabled: false,
+                        },
+                    }
+                }
+            );
 
-        // This is an orphaned step.
-        currentStepNode.addClass('orphan');
+            this.revealStep(stepConfig);
+        }
 
-        // It lives in the body.
-        $(document.body).append(currentStepNode);
-        this.currentStepNode = currentStepNode;
+        return this;
+    }
 
-        this.currentStepNode.offset(this.calculateStepPositionInPage());
-        this.currentStepNode.css('position', 'fixed');
+    /**
+     * Make the given step visible.
+     *
+     * @method revealStep
+     * @param {Object} stepConfig The step configuration of the step
+     * @chainable
+     * @return {Object} this.
+     */
+    revealStep(stepConfig) {
+        // Fade the step in.
+        this.currentStepNode.fadeIn('', $.proxy(function() {
+                // Announce via ARIA.
+                this.announceStep(stepConfig);
+
+                // Focus on the current step Node.
+                this.currentStepNode.focus();
+                window.setTimeout($.proxy(function() {
+                    // After a brief delay, focus again.
+                    // There seems to be an issue with Jaws where it only reads the dialogue title initially.
+                    // This second focus helps it to read the full dialogue.
+                    if (this.currentStepNode) {
+                        this.currentStepNode.focus();
+                    }
+                }, this), 100);
 
-        this.currentStepPopper = new Popper($('body'), this.currentStepNode[0], {
-            removeOnDestroy: true,
-            placement: stepConfig.placement + '-start',
-            arrowElement: '[data-role="arrow"]',
-            // Empty the modifiers. We've already placed the step and don't want it moved.
-            modifiers: {
-                hide: {
-                    enabled: false
-                },
-                applyStyle: {
-                    onLoad: null,
-                    enabled: false
-                }
-            }
-        });
+            }, this));
 
-        this.revealStep(stepConfig);
+        return this;
     }
 
-    return this;
-};
-
-Tour.prototype.revealStep = function (stepConfig) {
-    // Fade the step in.
-    this.currentStepNode.fadeIn('', $.proxy(function () {
-        // Announce via ARIA.
-        this.announceStep(stepConfig);
-
-        // Focus on the current step Node.
-        this.currentStepNode.focus();
-        window.setTimeout($.proxy(function () {
-            // After a brief delay, focus again.
-            // There seems to be an issue with Jaws where it only reads the dialogue title initially.
-            // This second focus helps it to read the full dialogue.
-            if (this.currentStepNode) {
-                this.currentStepNode.focus();
+    /**
+     * Helper to announce the step on the page.
+     *
+     * @method  announceStep
+     * @param   {Object}    stepConfig      The step configuration of the step
+     * @chainable
+     * @return {Object} this.
+     */
+    announceStep(stepConfig) {
+        // Setup the step Dialogue as per:
+        // * https://www.w3.org/TR/wai-aria-practices/#dialog_nonmodal
+        // * https://www.w3.org/TR/wai-aria-practices/#dialog_modal
+
+        // Generate an ID for the current step node.
+        let stepId = 'tour-step-' + this.tourName + '-' + stepConfig.stepNumber;
+        this.currentStepNode.attr('id', stepId);
+
+        let bodyRegion = this.currentStepNode.find('[data-placeholder="body"]').first();
+        bodyRegion.attr('id', stepId + '-body');
+        bodyRegion.attr('role', 'document');
+
+        let headerRegion = this.currentStepNode.find('[data-placeholder="title"]').first();
+        headerRegion.attr('id', stepId + '-title');
+        headerRegion.attr('aria-labelledby', stepId + '-body');
+
+        // Generally, a modal dialog has a role of dialog.
+        this.currentStepNode.attr('role', 'dialog');
+        this.currentStepNode.attr('tabindex', 0);
+        this.currentStepNode.attr('aria-labelledby', stepId + '-title');
+        this.currentStepNode.attr('aria-describedby', stepId + '-body');
+
+        // Configure ARIA attributes on the target.
+        let target = this.getStepTarget(stepConfig);
+        if (target) {
+            if (!target.attr('tabindex')) {
+                target.attr('tabindex', 0);
             }
-        }, this), 100);
-    }, this));
 
-    return this;
-};
-
-/**
- * Helper to announce the step on the page.
- *
- * @method  announceStep
- * @param   {Object}    stepConfig      The step configuration of the step
- * @chainable
- */
-Tour.prototype.announceStep = function (stepConfig) {
-    // Setup the step Dialogue as per:
-    // * https://www.w3.org/TR/wai-aria-practices/#dialog_nonmodal
-    // * https://www.w3.org/TR/wai-aria-practices/#dialog_modal
-
-    // Generate an ID for the current step node.
-    var stepId = 'tour-step-' + this.tourName + '-' + stepConfig.stepNumber;
-    this.currentStepNode.attr('id', stepId);
-
-    var bodyRegion = this.currentStepNode.find('[data-placeholder="body"]').first();
-    bodyRegion.attr('id', stepId + '-body');
-    bodyRegion.attr('role', 'document');
-
-    var headerRegion = this.currentStepNode.find('[data-placeholder="title"]').first();
-    headerRegion.attr('id', stepId + '-title');
-    headerRegion.attr('aria-labelledby', stepId + '-body');
-
-    // Generally, a modal dialog has a role of dialog.
-    this.currentStepNode.attr('role', 'dialog');
-    this.currentStepNode.attr('tabindex', 0);
-    this.currentStepNode.attr('aria-labelledby', stepId + '-title');
-    this.currentStepNode.attr('aria-describedby', stepId + '-body');
-
-    // Configure ARIA attributes on the target.
-    var target = this.getStepTarget(stepConfig);
-    if (target) {
-        if (!target.attr('tabindex')) {
-            target.attr('tabindex', 0);
+            target
+                .data('original-describedby', target.attr('aria-describedby'))
+                .attr('aria-describedby', stepId + '-body')
+                ;
         }
 
-        target.data('original-describedby', target.attr('aria-describedby')).attr('aria-describedby', stepId + '-body');
-    }
+        this.accessibilityShow(stepConfig);
 
-    this.accessibilityShow(stepConfig);
+        return this;
+    }
 
-    return this;
-};
+    /**
+     * Handle key down events.
+     *
+     * @method  handleKeyDown
+     * @param   {EventFacade} e
+     */
+    handleKeyDown(e) {
+        let tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], ';
+        tabbableSelector += ':input:enabled, [tabindex], button:enabled';
+        switch (e.keyCode) {
+            case 27:
+                this.endTour();
+                break;
+
+            // 9 == Tab - trap focus for items with a backdrop.
+            case 9:
+                // Tab must be handled on key up only in this instance.
+                (function() {
+                    if (!this.currentStepConfig.hasBackdrop) {
+                        // Trapping tab focus is only handled for those steps with a backdrop.
+                        return;
+                    }
 
-/**
- * Handle key down events.
- *
- * @method  handleKeyDown
- * @param   {EventFacade} e
- */
-Tour.prototype.handleKeyDown = function (e) {
-    var tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], :input:enabled, [tabindex], button:enabled';
-    switch (e.keyCode) {
-        case 27:
-            this.endTour();
-            break;
-
-        // 9 == Tab - trap focus for items with a backdrop.
-        case 9:
-            // Tab must be handled on key up only in this instance.
-            (function () {
-                if (!this.currentStepConfig.hasBackdrop) {
-                    // Trapping tab focus is only handled for those steps with a backdrop.
-                    return;
-                }
+                    // Find all tabbable locations.
+                    let activeElement = $(document.activeElement);
+                    let stepTarget = this.getStepTarget(this.currentStepConfig);
+                    let tabbableNodes = $(tabbableSelector);
+                    let dialogContainer = $('span[data-flexitour="container"]');
+                    let currentIndex;
+                    // Filter out element which is not belong to target section or dialogue.
+                    if (stepTarget) {
+                        tabbableNodes = tabbableNodes.filter(function(index, element) {
+                            return stepTarget !== null
+                                && (stepTarget.has(element).length
+                                    || dialogContainer.has(element).length
+                                    || stepTarget.is(element)
+                                    || dialogContainer.is(element));
+                        });
+                    }
 
-                // Find all tabbable locations.
-                var activeElement = $(document.activeElement);
-                var stepTarget = this.getStepTarget(this.currentStepConfig);
-                var tabbableNodes = $(tabbableSelector);
-                var dialogContainer = $('span[data-flexitour="container"]');
-                var currentIndex = void 0;
-                // Filter out element which is not belong to target section or dialogue.
-                if (stepTarget) {
-                    tabbableNodes = tabbableNodes.filter(function (index, element) {
-                        return stepTarget != null && (stepTarget.has(element).length || dialogContainer.has(element).length || stepTarget.is(element) || dialogContainer.is(element));
+                    // Find index of focusing element.
+                    tabbableNodes.each(function(index, element) {
+                        if (activeElement.is(element)) {
+                            currentIndex = index;
+                            return false;
+                        }
+                        // Keep looping.
+                        return true;
                     });
-                }
 
-                // Find index of focusing element.
-                tabbableNodes.each(function (index, element) {
-                    if (activeElement.is(element)) {
-                        currentIndex = index;
-                        return false;
-                    }
-                });
-
-                var nextIndex = void 0;
-                var nextNode = void 0;
-                var focusRelevant = void 0;
-                if (currentIndex != void 0) {
-                    var direction = 1;
-                    if (e.shiftKey) {
-                        direction = -1;
-                    }
-                    nextIndex = currentIndex;
-                    do {
-                        nextIndex += direction;
-                        nextNode = $(tabbableNodes[nextIndex]);
-                    } while (nextNode.length && nextNode.is(':disabled') || nextNode.is(':hidden'));
-                    if (nextNode.length) {
-                        // A new f
-                        focusRelevant = nextNode.closest(stepTarget).length;
-                        focusRelevant = focusRelevant || nextNode.closest(this.currentStepNode).length;
-                    } else {
-                        // Unable to find the target somehow.
-                        focusRelevant = false;
+                    let nextIndex;
+                    let nextNode;
+                    let focusRelevant;
+                    if (currentIndex != void 0) {
+                        let direction = 1;
+                        if (e.shiftKey) {
+                            direction = -1;
+                        }
+                        nextIndex = currentIndex;
+                        do {
+                            nextIndex += direction;
+                            nextNode = $(tabbableNodes[nextIndex]);
+                        } while (nextNode.length && nextNode.is(':disabled') || nextNode.is(':hidden'));
+                        if (nextNode.length) {
+                            // A new f
+                            focusRelevant = nextNode.closest(stepTarget).length;
+                            focusRelevant = focusRelevant || nextNode.closest(this.currentStepNode).length;
+                        } else {
+                            // Unable to find the target somehow.
+                            focusRelevant = false;
+                        }
                     }
-                }
 
-                if (focusRelevant) {
-                    nextNode.focus();
-                } else {
-                    if (e.shiftKey) {
-                        // Focus on the last tabbable node in the step.
-                        this.currentStepNode.find(tabbableSelector).last().focus();
+                    if (focusRelevant) {
+                        nextNode.focus();
                     } else {
-                        if (this.currentStepConfig.isOrphan) {
-                            // Focus on the step - there is no target.
-                            this.currentStepNode.focus();
+                        if (e.shiftKey) {
+                            // Focus on the last tabbable node in the step.
+                            this.currentStepNode.find(tabbableSelector).last().focus();
                         } else {
-                            // Focus on the step target.
-                            stepTarget.focus();
+                            if (this.currentStepConfig.isOrphan) {
+                                // Focus on the step - there is no target.
+                                this.currentStepNode.focus();
+                            } else {
+                                // Focus on the step target.
+                                stepTarget.focus();
+                            }
                         }
                     }
-                }
-                e.preventDefault();
-            }).call(this);
-            break;
+                    e.preventDefault();
+                }).call(this);
+                break;
+        }
     }
-};
 
-/**
- * Start the current tour.
- *
- * @method  startTour
- * @param   {Integer}   startAt     Which step number to start at. If not specified, starts at the last point.
- * @chainable
- */
-Tour.prototype.startTour = function (startAt) {
-    if (this.storage && typeof startAt === 'undefined') {
-        var storageStartValue = this.storage.getItem(this.storageKey);
-        if (storageStartValue) {
-            var storageStartAt = parseInt(storageStartValue, 10);
-            if (storageStartAt <= this.steps.length) {
-                startAt = storageStartAt;
+    /**
+     * Start the current tour.
+     *
+     * @method  startTour
+     * @param   {Integer}   startAt     Which step number to start at. If not specified, starts at the last point.
+     * @chainable
+     * @return {Object} this.
+     */
+    startTour(startAt) {
+        if (this.storage && typeof startAt === 'undefined') {
+            let storageStartValue = this.storage.getItem(this.storageKey);
+            if (storageStartValue) {
+                let storageStartAt = parseInt(storageStartValue, 10);
+                if (storageStartAt <= this.steps.length) {
+                    startAt = storageStartAt;
+                }
             }
         }
-    }
 
-    if (typeof startAt === 'undefined') {
-        startAt = this.getCurrentStepNumber();
-    }
+        if (typeof startAt === 'undefined') {
+            startAt = this.getCurrentStepNumber();
+        }
 
-    this.fireEventHandlers('beforeStart', startAt);
-    this.gotoStep(startAt);
-    this.fireEventHandlers('afterStart', startAt);
+        this.fireEventHandlers('beforeStart', startAt);
+        this.gotoStep(startAt);
+        this.fireEventHandlers('afterStart', startAt);
 
-    return this;
-};
+        return this;
+    }
 
-/**
- * Restart the tour from the beginning, resetting the completionlag.
- *
- * @method  restartTour
- * @chainable
- */
-Tour.prototype.restartTour = function () {
-    return this.startTour(0);
-};
+    /**
+     * Restart the tour from the beginning, resetting the completionlag.
+     *
+     * @method  restartTour
+     * @chainable
+     * @return {Object} this.
+     */
+    restartTour() {
+        return this.startTour(0);
+    }
 
-/**
- * End the current tour.
- *
- * @method  endTour
- * @chainable
- */
-Tour.prototype.endTour = function () {
-    this.fireEventHandlers('beforeEnd');
-
-    if (this.currentStepConfig) {
-        var previousTarget = this.getStepTarget(this.currentStepConfig);
-        if (previousTarget) {
-            if (!previousTarget.attr('tabindex')) {
-                previousTarget.attr('tabindex', '-1');
+    /**
+     * End the current tour.
+     *
+     * @method  endTour
+     * @chainable
+     * @return {Object} this.
+     */
+    endTour() {
+        this.fireEventHandlers('beforeEnd');
+
+        if (this.currentStepConfig) {
+            let previousTarget = this.getStepTarget(this.currentStepConfig);
+            if (previousTarget) {
+                if (!previousTarget.attr('tabindex')) {
+                    previousTarget.attr('tabindex', '-1');
+                }
+                previousTarget.focus();
             }
-            previousTarget.focus();
         }
-    }
-
-    this.hide(true);
 
-    this.fireEventHandlers('afterEnd');
+        this.hide(true);
 
-    return this;
-};
+        this.fireEventHandlers('afterEnd');
 
-/**
- * Hide any currently visible steps.
- *
- * @method hide
- * @chainable
- */
-Tour.prototype.hide = function (transition) {
-    this.fireEventHandlers('beforeHide');
-
-    if (this.currentStepNode && this.currentStepNode.length) {
-        this.currentStepNode.hide();
-        if (this.currentStepPopper) {
-            this.currentStepPopper.destroy();
-        }
+        return this;
     }
 
-    // Restore original target configuration.
-    if (this.currentStepConfig) {
-        var target = this.getStepTarget(this.currentStepConfig);
-        if (target) {
-            if (target.data('original-labelledby')) {
-                target.attr('aria-labelledby', target.data('original-labelledby'));
-            }
-
-            if (target.data('original-describedby')) {
-                target.attr('aria-describedby', target.data('original-describedby'));
-            }
-
-            if (target.data('original-tabindex')) {
-                target.attr('tabindex', target.data('tabindex'));
+    /**
+     * Hide any currently visible steps.
+     *
+     * @method hide
+     * @param {Bool} transition Animate the visibility change
+     * @chainable
+     * @return {Object} this.
+     */
+    hide(transition) {
+        this.fireEventHandlers('beforeHide');
+
+        if (this.currentStepNode && this.currentStepNode.length) {
+            this.currentStepNode.hide();
+            if (this.currentStepPopper) {
+                this.currentStepPopper.destroy();
             }
         }
 
-        // Clear the step configuration.
-        this.currentStepConfig = null;
-    }
+        // Restore original target configuration.
+        if (this.currentStepConfig) {
+            let target = this.getStepTarget(this.currentStepConfig);
+            if (target) {
+                if (target.data('original-labelledby')) {
+                    target.attr('aria-labelledby', target.data('original-labelledby'));
+                }
 
-    var fadeTime = 0;
-    if (transition) {
-        fadeTime = 400;
-    }
+                if (target.data('original-describedby')) {
+                    target.attr('aria-describedby', target.data('original-describedby'));
+                }
+
+                if (target.data('original-tabindex')) {
+                    target.attr('tabindex', target.data('tabindex'));
+                }
+            }
 
-    // Remove the backdrop features.
-    $('[data-flexitour="step-background"]').remove();
-    $('[data-flexitour="step-backdrop"]').removeAttr('data-flexitour');
-    $('[data-flexitour="backdrop"]').fadeOut(fadeTime, function () {
-        $(this).remove();
-    });
-
-    // Remove aria-describedby and tabindex attributes.
-    if (this.currentStepNode && this.currentStepNode.length) {
-        var stepId = this.currentStepNode.attr('id');
-        if (stepId) {
-            var currentStepElement = '[aria-describedby="' + stepId + '-body"]';
-            $(currentStepElement).removeAttr('tabindex');
-            $(currentStepElement).removeAttr('aria-describedby');
+            // Clear the step configuration.
+            this.currentStepConfig = null;
         }
-    }
 
-    // Reset the listeners.
-    this.resetStepListeners();
+        let fadeTime = 0;
+        if (transition) {
+            fadeTime = 400;
+        }
 
-    this.accessibilityHide();
+        // Remove the backdrop features.
+        $('[data-flexitour="step-background"]').remove();
+        $('[data-flexitour="step-backdrop"]').removeAttr('data-flexitour');
+        $('[data-flexitour="backdrop"]').fadeOut(fadeTime, function() {
+            $(this).remove();
+        });
 
-    this.fireEventHandlers('afterHide');
+        // Remove aria-describedby and tabindex attributes.
+        if (this.currentStepNode && this.currentStepNode.length) {
+            let stepId = this.currentStepNode.attr('id');
+            if (stepId) {
+                let currentStepElement = '[aria-describedby="' + stepId + '-body"]';
+                $(currentStepElement).removeAttr('tabindex');
+                $(currentStepElement).removeAttr('aria-describedby');
+            }
+        }
 
-    this.currentStepNode = null;
-    this.currentStepPopper = null;
-    return this;
-};
+        // Reset the listeners.
+        this.resetStepListeners();
 
-/**
- * Show the current steps.
- *
- * @method show
- * @chainable
- */
-Tour.prototype.show = function () {
-    // Show the current step.
-    var startAt = this.getCurrentStepNumber();
+        this.accessibilityHide();
 
-    return this.gotoStep(startAt);
-};
+        this.fireEventHandlers('afterHide');
 
-/**
- * Return the current step node.
- *
- * @method  getStepContainer
- * @return  {jQuery}
- */
-Tour.prototype.getStepContainer = function () {
-    return $(this.currentStepNode);
-};
-
-/**
- * Calculate scrollTop.
- *
- * @method  calculateScrollTop
- * @param   {Object}    stepConfig      The step configuration of the step
- * @return  {Number}
- */
-Tour.prototype.calculateScrollTop = function (stepConfig) {
-    var scrollTop = $(window).scrollTop();
-    var viewportHeight = $(window).height();
-    var targetNode = this.getStepTarget(stepConfig);
-
-    if (stepConfig.placement === 'top') {
-        // If the placement is top, center scroll at the top of the target.
-        scrollTop = targetNode.offset().top - viewportHeight / 2;
-    } else if (stepConfig.placement === 'bottom') {
-        // If the placement is bottom, center scroll at the bottom of the target.
-        scrollTop = targetNode.offset().top + targetNode.height() - viewportHeight / 2;
-    } else if (targetNode.height() <= viewportHeight * 0.8) {
-        // If the placement is left/right, and the target fits in the viewport, centre screen on the target
-        scrollTop = targetNode.offset().top - (viewportHeight - targetNode.height()) / 2;
-    } else {
-        // If the placement is left/right, and the target is bigger than the viewport, set scrollTop to target.top + buffer
-        // and change step attachmentTarget to top+.
-        scrollTop = targetNode.offset().top - viewportHeight * 0.2;
+        this.currentStepNode = null;
+        this.currentStepPopper = null;
+        return this;
     }
 
-    // Never scroll over the top.
-    scrollTop = Math.max(0, scrollTop);
-
-    // Never scroll beyond the bottom.
-    scrollTop = Math.min($(document).height() - viewportHeight, scrollTop);
+    /**
+     * Show the current steps.
+     *
+     * @method show
+     * @chainable
+     * @return {Object} this.
+     */
+    show() {
+        // Show the current step.
+        let startAt = this.getCurrentStepNumber();
+
+        return this.gotoStep(startAt);
+    }
 
-    return Math.ceil(scrollTop);
-};
+    /**
+     * Return the current step node.
+     *
+     * @method  getStepContainer
+     * @return  {jQuery}
+     */
+    getStepContainer() {
+        return $(this.currentStepNode);
+    }
 
-/**
- * Calculate dialogue position for page middle.
- *
- * @method  calculateScrollTop
- * @return  {Number}
- */
-Tour.prototype.calculateStepPositionInPage = function () {
-    var viewportHeight = $(window).height();
-    var stepHeight = this.currentStepNode.height();
+    /**
+     * Calculate scrollTop.
+     *
+     * @method  calculateScrollTop
+     * @param   {Object}    stepConfig      The step configuration of the step
+     * @return  {Number}
+     */
+    calculateScrollTop(stepConfig) {
+        let scrollTop = $(window).scrollTop();
+        let viewportHeight = $(window).height();
+        let targetNode = this.getStepTarget(stepConfig);
+
+        if (stepConfig.placement === 'top') {
+            // If the placement is top, center scroll at the top of the target.
+            scrollTop = targetNode.offset().top - (viewportHeight / 2);
+        } else if (stepConfig.placement === 'bottom') {
+            // If the placement is bottom, center scroll at the bottom of the target.
+            scrollTop = targetNode.offset().top + targetNode.height() - (viewportHeight / 2);
+        } else if (targetNode.height() <= (viewportHeight * 0.8)) {
+            // If the placement is left/right, and the target fits in the viewport, centre screen on the target
+            scrollTop = targetNode.offset().top - ((viewportHeight - targetNode.height()) / 2);
+        } else {
+            // If the placement is left/right, and the target is bigger than the viewport, set scrollTop to target.top + buffer
+            // and change step attachmentTarget to top+.
+            scrollTop = targetNode.offset().top - (viewportHeight * 0.2);
+        }
 
-    var viewportWidth = $(window).width();
-    var stepWidth = this.currentStepNode.width();
+        // Never scroll over the top.
+        scrollTop = Math.max(0, scrollTop);
 
-    return {
-        top: Math.ceil((viewportHeight - stepHeight) / 2),
-        left: Math.ceil((viewportWidth - stepWidth) / 2)
-    };
-};
+        // Never scroll beyond the bottom.
+        scrollTop = Math.min($(document).height() - viewportHeight, scrollTop);
 
-/**
- * Position the step on the page.
- *
- * @method  positionStep
- * @param   {Object}    stepConfig      The step configuration of the step
- * @chainable
- */
-Tour.prototype.positionStep = function (stepConfig) {
-    var content = this.currentStepNode;
-    if (!content || !content.length) {
-        // Unable to find the step node.
-        return this;
+        return Math.ceil(scrollTop);
     }
 
-    var flipBehavior = void 0;
-    switch (stepConfig.placement) {
-        case 'left':
-            flipBehavior = ['left', 'right', 'top', 'bottom'];
-            break;
-        case 'right':
-            flipBehavior = ['right', 'left', 'top', 'bottom'];
-            break;
-        case 'top':
-            flipBehavior = ['top', 'bottom', 'right', 'left'];
-            break;
-        case 'bottom':
-            flipBehavior = ['bottom', 'top', 'right', 'left'];
-            break;
-        default:
-            flipBehavior = 'flip';
-            break;
+    /**
+     * Calculate dialogue position for page middle.
+     *
+     * @method  calculateScrollTop
+     * @return  {Number}
+     */
+    calculateStepPositionInPage() {
+        let viewportHeight = $(window).height();
+        let stepHeight = this.currentStepNode.height();
+
+        let viewportWidth = $(window).width();
+        let stepWidth = this.currentStepNode.width();
+
+        return {
+            top: Math.ceil((viewportHeight - stepHeight) / 2),
+            left: Math.ceil((viewportWidth - stepWidth) / 2)
+        };
     }
 
-    var target = this.getStepTarget(stepConfig);
-    var config = {
-        placement: stepConfig.placement + '-start',
-        removeOnDestroy: true,
-        modifiers: {
-            flip: {
-                behaviour: flipBehavior
-            },
-            arrow: {
-                element: '[data-role="arrow"]'
-            }
-        },
-        onCreate: function onCreate(data) {
-            recalculateArrowPosition(data);
-        },
-        onUpdate: function onUpdate(data) {
-            recalculateArrowPosition(data);
+    /**
+     * Position the step on the page.
+     *
+     * @method  positionStep
+     * @param   {Object}    stepConfig      The step configuration of the step
+     * @chainable
+     * @return {Object} this.
+     */
+    positionStep(stepConfig) {
+        let content = this.currentStepNode;
+        if (!content || !content.length) {
+            // Unable to find the step node.
+            return this;
         }
-    };
-
-    var recalculateArrowPosition = function recalculateArrowPosition(data) {
-        var placement = data.placement.split('-')[0];
-        var isVertical = ['left', 'right'].indexOf(placement) !== -1;
-        var arrowElement = data.instance.popper.querySelector('[data-role="arrow"]');
-        var stepElement = $(data.instance.popper.querySelector('[data-role="flexitour-step"]'));
-        if (isVertical) {
-            var arrowHeight = parseFloat(window.getComputedStyle(arrowElement).height);
-            var arrowOffset = parseFloat(window.getComputedStyle(arrowElement).top);
-            var popperHeight = parseFloat(window.getComputedStyle(data.instance.popper).height);
-            var popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).top);
-            var popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));
-            var popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;
-            var arrowPos = arrowOffset + arrowHeight / 2;
-            var maxPos = popperHeight + popperOffset - popperBorderWidth - popperBorderRadiusWidth;
-            var minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;
-            if (arrowPos >= maxPos || arrowPos <= minPos) {
-                var newArrowPos = 0;
-                if (arrowPos > popperHeight / 2) {
-                    newArrowPos = maxPos - arrowHeight;
-                } else {
-                    newArrowPos = minPos + arrowHeight;
+
+        let flipBehavior;
+        switch (stepConfig.placement) {
+            case 'left':
+                flipBehavior = ['left', 'right', 'top', 'bottom'];
+                break;
+            case 'right':
+                flipBehavior = ['right', 'left', 'top', 'bottom'];
+                break;
+            case 'top':
+                flipBehavior = ['top', 'bottom', 'right', 'left'];
+                break;
+            case 'bottom':
+                flipBehavior = ['bottom', 'top', 'right', 'left'];
+                break;
+            default:
+                flipBehavior = 'flip';
+                break;
+        }
+
+        let target = this.getStepTarget(stepConfig);
+        var config = {
+            placement: stepConfig.placement + '-start',
+            removeOnDestroy: true,
+            modifiers: {
+                flip: {
+                    behaviour: flipBehavior,
+                },
+                arrow: {
+                    element: '[data-role="arrow"]',
+                },
+            },
+            onCreate: function(data) {
+                recalculateArrowPosition(data);
+            },
+            onUpdate: function(data) {
+                recalculateArrowPosition(data);
+            },
+        };
+
+        let recalculateArrowPosition = function(data) {
+            let placement = data.placement.split('-')[0];
+            const isVertical = ['left', 'right'].indexOf(placement) !== -1;
+            const arrowElement = data.instance.popper.querySelector('[data-role="arrow"]');
+            const stepElement = $(data.instance.popper.querySelector('[data-role="flexitour-step"]'));
+            if (isVertical) {
+                let arrowHeight = parseFloat(window.getComputedStyle(arrowElement).height);
+                let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).top);
+                let popperHeight = parseFloat(window.getComputedStyle(data.instance.popper).height);
+                let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).top);
+                let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));
+                let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;
+                let arrowPos = arrowOffset + (arrowHeight / 2);
+                let maxPos = popperHeight + popperOffset - popperBorderWidth - popperBorderRadiusWidth;
+                let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;
+                if (arrowPos >= maxPos || arrowPos <= minPos) {
+                    let newArrowPos = 0;
+                    if (arrowPos > (popperHeight / 2)) {
+                        newArrowPos = maxPos - arrowHeight;
+                    } else {
+                        newArrowPos = minPos + arrowHeight;
+                    }
+                    $(arrowElement).css('top', newArrowPos);
                 }
-                $(arrowElement).css('top', newArrowPos);
-            }
-        } else {
-            var arrowWidth = parseFloat(window.getComputedStyle(arrowElement).width);
-            var _arrowOffset = parseFloat(window.getComputedStyle(arrowElement).left);
-            var popperWidth = parseFloat(window.getComputedStyle(data.instance.popper).width);
-            var _popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).left);
-            var _popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));
-            var _popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;
-            var _arrowPos = _arrowOffset + arrowWidth / 2;
-            var _maxPos = popperWidth + _popperOffset - _popperBorderWidth - _popperBorderRadiusWidth;
-            var _minPos = _popperOffset + _popperBorderWidth + _popperBorderRadiusWidth;
-            if (_arrowPos >= _maxPos || _arrowPos <= _minPos) {
-                var _newArrowPos = 0;
-                if (_arrowPos > popperWidth / 2) {
-                    _newArrowPos = _maxPos - arrowWidth;
-                } else {
-                    _newArrowPos = _minPos + arrowWidth;
+            } else {
+                let arrowWidth = parseFloat(window.getComputedStyle(arrowElement).width);
+                let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).left);
+                let popperWidth = parseFloat(window.getComputedStyle(data.instance.popper).width);
+                let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).left);
+                let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));
+                let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;
+                let arrowPos = arrowOffset + (arrowWidth / 2);
+                let maxPos = popperWidth + popperOffset - popperBorderWidth - popperBorderRadiusWidth;
+                let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;
+                if (arrowPos >= maxPos || arrowPos <= minPos) {
+                    let newArrowPos = 0;
+                    if (arrowPos > (popperWidth / 2)) {
+                        newArrowPos = maxPos - arrowWidth;
+                    } else {
+                        newArrowPos = minPos + arrowWidth;
+                    }
+                    $(arrowElement).css('left', newArrowPos);
                 }
-                $(arrowElement).css('left', _newArrowPos);
             }
+        };
+
+        let background = $('[data-flexitour="step-background"]');
+        if (background.length) {
+            target = background;
         }
-    };
+        this.currentStepPopper = new Popper(target, content[0], config);
 
-    var background = $('[data-flexitour="step-background"]');
-    if (background.length) {
-        target = background;
+        return this;
     }
-    this.currentStepPopper = new Popper(target, content[0], config);
 
-    return this;
-};
+    /**
+     * Add the backdrop.
+     *
+     * @method  positionBackdrop
+     * @param   {Object}    stepConfig      The step configuration of the step
+     * @chainable
+     * @return {Object} this.
+     */
+    positionBackdrop(stepConfig) {
+        if (stepConfig.backdrop) {
+            this.currentStepConfig.hasBackdrop = true;
+            let backdrop = $('<div data-flexitour="backdrop"></div>');
 
-/**
- * Add the backdrop.
- *
- * @method  positionBackdrop
- * @param   {Object}    stepConfig      The step configuration of the step
- * @chainable
- */
-Tour.prototype.positionBackdrop = function (stepConfig) {
-    if (stepConfig.backdrop) {
-        this.currentStepConfig.hasBackdrop = true;
-        var backdrop = $('<div data-flexitour="backdrop"></div>');
-
-        if (stepConfig.zIndex) {
-            if (stepConfig.attachPoint === 'append') {
-                stepConfig.attachTo.append(backdrop);
+            if (stepConfig.zIndex) {
+                if (stepConfig.attachPoint === 'append') {
+                    stepConfig.attachTo.append(backdrop);
+                } else {
+                    backdrop.insertAfter(stepConfig.attachTo);
+                }
             } else {
-                backdrop.insertAfter(stepConfig.attachTo);
+                $('body').append(backdrop);
             }
-        } else {
-            $('body').append(backdrop);
-        }
 
-        if (this.isStepActuallyVisible(stepConfig)) {
-            // The step has a visible target.
-            // Punch a hole through the backdrop.
-            var background = $('<div data-flexitour="step-background"></div>');
+            if (this.isStepActuallyVisible(stepConfig)) {
+                // The step has a visible target.
+                // Punch a hole through the backdrop.
+                let background = $('<div data-flexitour="step-background"></div>');
 
-            var targetNode = this.getStepTarget(stepConfig);
-
-            var buffer = 10;
+                let targetNode = this.getStepTarget(stepConfig);
 
-            var colorNode = targetNode;
-            if (buffer) {
-                colorNode = $('body');
-            }
+                let buffer = 10;
 
-            background.css({
-                width: targetNode.outerWidth() + buffer + buffer,
-                height: targetNode.outerHeight() + buffer + buffer,
-                left: targetNode.offset().left - buffer,
-                top: targetNode.offset().top - buffer,
-                backgroundColor: this.calculateInherittedBackgroundColor(colorNode)
-            });
+                let colorNode = targetNode;
+                if (buffer) {
+                    colorNode = $('body');
+                }
 
-            if (targetNode.offset().left < buffer) {
                 background.css({
-                    width: targetNode.outerWidth() + targetNode.offset().left + buffer,
-                    left: targetNode.offset().left
+                    width: targetNode.outerWidth() + buffer + buffer,
+                    height: targetNode.outerHeight() + buffer + buffer,
+                    left: targetNode.offset().left - buffer,
+                    top: targetNode.offset().top - buffer,
+                    backgroundColor: this.calculateInherittedBackgroundColor(colorNode),
                 });
-            }
 
-            if (targetNode.offset().top < buffer) {
-                background.css({
-                    height: targetNode.outerHeight() + targetNode.offset().top + buffer,
-                    top: targetNode.offset().top
-                });
-            }
+                if (targetNode.offset().left < buffer) {
+                    background.css({
+                        width: targetNode.outerWidth() + targetNode.offset().left + buffer,
+                        left: targetNode.offset().left,
+                    });
+                }
 
-            var targetRadius = targetNode.css('borderRadius');
-            if (targetRadius && targetRadius !== $('body').css('borderRadius')) {
-                background.css('borderRadius', targetRadius);
-            }
+                if (targetNode.offset().top < buffer) {
+                    background.css({
+                        height: targetNode.outerHeight() + targetNode.offset().top + buffer,
+                        top: targetNode.offset().top,
+                    });
+                }
 
-            var targetPosition = this.calculatePosition(targetNode);
-            if (targetPosition === 'fixed') {
-                background.css('top', 0);
-            } else if (targetPosition === 'absolute') {
-                background.css('position', 'fixed');
-            }
+                let targetRadius = targetNode.css('borderRadius');
+                if (targetRadius && targetRadius !== $('body').css('borderRadius')) {
+                    background.css('borderRadius', targetRadius);
+                }
 
-            var fader = background.clone();
-            fader.css({
-                backgroundColor: backdrop.css('backgroundColor'),
-                opacity: backdrop.css('opacity')
-            });
-            fader.attr('data-flexitour', 'step-background-fader');
+                let targetPosition = this.calculatePosition(targetNode);
+                if (targetPosition === 'fixed') {
+                    background.css('top', 0);
+                } else if (targetPosition === 'absolute') {
+                    background.css('position', 'fixed');
+                }
 
-            if (stepConfig.zIndex) {
-                if (stepConfig.attachPoint === 'append') {
-                    stepConfig.attachTo.append(background);
+                let fader = background.clone();
+                fader.css({
+                    backgroundColor: backdrop.css('backgroundColor'),
+                    opacity: backdrop.css('opacity'),
+                });
+                fader.attr('data-flexitour', 'step-background-fader');
+
+                if (stepConfig.zIndex) {
+                    if (stepConfig.attachPoint === 'append') {
+                        stepConfig.attachTo.append(background);
+                    } else {
+                        fader.insertAfter(stepConfig.attachTo);
+                        background.insertAfter(stepConfig.attachTo);
+                    }
                 } else {
-                    fader.insertAfter(stepConfig.attachTo);
-                    background.insertAfter(stepConfig.attachTo);
+                    $('body').append(fader);
+                    $('body').append(background);
                 }
-            } else {
-                $('body').append(fader);
-                $('body').append(background);
-            }
 
-            // Add the backdrop data to the actual target.
-            // This is the part which actually does the work.
-            targetNode.attr('data-flexitour', 'step-backdrop');
+                // Add the backdrop data to the actual target.
+                // This is the part which actually does the work.
+                targetNode.attr('data-flexitour', 'step-backdrop');
 
-            if (stepConfig.zIndex) {
-                backdrop.css('zIndex', stepConfig.zIndex);
-                background.css('zIndex', stepConfig.zIndex + 1);
-                targetNode.css('zIndex', stepConfig.zIndex + 2);
-            }
+                if (stepConfig.zIndex) {
+                    backdrop.css('zIndex', stepConfig.zIndex);
+                    background.css('zIndex', stepConfig.zIndex + 1);
+                    targetNode.css('zIndex', stepConfig.zIndex + 2);
+                }
 
-            fader.fadeOut('2000', function () {
-                $(this).remove();
-            });
+                fader.fadeOut('2000', function() {
+                    $(this).remove();
+                });
+            }
         }
+        return this;
     }
-    return this;
-};
 
-/**
- * Calculate the inheritted z-index.
- *
- * @method  calculateZIndex
- * @param   {jQuery}    elem                        The element to calculate z-index for
- * @return  {Number}                                Calculated z-index
- */
-Tour.prototype.calculateZIndex = function (elem) {
-    elem = $(elem);
-    while (elem.length && elem[0] !== document) {
-        // Ignore z-index if position is set to a value where z-index is ignored by the browser
-        // This makes behavior of this function consistent across browsers
-        // WebKit always returns auto if the element is positioned.
-        var position = elem.css("position");
-        if (position === "absolute" || position === "relative" || position === "fixed") {
-            // IE returns 0 when zIndex is not specified
-            // other browsers return a string
-            // we ignore the case of nested elements with an explicit value of 0
-            // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
-            var value = parseInt(elem.css("zIndex"), 10);
-            if (!isNaN(value) && value !== 0) {
-                return value;
+    /**
+     * Calculate the inheritted z-index.
+     *
+     * @method  calculateZIndex
+     * @param   {jQuery}    elem                        The element to calculate z-index for
+     * @return  {Number}                                Calculated z-index
+     */
+    calculateZIndex(elem) {
+        elem = $(elem);
+        while (elem.length && elem[0] !== document) {
+      &n